executable program cross-platform implementing method

文档序号:1577088 发布日期:2020-01-31 浏览:34次 中文

阅读说明:本技术 一种可执行程序的跨平台实现方法 (executable program cross-platform implementing method ) 是由 王钧正 于 2018-07-19 设计创作,主要内容包括:本发明涉及一种可执行程序的跨平台实现方法,包括:S1.对至少两种操作系统的硬件驱动进行抽象并生成第一抽象类;S2.对所述操作系统的界面渲染进行抽象并生成第二抽象类;S3.基于所述第一抽象类和所述第二抽象类编写可执行程序的源代码;S4.根据所述操作系统的接口类型,将所述源代码打包成与所述操作系统相匹配的实现类。根据本发明,可以只通过编写一次源代码,通过对源代码按照不同操作系统的接口对源代码进行相应的编译及封装后,即可得到不同平台的多套餐饮管理系统。同时,还保持了界面样式、操作逻辑的完全一致。不需要开展多个开发小组分别开发不同操作系统的餐饮管理系统,极大的简化了跨平台开发的成本,节约了资源。(The invention relates to a cross-platform implementation method of executable programs, which comprises the steps of S1, abstracting hardware drivers of at least two operating systems and generating a abstract class, S2, abstracting interface rendering of the operating systems and generating a second abstract class, S3, compiling source codes of the executable programs based on the abstract class and the second abstract class, and S4, packing the source codes into implementation classes matched with the operating systems according to interface types of the operating systems.)

1, method for realizing cross platform of executable program, comprising:

s1, abstracting hardware drivers of at least two operating systems and generating th abstract classes;

s2, abstracting the interface rendering of the operating system and generating a second abstract class;

s3, writing a source code of an executable program based on the th abstract class and the second abstract class;

and S4, packing the source code into an implementation class matched with the operating system according to the interface type of the operating system.

2. The method of claim 1, wherein step S1 includes:

s11, analyzing the driving characteristics of the hardware drive of the operating system according to the system characteristics of the operating system;

s12, abstracting the hardware driver of each operating system into abstract classes in the same format according to the driving characteristics of each operating system.

3. The method of claim 2, wherein step S2 includes:

s21, acquiring the interface characteristics of the operating system according to the interface characteristics of the operating system;

and S22, rendering and abstracting the interface of each operating system into a second abstract class in the same format according to the interface characteristics of each operating system.

4. The method of claim 3, wherein in step S22, in the process of rendering the interface of each operating system into a second abstract class in the same format, the interface style is abstracted into a combination of series basic operation spaces and the interface layout is described by relative positions, and the interaction behavior is abstracted into series actions.

5. The method of claim 1, wherein step S3 includes:

s31, establishing a standard basic control abstract class;

and S32, configuring a user interface based on the second abstract class, and packaging the source code based on the th abstract class.

6. The cross-platform implementation method according to claim 1, wherein step S4 includes;

s41, compiling the source code into a program with a corresponding format according to the interface type of the operating system;

and S42, packaging the program formed after compiling to generate an installation program with a corresponding format.

7. The cross-platform implementation method of claim 3, wherein the operating system comprises: the system comprises a Windows mobile operating system, an Android operating system, an apple iso operating system, a Windows operating system and a Linux operating system.

8. The method according to claim 3, wherein in step S33, the user interface is configured by using Java AWT and based on the second abstract class.

Technical Field

The invention relates to a cross-platform implementation method of executable programs, in particular to a cross-platform implementation method of executable programs for a catering management system.

Background

In recent years, with the rise of mobile devices such as mobile phones, tablets and intelligent wearable devices, development and application of application programs reach unprecedented heights, under the general condition, the development of general APP is designed for an operating system and a specific service platform, and if products are released on different platforms and different operating systems, a plurality of sets of application programs must be developed.

Disclosure of Invention

The invention aims to provide a cross-platform implementation method of executable programs, which solves the problem that the executable programs cannot be compatible with a plurality of platforms simultaneously.

To achieve the above object, the present invention provides methods for implementing cross-platform executable programs, comprising:

s1, abstracting hardware drivers of at least two operating systems and generating th abstract classes;

s2, abstracting the interface rendering of the operating system and generating a second abstract class;

s3, writing a source code of an executable program based on the th abstract class and the second abstract class;

and S4, packing the source code into an implementation class matched with the operating system according to the interface type of the operating system.

According to aspects of the present invention, step S1 includes:

s11, analyzing the driving characteristics of the hardware drive of the operating system according to the system characteristics of the operating system;

s12, abstracting the hardware driver of each operating system into abstract classes in the same format according to the driving characteristics of each operating system.

According to aspects of the present invention, step S2 includes:

s21, acquiring the interface characteristics of the operating system according to the interface characteristics of the operating system;

and S22, rendering and abstracting the interface of each operating system into a second abstract class in the same format according to the interface characteristics of each operating system.

According to aspects of the invention, in step S22, in the process of rendering the interface of each operating system into a second abstract class in the same format, the interface styles are abstracted into the combination of series basic operation spaces, the interface layout is described by relative positions, and the interaction behaviors are abstracted into series actions.

According to aspects of the present invention, step S3 includes:

s31, establishing a standard basic control abstract class;

and S32, configuring a user interface based on the second abstract class, and packaging the source code based on the th abstract class.

According to aspects of the invention, step S4 includes;

s41, compiling the source code into a program with a corresponding format according to the interface type of the operating system;

and S42, packaging the program formed after compiling to generate an installation program with a corresponding format.

According to aspects of the present invention, the operating system includes a Windows mobile operating system, an Android operating system, an apple iso operating system, a Windows operating system, and a Linux operating system.

According to aspects of the invention, in step S33, the user interface is configured by employing Java AWT and based on the second abstract class.

According to schemes of the invention, multiple sets of catering management systems of different platforms can be obtained by compiling source codes and correspondingly compiling and packaging the source codes according to interfaces of different operating systems, meanwhile, the interface style and the operating logic are kept completely , multiple development groups are not required to respectively develop the catering management systems of different operating systems, the cross-platform development cost is greatly simplified, the resources are saved, so that (1- (1/N)). 100% of resources can be saved, N is the number of crossed target platforms, the method is beneficial to maintenance of the catering management systems, the workload of maintenance personnel is reduced, the manpower resources are saved in steps, meanwhile, the interface style and the operating logic of the catering management systems on various operating systems are kept , the convenience of user operation is further ensured in steps, and the use experience of users is improved.

Drawings

FIG. 1 schematically shows a flow diagram according to embodiments of the invention;

FIG. 2 schematically shows an application packaging flow diagram according to embodiments of the invention;

FIG. 3 schematically shows a block diagram of system development libraries in accordance with embodiments of the invention.

Detailed Description

In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.

In describing embodiments of the present invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," and the like are used in an orientation or positional relationship that is based on the orientation or positional relationship shown in the associated drawings, which is for convenience and simplicity of description only, and does not indicate or imply that the referenced device or element must have a particular orientation, be constructed and operated in a particular orientation, and thus, the above-described terms should not be construed as limiting the present invention.

The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments, which are not specifically described herein at , but the embodiments of the present invention are not limited to the following embodiments.

As shown in FIG. 1, according to embodiments of the present invention, the methods for implementing cross-platform executable programs of the present invention include:

s1, abstracting hardware drivers of at least two operating systems and generating th abstract classes;

s2, abstracting the interface rendering of the operating system and generating a second abstract type;

s3, writing a source code of the executable program based on the th abstract class and the second abstract class;

and S4, packing the source codes into an implementation class matched with the operating system according to the interface type of the operating system.

According to embodiments of the present invention, step S1 includes:

s11, analyzing the driving characteristics of the hardware drive of the operating system according to the system characteristics of the operating system;

and S12, abstracting the hardware driver of each operating system into a abstract class with the same format according to the driving characteristics of each operating system.

According to embodiments of the present invention, step S2 includes:

s21, acquiring interface characteristics of the operating system according to the interface characteristics of the operating system;

in the embodiment, in the process of rendering and abstracting the interface of each operating system into the second abstract class in the same format as , the interface style is abstracted into a combination of series basic operation spaces, wherein the basic operation spaces comprise buttons, input boxes, radio boxes, check boxes and the like, and the interface layout is described by relative positions, and the interaction behavior is abstracted into series actions.

According to embodiments of the present invention, step S3 includes:

s31, establishing a standard basic control abstract class, wherein the basic control abstract class comprises a button, an input box, a radio box, a check box and the like;

and S32, configuring the user interface based on the second abstract class, and packaging the source code based on the th abstract class.

According to embodiments of the invention, step S4 includes;

s41, compiling the source code into a program with a corresponding format according to the interface type of the operating system;

and S42, packaging the program formed after compiling to generate an installation program with a corresponding format.

In this embodiment, the operating system includes: windows mobile operating system, Android operating system, apple iso operating system, Windows operating system and Linux operating system. As shown in fig. 2, in the present embodiment, the source code is compiled by selecting a target platform on which the application needs to run. And selecting a Windows operating system and an Android operating system as an application program running platform according to requirements. Aiming at the Windows operating system, the implementation class of the Windows operating system interface is copied, a JAVA program is compiled and constructed for a source code, and the source code is compiled and then packaged into an EXE installation program which can run on the Windows operating system. Aiming at the Android operating system, the implementation class of an Android operating system interface is copied, a JAVA program is compiled and constructed for a source code, and the source code is compiled and then packaged into an APK installation program which can run on the Android operating system.

As shown in FIG. 3, according to embodiments of the present invention, the cross-platform implementation method of the executable program of the present invention is developed through a system development library, in the present embodiment, the system development library applied to the present invention includes a core code editing module, a GUI code editing module, an extension module, a tool set module, and an encapsulation module.

According to the method, a plurality of sets of catering management systems of different platforms can be obtained only by compiling times of source codes and correspondingly compiling and packaging the source codes according to interfaces of different operating systems, meanwhile, the interface style and the operating logic are kept completely , a plurality of development groups are not required to develop the catering management systems of different operating systems respectively, the cross-platform development cost is greatly simplified, and the resources are saved, so that the (1- (1/N)). 100% of resources can be saved, N is the number of crossed target platforms, the method is beneficial to maintenance of the catering management systems, the workload of maintenance personnel is reduced, the manpower resources are saved in steps, meanwhile, the interface style and the operating logic of the catering management systems on various operating systems are kept steps, the convenience of user operation is further ensured, and the use experience of users is improved.

The foregoing is merely exemplary of particular aspects of the present invention and devices and structures not specifically described herein are understood to be those of ordinary skill in the art and are intended to be implemented in such conventional ways.

The above description is intended to be exemplary of aspects of the present invention, and not to limit the present invention, and it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种功能粒度上基于语义信息的源代码相似度评估方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!