Software compiling method and device, equipment and medium

By querying compiled architectures in the preset database and compiling code files on the uncompiled architecture, the problem of repeated compilation of software on processors of different architectures is solved, and resource saving and compilation efficiency are improved.

CN120335779APending Publication Date: 2025-07-18LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510512580.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, software has duplicate compilation problems when compiled on processors of different architectures, resulting in waste of resources and low compilation efficiency.

Method used

By querying the compiled architecture in the preset database, determining the uncompiled architecture, and compiling the code file in the target compilation unit corresponding to the uncompiled architecture, recording the compilation results, and using the incremental architecture compilation method to avoid duplicate compilation.

Benefits of technology

Save resources, improve compilation efficiency, and realize subsequent reuse of compilation results and information traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120335779A_ABST
    Figure CN120335779A_ABST
Patent Text Reader

Abstract

The invention discloses a software compiling method and device, equipment and a medium in the technical field of computers. According to the method, for a to-be-compiled code file, firstly, a library is checked to determine which architectures the software version of the current code file has been compiled (that is, the compiled architecture is determined), then, according to the compiled architecture and all to-be-compiled architectures corresponding to the to-be-compiled code file, an uncompiled architecture corresponding to the to-be-compiled code file is determined, and the to-be-compiled code file is compiled according to the determined uncompiled architecture. And then compiling of the code file is completed on the remaining uncompiled architecture, and related records are put in storage. According to the scheme, the problem of repeated compiling of the same software version on the same architecture processor is solved in an incremental architecture compiling mode, resources are saved, and the compiling efficiency is also improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and particularly to a software compilation method, apparatus, device, and medium. Background Art

[0002] Currently, after a software is compiled on a processor of any architecture, the current version information of the software is recorded in the compilation system. If subsequent compilation of this version of the software is desired on a processor of another architecture, it is necessary to repeat the compilation on the processor where the compilation has already been completed, resulting in waste of resources and affecting the compilation efficiency.

[0003] Therefore, how to improve the compilation efficiency is a problem that needs to be solved by those skilled in the art. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a software compilation method, apparatus, device, and medium, which improves the compilation efficiency in an incremental architecture compilation manner. The specific solutions are as follows:

[0005] In a first aspect, this application provides a software compilation method, including:

[0006] Receiving a code file to be compiled and its version information;

[0007] Querying in a preset database for the compiled architecture corresponding to the version information;

[0008] Determining, according to the compiled architecture and the architecture to be compiled corresponding to the code file to be compiled, the architecture to be compiled corresponding to the code file to be compiled;

[0009] Compiling the code file to be compiled in the target compilation group corresponding to the architecture to be compiled, and recording the architecture to be compiled, the version information, and the corresponding compilation result information in the preset database.

[0010] In a second aspect, this application provides a software compilation apparatus, including:

[0011] A receiving module, configured to receive a code file to be compiled and its version information;

[0012] A querying module, configured to query in a preset database for the compiled architecture corresponding to the version information;

[0013] A determining module, configured to determine, according to the compiled architecture and the architecture to be compiled corresponding to the code file to be compiled, the architecture to be compiled corresponding to the code file to be compiled;

[0014] A compilation module, configured to compile the to-be-compiled code file in a target compilation unit corresponding to the uncompiled architecture, and record the uncompiled architecture, the version information, and the corresponding compilation result information into the preset database.

[0015] In a third aspect, the present application provides an electronic device, including:

[0016] A memory, configured to store a computer program;

[0017] A processor, configured to execute the computer program to implement the software compilation method disclosed above.

[0018] In a fourth aspect, the present application provides a non-volatile storage medium, configured to store a computer program, wherein the computer program, when executed by a processor, implements the software compilation method disclosed above.

[0019] In a fifth aspect, the present application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the software compilation method disclosed above.

[0020] As can be seen from the above solutions, the present application provides a software compilation method, including: receiving a to-be-compiled code file and its version information; querying in a preset database for the compiled architecture corresponding to the version information; determining, according to the compiled architecture and the to-be-compiled architecture corresponding to the to-be-compiled code file, the uncompiled architecture corresponding to the to-be-compiled code file; compiling the to-be-compiled code file in a target compilation unit corresponding to the uncompiled architecture, and recording the uncompiled architecture, the version information, and the corresponding compilation result information into the preset database.

[0021] It can be seen that for a to-be-compiled code file, the present application first queries the database to determine on which architectures the software version of the current code file has been compiled (i.e., determines the compiled architecture), and then determines, according to the compiled architecture and all the to-be-compiled architectures corresponding to the to-be-compiled code file, the uncompiled architecture corresponding to the to-be-compiled code file. After that, the compilation of this code file is completed on the remaining uncompiled architectures, and the relevant records are stored in the database. This solution solves the problem of repeated compilation of the same software version on processors with the same architecture in an incremental architecture compilation manner, saves resources, and improves the compilation efficiency. Moreover, the compilation results of the corresponding software version recorded in the preset database on the already-compiled processors are not affected by subsequent newly added compilation processes, enabling subsequent reuse of the corresponding compilation results and facilitating the traceability and query of compilation information.

[0022] Correspondingly, a software compilation device, device, medium, and program product provided by the present application also have the above technical effects. Description of the Drawings

[0023] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings.

[0024] Figure 1 It is a flowchart of a software compilation method disclosed in the present application;

[0025] Figure 2 It is a schematic diagram of the construction process of a compilation system disclosed in the present application;

[0026] Figure 3 It is a flowchart of the second software compilation method disclosed in the present application;

[0027] Figure 4 It is a flowchart of the third software compilation method disclosed in the present application;

[0028] Figure 5 It is a flowchart of a new architecture compilation method disclosed in the present application;

[0029] Figure 6 It is a flowchart of a specified architecture compilation method disclosed in the present application;

[0030] Figure 7 It is a server structure diagram provided by the present application;

[0031] Figure 8 It is a terminal structure diagram provided by the present application. Detailed implementation manners

[0032] The following will clearly and completely describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other examples obtained by those of ordinary skill in the art without creative efforts belong to the scope protected by the present application.

[0033] Currently, after a software is compiled on a processor with any architecture, the current version information of the software will be recorded in the compilation system. If you want to compile this version of the software on a processor with a different architecture later, you need to repeat the compilation on the processor where the compilation has been completed, which causes waste of resources and also affects the compilation efficiency. For this reason, this application provides a software compilation solution, which can solve the problem of repeated compilation of the same software version on processors with the same architecture in an incremental architecture compilation mode, saving resources and improving the compilation efficiency. Moreover, the compilation results of the corresponding software version recorded in the preset database on the compiled processor are not affected by subsequent newly added compilation processes, enabling subsequent reuse of the corresponding compilation results and facilitating the traceability and query of compilation information.

[0034] See Figure 1 As shown, an embodiment of this application discloses a software compilation method, including:

[0035] S101. Receive the code file to be compiled and its version information.

[0036] This embodiment is applied to a compilation system that manages multiple compilers, and the processor architecture types of these compilers are different, that is: the architecture types of these compilers are different. The user submits a compilation instruction at the client of the compilation system, and through the compilation instruction, the code file to be compiled or its storage address, the corresponding version information, etc. can be transmitted to the compilation system, so that if the compilation system obtains the storage address of the code file to be compiled, it will obtain the code file to be compiled according to this storage address. The code file to be compiled can be implemented based on any programming language.

[0037] S102. Query the compiled architecture corresponding to the version information in the preset database.

[0038] It should be noted that the preset database is communicatively connected to the compilation system, and information related to the successful compilation of any software version is stored in this database. For example: if version 1.1 of a certain code A is successfully compiled on a compiler of architecture X, then a piece of information is recorded in the preset database, including: the name of code A as the code file to be compiled, the version number 1.1 of code A, the architecture model of the compiler of architecture X, the flag bit indicating successful compilation, the storage address of the compiled data packet, the verification information of the compiled data packet, and the compilation target information, etc. These can all be used as the compilation result information of code A. Among them, the compilation target information includes: the software packages of code A, and these software packages are generally integrated into an image. Therefore, in this embodiment, the compiled architecture corresponding to the version information of the code file to be compiled can be queried in the preset database. Referring to the above information record, the compiled architecture includes: the architecture model of the compiler of architecture X. In one implementation manner, the uncompiled architecture, version information, and corresponding compilation result information are recorded in the preset database, including: in the preset database, the uncompiled architecture is recorded as the compiled architecture corresponding to the version information; the address of the compiled data packet, the data packet verification value, the tag of the version information, the compilation target information, and the compilation success flag bit are recorded as the compilation result information.

[0039] S103. Determine the uncompiled architecture corresponding to the code file to be compiled according to the compiled architecture and the uncompiled architecture corresponding to the code file to be compiled.

[0040] Since there may be more than one uncompiled architecture corresponding to the code file to be compiled, then through S103, it is confirmed on which architectures the current version of the code file to be compiled has been compiled and on which architectures it has not been compiled temporarily. For example: the uncompiled architectures corresponding to the code file to be compiled include: architecture X, architecture Y, architecture Z, and architecture XU, and the compiled architecture determined by S102 is architecture X, then the uncompiled architectures corresponding to the code file to be compiled are: architecture Y, architecture Z, and architecture XU. The architectures described in this article are all: the architectures of the processor, which can be x86 architecture, ARM architecture, MIPS architecture, etc.

[0041] S104. Compile the code file to be compiled in the target compilation group corresponding to the uncompiled architecture, and record the uncompiled architecture, version information, and corresponding compilation result information in the preset database.

[0042] In this embodiment, the target compilation unit may be an empty set or may include at least one compiler. Referring to the above example, the target compilation unit includes compilers of architecture Y, compilers of architecture Z, and compilers of architecture XU. Any compiler needs to obtain the code file to be compiled when compiling the code file to be compiled. Therefore, by sending the code file to be compiled to the target compilation unit, the compilation of the code file to be compiled can be completed in the target compilation unit. In one implementation, compiling the code file to be compiled in the target compilation unit corresponding to the uncompiled architecture includes: determining the target compilation unit in the available list; sending the code file to be compiled to the target compilation unit and compiling the code file to be compiled in the target compilation unit. Among them, the available list records multiple compilers that are managed by the compilation system and are running normally and well. After any compiler is connected to the compilation system, it sends its own architecture type and its own compilation ability index information to the compilation system, so that the compilation system can perform compatibility adaptation, compilation environment initialization, and heartbeat monitoring on the newly connected compiler. If all of the above are completed, the name, model, or other information identifying the identity of this compiler will be recorded in the available list. Heartbeat monitoring is used to monitor whether the compiler is running normally and well. Therefore, the generation process of the available list includes: receiving the architecture type and the compilation ability index information of any compiler; performing compilation compatibility adaptation on the current compiler according to the architecture type and the compilation ability index information; after the compilation environment of the current compiler is initialized successfully, performing heartbeat monitoring on the current compiler and recording the current compiler in the available list.

[0043] Since the target compilation unit may include multiple compilers, and the operating conditions of these compilers may vary, in this embodiment, the code file to be compiled can be first compiled in the in-place compilers that are operating normally and well, and then the current compilation process is paused; after the out-of-place compilers with abnormal operation go online, the code file to be compiled is compiled in the out-of-place compilers. Of course, if all the compilers in the target compilation unit are operating normally and well, the code file to be compiled is separately compiled in these compilers at the same time to efficiently complete this compilation task in a parallel manner. Therefore, in one implementation, compiling the code file to be compiled in the target compilation unit corresponding to the uncompiled architecture includes: detecting whether there are out-of-place compilers in the target compilation unit; if there are out-of-place compilers in the target compilation unit, after compiling the code file to be compiled in the in-place compilers in the target compilation unit, the current compilation process is paused; after the out-of-place compilers go online, the code file to be compiled is compiled in the out-of-place compilers; if there are no out-of-place compilers in the target compilation unit, the code file to be compiled is separately compiled in each compiler in the target compilation unit. Among them, a compiler may be out of place due to abnormal conditions such as network failures or machine failures, and the in-place status of each compiler can be monitored through heartbeat monitoring. In one implementation, if any compiler in the target compilation unit fails to compile, the current compilation process is stopped, a notification message indicating compilation failure is returned, and the version information recorded in the preset database and its corresponding compiled architecture are retained; that is: in the case where any compiler in the target compilation unit fails to compile, considering that other compilers in the target compilation unit may also fail to compile, to avoid resource consumption caused by unnecessary compilation operations, the current compilation process can be directly stopped and the client is informed that the current compilation task has failed; subsequently, the user can resubmit this compilation task on the client.

[0044] Referring to the above example, when the target compilation unit is an empty set, it means that this version of the code file to be compiled has been compiled in all its corresponding uncompiled architectures. Then, a notification message indicating that the current version information has been compiled on the uncompiled architecture can be directly returned, and the current compilation process is ended. Among them, the uncompiled architectures corresponding to the code file to be compiled can include the architectures of all compilers managed by the compilation system, or some architectures specified by the user on the client. In one implementation, if the uncompiled architecture is an empty set or all compilers in the target compilation unit have successfully compiled, a notification message indicating that the version information has been compiled on the uncompiled architecture is returned, and the current compilation process is ended.

[0045] It should be noted that after receiving a compilation task, the compilation system in this embodiment not only judges the software version, but also further judges the architecture type, thus solving the limitation that "a software version is only compiled once in the compilation system". And this solution uses an incremental architecture compilation method to solve the problem of repeated compilation of the same software version on processors with the same architecture, saving resources and improving compilation efficiency. Moreover, the compilation results of the corresponding software versions recorded in the preset database on the processors that have been compiled are not affected by subsequent newly added compilation processes, enabling subsequent reuse of the corresponding compilation results and facilitating the traceability and query of compilation information.

[0046] Please refer to Figure 2 , the construction process of the compilation system includes:

[0047] Establish an architecture registration center module to support each compiler to automatically report its own CPU architecture type and its own compilation ability when starting up; the own compilation ability can be the number of CPU cores, and the more cores, the stronger the compilation ability.

[0048] The compilation server in the compilation system maintains a dynamic architecture whitelist: when a new architecture compiler is detected to register, the supported architecture whitelist is automatically expanded. Specifically, when the compilation server detects a new architecture, it performs compilation compatibility adaptation on the compiler, and then initializes the Mock compilation environment on the compiler. Successful initialization indicates that the software source and compilation environment of the compiler are okay and meet the compilation requirements. After meeting the compilation requirements, it is updated to the whitelist.

[0049] The compilation server continuously performs heartbeat monitoring on the compilers in the whitelist: if any compiler disconnects from the compilation server, then the corresponding alarm of the compiler is output to notify the user.

[0050] Please refer to Figure 3 and Figure 4 , a specific compilation process includes: R & D and operation and maintenance personnel submit a compilation instruction to the compilation server according to the address of the repository storing the code files, the compilation target, and the commit record of the compilation (a new commit will be generated every time the code file is updated). After receiving the compilation instruction, the compilation server searches the database according to the compilation information carried in the submitted compilation instruction to query whether the version number of the currently compiled software has been compiled. If all architectures of compilers have compiled it, then a notification message that the current version has been compiled by all architectures is returned, and then the compilation is stopped and the compilation task ends.

[0051] Figure 3 The compilation process shown also includes:

[0052] Status synchronization: After the preprocessing stage, compilation stage, packaging stage, and verification stage of each compilation process are completed, it is updated to the database in real time for recording to facilitate traceability.

[0053] Failure handling: When compilation fails, it automatically triggers a retry (the maximum number of retries can be set, for example, up to 3 retries). If the retry fails, corresponding alarms are pushed.

[0054] Monitoring view: During each compilation process, the compilation progress, resource occupancy rate, and whether there are abnormalities of the compilation machines of each architecture are globally displayed.

[0055] Please refer to Figure 4 , if it is confirmed that the compilation machines of all architectures in the system have not compiled the current software version, the compilation instructions are distributed to all available compilation machines respectively, so that the compilation machines of each architecture compile the software to generate the corresponding rpm packages and src.rpm packages, and save the obtained relevant software packages in the nfs server according to the agreed storage location. This nfs server can be accessed by all compilation machines and compilation servers. Then, the compilation machines of each architecture save information such as the address of the compiled software package, the sha256 value (check value) of the software package, tag (label of version information), and target (compilation target information) in the database. If there are unavailable compilation machines, for example, when compiling software packages for three architectures but only two architecture compilation machines are online, then first compile these two architectures, and then pause the overall task. Wait until the other compilation machine arrives and finishes compiling, and then determine that the entire compilation task is completed.

[0056] Among them, the architectures of the compilation machines in the system can be x86_64 architecture, aarch64 architecture, etc. If there are only x86_64 architecture and aarch64 architecture compilation machines currently, the compilation tasks are sent to these two compilation machines. After the compilation machines complete the compilation, they notify the compilation server, and the compilation server places the compilation products in the nfs server directory configured in advance. The server stores information such as the compilation products, storage addresses, sha256 hash values, architecture information, whether the compilation is successful, and tag version numbers in the database. And when the compilation server receives a new compilation instruction, it will first retrieve the information in the database and compare it according to the name and version number of the software package. If the version of the same software package has been compiled on the compilation machines of some architectures, a notification message indicating which architectures' compilation machines the current software version has been compiled on will be returned.

[0057] If it is confirmed that the current software version has been compiled on some of the compilers for specific architectures, then directly set these compiled compilers to complete without recompiling. Only distribute the compilation instructions to the compilers that have not been compiled. After these compilers complete the compilation, supplement the newly added compilation-related result information to the database according to the rules, that is: find the record information corresponding to the current software version in the database (the compilation-related result information recorded during the previous compilation of the current software version), and supplement the newly added compilation-related result information to this record information.

[0058] Please refer to Figure 5 , if it is necessary to add compilers for other types of architectures, then add this compiler to the whitelist. After submitting the compilation instructions, the compilation server will distribute the compilation information to the newly added compiler to compile new products. It should be noted that for the situation where the current software version has been compiled on some of the compilers for specific architectures, since it has been successfully compiled before, if the remaining compilers that have not been compiled fail to compile, it will not affect the previous successful compilation results and will not modify any information in the database. Only after the remaining compilers that have not been compiled succeed in compilation, the database will be modified and the tasks will be merged into an overall compilation task and set to compile successfully. This not only avoids repeated compilation but also realizes the reuse of the original successful compilation information and improves the compilation efficiency.

[0059] After the compilation server distributes the compilation instructions to the compilers, if none of the architectures have been compiled, then all architectures need to be compiled. If the compiler for one of the architectures fails to compile, considering that the compilers for other architectures are also likely to fail to compile, the entire compilation process will terminate. The compilation server will stop the tasks of the compilers that have not completed the compilation and set the tasks to failed. If the compilation is resubmitted later, all the compilers for all architectures will be recompiled.

[0060] Please refer to Figure 6 , it is also possible to use the compilers for the specified architectures to complete the current compilation instructions. After the compilation server receives the compilation instructions for the specified architectures, it checks whether the compilers for the corresponding architectures are online. If they are online, it sends the compilation tasks to these compilers, and the compilers for other architectures will not receive these compilation instructions. After the compilers for the specified architectures succeed in compilation, they return a signal of successful compilation to the compilation server. After the compilation server receives the signal of successful compilation from the compiler, it modifies the corresponding database information. When the compilation server receives the compilation instructions for other architectures of the same software package and the same version, it distributes these compilation instructions to the compilers for other architectures, and new information will be added to the database after successful compilation to achieve flexible architecture and version control.

[0061] Next, a software compilation device provided by an embodiment of the present application will be introduced. The software compilation device described below can be cross-referred to other embodiments described in this article.

[0062] An embodiment of the present application discloses a software compilation device, including:

[0063] A receiving module, configured to receive a code file to be compiled and its version information;

[0064] A query module, configured to query a compiled architecture corresponding to the version information in a preset database;

[0065] A determination module, configured to determine an uncompiled architecture corresponding to the code file to be compiled according to the compiled architecture and the uncompiled architecture corresponding to the code file to be compiled;

[0066] A compilation module, configured to compile the code file to be compiled in a target compilation unit group corresponding to the uncompiled architecture, and record the uncompiled architecture, version information, and corresponding compilation result information in a preset database.

[0067] In one implementation manner, the compilation module is specifically configured to:

[0068] Determine a target compilation unit group from an available list;

[0069] Send the code file to be compiled to the target compilation unit group, and compile the code file to be compiled in the target compilation unit group.

[0070] In one implementation manner, the generation process of the available list includes:

[0071] Receive the architecture type and its own compilation capability index information sent by any compiler;

[0072] Perform compilation compatibility adaptation on the current compiler according to the architecture type and compilation capability index information;

[0073] After initializing the compilation environment of the current compiler successfully, perform heartbeat monitoring on the current compiler, and record the current compiler in the available list.

[0074] In one implementation manner, it further includes:

[0075] A response module, configured to, if the uncompiled architecture is an empty set or all compilers in the target compilation unit group are compiled successfully, return a notification message indicating that the version information has been compiled on the uncompiled architecture, and end the current compilation process.

[0076] In one implementation manner, the response module is further configured to:

[0077] If any compiler in the target compilation unit group fails to compile, stop the current compilation process, return a notification message indicating compilation failure, and retain the version information and its corresponding compiled architecture recorded in the preset database.

[0078] In one implementation manner, the compilation module is specifically configured to:

[0079] In a preset database, record the uncompiled architecture as the compiled architecture corresponding to the version information;

[0080] Record the obtained packet address of the compilation, the packet check value, the label of the version information, the compilation target information, and the compilation success flag bit as the compilation result information.

[0081] In one implementation, the compilation module is specifically configured to:

[0082] Detect whether there is an out-of-position compiler in the target compilation unit;

[0083] If there is an out-of-position compiler in the target compilation unit, after compiling the code file to be compiled in the in-position compilers in the target compilation unit, pause the current compilation process; wait for the out-of-position compiler to go online, and then compile the code file to be compiled in the out-of-position compiler;

[0084] If there is no out-of-position compiler in the target compilation unit, compile the code file to be compiled in each compiler in the target compilation unit respectively.

[0085] Among them, for the more specific working processes of each module and unit in this embodiment, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.

[0086] It can be seen that this embodiment provides a software compilation device. This solution uses an incremental architecture compilation method to solve the problem of repeated compilation of the same software version on processors with the same architecture, saves resources, and improves the compilation efficiency. Moreover, the compilation results of the corresponding software version recorded in the preset database on the already compiled processors are not affected by subsequent newly added compilation processes, enabling subsequent reuse of the corresponding compilation results and facilitating the traceability and query of compilation information.

[0087] Next, an electronic device provided by an embodiment of the present application will be introduced. The electronic device described below can be mutually referred to with other embodiments described herein.

[0088] An embodiment of the present application discloses an electronic device, including:

[0089] A memory for storing a computer program;

[0090] A processor for executing the computer program to implement the method disclosed in any of the foregoing embodiments.

[0091] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: receiving a code file to be compiled and its version information; querying in a preset database for a compiled architecture corresponding to the version information; determining an uncompiled architecture corresponding to the code file to be compiled according to the compiled architecture and the uncompiled architecture corresponding to the code file to be compiled; compiling the code file to be compiled in a target compilation group corresponding to the uncompiled architecture, and recording the uncompiled architecture, version information, and corresponding compilation result information in the preset database.

[0092] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: determining a target compilation group from an available list; sending the code file to be compiled to the target compilation group and compiling the code file to be compiled in the target compilation group.

[0093] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: receiving the architecture type and its own compilation capability index information sent by any compiler; performing compilation compatibility adaptation on the current compiler according to the architecture type and compilation capability index information; after initializing the compilation environment of the current compiler successfully, performing heartbeat monitoring on the current compiler and recording the current compiler in the available list.

[0094] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: if the uncompiled architecture is an empty set or all compilers in the target compilation group have been compiled successfully, returning a notification message indicating that the version information has been compiled on the uncompiled architecture and ending the current compilation process.

[0095] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: if any compiler in the target compilation group fails to compile, stopping the current compilation process, returning a notification message indicating compilation failure, and retaining the version information and its corresponding compiled architecture recorded in the preset database.

[0096] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: in the preset database, recording the uncompiled architecture as the compiled architecture corresponding to the version information; recording the address of the compiled data packet, the data packet check value, the label of the version information, the compilation target information, and the compilation success flag bit as the compilation result information.

[0097] In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: Detect whether there is an out-of-position compiler in the target compiler group; if there is an out-of-position compiler in the target compiler group, after compiling the code file to be compiled in the in-position compilers in the target compiler group, pause the current compilation process; wait for the out-of-position compiler to go online and then compile the code file to be compiled in the out-of-position compiler; if there is no out-of-position compiler in the target compiler group, compile the code file to be compiled in each compiler in the target compiler group respectively.

[0098] Further, an embodiment of the present application also provides an electronic device. Among them, the above-mentioned electronic device can be either a server as shown in Figure 7 or a terminal as shown in Figure 8 . Figure 7 and Figure 8 are both structural diagrams of electronic devices shown according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the scope of use of the present application.

[0099] Figure 7 This is a schematic structural diagram of a server provided by an embodiment of the present application. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input / output interface, and a communication bus. Among them, the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the relevant steps in the software compilation disclosed in any of the foregoing embodiments.

[0100] In this embodiment, the power supply is used to provide working voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.

[0101] In addition, as a carrier for resource storage, the memory can be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon include an operating system, a computer program, and data, etc., and the storage method can be temporary storage or permanent storage.

[0102] Among them, the operating system is used to manage and control each hardware device and computer program on the server, so as to realize the operation and processing of data in the memory by the processor. It can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the software compilation method disclosed in any of the foregoing embodiments, the computer program may further include computer programs that can be used to complete other specific tasks. In addition to data such as update information of the application program, the data may further include data such as developer information of the application program.

[0103] Figure 8 FIG. 0 is a schematic structural diagram of a terminal provided by an embodiment of the present application. The terminal may specifically include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.

[0104] Generally, the terminal in this embodiment includes a processor and a memory.

[0105] Among them, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computing operations related to machine learning.

[0106] The memory may include one or more computer non-volatile storage media, which may be non-transitory. The memory may also include high-speed random access memory, as well as non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory is at least used to store the following computer programs. After the computer programs are loaded and executed by the processor, the relevant steps in the software compilation method executed by the terminal side disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored in the memory may also include an operating system and data, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, update information of application programs.

[0107] In some embodiments, the terminal may further include a display screen, an input / output interface, a communication interface, sensors, a power supply, and a communication bus.

[0108] Those skilled in the art can understand that Figure 8 the structure shown in does not constitute a limitation on the terminal, and it may include more or fewer components than shown in the figure.

[0109] Next, a non-volatile storage medium provided by an embodiment of the present application will be introduced. The non-volatile storage medium described below may be referred to each other with other embodiments described herein.

[0110] A non-volatile storage medium is used to store computer programs. When the computer programs are executed by a processor, the software compilation method disclosed in the foregoing embodiments is implemented. Among them, the non-volatile storage medium is a computer-readable non-volatile storage medium. As a carrier for storing resources, it may be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon include an operating system, computer programs, and data, etc., and the storage method may be temporary storage or permanent storage.

[0111] Next, a computer program product provided by an embodiment of the present application will be introduced. The computer program product described below may be referred to each other with other embodiments described herein.

[0112] A computer program product includes computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the software compilation method disclosed above are implemented.

[0113] In this specification, the various embodiments are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other.

[0114] The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be implemented directly in hardware, in software modules executed by a processor, or in a combination thereof. The software modules may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of non-volatile storage medium known in the art.

[0115] Specific examples are used in this document to illustrate the principles and implementation manners of the present application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation on the present application.

Claims

1. A software compilation method, characterized in that, including: Receiving the code file to be compiled and its version information; Querying the compiled architecture corresponding to the version information in a preset database; Determining the uncompiled architecture corresponding to the code file to be compiled according to the compiled architecture and the uncompiled architecture corresponding to the code file to be compiled; Compiling the code file to be compiled in the target compilation group corresponding to the uncompiled architecture, and recording the uncompiled architecture, the version information, and the corresponding compilation result information in the preset database.

2. The method according to claim 1, wherein Compiling the code file to be compiled in the target compilation group corresponding to the uncompiled architecture includes: Determining the target compilation group from the available list; Sending the code file to be compiled to the target compilation group and compiling the code file to be compiled in the target compilation group.

3. The method according to claim 2, wherein The generation process of the available list includes: Receiving the architecture type and the compilation ability index information of any compiler; Performing compilation compatibility adaptation on the current compiler according to the architecture type and the compilation ability index information; After the compilation environment of the current compiler is initialized successfully, performing heartbeat monitoring on the current compiler and recording the current compiler in the available list.

4. The method according to claim 1, wherein If the uncompiled architecture is an empty set or all compilers in the target compilation group are compiled successfully, returning a notification message indicating that the compilation of the version information has been completed on the uncompiled architecture, and ending the current compilation process.

5. The method according to claim 1, wherein It also includes: If any compiler in the target compilation group fails to compile, stopping the current compilation process, returning a notification message indicating compilation failure, and retaining the version information and its corresponding compiled architecture recorded in the preset database.

6. The method according to claim 1, wherein Recording the uncompiled architecture, the version information, and the corresponding compilation result information in the preset database includes: In the preset database, recording the uncompiled architecture as the compiled architecture corresponding to the version information; Recording the address of the compiled data packet, the data packet check value, the label of the version information, the compilation target information, and the compilation success flag bit as the compilation result information.

7. The method according to any one of claims 1 to 6, characterized in that, Compiling the code file to be compiled in the target compilation group corresponding to the uncompiled architecture includes: Detecting whether there is an out-of-position compiler in the target compilation group; If there is an out-of-position compiler in the target compilation group, after compiling the code file to be compiled in the in-position compilers in the target compilation group, pausing the current compilation process; waiting for the out-of-position compiler to go online and then compiling the code file to be compiled in the out-of-position compiler; If there is no out-of-position compiler in the target compilation group, compiling the code file to be compiled in each compiler in the target compilation group respectively.

8. A software compilation device, characterized in that, including: A receiving module for receiving the code file to be compiled and its version information; A querying module for querying the compiled architecture corresponding to the version information in a preset database; A determining module for determining the uncompiled architecture corresponding to the code file to be compiled according to the compiled architecture and the uncompiled architecture corresponding to the code file to be compiled; A compilation module, configured to compile the code file to be compiled in a target compilation unit corresponding to the uncompiled architecture, and record the uncompiled architecture, the version information, and the corresponding compilation result information into the preset database.

9. An electronic device, characterized in that, It includes: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the method according to any one of claims 1 to 7.

10. A non-volatile storage medium, characterized in that, For saving a computer program, wherein the computer program, when executed by a processor, implements the method according to any one of claims 1 to 7.