Cross-platform program development method, device, equipment and storage medium thereof

By keeping the underlying interface function names unchanged at the software level and using a cross-platform interface design framework to achieve unified interface and source code adaptation, the problem of high development costs for cross-platform applications is solved, and interface consistency and cost savings are achieved across different operating systems.

CN115185500BActive Publication Date: 2026-02-13WUHAN YOUPIN CHUDING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210674363.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-14
Publication Date
2026-02-13
Estimated Expiration
2042-06-14

AI Technical Summary

Technical Problem

In existing technologies, cross-platform application development requires separate development for different operating systems, resulting in high R&D costs, high time costs, and high release costs. Moreover, existing cross-platform development methods mostly remain at the hardware level, which greatly affects the modification of upper-level code.

Method used

By keeping the underlying interface function names unchanged at the software level, replacing code that does not support multiple operating systems, and using a cross-platform interface design framework to achieve unified interface and source code adaptation, it is compiled into executable programs for different operating systems.

Benefits of technology

It achieves consistency in interface style and operation logic across different operating systems, reduces R&D costs, time costs, and release costs, saves R&D resources, and simplifies the cross-platform development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115185500B_ABST
    Figure CN115185500B_ABST
Patent Text Reader

Abstract

The application provides a cross-platform program development method and device, equipment and a storage medium thereof, and relates to the technical field of cross-platform program development.The application comprises the following steps: determining compatible to-be-adapted compatible code from a first bottom-layer interface set;replacing original interface code with the to-be-adapted compatible code to obtain a third bottom-layer interface set; determining an interface uniform interface according to the interface properties of a to-be-adapted operating system and an original operating system; determining source code according to the third bottom-layer interface set and the interface uniform interface to determine a cross-platform program; the second bottom-layer interface set is determined according to the original operating system; and the to-be-adapted compatible code and the original interface code comprise at least one same interface function name. The application can obtain executable programs of an application program in different operating systems by compiling source code once. The application can keep the interface style and operation logic of the executable programs consistent, simplify the research and development steps, reduce the time cost and the release cost, and save research and development resources.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of application development, and in particular to a cross-platform program development method, device and equipment and a storage medium thereof. BACKGROUND

[0002] With the vigorous development of science and technology, there are many operating systems on the market at present, and due to the different operating systems used by each user, when facing the same application program, the application program needs to be designed to adapt to the corresponding version of the operating system, so as to realize the normal operation of the application program in the adapted operating system. For example, there are many stock investment software on the market at present, which mainly runs on Windows system and MAC system, and the development methods of the two operating systems are very different, resulting in that the stock investment software cannot be compatible with the two platforms at the same time. If it is required to run on the two operating systems at the same time, corresponding developers need to be invested for each operating system platform to develop respectively to obtain different application program versions.

[0003] The current commonly used cross-platform application software development method often stays at the hardware level, abstracts the hardware driver and creates a new unified interface, and adapts different operating platforms through the unified interface. However, since there is a large amount of code in the upper layer based on the bottom layer library interface, redesigning the bottom layer interface at this time will cause a large amount of modification of the upper layer code, thereby increasing the research and development cost, time cost and release cost.

[0004] At present, there is no technical solution that can maintain the bottom layer interface unchanged and realize multi-platform adaptation of application program development by using software level interface compatibility, and there is no cross-platform program development method, device and equipment and storage medium corresponding to the above technical solution. SUMMARY

[0005] The present application provides a cross-platform program development method, device and equipment and a storage medium, to solve the technical defects of high development cost required for different operating systems of the same application program in the prior art. The present application maintains the interface function name of the bottom layer interface unchanged, replaces the code that does not support adaptation to multiple operating systems in the software layer with code that can adapt to multiple operating systems, thereby avoiding the modification of the upper layer code.

[0006] In a first aspect, the present application provides a cross-platform program development method, comprising:

[0007] According to the first bottom layer interface set, determine the to-be-adapted compatible code compatible with the second bottom layer interface set;

[0008] Replace the original interface code in the second bottom layer interface set with the to-be-adapted compatible code to obtain a third bottom layer interface set after replacement in the original operating system;

[0009] Determine the interface uniform interface according to the interface attribute of the to-be-adapted operating system and the interface attribute of the original operating system;

[0010] Determine the source code associated with the to-be-adapted operating system according to the third bottom layer interface set and the interface uniform interface to determine the cross-platform program associated with the to-be-adapted operating system;

[0011] The interface uniform interface is determined according to a drawing engine interface in a cross-platform interface design framework;

[0012] The first bottom layer interface set is determined according to the to-be-adapted operating system;

[0013] The second bottom layer interface set is determined according to the original operating system;

[0014] The to-be-adapted compatible code and the original interface code at least include one same interface function name.

[0015] According to the cross-platform program development method provided by the application, the to-be-adapted compatible code compatible with the second bottom layer interface set is determined according to the first bottom layer interface set, which comprises:

[0016] Determine the first feature related to the first bottom layer interface set according to the first bottom layer interface set;

[0017] Determine the second feature related to the second bottom layer interface set according to the second bottom layer interface set;

[0018] Determine the to-be-adapted compatible code according to the first feature and the second feature.

[0019] According to the cross-platform program development method provided by the application, the interface uniform interface is determined according to the interface attribute of the to-be-adapted operating system and the interface attribute of the original operating system, which comprises:

[0020] Determine the interface attribute of the to-be-adapted operating system according to the interface drawing mode of the to-be-adapted operating system;

[0021] Determine the interface attribute of the original operating system according to the interface drawing mode of the original operating system;

[0022] Determine the interface uniform interface by using a drawing engine interface in a cross-platform interface design framework according to the interface attribute of the to-be-adapted operating system and the interface attribute of the original operating system.

[0023] According to a cross-platform program development method provided by the present invention, the step of determining the source code associated with the operating system to be adapted based on a third underlying interface set and the unified interface to determine the cross-platform program associated with the operating system to be adapted includes:

[0024] The source code associated with the operating system to be adapted is determined based on the third underlying interface set and the unified interface.

[0025] Based on the source code, compile it into a cross-platform program associated with the operating system to be adapted.

[0026] According to a cross-platform program development method provided by the present invention, before determining the compatible code to be adapted to be compatible with the second underlying interface set, the method further includes:

[0027] Receive development instructions and acquire all cross-platform programs to be developed;

[0028] Based on all cross-platform programs to be developed, determine the corresponding operating system to be adapted for each cross-platform program to be developed.

[0029] According to a cross-platform program development method provided by the present invention, after determining the cross-platform program associated with the operating system to be adapted, the method further includes:

[0030] Iterate through each operating system to be adapted until all cross-platform programs associated with each operating system to be adapted are identified.

[0031] According to a cross-platform program development method provided by the present invention, the operating system to be adapted includes at least one of Windows operating system, Linux operating system and MAC operating system.

[0032] Secondly, a cross-platform application development device is provided, including:

[0033] Processing module: Used to determine the compatible code to be adapted to be compatible with the second underlying interface set based on the first underlying interface set;

[0034] The acquisition module is used to replace the original interface code in the second underlying interface set with the code to be adapted and compatible, and to obtain the third underlying interface set after replacement in the original operating system.

[0035] Determining module: used to determine the unified interface based on the interface attributes of the operating system to be adapted and the interface attributes of the original operating system;

[0036] Execution module: used to determine the source code associated with the operating system to be adapted based on the third underlying interface set and the unified interface, so as to determine the cross-platform program associated with the operating system to be adapted.

[0037] The third aspect also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the cross-platform program development method when executing the program.

[0038] The fourth aspect also provides a non-transitory computer readable storage medium, having a computer program stored thereon, wherein the computer program is executable by a processor to implement the cross-platform program development method.

[0039] The present application provides a cross-platform program development method, device, equipment and storage medium thereof, which reserves the interface function name of the underlying operating system unchanged, replaces the original interface code with the to-be-adapted compatible code compatible with the to-be-adapted operating system, so as to ensure the consistency of interface calls in different operating systems, and further the upper-layer business of program development will not be affected, and the code used by the upper layer does not need to be modified. The present application only needs to compile the source code once, and through corresponding compilation and packaging of the source code according to the interfaces of different operating systems, the executable programs of the same application of different operating systems can be obtained. At the same time, the present application also maintains the complete consistency of the interface style and operation logic of the executable program, and does not need to call multiple development groups to develop programs of different operating systems respectively, which greatly simplifies the research and development cost, time cost and release cost of cross-platform development, and saves the research and development resources. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the present application or prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0041] Figure 1 is one of the flowcharts of the cross-platform program development method provided by the present application;

[0042] Figure 2 is the flowchart of determining the to-be-adapted compatible code compatible with the second underlying interface set provided by the present application;

[0043] Figure 3 is the flowchart of determining the interface unified interface provided by the present application;

[0044] Figure 4 is the flowchart of determining the cross-platform program associated with the to-be-adapted operating system provided by the present application;

[0045] Figure 5is the second flow schematic diagram of the cross-platform program development method provided by the application;

[0046] Figure 6 is the structural schematic diagram of the cross-platform program development device provided by the application;

[0047] Figure 7 is the structural schematic diagram of the electronic device provided by the application. DETAILED DESCRIPTION

[0048] For the purpose, technical solutions and advantages of the present application to be more clear, the technical solutions in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0049] It should be noted that in the description of the embodiments of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the sentence "comprises a" does not exclude the existence of another identical element in the process, method, article or device comprising the element.

[0050] The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second" and the like are generally of a kind and do not limit the number of objects, for example, the first object can be one or more.

[0051] Figure 1 is the first flow schematic diagram of the cross-platform program development method provided by the application, comprising:

[0052] According to the first bottom layer interface set, determine the to-be-adapted compatible code compatible with the second bottom layer interface set;

[0053] Replace the original interface code in the second bottom layer interface set with the to-be-adapted compatible code to obtain a third bottom layer interface set after replacement in the original operating system;

[0054] According to the interface attribute of the to-be-adapted operating system and the interface attribute of the original operating system, determine the interface uniform interface;

[0055] determining source code associated with the to-be-adapted operating system according to the third bottom-layer interface set and the interface uniform interface, so as to determine a cross-platform program associated with the to-be-adapted operating system;

[0056] The interface uniform interface is determined according to a drawing engine interface in a cross-platform interface design framework.

[0057] The first bottom-layer interface set is determined according to a to-be-adapted operating system.

[0058] The second bottom-layer interface set is determined according to an original operating system.

[0059] The to-be-adapted compatible code and the original interface code at least include one same interface function name.

[0060] In step 101, the first bottom-layer interface set is determined according to a to-be-adapted operating system, and the to-be-adapted operating system can be a Windows operating system, a Linux operating system or a MAC operating system; the second bottom-layer interface set is determined according to an original operating system, and the original operating system can also be a Windows operating system, a Linux operating system or a MAC operating system, that is, in the present application, system characteristics of the first bottom-layer interface set and the second bottom-layer interface set are determined, and the system characteristics of the first bottom-layer interface set and the system characteristics of the second bottom-layer interface set are analyzed, and then the to-be-adapted compatible code is determined.

[0061] The present application is different from the prior art in which a program is developed by creating an interface at a hardware level, and a bottom-layer interface set at a software level, that is, a bottom-layer library of an operating system, is used to realize development of a business personnel, and the bottom-layer library includes a set of all function interfaces, for example, the to-be-adapted compatible code at least includes an interface function name and code elements adapted to an original operating system and a to-be-adapted operating system.

[0062] In step 102, the original interface code in the second bottom layer interface set is replaced by the to-be-adapted compatible code, and a third bottom layer interface set after replacement in the original operating system is obtained, wherein the original interface code in the second bottom layer interface set at least contains an interface function name and a code element adapted to the original operating system, and those skilled in the art understand that the to-be-adapted compatible code and the original interface code at least include one same interface function name, and the to-be-adapted compatible code is the improved code that can support cross-platform functions, which can be used in a Windows operating system, a Linux operating system or a MAC operating system according to different to-be-adapted operating systems, and as long as the specific interface function in the application remains unchanged, although the bottom layer interface set in the original operating system is replaced, the development of the upper layer code by the business developer is not affected.

[0063] The third bottom layer interface set is the bottom layer library of the to-be-adapted compatible code after replacement, and those skilled in the art understand that assuming that the Windows operating system is the original operating system, only the Windows operating system has a specific interface function name, which is used to provide the interface provided by the Windows operating system to the bottom layer library, and for other operating systems, there are similar interface implementations of the specific interface function name, but the forms are different, and the application aims to improve the specific interface function, which can realize cross-platform program development based on the existing code.

[0064] And the software development structure has a layer-by-layer dependent relationship, specifically, the upper layer depends on the lower layer, for example, the business developer depends on the bottom layer library to realize the business development of the upper layer, and the bottom layer library depends on the interface function provided by the operating system, which is used to provide the function required by the upper layer, so in the application, only the specific interface function needs to be improved, that is, the interface style and operation logic under different operating systems can be completely consistent with the minimum change as the cost, which greatly saves the research and development resources.

[0065] The technical solutions in steps 101 to 103 of the application will be beneficial to the maintenance of the program software, reduce the workload of the maintenance personnel, and further save the human resources. Meanwhile, in the case of ensuring that the software interface style and operation logic on multiple operating systems are consistent, the convenience of user operation is further ensured, and the user experience is improved.

[0066] The application provides a cross-platform program development method and device, equipment and a storage medium thereof, which reserves the interface function name of an underlying operating system unchanged, replaces original interface code with to-be-adapted compatible code compatible with a to-be-adapted operating system, so that the consistency of interface calling in different operating systems is ensured, and then the upper-layer business of program development is not affected, and the code used by the upper layer does not need to be modified, the application only needs to compile source code once, and through corresponding compilation and packaging of the source code according to the interface of different operating systems, executable programs of the same application of different operating systems can be obtained. Meanwhile, the application also maintains the complete consistency of the interface style and operation logic, and does not need to call multiple development groups to develop programs of different operating systems respectively, greatly simplifies the research and development cost, time cost and release cost of cross-platform development, and saves research and development resources.

[0067] Figure 2 The application provides a process schematic diagram for determining to-be-adapted compatible code compatible with a second underlying interface set, the to-be-adapted compatible code compatible with the second underlying interface set is determined according to a first underlying interface set, and the process includes the following steps.

[0068] A first feature related to the first underlying interface set is determined according to the first underlying interface set.

[0069] A second feature related to the second underlying interface set is determined according to the second underlying interface set.

[0070] To-be-adapted compatible code is determined according to the first feature and the second feature.

[0071] In step 1011, the first feature at least includes an interface function name and internal implementation logic in a to-be-adapted operating system and code elements adapted to the to-be-adapted operating system.

[0072] In step 1012, the second feature at least includes an interface function name and internal implementation logic in an original operating system and code elements adapted to the original operating system.

[0073] In step 1013, the interface function name in the original operating system is kept unchanged, and the code elements adapted to the original operating system are replaced with code elements adapted to both the original operating system and the to-be-adapted operating system, and the to-be-adapted compatible code is determined according to the code elements adapted to both the original operating system and the to-be-adapted operating system and the interface function name in the original operating system.

[0074] Figure 3is a flowchart of a process for determining a uniform interface of an interface provided by the present application, and the uniform interface of an interface is determined according to the interface attribute of the operating system to be adapted and the interface attribute of the original operating system, and the process comprises the following steps:

[0075] The interface attribute of the operating system to be adapted is determined according to the interface drawing mode of the operating system to be adapted.

[0076] The interface attribute of the original operating system is determined according to the interface drawing mode of the original operating system.

[0077] The uniform interface is determined according to the interface attribute of the operating system to be adapted and the interface attribute of the original operating system by using the drawing engine interface in the cross-platform interface design framework.

[0078] In step 1031, the interface drawing mode is implemented by means of the interface rendering capability of the cross-platform interface design framework, and accordingly, in step 1032, the way of determining the interface attribute of the original operating system according to the interface drawing mode of the original operating system is the same as that in step 1031, and the interface attribute mainly includes window display and hiding, position and size change, window mouse and keyboard event adaptation, window closing and destruction, etc., which all need to be adapted.

[0079] In step 1033, the cross-platform interface library in the prior art is implemented, and the interface development tool used is an open-source interface library based on the image device interface / image device interface and drawing engine specific to the Windows operating system. If cross-platform development of a program is needed, all interfaces related to the Windows operating system corresponding to the interface development tool need to be abstracted into a layer of general interfaces to adapt to different platforms. Since there are a large amount of codes in the upper layer based on the interface development tool library interface, redesigning the interface development tool interface at this time will cause a large amount of changes to the upper layer codes.

[0080] The interface development tool has the event loop function of the Windows operating system internally, for example, a mouse click event, and a system event is generated when the mouse is clicked, and the software layer can receive the notification of the system event. This is the function possessed by each operating system, and the interface form provided by each operating system is different. The cross-platform interface design framework can unify the differences and provide a unified event interface, and finally realize cross-platform program development. The interface development tool realizes cross-platform program development by using the interface of the cross-platform interface design framework. For basic controls, the interface development tool is a bottom layer library. Since the interface function name of the interface development tool is not modified in the present application, the basic controls will not be affected.

[0081] In order to solve the above technical problems, the application reserves the bottom interface function name of the current interface development tool to the Windows operating system, that is, the interface with the bottom layer dependence to the Windows operating system is directly regarded as the cross-platform abstract interface, the processing method corresponding to the interface on other operating system platforms is replaced by the processing method specific to the platform, and then the cross-platform event processing and drawing engine interface provided by the cross-platform interface design framework is used, and the cross-platform interface design framework interface or the combination logic of the cross-platform interface design framework interface is used to realize the processing method specific to the above operating platform, so as to guarantee the executable of the current interface development tool to the bottom interface of the Windows operating system, thereby avoiding modifying the upper code.

[0082] Figure 4 The application provides a flowchart for determining a cross-platform program associated with the to-be-adapted operating system, and the source code associated with the to-be-adapted operating system is determined according to the third bottom interface set and the interface uniform interface, so as to determine the cross-platform program associated with the to-be-adapted operating system, and the method comprises the following steps of:

[0083] The source code associated with the to-be-adapted operating system is determined according to the third bottom interface set and the interface uniform interface.

[0084] The cross-platform program associated with the to-be-adapted operating system is compiled according to the source code.

[0085] In step 1041, the application keeps the framework library basic control in the interface development tool unchanged, and determines the source code associated with the to-be-adapted operating system by means of part of the event loop mechanism of the cross-platform interface design framework.

[0086] In step 1042, the drawing engine of the interface development tool framework and the cross-platform interface design framework drawing engine are matched and compatible, and are encapsulated. Those skilled in the art understand that in the existing design, there is a certain similarity in the drawing interface for each operating system, but even if there are great differences in each operating system, the adaptation can be realized through the design method. The application aims to realize the consistency of the interface call, so as to ensure that the upper business development code is unchanged.

[0087] In an optional embodiment, taking Windows operating platform and MAC operating platform as examples: the core adaptation layer is used to adapt the implementation manners of the underlying library and the part of the interface layer, and determine the cross-platform source code, and then automatically compile the source code according to the target platform environment, for the Windows operating system, first generate the implementation class library of the Windows operating system interface, then compile and build the object-oriented high-level programming language program for the source code, and after the compilation of the source code is completed, package it into an executable file installer that can run on the Windows operating system; and for the MAC operating system, generate the implementation class library of the MAC operating system interface, compile and build the object-oriented high-level programming language program for the source code, and after the compilation of the source code is completed, package it into a compressed image file installer that can run on the MAC operating system on the MAC.

[0088] Figure 5 is a flowchart of the cross-platform program development method provided by the application, and before determining the to-be-adapted compatible code compatible with the second underlying interface set, further comprising:

[0089] receiving a development instruction and obtaining all to-be-developed cross-platform programs;

[0090] determining a to-be-adapted operating system corresponding to each to-be-developed cross-platform program according to all to-be-developed cross-platform programs.

[0091] In step 201, the development instruction is an instruction actually determined by a business research and development personnel according to customer demand, which contains all to-be-developed cross-platform programs that need to be developed.

[0092] In step 202, each to-be-developed cross-platform program corresponds to a to-be-adapted operating system, so that a to-be-adapted operating system corresponding to each to-be-developed cross-platform program can be determined according to all to-be-developed cross-platform programs.

[0093] Optionally, after determining the cross-platform program associated with the to-be-adapted operating system, further comprising:

[0094] traversing each to-be-adapted operating system until the cross-platform program associated with all to-be-adapted operating systems is determined.

[0095] In such an embodiment, the application aims to provide an automatic cross-platform program development method, so that the application can determine the cross-platform program associated with all to-be-adapted operating systems as long as the to-be-developed cross-platform program is obtained, thereby reducing the development of the research and development personnel and reducing the research and development cost.

[0096] Figure 6is a structural schematic view of the cross-platform program development device provided by the present application, and the present application further provides a cross-platform program development device, comprising a processing module 1: configured to determine, according to a first bottom-layer interface set, to-be-adapted compatible code compatible with a second bottom-layer interface set, and the working principle of the processing module 1 can refer to the foregoing step 101, which will not be repeated here.

[0097] The cross-platform program development device further comprises an acquisition module 2: configured to replace original interface code in the second bottom-layer interface set with the to-be-adapted compatible code, and to acquire a third bottom-layer interface set after replacement in an original operating system, and the working principle of the acquisition module 2 can refer to the foregoing step 102, which will not be repeated here.

[0098] The cross-platform program development device further comprises a determination module 3: configured to determine, according to interface attributes of the to-be-adapted operating system and interface attributes of the original operating system, an interface uniform interface, and the working principle of the determination module 3 can refer to the foregoing step 103, which will not be repeated here.

[0099] The cross-platform program development device further comprises an execution module 4: configured to determine, according to the third bottom-layer interface set and the interface uniform interface, source code associated with the to-be-adapted operating system, so as to determine a cross-platform program associated with the to-be-adapted operating system, and the working principle of the execution module 4 can refer to the foregoing step 104, which will not be repeated here.

[0100] Those skilled in the art understand that, as another optional embodiment of the present application, the cross-platform implementation method of the executable program of the present application is developed through a system development library, and in the present embodiment, the system development library applicable to the present application comprises a core code module, an adaptation layer module, a graphical user interface code module, an extension module and a tool set module. The extension module comprises a basic module, an event module, an extensible markup language module and a control module. The tool set module comprises a packaging tool module. The core code of the executable program is edited through the core code editing module in the system development library, and the graphical interface code of the executable program is edited through the graphical user interface code editing module. The tasks or functions required to be performed by the executable program are added through the selection of corresponding extension modules respectively, so as to construct the source code of the executable program of the present application. In the present embodiment, the source code is packaged through the packaging tool module, and taking the Windows operating system and the MAC operating system as examples, the packaging tool module comprises a Windows operating system packaging tool and a MAC operating system packaging tool, and the source code is packaged into corresponding formats respectively.

[0101] The application provides a cross-platform program development method and device, equipment and a storage medium thereof, which reserves unchanged interface function names of an underlying operating system, replaces original interface codes with to-be-adapted compatible codes compatible with a to-be-adapted operating system, so that consistency of interface calling in different operating systems is ensured, and then upper-layer business of program development is not affected, and codes used by the upper layer do not need to be modified, the application only needs to compile source codes once, and after the source codes are compiled and encapsulated according to interfaces of different operating systems, executable programs of the same application of different operating systems can be obtained. Meanwhile, the application also maintains complete consistency of interface styles and operation logic, and does not need to call multiple development groups to develop programs of different operating systems respectively, greatly simplifies research and development cost, time cost and release cost of cross-platform development, and saves research and development resources.

[0102] Figure 7 is a structural schematic diagram of an electronic device provided by the application. As shown in Figure 7 the electronic device can include a processor 710, a communications interface 720, a memory 730 and a communications bus 740, wherein the processor 710, the communications interface 720 and the memory 730 complete mutual communication through the communications bus 740. The processor 710 can call logical instructions in the memory 730 to execute a cross-platform program development method, including: determining to-be-adapted compatible codes compatible with a second underlying interface set according to a first underlying interface set; replacing original interface codes in the second underlying interface set with the to-be-adapted compatible codes, obtaining a third underlying interface set after replacement in an original operating system; determining an interface unified interface according to an interface attribute of the to-be-adapted operating system and an interface attribute of the original operating system; determining source codes associated with the to-be-adapted operating system according to the third underlying interface set and the interface unified interface, to determine a cross-platform program associated with the to-be-adapted operating system; the interface unified interface is determined according to a drawing engine interface in a cross-platform interface design framework; the first underlying interface set is determined according to the to-be-adapted operating system; the second underlying interface set is determined according to the original operating system; and the to-be-adapted compatible codes and the original interface codes include at least one same interface function name.

[0103] In addition, the logic instructions in the memory 730 described above can be implemented in the form of software function units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0104] In another aspect, the present application also provides a control software for running programs or instructions on a control terminal, which, when executed by the control terminal, performs the cross-platform program development method described above, which includes: determining, according to a first bottom layer interface set, compatible to-be-adapted compatible codes with a second bottom layer interface set; replacing original interface code in the second bottom layer interface set with the to-be-adapted compatible codes to obtain a third bottom layer interface set after replacement in an original operating system; determining an interface uniform interface according to interface properties of the to-be-adapted operating system and interface properties of the original operating system; determining source codes associated with the to-be-adapted operating system according to the third bottom layer interface set and the interface uniform interface to determine a cross-platform program associated with the to-be-adapted operating system; the interface uniform interface is determined according to a rendering engine interface in a cross-platform interface design framework; the first bottom layer interface set is determined according to the to-be-adapted operating system; the second bottom layer interface set is determined according to the original operating system; and the to-be-adapted compatible codes and the original interface codes include at least one same interface function name.

[0105] In another aspect, the present application also provides a computer program product comprising a computer program, which can be stored on a non-transitory computer readable storage medium, and the computer program, when executed by a processor, enables a computer to perform a cross-platform program development method provided by any of the above methods, the method comprising: determining, according to a first set of underlying interfaces, to-be-adapted compatible codes compatible with a second set of underlying interfaces; replacing original interface codes in the second set of underlying interfaces with the to-be-adapted compatible codes to obtain a third set of underlying interfaces after replacement in an original operating system; determining an interface uniform interface according to an interface attribute of the to-be-adapted operating system and an interface attribute of the original operating system; determining source codes associated with the to-be-adapted operating system according to the third set of underlying interfaces and the interface uniform interface to determine a cross-platform program associated with the to-be-adapted operating system; the interface uniform interface is determined according to a rendering engine interface in a cross-platform interface design framework; the first set of underlying interfaces is determined according to the to-be-adapted operating system; the second set of underlying interfaces is determined according to the original operating system; and the to-be-adapted compatible codes and the original interface codes comprise at least one same interface function name.

[0106] In yet another aspect, the present application also provides a non-transitory computer readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements a cross-platform program development method provided by any of the above methods, the method comprising: determining, according to a first set of underlying interfaces, to-be-adapted compatible codes compatible with a second set of underlying interfaces; replacing original interface codes in the second set of underlying interfaces with the to-be-adapted compatible codes to obtain a third set of underlying interfaces after replacement in an original operating system; determining an interface uniform interface according to an interface attribute of the to-be-adapted operating system and an interface attribute of the original operating system; determining source codes associated with the to-be-adapted operating system according to the third set of underlying interfaces and the interface uniform interface to determine a cross-platform program associated with the to-be-adapted operating system; the interface uniform interface is determined according to a rendering engine interface in a cross-platform interface design framework; the first set of underlying interfaces is determined according to the to-be-adapted operating system; the second set of underlying interfaces is determined according to the original operating system; and the to-be-adapted compatible codes and the original interface codes comprise at least one same interface function name.

[0107] The device embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected to achieve the purposes of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0108] Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software and the necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0109] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A cross-platform application development method, characterized in that, include: Based on the first set of underlying interfaces, determine the compatible code to be adapted that is compatible with the second set of underlying interfaces; The code to be adapted and compatible is determined based on code elements that are compatible with both the original operating system and the operating system to be adapted, as well as the interface function names in the original operating system. At the software level, the original interface code in the second underlying interface set is replaced with the code to be adapted and compatible, and the replaced third underlying interface set in the original operating system is obtained. Based on the interface attributes of the operating system to be adapted and the interface attributes of the original operating system, a unified interface is determined. Based on the third underlying interface set and the unified interface, the source code associated with the operating system to be adapted is determined, so as to determine the cross-platform program associated with the operating system to be adapted. The unified interface is determined based on the rendering engine interface in the cross-platform interface design framework; The first set of underlying interfaces is determined based on the operating system to be adapted; The second set of underlying interfaces is determined based on the original operating system; The code to be adapted and the original interface code share at least one identical interface function name.

2. The cross-platform application development method according to claim 1, characterized in that, The step of determining the compatible code to be adapted, which is compatible with the second underlying interface set, based on the first underlying interface set, includes: Based on the first set of underlying interfaces, determine a first feature related to the first set of underlying interfaces; Based on the second set of underlying interfaces, determine the second feature related to the second set of underlying interfaces; Based on the first feature and the second feature, the code to be adapted and compatible is determined.

3. The cross-platform application development method according to claim 1, characterized in that, The step of determining a unified interface based on the interface attributes of the operating system to be adapted and the interface attributes of the original operating system includes: The interface attributes of the operating system to be adapted are determined based on the interface drawing method of the operating system to be adapted. The interface attributes of the original operating system are determined based on the interface drawing method of the original operating system; Based on the interface attributes of the operating system to be adapted and the interface attributes of the original operating system, the rendering engine interface in the cross-platform interface design framework is used to determine the unified interface.

4. The cross-platform application development method according to claim 1, characterized in that, The step of determining the source code associated with the operating system to be adapted based on the third underlying interface set and the unified interface, in order to determine the cross-platform program associated with the operating system to be adapted, includes: The source code associated with the operating system to be adapted is determined based on the third underlying interface set and the unified interface. Based on the source code, compile it into a cross-platform program associated with the operating system to be adapted.

5. The cross-platform application development method according to claim 1, characterized in that, Before determining the compatible code to be adapted to be compatible with the second underlying interface set, the following is also included: Receive development instructions and acquire all cross-platform programs to be developed; Based on all cross-platform programs to be developed, determine the corresponding operating system to be adapted for each cross-platform program to be developed.

6. The cross-platform application development method according to claim 5, characterized in that, After identifying the cross-platform program associated with the operating system to be adapted, the process also includes: Iterate through each operating system to be adapted until all cross-platform programs associated with each operating system to be adapted are identified.

7. The cross-platform application development method according to claim 1, characterized in that, The operating system to be adapted includes at least one of Windows, Linux, and MAC operating systems.

8. A cross-platform program development device, characterized in that, include: Processing module: Used to determine the compatible code to be adapted to be compatible with the second underlying interface set based on the first underlying interface set; The code to be adapted and compatible is determined based on code elements that are compatible with both the original operating system and the operating system to be adapted, as well as the interface function names in the original operating system. Acquisition module: Used at the software level to replace the original interface code in the second underlying interface set with the code to be adapted and compatible, and to acquire the replaced third underlying interface set in the original operating system; Determining module: used to determine the unified interface based on the interface attributes of the operating system to be adapted and the interface attributes of the original operating system; Execution module: used to determine the source code associated with the operating system to be adapted based on the third underlying interface set and the unified interface, so as to determine the cross-platform program associated with the operating system to be adapted.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the cross-platform program development method as described in any one of claims 1 to 6.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the cross-platform program development method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for compatibility of multi-version application programming interface

    CN105183484A

  • Cross-platform implementation method of executable program

    CN110737468A