Mobile terminal fast compiling and packaging method and device

CN115617350BActive Publication Date: 2026-09-29INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202211411605.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2026-09-29
Estimated Expiration
2042-11-11

AI Technical Summary

Technical Problem

点了运行代码按钮,等待时间太长,严重拖拉研发效率

Benefits of technology

[0015]本申请的有益技术效果在于:基于现有的编译打包策略,使用分布式编译加差异更新的思想,充分考量CI机器的算力,利用贪婪算法动态计算每次打包时的局部最优解,利用最小算力最大程度提升打包速度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115617350B_ABST
    Figure CN115617350B_ABST
Patent Text Reader

Abstract

The application provides a mobile terminal rapid compiling and packaging method and device, relates to the field of code compiling, and can be applied to the financial field and other fields.The method comprises the following steps: obtaining task parameters according to received packaging task analysis; calculating a local optimal solution of task parameter packaging through a greedy algorithm based on the computing power data of multiple CI machines; obtaining multiple compiling products through code compiling of the corresponding multiple CI machines respectively according to the local optimal solution; generating an execution file through code linking according to the compiling products; and obtaining a compiling and packaging result through the execution file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of code compilation and can be applied to the financial field and other fields, particularly a method and apparatus for rapid compilation and packaging for mobile devices. Background Technology

[0002] With market development and an explosive growth in business scenarios, mobile devices are carrying more and more functions, and the increase in code volume has directly led to a sharp increase in compilation and packaging time.

[0003] Almost all business logic code exists as source code within the main project. Taking test package packaging as an example, the process involves pre-compiling the source files, compiling the code into low-level assembly language, converting the assembly code into machine code, linking static library files (.a, .lib, etc.), generating an executable file, and uploading the test package. However, this method has the following problems: verifying a single test issue requires an hour of packaging time; changing even a single variable name necessitates recompiling all files; and the wait time after clicking the "run code" button is excessively long, severely hindering development efficiency. Summary of the Invention

[0004] The purpose of this application is to provide a method and apparatus for rapid compilation and packaging of mobile devices, which optimizes the compilation and packaging strategy, reduces the compilation and packaging time, improves the efficiency of R&D and testing, and increases the satisfaction of R&D users and test users.

[0005] To achieve the above objectives, the mobile terminal rapid compilation and packaging method provided in this application specifically includes: parsing and obtaining task parameters based on the received packaging task; calculating the local optimal solution for packaging the task parameters using a greedy algorithm based on the computing power data of multiple CI machines; compiling the code using the corresponding multiple CI machines to obtain multiple compilation products based on the local optimal solution; generating an executable file by combining and linking the compilation products; and obtaining the compilation and packaging result through the executable file.

[0006] In the above-mentioned mobile terminal fast compilation and packaging method, optionally, the local optimal solution for packaging with the task parameters by using a greedy algorithm includes: finding the packaging configuration parameters of the previous packaging process according to the task parameters; obtaining the components involved in code changes by comparing the version nodes in the configuration parameters according to the current version node; obtaining the CI machine information for code compilation based on the computing power comparison of the components involved in code changes; and generating a local optimal solution based on the CI machine information.

[0007] In the above-mentioned mobile terminal rapid compilation and packaging method, optionally, obtaining the CI machine information for code compilation based on the comparison of computing power of the components involved in the code change includes: calculating the compilation time of the corresponding CI machine based on the computing power of the components involved in the code change; sorting multiple CI machines in descending order based on the compilation time and the working status of the corresponding CI machine; and determining the CI machine information for code compilation through the descending order.

[0008] In the above-mentioned mobile terminal rapid compilation and packaging method, optionally, determining the CI machine information for code compilation by sorting in descending order further includes: calculating the task time for completing code compilation for each of the corresponding multiple CI machines based on the CI machine information; comparing the task times to obtain a comparison result; and adjusting the CI machine allocation in the CI machine information based on the comparison result.

[0009] In the above-mentioned method for rapid compilation and packaging on mobile devices, optionally, the task parameters include the application name, version type, and git stream.

[0010] In the above-described mobile terminal rapid compilation and packaging method, optionally, generating an executable file by linking the compiled product through code merging includes: calculating the packaging processing time for each CI machine in an idle state to complete the code merging and linking of the compiled product; determining the CI machine to package the compiled product based on the packaging processing time and the computing power of each CI machine; and generating an executable file by packaging the compiled product through the determined CI machine.

[0011] This application also provides a mobile terminal rapid compilation and packaging device, the device comprising a parsing module, an analysis module, a compilation module, and a packaging module; the parsing module is used to obtain a packaging task and parse task parameters based on the packaging task; the analysis module is used to calculate the local optimal solution for packaging the task parameters using a greedy algorithm based on the computing power data of multiple CI machines; the compilation module is used to compile the code using the corresponding multiple CI machines according to the local optimal solution to obtain multiple compilation products; the packaging module is used to generate an executable file by combining and linking the compilation products, and obtain the compilation and packaging result through the executable file.

[0012] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.

[0013] This application also provides a computer-readable storage medium storing a computer program that performs the above-described methods.

[0014] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.

[0015] The beneficial technical effects of this application are as follows: based on the existing compilation and packaging strategies, it uses the idea of ​​distributed compilation and differential update, fully considers the computing power of the CI machine, uses a greedy algorithm to dynamically calculate the local optimal solution for each packaging, and maximizes the packaging speed with minimal computing power. Attached Figure Description

[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, do not constitute a limitation thereof. In the drawings:

[0017] Figure 1 This is a flowchart illustrating a mobile terminal rapid compilation and packaging method provided in an embodiment of this application;

[0018] Figure 2 A schematic diagram illustrating the calculation process of a local optimal solution provided in an embodiment of this application;

[0019] Figure 3 This is a schematic diagram of the CI machine information acquisition process provided in an embodiment of this application;

[0020] Figure 4 This is a schematic diagram illustrating the optimization process for CI machine allocation provided in an embodiment of this application;

[0021] Figure 5 This is a schematic diagram of the process for obtaining the executable file provided in an embodiment of this application;

[0022] Figure 6 This is a schematic diagram illustrating the application process of a mobile terminal rapid compilation and packaging method provided in an embodiment of this application.

[0023] Figure 7 A schematic diagram of the structure of a mobile terminal rapid compilation and packaging device provided in an embodiment of this application;

[0024] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The following will describe in detail the implementation methods of this application with reference to the accompanying drawings and embodiments, so as to fully understand how this application uses technical means to solve technical problems and achieve technical effects, and to implement it accordingly. It should be noted that, as long as there is no conflict, the various embodiments and features in each embodiment of this application can be combined with each other, and the resulting technical solutions are all within the protection scope of this application.

[0026] Furthermore, the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0027] Please refer to Figure 1 As shown, the mobile terminal rapid compilation and packaging method provided in this application specifically includes:

[0028] S101 parses the received packaging task to obtain the task parameters;

[0029] S102 calculates the local optimal solution when packaging the task parameters based on the computing power data of multiple CI machines using a greedy algorithm;

[0030] S103 Based on the local optimal solution, the code is compiled using the corresponding multiple CI machines to obtain multiple compilation products;

[0031] S104 generates an executable file by linking the compiled output through a combined code, and obtains the compilation and packaging result through the executable file.

[0032] The task parameters include the application name, version type, and git stream. The CI machine, commonly known as a packaging machine, is a computer device specifically designed to pull code, compile and package it, and upload it to a test package download server. The executable file is a file that can be loaded and executed by the operating system, i.e., a software installation package. The code linking process generates a Mach-O file by combining the compiled .o files and .dylib, .a, and .tdb files. In this embodiment, after obtaining the task parameters, a greedy algorithm is used to dynamically calculate the packaging time to find the path with the shortest packaging time, thereby reducing repeated builds and improving packaging speed. Specific details will be provided in subsequent embodiments and will not be elaborated here.

[0033] Please refer to Figure 2 As shown, in one embodiment of this application, the local optimal solution for packaging the task parameters using a greedy algorithm includes:

[0034] S201 searches for the packaging configuration parameters of the previous packaging process based on the task parameters;

[0035] S202 compares the version nodes in the configuration parameters with the current version node to obtain the components involved in the code change;

[0036] S203 obtains the CI machine information for code compilation based on the comparison of computing power of the components involved in the code change, and generates a local optimal solution based on the CI machine information.

[0037] Specifically, in practice, the process mainly involves finding the duration of the last build (including total build time, compilation time for different components, linking and executable generation time, and upload time to the server), the version node of the git stream at the time of build, the latest version node of the git stream, and the CI machine at the time of build, based on the app name, version type, and git stream. Then, by calculating the difference between the version node of the git stream at the time of build and the latest version node of the git stream, the components involved in the code changes are obtained. Finally, based on a comparison of the computing power of the components involved in the code changes, the information of the CI machine used for code compilation is obtained. During this process, calculating the difference between the version node of the git stream at the time of build and the latest version node of the git stream identifies the differences, reducing the problem of duplicate builds. The subsequent comparison of computing power is based on the actual computing power of each CI machine to calculate an efficient compilation strategy to complete the code compilation.

[0038] Please refer to Figure 3 As shown, in one embodiment of this application, obtaining the CI machine information for code compilation based on a comparison of the computing power of the components involved in the code change includes:

[0039] S301 calculates the compilation time of the corresponding CI machine based on the computing power of the components involved in the code change;

[0040] S302 sorts the multiple CI machines in descending order according to the compilation time and the working status of the corresponding CI machine;

[0041] S303 determines the CI machine information for code compilation by means of the descending order.

[0042] Please refer to this again. Figure 4 As shown, the CI machine information for code compilation determined by the descending order further includes:

[0043] S401 calculates the task time for completing code compilation for each of the corresponding multiple CI machines based on the CI machine information;

[0044] S402 compares the task times to obtain a comparison result, and adjusts the CI machine allocation in the CI machine information according to the comparison result.

[0045] Specifically, in practice, once the components involved in the code change are identified, the compilation time of each affected component can be calculated. First, check if the CI machine was idle during the last compilation of that component. If idle, directly read the previous compilation time. If not idle, obtain information on other idle CI machines and sort them in descending order of computing power. (The computing power of each CI machine can be determined by its corresponding memory size and CPU model; CI machines with larger memory have higher computing power than those with smaller memory, and those with higher CPU manufacturing processes have higher computing power than those with lower CPU manufacturing processes. If a CI machine has large memory and a low CPU manufacturing process, its corresponding computing power can be confirmed using existing computing power quantification methods.) Next, for CI machines that were not idle during the last compilation of that component, check their previous compilation time and sort them in descending order. Thus, at least two compilation tasks can be assigned to the two CI machines with the highest idle computing power in the descending order.

[0046] In this embodiment, if there are still CI machines in an active state that can handle the remaining compilation tasks, the estimated completion times of the tasks on the active CI machines can be sorted in descending order. Based on the descending order, the remaining compilation tasks are assigned to CI machines whose estimated completion times are closer to the current time. In this way, all compilation tasks are assigned. Of course, to further optimize packaging efficiency, this application can also calculate and compare the estimated completion times of each compilation task based on the task allocation. If a compilation task has the latest estimated completion time and its assigned CI machine is not the one with the highest computing power, then it is calculated again whether there is a CI machine with higher computing power that can be used for the compilation task. If so, the corresponding CI machine allocation is adjusted; otherwise, the current CI machine allocation is maintained. This process can be selected and set according to actual needs, and this application does not further limit it here.

[0047] Please refer to Figure 5 As shown, in one embodiment of this application, generating an executable file by linking the compiled artifacts together includes:

[0048] S501 calculates the packaging processing time for each CI machine in idle state to complete the linking of the compiled products;

[0049] S502 determines the CI machine to package the compiled product based on the packaging processing time and the computing power of each CI machine, and generates an executable file by packaging the compiled product using the determined CI machine.

[0050] In practice, you can check the estimated completion time of the last packaging and the CI machine with the most compilation cache. If it is in the median or low range of all CI machines, then use the CI machine as the packaging device for this time, and wait for each component to be compiled and then pull it one by one to combine and link to generate the executable file. If the estimated completion time of the CI machine is in the high range, then take the device with the highest computing power in the middle or low range as the packaging device for this time.

[0051] To facilitate a clearer understanding of the overall application flow of the embodiments provided in this application, please refer to the following: Figure 6 As shown, the above embodiments are described in their entirety; those skilled in the art will understand that this example is merely to illustrate one application of this application and does not limit it in any way.

[0052] Please refer to Figure 6 As shown, the project is first modularized based on the functions corresponding to the compiled code, and is basically divided into basic public components (network requests, image loading, data parsing, etc.), functional components (login components, payment components, sharing components, etc.), and business components (my account, remittance and transfer, utility payment, etc.). Then, the packaging task is started, and the packaging task instruction is sent to the packaging platform. The instruction includes the name of the APP to be packaged, the version type, the git stream, etc.

[0053] The packaging platform dynamically calculates the packaging time using a greedy algorithm based on the app name, version type, Git flow, CI machine status, and task status, seeking the path with the shortest packaging time to reduce redundant builds. The calculation process includes:

[0054] 1. Based on the app name, version type, and git stream, find the duration of the last packaging (including total packaging time, compilation time of different components, linking and executable file generation time, and upload time to the server), the version node of the git stream at the time of packaging, the latest version node of the git stream, and the CI machine at the time of packaging (e.g., CI machine 9).

[0055] 2. By calculating the difference between the version node of the git stream during packaging and the latest version node of the git stream, the components involved in the code changes (such as components A to E) can be obtained;

[0056] 3. Calculate the compilation time of components (components A to E) involved in code changes. First, check whether the CI machine was idle when the component was last compiled (e.g., if the CI machine corresponding to component E is idle). Then, (component E) directly reads the compilation time of the last compilation.

[0057] 4. Obtain the idle CI machines and sort them in descending order according to their computing power (each CI machine has a computing power value, and the computing power of different devices is generally different. The computing power of 8G memory is generally greater than that of 4G memory, and the computing power of Core i7 is generally greater than that of Core i5) (e.g., the sorting result is CI machine 1, CI machine 2).

[0058] 5. For CI machines that were not idle during the last compilation of this component (e.g., components A to D), check their last compilation time and sort them in descending order (e.g., the sorting result is D, C, B, A). Then, assign the compilation task of component D to CI machine 1, which is idle and has the largest computing power, and assign the compilation task of component C to CI machine 2, which is idle and has the largest computing power. (At this time, components B and A are still not executing compilation tasks, and there are no idle CI machines).

[0059] 6. Sort the estimated completion times of the CI machines in descending order (e.g., CI machine 3, CI machine 4, CI machine 5, etc.). Then, assign the compilation task of component B to CI machine 3, which has the closest estimated completion time but the task status, and assign the compilation task of component A to CI machine 4, which has the closest estimated completion time but the task status.

[0060] 7. Compare the estimated completion time of each component's compilation task. If the estimated completion time of component E's task is the latest and its assigned CI machine is not the device with the highest computing power, then add component E's compilation task and recalculate from step 5.

[0061] 8. Check the estimated completion time of the last packaging and the CI machine 9 with the most compilation cache. If it is in the median or low range of all CI machines, then use CI machine 9 as the packaging device for this time, wait for each component to be compiled, pull them one by one, combine the code and link them to generate the executable file.

[0062] 9. If the estimated completion time on CI machine 9 is in the high digits, then the device with the highest computing power among the middle and low digits will be selected as the packaging device for this time.

[0063] Based on the above calculation results, CI machines are allocated to compile the components involved in the code changes; the CI machine, acting as a packaging machine, pulls the compilation products, performs code merging and linking of the compilation products, produces executable files, uploads the executable files, and finally ends the task.

[0064] Please refer to Figure 7As shown, this application also provides a mobile terminal rapid compilation and packaging device, the device comprising a parsing module, an analysis module, a compilation module, and a packaging module; the parsing module is used to obtain a packaging task and parse the task parameters according to the packaging task; the analysis module is used to calculate the local optimal solution of the task parameters when packaging based on the computing power data of multiple CI machines using a greedy algorithm; the compilation module is used to compile the code through the corresponding multiple CI machines according to the local optimal solution to obtain multiple compilation products; the packaging module is used to generate an executable file through code merging and linking of the compilation products, and obtain the compilation and packaging result through the executable file; in the above embodiments, the specific implementation of each module has been described in detail in the foregoing embodiments, and will not be described in detail here.

[0065] The beneficial technical effects of this application are as follows: based on the existing compilation and packaging strategies, it uses the idea of ​​distributed compilation and differential update, fully considers the computing power of the CI machine, uses a greedy algorithm to dynamically calculate the local optimal solution for each packaging, and maximizes the packaging speed with minimal computing power.

[0066] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.

[0067] This application also provides a computer-readable storage medium storing a computer program that performs the above-described methods.

[0068] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.

[0069] like Figure 8 As shown, the electronic device 600 may also include: a communication module 110, an input unit 120, an audio processing unit 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components. Figure 8 All components shown; in addition, the electronic device 600 may also include Figure 8 For components not shown, please refer to existing technology.

[0070] like Figure 8 As shown, the central processing unit 100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device. The central processing unit 100 receives inputs and controls the operation of various components of the electronic device 600.

[0071] The memory 140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 100 may execute the program stored in the memory 140 to perform information storage or processing, etc.

[0072] Input unit 120 provides input to central processing unit 100. Input unit 120 may be, for example, a keypad or touch input device. Power supply 170 provides power to electronic device 600. Display 160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.

[0073] The memory 140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 may include an application / function storage unit 142 for storing application programs and function programs or processes for executing the operation of the electronic device 600 via the central processing unit 100.

[0074] The memory 140 may also include a data storage unit 143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 144 of the memory 140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0075] The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processing unit 100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.

[0076] Based on different communication technologies, multiple communication modules 110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 110 is also coupled to a speaker 131 and a microphone 132 via an audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby enabling typical telecommunications functions. The audio processor 130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 130 is coupled to a central processing unit 100, enabling on-device recording via the microphone 132 and on-device playback of stored audio via the speaker 131.

[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0078] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0081] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for rapid compilation and packaging of mobile devices, characterized in that, The method includes: Obtain the task parameters by parsing the received packaging task; Based on the computing power data of multiple CI machines, a greedy algorithm is used to calculate the local optimal solution when packaging the task parameters; Based on the local optimal solution, multiple compilation products are obtained by compiling the code using multiple corresponding CI machines; An executable file is generated by linking the compiled artifacts together, and the compiled and packaged result is obtained through the executable file. The local optimal solution for packaging the task parameters using a greedy algorithm includes: The packaging configuration parameters of the previous packaging process are retrieved based on the task parameters; wherein, the packaging configuration parameters include packaging duration, version node at the time of packaging, latest version node, and CI machine at the time of packaging; Based on the current version node, compare the version nodes in the configuration parameters to obtain the components involved in the code changes; Based on the comparison of computing power of the components involved in the code change, obtain the CI machine information for code compilation, and generate a local optimal solution based on the CI machine information; The CI machine information for code compilation, obtained based on a comparison of the computing power of the components involved in the code changes, includes: The compilation time of the corresponding CI machine is calculated based on the computing power of the components involved in the code changes; The multiple CI machines are sorted in descending order based on the compilation time and the corresponding working status of the CI machine. The CI machine information for code compilation is determined by the descending order; The CI machine information used to determine code compilation through the descending order also includes: Calculate the task time for each of the corresponding CI machines to complete code compilation based on the CI machine information; The task times are compared to obtain a comparison result, and the CI machine allocation in the CI machine information is adjusted according to the comparison result. Specifically, obtaining the CI machine information for code compilation based on a comparison of the computing power of the components involved in the code changes includes: Once the components involved in the code change are identified, the compilation time of each component is calculated. First, check if the CI machine was idle when the component was last compiled. If it was idle, directly read the compilation time from the last compilation. If it was not idle, obtain information on other idle CI machines and sort them in descending order of computing power. For CI machines that were not idle when the component was last compiled, check the compilation time of the component and sort them in descending order. Assign at least two compilation tasks to the two CI machines with the largest idle computing power in the descending order. If there are still CI machines that are not idle and can handle the remaining compilation tasks, then the estimated completion times of the tasks of the non-idle CI machines are sorted in descending order, and the remaining compilation tasks are assigned to CI machines whose estimated completion times are closer to the current time based on the descending order. The estimated completion time of each compilation task is calculated and compared based on the task allocation. If a compilation task has the latest estimated completion time and the allocated CI machine is not the device with the highest computing power, then it is calculated again whether there is a CI machine with stronger computing power that can be used for the compilation task. If there is, the corresponding CI machine allocation is adjusted; otherwise, the current CI machine allocation is maintained.

2. The mobile terminal rapid compilation and packaging method according to claim 1, characterized in that, The task parameters include the application name, version type, and git stream.

3. The mobile terminal rapid compilation and packaging method according to claim 1, characterized in that, The executable file generated by linking the compiled artifacts contains: Calculate the packaging processing time for each CI machine to complete the linking of compiled products in idle state; The CI machine for packaging the compiled output is determined based on the packaging processing time and the computing power of each CI machine, and the executable file is generated by packaging the compiled output using the determined CI machine.

4. A mobile terminal rapid compilation and packaging device, characterized in that, The device includes a parsing module, an analysis module, a compilation module, and a packaging module; The parsing module is used to obtain the packaging task and parse the task parameters based on the packaging task. The analysis module is used to calculate the local optimal solution when packaging the task parameters based on the computing power data of multiple CI machines using a greedy algorithm. The compilation module is used to compile the code according to the local optimal solution using multiple corresponding CI machines to obtain multiple compilation products; The packaging module is used to generate an executable file by linking the compiled artifacts together, and to obtain the compilation and packaging result through the executable file. The local optimal solution for packaging the task parameters using a greedy algorithm includes: The packaging configuration parameters of the previous packaging process are retrieved based on the task parameters; wherein, the packaging configuration parameters include packaging duration, version node at the time of packaging, latest version node, and CI machine at the time of packaging; Based on the current version node, compare the version nodes in the configuration parameters to obtain the components involved in the code changes; Based on the comparison of computing power of the components involved in the code change, obtain the CI machine information for code compilation, and generate a local optimal solution based on the CI machine information; The CI machine information for code compilation, obtained based on a comparison of the computing power of the components involved in the code changes, includes: The compilation time of the corresponding CI machine is calculated based on the computing power of the components involved in the code changes; The multiple CI machines are sorted in descending order based on the compilation time and the corresponding working status of the CI machine. The CI machine information for code compilation is determined by the descending order; The CI machine information used to determine code compilation through the descending order also includes: Calculate the task time for each of the corresponding CI machines to complete code compilation based on the CI machine information; The task times are compared to obtain a comparison result, and the CI machine allocation in the CI machine information is adjusted according to the comparison result. Specifically, obtaining the CI machine information for code compilation based on a comparison of the computing power of the components involved in the code changes includes: Once the components involved in the code change are identified, the compilation time of each component is calculated. First, check if the CI machine was idle when the component was last compiled. If it was idle, directly read the compilation time from the last compilation. If it was not idle, obtain information on other idle CI machines and sort them in descending order of computing power. For CI machines that were not idle when the component was last compiled, check the compilation time of the component and sort them in descending order. Assign at least two compilation tasks to the two CI machines with the largest idle computing power in the descending order. If there are still CI machines that are not idle and can handle the remaining compilation tasks, then the estimated completion times of the tasks of the non-idle CI machines are sorted in descending order, and the remaining compilation tasks are assigned to CI machines whose estimated completion times are closer to the current time based on the descending order. The estimated completion time of each compilation task is calculated and compared based on the task allocation. If a compilation task has the latest estimated completion time and the allocated CI machine is not the device with the highest computing power, then it is calculated again whether there is a CI machine with stronger computing power that can be used for the compilation task. If there is, the corresponding CI machine allocation is adjusted; otherwise, the current CI machine allocation is maintained.

5. 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 computer program, it implements the method of any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that enables a computer to execute the method of any one of claims 1 to 3.

7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Compiling and debugging method of embedded equipment

    CN110543425A

  • Continuous integration method, and continuous integration method and system based on distributed compiling

    CN111580802A

  • File difference-based compiling method, storage medium and electronic equipment

    CN114047919A

  • Compiling method, compiling device, computer equipment and storage medium

    CN114968201A

  • Devices, methods, and media for efficient data dependency management for in-order issue processors

    US20220107811A1