Compilation server scheduling method and device, electronic equipment and storage medium
By finding the most idle compilation server among multiple compilation servers to handle compilation tasks, the problem of long-term compilation waiting in the existing technology is solved, and more efficient resource utilization and development progress are achieved.
Patent Information
- Application Number
- CN202411666303.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, compilation tasks are assigned to the compilation server without strategy, resulting in the inability to fully utilize the server performance, resulting in the compilation wait time taking, affecting the development progress.
By finding the most free compilation server that supports the target compilation task, it is used as the target compilation server for the target compilation task, so as to maximize the rational use of the compilation server resources.
Reduces the idle waiting time for compilation tasks, shortens the time for developers to use libraries, and improves the efficiency of development and testing.
Smart Images

Figure CN119597298A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of compile server scheduling, and in particular to a compile server scheduling method, device, electronic device and storage medium. Background Art
[0002] During the project development and testing phase, developers will continuously submit code, and the compilation server will compile the submitted code. When multiple developers submit code at the same time, there may be a queue.
[0003] However, in the prior art, compilation tasks are assigned to various compilation servers without strategy for compilation, which cannot fully utilize the performance of each compilation server, resulting in a long compilation waiting time. As a result, during the peak period of code submission, developers have to wait for a long time for the access control pipeline, affecting the development progress of the project. Summary of the invention
[0004] In view of this, an object of embodiments of the present invention is to provide a compile server scheduling method, device, electronic device and storage medium to at least partially improve the above-mentioned problem.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a compile server scheduling method, the method comprising:
[0007] When receiving a target compilation task of a target firmware project, searching for a first candidate compilation server that supports the target compilation task; the first candidate compilation server is installed with a target client of the target firmware project;
[0008] searching, from each of the first candidate compile servers, for a second candidate compile server in an unexecuted state; the unexecuted state indicates that the state of the target client is idle;
[0009] The most idle compile server is selected from each of the second candidate compile servers as the target compile server of the target compile task.
[0010] Optionally, the selecting the most idle compile server from each of the second compile servers to be selected as the target compile server for the target compile task includes:
[0011] Obtaining the number of projects being compiled and the number of CPU cores in each of the second candidate compile servers;
[0012] Calculate the number of idle CPU cores of each of the second to-be-selected compile servers based on the number of each of the projects and the number of each of the CPU cores;
[0013] The second candidate compile server having the largest number of idle CPU cores is used as the target compile server for the target compile task.
[0014] Optionally, the selecting the most idle compile server from each of the second compile servers to be selected as the target compile server for the compile task includes:
[0015] From each of the second candidate compile servers, a compile server that is executing the least number of compile tasks is found as the target compile server for the target compile task.
[0016] Optionally, the method further comprises:
[0017] When the first candidate compile servers are not idle, a first candidate compile server with a shorter estimated waiting time is calculated as the target compile server for the target compile task.
[0018] Optionally, the calculating of the first candidate compile server with a shorter estimated waiting time as the target compile server for the target compile task includes:
[0019] Find out the queued compilation tasks of each of the first to-be-selected compilation servers; the queued compilation tasks represent compilation tasks that are waiting to be compiled;
[0020] The first candidate compile server with the least number of queued compile tasks is used as the target compile server for the target compile task.
[0021] Optionally, the calculating of the first candidate compile server with a shorter estimated waiting time as the target compile server for the target compile task includes:
[0022] Find out the first queue number of the queued compilation tasks of each of the first to-be-selected compilation servers and the second queue number of the compilation tasks of the target firmware project in each of the queued compilation tasks;
[0023] Obtaining the number of CPU cores of each of the first candidate compile servers;
[0024] Divide each of the first queue numbers by the corresponding number of CPU cores to obtain an average queue number;
[0025] For each of the first to-be-selected compile servers, taking the larger one of the second queue number and the average queue number as a comparison queue number;
[0026] The first candidate compile server with the smallest comparison queue number is selected as the target compile server for the target compile task.
[0027] Optionally, the method further comprises:
[0028] querying the usage of the compile server of the target firmware project once at a first preset frequency;
[0029] If the number of preset situations occurring exceeds the preset number within the preset time, the number of compiling servers that can support the target firmware project is increased; wherein the preset situation is that the number of compiling tasks queued simultaneously is greater than the preset number.
[0030] Optionally, the calculation formula for increasing the number of compile servers that can support the target firmware project is:
[0031] ceil(line_up_num*line_up_time / compile_time)
[0032] Wherein, ceil is a round-up function, line_up_num is the average number of queues of the target compile task, line_up_time is the average queue duration of the target compile task, and compile_time is the compile duration of the target compile task.
[0033] Optionally, the state of the target client further includes occupied, and the method further includes:
[0034] Searching for an occupied client whose status is occupied on each of the compilation servers at a second preset frequency;
[0035] Determining whether each of the occupied clients is actually executing a compilation task;
[0036] If not, the state of the occupied client is changed to idle, and the occupied client is released.
[0037] In a second aspect, an embodiment of the present invention provides a compile server scheduling device, the device comprising:
[0038] A first candidate compile server search module is used to search for a first candidate compile server that supports the target compile task when receiving a target compile task of a target firmware project; the first candidate compile server is installed with a target client of the target firmware project;
[0039] A second candidate compile server search module is used to search for a second candidate compile server in an unexecuted state from each of the first candidate compile servers; the unexecuted state indicates that the state of the target client is idle;
[0040] The target compile server search module is used to select the most idle compile server from each of the second candidate compile servers as the target compile server for the target compile task.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-described methods when executing the program.
[0042] In a fourth aspect, an embodiment of the present invention provides a storage medium having a computer program stored thereon, wherein the computer program implements any of the above-described methods when executed by a processor.
[0043] The embodiment of the present invention provides a compile server scheduling method, device, electronic device and storage medium. When receiving a target compile task of a target firmware project, a first candidate compile server that supports the target compile task is searched, a second candidate compile server that is in an unexecuted state is searched from each first candidate compile server, and the most idle compile server is selected from each second candidate compile server as the target compile server of the target compile task. Thus, the compile server resources can be reasonably utilized to the maximum extent, the idle waiting time of the compile task can be reduced, the time for developers to upload code to the library can be shortened, and the efficiency of development and testing can be improved.
[0044] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0046] Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention;
[0047] Figure 2 A flowchart of a compile server scheduling method provided by an embodiment of the present invention;
[0048] Figure 3 Another schematic diagram of a flow chart of a compile server scheduling method provided by an embodiment of the present invention;
[0049] Figure 4 A schematic diagram of a process flow of step S240 provided in an embodiment of the present invention;
[0050] Figure 5 A schematic structural block diagram of a compile server scheduling device provided in an embodiment of the present invention.
[0051] Icons: 100 - electronic device; 101 - memory; 102 - communication interface; 103 - processor; 104 - bus; 300 - compilation server scheduling device; 310 - first compilation server search module to be selected; 320 - second compilation server search module to be selected; 330 - target compilation server search module. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0053] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0055] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0056] During the project development and testing phase, developers will continuously submit code, and the compilation server will compile the submitted code. Since compilation will occupy and consume the CPU, memory and other performance of the compilation server, when multiple developers submit code in the same period of time, there may be a queue.
[0057] However, in the prior art, compilation tasks are assigned to various compilation servers without strategy for compilation, which cannot fully utilize the performance of each compilation server, resulting in a long compilation waiting time. As a result, during the peak period of code submission, developers have to wait for a long time for the access control pipeline, affecting the development progress of the project.
[0058] Based on the above situation, the embodiments of the present invention provide a compilation server scheduling method, device, electronic device and storage medium. When a target compilation task of a target firmware project is received, the most idle compilation server that can support the target compilation task is found out from multiple compilation servers as the target compilation server of the target compilation task, thereby making the most reasonable use of compilation server resources, shortening the time for developers to upload code to the library, and improving the efficiency of development and testing.
[0059] To implement the process steps and functions of each example of the present invention, please refer to Figure 1 , Figure 1 A schematic structural block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 100 includes a memory 101 and a processor 103, and the memory 101 and the processor 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses 104 or signal lines. The memory 101 can be used to store software programs and modules, and the processor 103 executes the software programs and modules stored in the memory 101 to perform various functional applications and data processing.
[0060] The electronic device 100 may be, but is not limited to, a personal computer (PC), a server, a distributed computer, etc. It is understandable that the electronic device 100 is not limited to a physical server, but may also be a virtual machine on a physical server, a virtual machine built on a cloud platform, etc., which can provide the same functions as the server or virtual machine. The operating system of the electronic device 100 may be, but is not limited to, a Windows system, a Linux system, etc.
[0061] Among them, the memory 101 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc.
[0062] The communication connection between the electronic device 100 and an external device is achieved through at least one communication interface 102 (which can be wired or wireless).
[0063] The processor 103 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the embodiment of the present invention can be completed by the hardware integrated logic circuit in the processor 103 or the instructions in the form of software. The processor 103 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0064] Understandably, Figure 1 The structure shown is for illustration only. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0065] The following is an exemplary description of the compilation server scheduling method provided by the present invention. Specifically, Figure 2 A flow chart of a compile server scheduling method provided by an embodiment of the present invention, see Figure 2 , the execution subject of this method can be the above Figure 1 The electronic device 100 shown in FIG. 1 includes: Figure 2 The following steps are shown:
[0066] S210: When receiving a target compilation task of a target firmware project, searching for a first candidate compilation server that supports the target compilation task, wherein the first candidate compilation server is installed with a target client of the target firmware project.
[0067] Install an agent client on each compile server. One client is configured for one firmware project. One compile server can be configured with multiple clients. For example, the current target firmware project is the 2752 project. The 2752 project configures an agent client as the target client on three compile servers respectively, indicating that these three compile servers can support the compilation of the 2752 project. If there are 10 compile servers in total, the three compile servers that can support the compilation of the 2752 project will be selected from these 10 compile servers.
[0068] S220: Searching for a second candidate compile server in a non-execution state from each first candidate compile server, wherein the non-execution state indicates that the target client is in an idle state.
[0069] Since parallel compilation of the same project is not allowed on the same compilation server, a compilation server that has not executed the compilation task of the target firmware project is found among the first compilation servers to be selected as the second compilation server to be selected.
[0070] S230: Selecting the most idle compile server from the second compile servers to be selected as the target compile server for the target compile task.
[0071] After finding out the compile servers that can support the compilation of the target firmware project and the second candidate compile servers that have not executed the compilation task of the target firmware project, find the most idle compile server as the target compile server of the target compilation task to reduce the waiting time of project compilation.
[0072] The method finds the idlest compile server that can support the target compile task among multiple compile servers as the target compile server of the target compile task, thereby reducing the idle waiting time of the compile task, making the most reasonable use of compile server resources, shortening the time for developers to upload code to the library, and improving the efficiency of development and testing.
[0073] In a possible implementation, the method of searching for the most idle compile server may be selected according to the number of CPU cores of the compile server. The above step S230 may include the following steps:
[0074] S231: Obtain the number of projects being compiled and the number of CPU cores in each second candidate compilation server.
[0075] S232: Calculate the number of idle CPU cores of each second candidate compile server based on the number of each project and the number of each CPU core.
[0076] S233: Use the second candidate compile server with the largest number of idle CPU cores as the target compile server for the target compile task.
[0077] First, obtain the number of projects being compiled and the number of CPU cores in each second candidate compilation server. For example, the number of projects being compiled and the number of CPU cores in the first second candidate compilation server are 3 and 4 respectively, and the number of idle CPU cores is 1; the number of projects being compiled and the number of CPU cores in the second second candidate compilation server are 2 and 4 respectively, and the number of idle CPU cores is 2. The second second candidate compilation server is used as the target compilation server for the target compilation task.
[0078] In another possible implementation manner, the above step S230 may include the following steps:
[0079] S231`: Find the compile server that is executing the least number of compile tasks from the second candidate compile servers and use it as the target compile server for the target compile task.
[0080] For example, you need to obtain idle compilation servers for project 2752. There are currently 5 compilation servers, 3 of which support the compilation of project 2752. The compilation server numbers are S1, S2, S3, S4, and S5. S1 and S2 do not support version compilation of project 2752, so these two compilation servers are excluded first. The target client corresponding to project 2752 on server S3 is not idle, so server S3 is also excluded. S4 and S5 have other projects being compiled. The number of executed projects is two projects (such as 2730 and 2754) on server S4 and one project (such as project 0901) on server S5. Then, server S5 with fewer projects being compiled is selected as the target compilation server for the target compilation task, and S5 is used to compile the target compilation task, so that the compilation servers are scheduled evenly.
[0081] Further, when receiving the target compilation task of the target firmware project, there may be a situation where none of the first candidate compilation servers that can support the target firmware project are idle. Therefore, in a possible implementation, see Figure 3 , Figure 3 Another flow chart of a compile server scheduling method provided by an embodiment of the present invention, the method may further include the following steps:
[0082] S240: When all first candidate compile servers are not idle, calculate a first candidate compile server with a shorter estimated waiting time as the target compile server for the target compile task.
[0083] When the first candidate compile servers are not idle, we need to calculate which first candidate compile server is expected to execute the target compile task the fastest, and queue the target compile task to the corresponding first candidate compile server, which can reduce the waiting time of the target compile task.
[0084] Optionally, step S240 may include:
[0085] The queued compile tasks of each first candidate compile server are found; wherein the queued compile tasks represent compile tasks that are waiting for compilation.
[0086] The first candidate compile server with the least number of queued compile tasks is used as the target compile server for the target compile task.
[0087] When all first candidate compile servers are not idle, the compile tasks waiting to be compiled on each first candidate compile server can be found, and the number of queued compile tasks of each first candidate compile server can be known. The first candidate compile server with the least number of queued compile tasks can be directly used as the target compile server for the target compile task. If there are multiple first candidate compile servers with the least number of queued compile tasks, one can be randomly selected. This method can quickly and easily select the target compile server.
[0088] In another possible implementation, in order to more accurately estimate the first candidate compile server with a shorter waiting time, step S240 may include: Figure 4 The following steps are shown:
[0089] S241: Find out the first queue number of the queued compile tasks of each first candidate compile server and the second queue number of the compile tasks of the target firmware project in each queued compile task.
[0090] S242: Obtain the number of CPU cores of each first candidate compile server.
[0091] S243: Divide each first queue number by the corresponding number of CPU cores to obtain an average queue number.
[0092] S244: For each first candidate compile server, the larger one between the second queue number and the average queue number is used as the comparison queue number.
[0093] S245: Select the first candidate compile server with the smallest queue number as the target compile server for the target compile task.
[0094] First, find out the queued compilation tasks of each first candidate compilation server, record it as the first queue number, and find out the compilation tasks of the target firmware project for the application among these queued compilation tasks, record it as the second queue number. For example, the number of queued compilation tasks on the first first candidate compilation server is 4, and there are 2 compilation tasks in the queued compilation tasks that need to compile project 2752, then the first queue number is 4 and the second queue number is 2.
[0095] If the number of queued compilation tasks on the first first candidate compilation server is 4 and the number of CPU cores is 4, then the average queue number is 4 / 4=1, and the second queue number is 2, then 2 is used as the comparison queue number. If the number of queued compilation tasks on the second first candidate compilation server is 6 and the number of CPU cores is 4, then the average queue number is 6 / 4=1.5, and the second queue number is 1, then 1.5 is used as the comparison queue number, and the second first candidate compilation server is used as the target compilation server of the target compilation task. If it is the previous implementation method, the first first candidate compilation server with 4 queued compilation tasks will be used as the target compilation server of the target compilation task. Compared with the previous implementation method, this method takes into account the situation where compilation tasks of multiple identical target firmware projects are queued on one compilation server.
[0096] When a target firmware project is queued in large numbers, it is necessary to add a compile server that supports the compilation of the target firmware project. Optionally, the method may further include:
[0097] The usage of the compile server of the target firmware project is queried once at a first preset frequency.
[0098] If the number of preset situations occurring exceeds the preset number within the preset time, the number of compile servers that can support the target firmware project is increased; wherein the preset situation is that the number of compile tasks queued simultaneously is greater than the preset number.
[0099] Optionally, the calculation formula for increasing the number of compile servers that can support the target firmware project is:
[0100] ceil(line_up_num*lime_up_time / compile_time)
[0101] Among them, ceil is the upward rounding function, line_up_num is the average number of queues for the target compilation task, line_up_time is the average queue duration for the target compilation task, and compile_time is the compilation duration for the target compilation task.
[0102] The queue status of each firmware item may also be queried once at the first preset frequency, and the processing and calculation are performed uniformly.
[0103] For example, query the usage of the compilation server of the target firmware project once every minute. If all three compilation servers owned by the 2752 project are occupied, and more than three compilation tasks are queued more than three times in three consecutive days, you can add a compilation server to the 2752 project.
[0104] If queues are found for three consecutive days, and more than three compilation tasks are queued at the same time more than three times a day, the daily queue limit is exceeded as follows:
[0105] On the first day, it happened three times. The average queuing time of the three compilation tasks was 2 minutes for the first time, the average queuing time of the four compilation tasks was 3 minutes for the second time, and the average queuing time of the three compilation tasks was 2 minutes for the third time.
[0106] On the second day, it happened 4 times. The average queuing time of the 4 compilation tasks was 3 minutes the first time, the average queuing time of the 4 compilation tasks was 3 minutes the second time, the average queuing time of the 3 compilation tasks was 2 minutes the third time, and the average queuing time of the 3 compilation tasks was 2 minutes the fourth time.
[0107] On the third day, it happened three times. The average queuing time of the three compilation tasks was 2 minutes the first time, the average queuing time of the three compilation tasks was 2 minutes the second time, and the average queuing time of the three compilation tasks was 2 minutes the third time.
[0108] The average number of queued compilation tasks for these three days is:
[0109] ((3+4+3) / 3+(4+4+3+3) / 4+(3+3+3) / 3) / 3(days)≈3.28
[0110] The average length of time for engineering queues is:
[0111] ((2+3+2) / 3+(3+3+2+2) / 4+(2+2+2) / 3) / 3(days)≈2.27
[0112] The number of additional compilation servers required for the 2752 project is calculated as:
[0113] ceil(3.28*2.27 / 3(single compilation task duration is 3 minutes))=3
[0114] Through calculation, we can add 3 compilation servers to the 2752 project, reduce the queuing time of compilation tasks, and improve the efficiency of code submission by developers.
[0115] Furthermore, considering that the target client may not be released normally, it is necessary to release the target client that is released normally. The state of the target client may also include occupation. The method may further include:
[0116] Search for occupied clients whose status is occupied on each compilation server at a second preset frequency.
[0117] Determine whether each occupied client is actually executing the compilation task.
[0118] If not, the status of the occupied client is changed to idle, and the occupied client is released.
[0119] For example, you can configure a separate project to run once a minute to check the task status of the target client. If it is occupied and the compilation task is not actually executed, release the target client.
[0120] This method can be used for each agent client to handle abnormal agent clients that are not released.
[0121] Furthermore, the embodiment of the present invention also provides a compilation server scheduling device, see Figure 5 , Figure 5 A schematic structural block diagram of a compile server scheduling device provided in an embodiment of the present invention, the compile server scheduling device 300 includes:
[0122] The first candidate compile server search module 310 is used to search for a first candidate compile server that supports the target compile task when receiving the target compile task of the target firmware project; the first candidate compile server is installed with the target client of the target firmware project.
[0123] The second candidate compile server search module 320 is used to search for a second candidate compile server in a non-execution state from among the first candidate compile servers; the non-execution state indicates that the target client is idle.
[0124] The target compile server search module 330 is used to select the most idle compile server from the second candidate compile servers as the target compile server for the target compile task.
[0125] In summary, the embodiment of the present invention provides a compile server scheduling method, device, electronic device and storage medium. When receiving a target compile task of a target firmware project, a compile server that can support the compilation of the target firmware project is found as the first compile server to be selected. From each first compile server to be selected, a compile server that has not executed the compilation task of the target firmware project is found as the second compile server to be selected. From each second compile server to be selected, the most idle compile server is selected as the target compile server of the target compile task. When each first compile server to be selected is not idle, a first compile server to be selected with a shorter estimated waiting time is calculated as the target compile server of the target compile task. In this way, the compile server resources can be reasonably utilized to the maximum extent, the idle waiting time of the compile task can be reduced, the time for developers to upload the code to the library can be shortened, and the efficiency of development and testing can be improved.
[0126] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a module, a program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0127] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0128] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0129] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0130] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
Claims
1. A compile server scheduling method, characterized in that: The method comprises: When receiving a target compilation task of a target firmware project, searching for a first candidate compilation server that supports the target compilation task; the first candidate compilation server is installed with a target client of the target firmware project; searching, from each of the first candidate compile servers, for a second candidate compile server in an unexecuted state; the unexecuted state indicates that the state of the target client is idle; The most idle compile server is selected from each of the second candidate compile servers as the target compile server of the target compile task.
2. The method according to claim 1, characterized in that The step of selecting the most idle compile server from each of the second compile servers to be selected as the target compile server for the target compile task includes: Obtaining the number of projects being compiled and the number of CPU cores in each of the second candidate compile servers; Calculate the number of idle CPU cores of each of the second to-be-selected compile servers based on the number of each of the projects and the number of each of the CPU cores; The second candidate compile server having the largest number of idle CPU cores is used as the target compile server for the target compile task.
3. The method according to claim 1, characterized in that The step of selecting the most idle compile server from the second compile servers to be selected as the target compile server for the compile task includes: From each of the second candidate compile servers, a compile server that is executing the least number of compile tasks is found as the target compile server for the target compile task.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the first candidate compile servers are not idle, a first candidate compile server with a shorter estimated waiting time is calculated as the target compile server for the target compile task.
5. The method according to claim 4, characterized in that The first candidate compile server with a shorter estimated waiting time calculated as the target compile server for the target compile task comprises: Find out the queued compilation tasks of each of the first to-be-selected compilation servers; the queued compilation tasks represent compilation tasks that are waiting to be compiled; The first candidate compile server with the least number of queued compile tasks is used as the target compile server for the target compile task.
6. The method according to claim 4, characterized in that The first candidate compile server with a shorter estimated waiting time calculated as the target compile server for the target compile task comprises: Find out the first queue number of the queued compilation tasks of each of the first to-be-selected compilation servers and the second queue number of the compilation tasks of the target firmware project in each of the queued compilation tasks; Obtaining the number of CPU cores of each of the first candidate compile servers; Divide each of the first queue numbers by the corresponding number of CPU cores to obtain an average queue number; For each of the first to-be-selected compile servers, taking the larger one of the second queue number and the average queue number as a comparison queue number; The first candidate compile server with the smallest comparison queue number is selected as the target compile server for the target compile task.
7. The method according to claim 1, characterized in that The method further comprises: querying the usage of the compile server of the target firmware project once at a first preset frequency; If the number of preset situations occurring exceeds the preset number within the preset time, the number of compiling servers that can support the target firmware project is increased; wherein the preset situation is that the number of compiling tasks queued simultaneously is greater than the preset number.
8. The method according to claim 7, characterized in that The calculation formula for increasing the number of compile servers that can support the target firmware project is: ceil(line_up_num*lime_up_time / compile_time) Wherein, ceil is a round-up function, line_up_num is the average number of queues of the target compile task, line_up_time is the average queue duration of the target compile task, and compile_time is the compile duration of the target compile task.
9. The method according to claim 1, characterized in that: The state of the target client further includes being occupied, and the method further includes: Searching for an occupied client whose status is occupied on each of the compilation servers at a second preset frequency; Determining whether each of the occupied clients is actually executing a compilation task; If not, the state of the occupied client is changed to idle, and the occupied client is released.
10. A compilation server scheduling device, characterized in that: The device comprises: A first candidate compile server search module is used to search for a first candidate compile server that supports the target compile task when receiving a target compile task of a target firmware project; the first candidate compile server is installed with a target client of the target firmware project; A second candidate compile server search module is used to search for a second candidate compile server in an unexecuted state from each of the first candidate compile servers; the unexecuted state indicates that the state of the target client is idle; The target compile server search module is used to select the most idle compile server from each of the second candidate compile servers as the target compile server for the target compile task.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 9 is implemented.
12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.