CN115794384A - Code compiling task allocation method, device, equipment and storage medium - Google Patents

Code compiling task allocation method, device, equipment and storage medium Download PDF

Info

Publication number
CN115794384A
CN115794384A CN202211418941.8A CN202211418941A CN115794384A CN 115794384 A CN115794384 A CN 115794384A CN 202211418941 A CN202211418941 A CN 202211418941A CN 115794384 A CN115794384 A CN 115794384A
Authority
CN
China
Prior art keywords
compiling
slave server
compiled
target
slave
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211418941.8A
Other languages
Chinese (zh)
Inventor
查玲
靳尧
葛迪
蔡志强
江浪
薛莹莹
吴限
张雅媛
吴桐
李永萍
苏宁
陆祉丞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202211418941.8A priority Critical patent/CN115794384A/en
Publication of CN115794384A publication Critical patent/CN115794384A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application provides a code compiling task distribution method, a code compiling task distribution device, code compiling task equipment and a storage medium. The method comprises the following steps: acquiring historical compiling records, tasks to be compiled and available resource amounts of all slave servers, wherein the tasks to be compiled comprise code base identifications to be compiled and compiling demand information; screening out at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server; screening out a second type candidate slave server which executes a historical compiling task with the same identification as the code library to be compiled from each first type candidate slave server; and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server. The scheme of the application can improve the efficiency of code compiling.

Description

Code compiling task allocation method, device, equipment and storage medium
Technical Field
The present application relates to computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for distributing code compilation tasks.
Background
At present, a code compiling task is mainly distributed in a master-slave server mode and source codes in a code library are compiled. Compiling resources are configured on a plurality of slave servers, code compiling tasks are distributed to the slave servers by the master service according to the occupation situation of the compiling resources on each slave server, and the slave servers use the compiling resources to compile source codes in the code base.
In the prior art, a master server allocates a code compiling task only according to the occupation situation of compiling resources on a slave server. However, in an actual compiling process, when compiling source codes in different code libraries, different compiling environments may need to be configured, and different compiling environments need different dependent packages, and when a server does not have a dependent package of a compiling environment in which a code library is configured, the server needs to download the dependent package and configure the compiling environment, thereby reducing the code compiling efficiency.
Disclosure of Invention
The application provides a code compiling task allocation method, a device, equipment and a storage medium, which are used for solving the problem of low code compiling efficiency in the prior art.
According to a first aspect of the present application, there is provided a code compilation task allocation method applied to a master server, where the master server is communicatively connected to at least one slave server, and the method includes:
acquiring historical compiling records, tasks to be compiled and available resource amounts of all slave servers, wherein the tasks to be compiled comprise code base identifications to be compiled and compiling demand information;
screening out at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server according to the compiling demand information and the available resource quantity of each slave server;
screening out a second type candidate slave server which executes a historical compiling task identical to the code base identifier to be compiled from each first type candidate slave server according to the code base identifier to be compiled and the historical compiling record;
and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the tasks to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server.
As an optional implementation manner, the compiling requirement information includes a compiling resource requirement amount, and the screening out at least one first class candidate slave server whose available resource amount meets the execution requirement from each slave server according to the compiling requirement information and an available resource amount of each slave server includes: and determining the slave servers with the available resource quantity larger than the compiling resource demand quantity as candidate slave servers of the first class.
As an optional implementation manner, the determining at least one target slave server according to the identifier of the code library to be compiled and the compiling requirement information, and allocating a task to be compiled to each target slave server for execution includes: determining a predicted compiling time length according to the code library identification to be compiled and the compiling demand information; if the predicted compiling time length is smaller than or equal to the preset compiling time length, determining one of the second type candidate slave servers as a target slave server, and distributing the task to be compiled to the target slave server for execution; and if the predicted compiling time length is determined to be larger than the preset compiling time length, determining at least one of the second type candidate slave servers as the target slave server according to the code base identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution.
As an optional implementation manner, the compiling requirement information includes testing requirement information and splitting requirement information, and the testing requirement information is that there is no testing requirement or there is a testing requirement; determining at least one of the second type candidate slave servers as the target slave server according to the code library identifier to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein the method comprises the following steps: if the test requirement information is determined to be free of test requirements, determining that the task to be compiled comprises a compiling step; if the test requirement information is determined to have the test requirement, determining that the task to be compiled comprises a compiling step and at least one testing step; determining at least one target compiling slave server for executing the compiling step according to the code library identification to be compiled and the splitting requirement information, and distributing the compiling step to each target compiling slave server for execution, wherein each target compiling slave server comprises at least one second-class candidate slave server; and if the at least one testing step is determined to exist, determining at least one target testing slave server for executing each testing step according to the number of the testing steps, and distributing each testing step to each target testing slave server for execution.
As an optional implementation manner, the determining, according to the number of the testing steps, at least one target testing slave server for executing each of the testing steps includes: determining other slave servers except the target compiling slave server as a third type candidate slave server; determining at least one candidate slave server of a third type as the target test slave server, wherein the number of the candidate slave servers of the third type is at most the same as that of the test steps; and distributing each testing step to each target testing slave server to execute, and distributing at least one testing step to each target testing slave server.
As an optional implementation manner, the splitting requirement information is a requirement for splitting or no splitting requirement; the determining, according to the code library identifier to be compiled and the splitting requirement information, at least one target compiling slave server for executing the compiling step, and allocating the compiling step to each target compiling slave server for execution, includes: if the splitting requirement information is determined to be free of splitting requirements, determining a logic structure of a source code to be compiled in a code base to be compiled according to the code base identifier to be compiled, and determining at least one compiling sub-step included in the compiling step according to the logic structure of the source code to be compiled; and determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second type candidate slave servers, and distributing each compiling sub-step to each target compiling slave server to be executed.
As an optional implementation, the determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second class candidate slave servers, and allocating each compiling sub-step to each target compiling slave server for execution includes: if the number M of the compiling substeps is determined to be less than the number N of the second type candidate slave servers, a first preset number P is set 1 Determines a second preset number P of candidate slave servers as target compiling slave servers 2 The first type candidate slave server of (1) is determined as a target compiling slave server; the first preset number P 1 ∈[1,M](ii) a The second preset number P 2 ∈[0,M-P1](ii) a If the number M of the compiling sub-steps is determined to be larger than or equal to the number N of the second type candidate slave servers, a third preset number P 3 To (1) aDetermining the second type of candidate slave servers as target compiling slave servers and setting a fourth preset number P 4 The first type candidate slave server of (1) is determined as a target compiling slave server; the third preset number P 3 ∈[1,N](ii) a The fourth preset number P 4 ∈[0,M-P1](ii) a Each compiling sub-step is distributed to each target compiling slave server to be executed, and each target compiling slave server is distributed with at least one compiling sub-step.
As an optional implementation manner, before determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second class candidate slave servers and allocating each compiling sub-step to each target compiling slave server for execution, the method further includes: and if the splitting requirement information is determined to have the splitting requirement, determining at least two compiling sub-steps included in the compiling step according to the splitting requirement information.
According to a second aspect of the present application, there is provided a code compiling task allocating device applied to a master server, the master server being communicatively connected to slave servers, including:
the system comprises an acquisition module, a compiling module and a compiling module, wherein the acquisition module is used for acquiring a task to be compiled, a code base identifier to be compiled and compiling requirement information corresponding to the task to be compiled, a historical compiling record and the available resource amount of each slave server;
the first screening module is used for screening at least one first-class candidate slave server of which the available resource quantity meets the execution requirement from each slave server according to the compiling demand information and the available resource quantity of each slave server;
the second screening module is used for screening at least one second-class candidate slave server from each first-class candidate slave server according to the code base identifier to be compiled and the corresponding historical compiling record of the code base identifier to be compiled, and the second-class candidate slave server executes a historical compiling task comprising the code base identifier to be compiled;
and the distribution module is used for determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server.
According to a third aspect of the present application, there is provided an electronic device comprising: a processor and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method as described in the first aspect.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium having stored therein computer-executable instructions for implementing the method as described in the first aspect when executed by a processor.
The code compiling task allocation method, the code compiling task allocation device, the code compiling task allocation equipment and the storage medium are applied to a master server, the master server is in communication connection with at least one slave server, and the tasks to be compiled comprise code library identification to be compiled and compiling requirement information by acquiring historical compiling records, tasks to be compiled and available resource quantities of the slave servers; screening out at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server according to the compiling requirement information and the available resource quantity of each slave server; screening out a second type candidate slave server which executes a historical compiling task identical to the identifier of the code library to be compiled from each first type candidate slave server according to the identifier of the code library to be compiled and the historical compiling record; and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the tasks to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server. Because the available resource amount of the first class candidate slave server meets the execution requirement of the task to be compiled, and the second class candidate slave server executes the historical compiling task which comprises the same identifier as the code library to be compiled, the second class candidate slave server already downloads the dependency package required by compiling the source code to be compiled in the code library to be compiled, and meets the execution requirement of the task to be compiled. Meanwhile, at least one target slave server is determined according to the code library identification to be compiled and the compiling requirement information, and each target slave server comprises at least one second type candidate slave server, so that the task to be compiled is distributed to each target slave server to be executed, and when the task to be compiled is executed, the second type target slave server does not need to download a dependency package required by compiling the source code to be compiled in the code library to be compiled. In conclusion, the scheme of the application can improve the efficiency of code compiling.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a network architecture diagram corresponding to an application scenario provided in an embodiment of the present application;
FIG. 2 is a flowchart illustrating a code compilation task allocation method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a code compilation task allocation method according to a second embodiment of the present application;
FIG. 4 is a flowchart illustrating a code compilation task allocation method according to a third embodiment of the present application;
FIG. 5 is a flowchart illustrating a code compilation task allocation method according to a fourth embodiment of the present application;
FIG. 6 is a schematic structural diagram of a code compilation task allocation device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. The drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the concepts of the application by those skilled in the art with reference to specific embodiments.
Detailed Description
The prior art related to the present application will be described and analyzed in detail below.
In the prior art, a master-slave compiling mode is adopted, and the master-slave compiling mode comprises a master server and a plurality of slave servers, and compiling resources are configured on the plurality of slave servers. When the source code in the compiling code base is needed, the main server randomly distributes the compiling task to the idle slave servers, and the slave servers carry out code compiling. When the slave server executes the compiling task, firstly, a compiling environment of the code needs to be configured, source codes in different code libraries may need different compiling environments, and different compiling environments need different dependent packages. If the dependency package required by compiling is not downloaded in advance when the slave server executes the compiling task, the dependency package needs to be downloaded from a database or the Internet, time is consumed, and code compiling efficiency is reduced.
In conclusion, the prior art has the problem of low code compiling efficiency.
Therefore, in order to improve the efficiency of code compilation, the present inventors have conducted creative studies in the face of the problems in the prior art, and have needed to download a compilation environment dependent package from a server in advance, which performs a compilation task. Therefore, the master server only needs to distribute the compiling task to the slave server which downloads the dependency package required by the compiling environment in advance when distributing the compiling task. Because the required compiling environment may not change or change very little when the source code in the same code library is compiled for multiple times, all or most of the dependency packages required by the compiling environment are downloaded from the server on which the source code to be compiled in the code library to be compiled has been compiled. Therefore, when the slave server which has compiled the source code to be compiled in the code library to be compiled compiles the source code to be compiled in the code library to be compiled, all or most of the time for downloading the dependency package can be saved, and the compiling efficiency is improved.
The inventor proposes a scheme of the application, the scheme is applied to a master server, the master server is in communication connection with at least one slave server, and the task to be compiled comprises a code library identifier to be compiled and compiling demand information by acquiring a historical compiling record, a task to be compiled and available resource quantity of each slave server; screening out at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server according to the compiling demand information and the available resource quantity of each slave server; screening out a second type candidate slave server which executes a historical compiling task identical to the code base identifier to be compiled from each first type candidate slave server according to the code base identifier to be compiled and the historical compiling record; and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server. Because the available resource amount of the first class candidate slave server meets the execution requirement of the task to be compiled, and the second class candidate slave server executes the historical compiling task which comprises the same identifier as the code library to be compiled, the second class candidate slave server already downloads the dependency package required by compiling the source code to be compiled in the code library to be compiled, and meets the execution requirement of the task to be compiled. Meanwhile, at least one target slave server is determined according to the code library identification to be compiled and the compiling requirement information, and each target slave server comprises at least one second type candidate slave server, so that the task to be compiled is distributed to each target slave server to be executed, and when the task to be compiled is executed, the second type target slave server does not need to download a dependency package required by compiling the source code to be compiled in the code library to be compiled. In conclusion, the scheme of the application can improve the efficiency of code compiling.
The application provides a code compiling task allocation method, a code compiling task allocation device, a code compiling task equipment and a storage medium, and aims to solve the technical problems in the prior art. The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
A network architecture and an application scenario of the code compilation task allocation method provided in the embodiment of the present application will be described below. When the following description refers to the accompanying drawings, the same data in different drawings represents the same or similar elements, unless otherwise indicated.
Fig. 1 is a network architecture diagram corresponding to an application scenario of a code compilation task allocation method provided in an embodiment of the present application. As shown in fig. 1, a network architecture corresponding to an application scenario provided in the embodiment of the present application includes: a user terminal 11, a master server 12, at least one code repository 13 and at least one slave server 14. The code base 13 stores uncompiled source code. The user terminal is communicatively connected to host server 12. The master server 12 is communicatively coupled to each slave server 14. Each code repository 13 is communicatively connected to each slave server 14.
The user terminal 11 is configured with a client of the code compiling task allocation application software, or the user terminal 11 accesses a website of the code compiling task allocation method. A user selects or inputs a code base identifier to be compiled through an operation interface of a client or a webpage corresponding to a website, selects or inputs compiling requirement information, and can trigger a code compiling request through a 'confirmation' component. After receiving a code compiling request triggered by a user, the user terminal 11 sends a task to be compiled to the main server 12, where the task to be compiled includes a code library identifier to be compiled and compiling requirement information.
The main server 12 is configured with a code compiling task allocating device and serves as a server for allocating the application software for the code compiling task. After receiving the task to be compiled, the master server 12 may obtain the available resource amount of each slave server through a communication connection with each slave server 14. Host server 12 may have a history compilation record stored thereon.
The main server 12 screens out at least one first-class candidate server with the available resource quantity meeting the execution requirement from each slave server 14 according to the compiling requirement information and the available resource quantity of each slave server 14; screening out a second type candidate slave server which executes a historical compiling task with the same identification of the compiling code base from each first type candidate slave server according to the identification of the code base to be compiled and the historical compiling record; and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server.
And after the target slave server is distributed to execute the task to be compiled, communicating with the code base to be compiled according to the code base to be compiled identifier, acquiring the source code to be compiled in the code base to be compiled, and compiling the source code to be compiled.
Embodiments of the present application will be described below with reference to the accompanying drawings. The embodiments described in the following examples do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
Example one
Fig. 2 is a flowchart illustrating a code compilation task allocation method according to an embodiment of the present application. As shown in fig. 2, the execution subject of the present application is a code compilation task allocation device, which is located in a master server, and the master server is communicatively connected to at least one slave server. The code compilation task allocation method provided by the embodiment includes steps 201 to 204.
Step 201, obtaining a historical compiling record, a task to be compiled and an available resource amount of each slave server, wherein the task to be compiled comprises a code base identifier to be compiled and compiling requirement information.
In this embodiment, the historical compiling record refers to an allocation record of the historical compiling tasks, and the historical compiling tasks refer to compiling tasks between tasks to be compiled. The historical compilation records may be stored in the host service.
The amount of available resources from the server may include Central Processing Unit (CPU) resources and storage resources available on the server to perform the compilation task. The storage resources may include memory resources and disk resources. The master server can communicate with each slave server to acquire the available resource amount of each slave server in real time.
The compiling requirement information includes the requirement of the source code to be compiled in the code library to be compiled at the time of compiling, and may include, for example, a compiling resource requirement amount. The compilation resource demand is a minimum amount of resources required to execute the compilation task, and the slave server may not complete the compilation task when the amount of available resources of the slave server is less than the amount of compilation resources.
Step 202, according to the compiling demand information and the available resource quantity of each slave server, screening out at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server.
As an alternative embodiment, the compilation requirement information includes a compilation resource requirement, and step 201 includes step 2021.
At step 2021, the slave server with the available resource amount greater than the compiling resource demand amount is determined as the first class candidate slave server.
In this embodiment, after acquiring the available resource amount of each slave server, the master server may sequentially compare the available resource amount of each slave server with the compilation resource demand amount, and determine the slave server whose available resource amount is greater than the compilation resource demand amount as a first-class candidate slave server.
Since the slave servers with the available resource amount larger than the compiling resource demand amount are determined as the first class candidate slave servers, the first class candidate slave servers capable of executing the compiling task can be screened from all the slave servers, and a foundation is laid for the distribution of the compiling task.
And step 203, screening out a second type candidate slave server which executes a historical compiling task identical to the code library identification to be compiled from each first type candidate slave server according to the code library identification to be compiled and the historical compiling record.
In this embodiment, the historical compiling record includes the historical compiling task and at least one historical slave server allocated to execute the historical compiling task. The historical compiling task comprises a historical compiling code base identification. Here, for the same code base, the code base is identified as the same at the time of multiple compilations.
In this embodiment, executed historical compiling tasks may be screened from each slave server according to the identifier of the code library to be compiled and the identifier of the historical compiling code library in the historical compiling task, where the historical compiling code library represents the slave server that is the same as the identifier of the code library to be compiled. Furthermore, the second type candidate slave servers can be screened out according to each first type candidate slave server and whether the historical compiling task which is the same as the identification of the code library to be compiled is executed or not.
And 204, determining at least one target slave server according to the code library identifier to be compiled and the compiling requirement information, and distributing the task to be compiled to each target slave server to be executed, wherein each target slave server comprises at least one second-class candidate slave server.
In this embodiment, the master server may determine any one or more second-class candidate slave servers as target slave servers, and allocate the task to be compiled to each target slave server for execution. Meanwhile, if the number of the second type candidate slave servers is small, the master server may also determine zero, one or more of the first type candidate slave servers as the target slave servers. And a plurality of targets complete the task to be compiled from the server together, so that the code compiling efficiency is improved.
After the target slave server is allocated to execute the task to be compiled, the target slave server downloads the source code to be compiled from the code library to be compiled, and can determine the compiling environment required by compiling the source code to be compiled according to the type of the source code to be compiled or the environment configuration information in the source code to be compiled. Because the target slave server compiles the source code to be compiled in the code base to be compiled once, the target slave server downloads the dependency package required by the compiling environment for configuring the source code to be compiled in the historical compiling process, and can directly construct the compiling environment according to the dependency package when executing the task to be compiled so as to compile the source code to be compiled.
According to the code compiling task allocation method provided by the embodiment, through acquiring the historical compiling record, the tasks to be compiled and the available resource amount of each slave server, the tasks to be compiled comprise the code library identification to be compiled and compiling requirement information; screening at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server according to the compiling demand information and the available resource quantity of each slave server; screening out a second type candidate slave server which executes a historical compiling task identical to the code base identifier to be compiled from each first type candidate slave server according to the code base identifier to be compiled and the historical compiling record; and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server. Because the available resource amount of the first class candidate slave server meets the execution requirement of the task to be compiled, and the second class candidate slave server executes the historical compiling task which comprises the same identifier as the code library to be compiled, the second class candidate slave server already downloads the dependency package required by compiling the source code to be compiled in the code library to be compiled, and meets the execution requirement of the task to be compiled. Meanwhile, at least one target slave server is determined according to the code library identification to be compiled and the compiling requirement information, and each target slave server comprises at least one second type candidate slave server, so that the task to be compiled is distributed to each target slave server to be executed, and when the task to be compiled is executed, the second type target slave server does not need to download a dependency package required by compiling the source code to be compiled in the code library to be compiled. In conclusion, the scheme of the application can improve the efficiency of code compiling.
Example two
Fig. 3 is a flowchart illustrating a code compilation task allocation method according to a second embodiment of the present application. As shown in fig. 3, in the code compiling task allocating method provided by this embodiment, on the basis of any one of the above embodiments, step 204 is refined, and then step 204 refinement includes steps 301 to 303.
Step 301, determining the expected compiling time according to the code library identifier to be compiled and the compiling requirement information.
In this embodiment, the main server may communicate with the to-be-compiled code base according to the to-be-compiled code base identifier, and obtain the data size and the code type of the to-be-compiled source code in the to-be-compiled code base from the to-be-compiled code base. The data amount may be a number of lines or bytes of the source code to be compiled, such as 3000 lines or 1G, for example. The code type may be a type of a writing language of the source code to be compiled, illustratively, java speech, C language, C # language, python language, or the like. Here, the type of the writing language of the compiled source code is a compiling language when the task to be compiled is executed.
The main server can calculate the predicted compiling time of the task to be compiled according to the data volume and the code type of the source code to be compiled in the code library to be compiled and the compiling requirement information.
Step 302, if it is determined that the predicted compiling time length is less than or equal to the preset compiling time length, determining one of the second type candidate slave servers as a target slave server, and allocating the task to be compiled to the target slave server for execution.
In this embodiment, the predicted compiling time length may reflect the complexity of the task to be compiled, and the longer the predicted compiling time length is, the more complex the task to be compiled is. If the predicted compiling time is less than or equal to the preset compiling time, the complexity of the task to be compiled is low, the task to be compiled can be executed and completed within a reasonable time, and the code compiling efficiency is high. Therefore, the target slave server can be determined from any one of the second type candidate servers, and the task to be compiled can be distributed to the target slave server to be executed.
Step 303, if it is determined that the predicted compiling time length is greater than the preset compiling time length, determining at least one of the second type candidate slave servers as a target slave server according to the code library identifier to be compiled and the compiling requirement information, and allocating the task to be compiled to each target slave server for execution.
In this embodiment, if the predicted compiling time length is greater than the preset compiling time length, it indicates that the complexity of the task to be compiled is high, the code compiling task cannot be executed and completed within a reasonable time, and the code compiling efficiency is low. In order to further improve the efficiency of code compilation, when the task to be compiled can be distributed to a plurality of slave servers to be executed in parallel, a plurality of target slave servers can be determined from the second type candidate servers, and the task to be compiled can be distributed to the plurality of target slave servers to be executed. Of course, if the task to be compiled cannot be distributed to a plurality of target slave servers for execution, and the compiling task can only be completed from beginning to end by one slave server, any one of the second type candidate slave servers may be determined as a target slave server, and the task to be compiled is distributed to the target slave server for execution.
In the code compiling task allocation method provided by the embodiment, the expected compiling time length is determined according to the identifier of the code library to be compiled and the compiling demand information; if the predicted compiling time length is determined to be less than or equal to the preset compiling time length, determining one of the second-class candidate slave servers as a target slave server, and distributing the task to be compiled to the target slave server for execution; and if the predicted compiling time length is determined to be larger than the preset compiling time length, determining at least one of the second type candidate slave servers as a target slave server according to the code base identification to be compiled and the compiling requirement information, and distributing the task to be compiled to each target slave server for execution. When the predicted compiling time length of the task to be compiled is less than the preset compiling time length, one second-class candidate slave server is determined as the target slave server, so that the use of slave server resources can be reduced while the code compiling efficiency is ensured. Meanwhile, when the predicted compiling time length of the task to be compiled is longer than the preset compiling time length, at least one of the second type candidate slave servers is determined as a target slave server, and the task to be compiled is executed by the plurality of target slave servers at the same time, so that the code compiling efficiency can be further improved.
EXAMPLE III
Fig. 4 is a flowchart illustrating a code compilation task allocation method according to a third embodiment of the present application. As shown in fig. 4, in the code compilation task allocation method provided in this embodiment, on the basis of the second embodiment, the compilation requirement information includes test requirement information and split requirement information, the test requirement information is no test requirement or has a test requirement, and the step 303 is refined, where the step 303 refinement includes steps 401 to 404.
Step 401, if it is determined that the test requirement information is no test requirement, determining that the task to be compiled includes a compiling step.
In this embodiment, the test requirement information is information that can be selected or input by a user, and is used to instruct the target slave server to execute the test step in the process of executing the task to be compiled. The testing step is used for checking the code to be compiled, and can be completed by a preset application program without configuring a compiling environment.
Here, if the test requirement information is no test requirement, the target slave server may only execute the compiling step in the process of executing the compiling task, and need not test the code to be compiled. The compiling step is to convert the source code to be compiled into a machine language that can be executed by the computer, and the compiling environment needs to be configured for execution.
Step 402, if it is determined that the test requirement information is a test requirement, it is determined that the task to be compiled includes a compiling step and at least one testing step.
In this embodiment, when the test requirement information indicates that there is a test requirement, the test requirement information may include at least one of quality detection, interface test, and unit test.
Here, if the test requirement information is that there is a test requirement, the target slave server needs to execute a test step to check the source code to be compiled in addition to executing the compilation step to compile the source code to be compiled in the process of executing the task to be compiled. Accordingly, it may be determined that the task to be compiled includes a compiling step and at least one testing step.
And step 403, determining at least one target compiling slave server for executing the compiling step according to the code library identifier to be compiled and the splitting requirement information, and allocating the compiling step to each target compiling slave server for execution, wherein each target compiling slave server comprises at least one second-class candidate slave server.
In this embodiment, the splitting requirement is information that can be selected or input by a user, and is used to instruct the main server how to split the source code to be compiled in the code library to be compiled when the compiling task is allocated.
It is to be understood that the split requirement may be with or without a split requirement. When the splitting requirement is the splitting requirement, the user designates the splitting mode of the source code to be compiled, and the main server only needs to split the source code to be compiled according to the splitting mode designated by the user.
When the splitting requirement is no splitting requirement, the user does not specify how to split the source code to be compiled, and the main server can scan the source code to be compiled and judge whether the source code to be compiled can be split or how to split the source code to be compiled.
In this embodiment, since the compiling task is to compile a source code to be compiled in a code library to be compiled, after the master server splits the source code to be compiled in the code library to be compiled, the compiling task may be executed by one or more target compiling slave servers, and the code compiling efficiency can be improved only by ensuring that at least one target compiling slave server is configured with a compiling environment.
And step 404, if it is determined that at least one test step exists, determining at least one target test slave server for executing each test step according to the number of the test steps, and distributing each test step to each target test slave server for execution.
As an alternative embodiment, step 404 includes steps 501 to 503.
In step 501, other slave servers except the target compiling slave server are determined as the third type candidate slave servers.
In this embodiment, the testing step may be performed by the target test slave server. Since the testing step does not need to configure the compiling environment, but the target compiling slave server executing the compiling step needs to configure the compiling environment, in order to ensure the efficiency of the target compiling slave server executing the compiling step, other slave servers except the target compiling slave server can be determined as the third type candidate slave servers, and the target testing slave server can be selected from the third type slave servers.
And 502, determining at least one candidate slave server of the third type as the target test slave server, wherein the number of the candidate slave servers of the third type is at most the same as that of the test steps.
And 503, distributing each test step to each target test slave server to be executed, wherein each target test slave server is distributed with at least one test step.
In this embodiment, the number of the target test slave servers may be one or multiple. When the number of the target test slave servers is one, each test step is executed on the one target test slave server. When the number of the target test slave servers is multiple, each test step can be distributed to each target test slave server to be executed, and the number of the target test slave servers can be at most the same as the number of the test steps so as to ensure that each target test slave server executes at least one test step.
The code compiling task distributing method provided by the embodiment determines other slave servers except the target compiling slave server as a third-class candidate slave server; determining at least one candidate slave server of the third type as the target test slave server, wherein the number of the candidate slave servers of the third type is at most the same as that of the test steps; and distributing each testing step to each target testing slave server to execute, and distributing at least one testing step to each target testing slave server. Because the test steps without the compiling environment are distributed to the target test slave server to be executed, the target test slave server executes the test steps while the target compiling slave server executes the compiling steps, the execution efficiency of the tasks to be compiled is improved, and the code compiling efficiency is improved.
According to the code compiling task allocation method provided by the embodiment, if the test requirement information is determined to be free of test requirements, the task to be compiled is determined to comprise a compiling step; if the test requirement information is determined to have the test requirement, determining that the task to be compiled comprises a compiling step and at least one testing step; determining at least one target compiling slave server for executing the compiling step according to the code library identification to be compiled and the splitting requirement information, and distributing the compiling step to each target compiling slave server for execution, wherein each target compiling slave server comprises at least one second-class candidate slave server; and if the at least one testing step is determined to exist, determining at least one target testing slave server for executing each testing step according to the number of the testing steps, and distributing each testing step to each target testing slave server for execution. Because the compiling step and the testing step which are possibly included in the task to be compiled are determined according to the testing requirement information, the compiling step and the testing step are separated, and the target compiling slave server and the target testing slave server respectively execute the compiling step and the testing step, the compiling efficiency is improved. Meanwhile, at least one target compiling slave server for executing the compiling step is determined according to the splitting information, the compiling step is distributed to each target compiling slave server to be executed, the compiling steps are executed in parallel by each target compiling slave server, and the target compiling slave servers comprise at least one second candidate slave server configured with a compiling environment, so that the compiling efficiency can be further improved.
Example four
Fig. 5 is a flowchart illustrating a code compilation task allocation method according to a fourth embodiment of the present application. As shown in fig. 5, on the basis of any of the above embodiments, the splitting requirement information is that there is a splitting requirement or there is no splitting requirement, and step 403 is refined, and then step 403 comprises steps 601 to 602.
Step 601, if the splitting requirement information is determined to have no splitting requirement, determining a logic structure of a source code to be compiled in a code library to be compiled according to the identifier of the code library to be compiled, and determining at least one compiling sub-step included in the compiling step according to the logic structure of the source code to be compiled.
In this embodiment, if the splitting requirement information is that there is no splitting requirement, the user does not specify how to split the source code to be compiled, and the main server may communicate with the code base to be compiled according to the code base identifier to be compiled, scan the source code to be compiled in the code base to be compiled, and obtain the logical structure of the source code to be compiled in the code base to be compiled. Illustratively, the source code to be compiled may be composed of a plurality of code modules, the logical structure of the source code to be compiled may be a main sub-module relationship among the plurality of code modules, and the main server may split the source code according to the main sub-module relationship among the plurality of code modules, and at the same time, split the compiling step into a compiling sub-step of compiling the plurality of code models.
And step 602, determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second type candidate slave servers, and distributing each compiling sub-step to each target compiling slave server to be executed.
As an alternative embodiment, step 602 includes steps 701 to 703.
Step 701, if it is determined that the number M of the compiling sub-steps is smaller than the number N of the second type candidate slave servers, setting a first preset number P 1 Determines a second preset number P of candidate slave servers as target compiling slave servers 2 The first type candidate slave server of (1) is determined as a target compiling slave server; a first predetermined number P 1 ∈[1,M](ii) a A second predetermined number P 2 ∈[0,M-P 1 ]。
In this embodiment, the number of compilation substeps is at least 2, i.e., M ≧ 2. The number of the candidate slave servers in the second class is at least 1, namely N is more than or equal to 1. To improve the efficiency of code compilation, at least one compilation substep needs to be assigned to the second class of candidates for execution from the server.
It will be appreciated that one second type of candidate slave server may perform at least one compilation sub-step, and therefore, if the number M of compilation sub-steps is less than the number N of second type of candidate slave servers, at least one second type of candidate slave server may be determined as a target compilation slave server, and at most the same number of second type of candidates as compilation sub-steps may be determined as target compilation slave servers. Therefore, in the present embodiment, the first predetermined number P 1 ∈[1,M]。
After ensuring that at least one compiling sub-step is allocated to the second type candidate slave server to execute, the rest compiling sub-steps can be continuously allocated to the second type candidate slave server to execute, and can also be allocated to the first type candidate slave server to execute. Similarly, a candidate slave server of the first type may also perform at least one compilation sub-step. Therefore, in this embodiment, the second preset number P may be set 2 Is determined as the target compiling slave server, and the second preset number P 2 ∈[0,M-P 1 ]。
Step 702, if it is determined that the number M of the compiling sub-steps is greater than or equal to the number N of the second type candidate slave servers, a third preset number P 3 Determines the second type candidate slave server as the target compiling slave server, and sets the fourth preset number P 4 The first type candidate slave server of (1) is determined as a target compiling slave server; a third predetermined number P 3 ∈[1,N](ii) a A fourth predetermined number P 4 ∈[0,M-P 1 ]。
In this embodiment, if the number M of the compiling sub-steps is greater than or equal to the number N of the second class candidate slave servers, at least one second class candidate slave server may be determined as a target compiling slave server, and at most N second class candidates may be determined as target compiling slave servers. Therefore, in the present embodiment, the first predetermined number P 1 ∈[1,M]。
Similarly, in this embodiment, after at least one compiling sub-step is allocated to the second type candidate slave server for execution, the remaining compiling sub-steps may also be allocated to the first type candidate slave server for execution. Therefore, in the present embodiment, the second predetermined number P 2 ∈[0,M-P 1 ]。
And step 703, distributing each compiling sub-step to each target compiling slave server to execute, and distributing at least one compiling sub-step to each target compiling slave server.
In this embodiment, after determining each target compilation slave server, each compilation sub-step is allocated to each target compilation slave server for execution, and each target compilation slave server is allocated with at least one compilation sub-step.
In the code compiling task allocation method provided by this embodiment, if it is determined that the number M of the compiling sub-steps is smaller than the number N of the second type candidate slave servers, the first preset number P is used 1 Is determined as a target compiling slave serverAnd a second preset number P 2 The first type candidate slave server of (1) is determined as a target compiling slave server; a first predetermined number P 1 ∈[1,M](ii) a A second predetermined number P 2 ∈[0,M-P 1 ](ii) a If the number M of compiling sub-steps is determined to be greater than or equal to the number N of candidate slave servers of the second class, a third preset number P 3 Is determined as the target compiling slave server, and a fourth preset number P is set 4 The first type candidate slave server of (1) is determined as a target compiling slave server; a third predetermined number P 3 ∈[1,N](ii) a A fourth predetermined number P 4 ∈[0,M-P 1 ](ii) a Each compiling sub-step is distributed to each target compiling slave server to be executed, and each target compiling slave server is distributed with at least one compiling sub-step. According to the number of the compiling sub-steps and the number of the second type candidate slave servers, at least one second type candidate slave server is determined as a target compiling slave server, and the first type candidate slave server can also be determined as a target compiling slave server, so that the code compiling efficiency is improved, meanwhile, a plurality of selectable modes are provided for the distribution of code compiling tasks, and the master server can utilize compiling resources of each slave server more flexibly.
In the code compiling task allocation method provided by this embodiment, if it is determined that the splitting requirement information is a non-splitting requirement, a logical structure of a source code to be compiled in a code library to be compiled is determined according to a code library identifier to be compiled, and at least one compiling sub-step included in the compiling step is determined according to the logical structure of the source code to be compiled; and determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second type candidate slave servers, and distributing each compiling sub-step to each target compiling slave server to be executed. Because at least one compiling sub-step included in the compiling step is determined according to the logic of the source code to be compiled, and each compiling sub-step is further distributed to each target compiling slave server to be executed, each target compiling slave server can execute the compiling step in parallel, and the code compiling efficiency is improved.
As an optional implementation manner, on the basis of any one of the above embodiments, before step 602, step 801 is further included.
Step 801, if it is determined that the splitting requirement information is the splitting requirement, determining at least two compiling sub-steps included in the compiling step according to the splitting requirement information.
In this embodiment, if the splitting requirement information indicates that there is a splitting requirement, the user specifies how to split the source code to be compiled, and the main server only needs to split the source code to be compiled into at least two code sub-modules according to the splitting requirement information, and determines that the at least two compiling sub-steps respectively compile the at least two code sub-modules. Here, the number of the compiling sub-steps is the same as the number of the code sub-modules, and the compiling sub-steps and the code sub-modules correspond to each other.
In the code compiling task allocation method provided by this embodiment, if it is determined that the splitting requirement information is a splitting requirement, at least two compiling sub-steps included in the compiling step are determined according to the splitting requirement information, because at least two compiling sub-steps included in the compiling step are determined according to the splitting requirement information, after the at least two compiling sub-steps are determined, each compiling sub-step can be allocated to at least one target compiling slave service to be executed, and each compiling sub-step is executed in parallel by each target compiling slave server, and because each target compiling slave server includes at least one second-class candidate slave server, the code compiling efficiency can be improved.
As an optional implementation manner, on the basis of any one of the above embodiments, the method further includes the following steps: sending a summarizing instruction to each target slave server, wherein the summarizing instruction comprises a target summarizing slave server identifier, and the target summarizing slave server is one of the target slave servers; and the summarizing instruction is used for indicating other target slave servers except the target summarizing slave server, sending the compiling result to the target summarizing slave server after the to-be-compiled task is executed, and is used for indicating the target summarizing slave server to receive the compiling result and sending the compiling result of each target slave server to the user terminal after the compiling result of each target slave server is summarized.
According to the code compiling method provided by the embodiment, the compiling results of the compiling tasks executed by the target slave servers are summarized and sent to the user terminal through the summary slave servers, so that when the compiling tasks are executed by a plurality of target slave servers, a user only needs to communicate with one target slave server, and the user experience is improved.
EXAMPLE five
Fig. 6 is a schematic structural diagram of a code compilation task allocation device according to an embodiment of the present application. As shown in fig. 6, the code compilation task assigning apparatus 60 provided in this embodiment includes: an acquisition module 61, a first screening module 62, a second screening module 63 and an assignment module 64.
The obtaining module 61 is configured to obtain a task to be compiled, a code base identifier to be compiled and compiling requirement information corresponding to the task to be compiled, a historical compiling record, and an available resource amount of each slave server;
the first screening module 62 is configured to screen out, from each slave server, at least one candidate slave server of the first class, where the available resource amount meets the execution requirement, according to the compiling demand information and the available resource amount of each slave server;
the second screening module 63 is configured to screen at least one second-class candidate slave server from the first-class candidates according to the to-be-compiled code base identifier and the corresponding historical compilation record thereof, where the second-class candidate slave server has executed a historical compilation task including the to-be-compiled code base identifier;
and the allocating module 64 is configured to determine at least one target slave server according to the code library identifier to be compiled and the compiling requirement information, and allocate the task to be compiled to each target slave server for execution, where each target slave server includes at least one second-class candidate slave server.
The code compiling task allocating device provided in this embodiment may execute the code compiling task allocating method provided in the first embodiment, and a specific implementation manner is similar to a principle, which is not described herein again.
As an optional implementation manner, the compilation requirement information includes a compilation resource requirement, and the first filtering module 62 is specifically configured to determine a slave server whose available resource amount is greater than the compilation resource requirement as a first class candidate slave server.
As an optional implementation manner, the allocating module 64 is specifically configured to determine an expected compiling time length according to the identifier of the code library to be compiled and the compiling requirement information; if the predicted compiling time length is determined to be less than or equal to the preset compiling time length, determining one of the second type candidate slave servers as a target slave server, and distributing the task to be compiled to the target slave server for execution; and if the predicted compiling time length is determined to be larger than the preset compiling time length, determining at least one of the second type candidate slave servers as a target slave server according to the code base identification to be compiled and the compiling requirement information, and distributing the task to be compiled to each target slave server for execution.
As an optional implementation manner, the compiling requirement information includes test requirement information and splitting requirement information, the test requirement information is no test requirement or has a test requirement, and the allocation module 64 is further specifically configured to determine that the task to be compiled includes a compiling step if it is determined that the test requirement information is no test requirement; if the test requirement information is determined to have the test requirement, determining that the task to be compiled comprises a compiling step and at least one testing step; determining at least one target compiling slave server for executing the compiling step according to the code library identification to be compiled and the splitting requirement information, and distributing the compiling step to each target compiling slave server for execution, wherein each target compiling slave server comprises at least one second-class candidate slave server; and if the at least one testing step is determined to exist, determining at least one target testing slave server for executing each testing step according to the number of the testing steps, and distributing each testing step to each target testing slave server for execution.
As an alternative embodiment, the allocating module 64 is further configured to determine other slave servers except the target compiling slave server as the third type candidate slave server; determining at least one candidate slave server of a third type as a target test slave server, wherein the number of the candidate slave servers of the third type is at most the same as that of the test steps; and distributing each testing step to each target testing slave server to execute, and distributing at least one testing step to each target testing slave server.
As an optional implementation manner, the splitting requirement information is a splitting requirement or no splitting requirement, and the allocation module 64 is further specifically configured to, if it is determined that the splitting requirement information is a splitting requirement, determine a logical structure of a source code to be compiled in the code library to be compiled according to the code library identifier to be compiled, and determine at least one compiling sub-step included in the compiling step according to the logical structure of the source code to be compiled;
and determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second type candidate slave servers, and distributing each compiling sub-step to each target compiling slave server to be executed.
As an optional implementation manner, the allocating module 64 is specifically further configured to, if it is determined that the number M of the compiling sub-steps is smaller than the number N of the second class candidate slave servers, determine the first preset number P 1 Determines a second preset number P of candidate slave servers as target compiling slave servers 2 The first type candidate slave server of (1) is determined as a target compiling slave server; a first predetermined number P 1 ∈[1,M](ii) a A second predetermined number P 2 ∈[0,M-P 1 ](ii) a If the number M of compiling sub-steps is determined to be greater than or equal to the number N of candidate slave servers of the second class, a third preset number P 3 Is determined as the target compiling slave server, and a fourth preset number P is set 4 The first type candidate slave server of (1) is determined as a target compiling slave server; a third predetermined number P 3 ∈[1,N](ii) a A fourth predetermined number P 4 ∈[0,M-P 1 ](ii) a Each compiling sub-step is assigned to each target compiling slave server to be executed, and each target compiling slave server is assigned at least one compiling sub-step.
As an optional implementation manner, the allocating module 64 is further specifically configured to determine, if it is determined that the splitting requirement information is that there is a splitting requirement, at least two compiling sub-steps included in the compiling step according to the splitting requirement information.
The code compilation task allocation device provided in this embodiment may execute the code compilation task allocation method provided in any one of the second to fourth embodiments, and a specific implementation manner is similar to a principle, which is not described herein again.
EXAMPLE six
Fig. 7 is a schematic structural diagram of an electronic device according to a sixth embodiment of the present application. As shown in fig. 7, the electronic device 70 provided in the present embodiment includes a processor 71 and a memory 72 communicatively connected to the processor 71.
The memory 72 stores computer-executable instructions.
The processor 71 executes the computer execution instructions stored in the memory 72 to implement the user trip identification information determination method provided in any one of the first to fourth embodiments, and the specific implementation manner is similar to the principle, and is not described herein again.
As an alternative embodiment, the electronic device 70 further comprises a transceiver. The transceiver is used for transceiving data.
The processor, memory, and transceiver may be interconnected by circuitry.
The processor 71, memory 72 and transceivers may be communicatively interconnected by a bus.
The memory 72 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks, or the like.
In an exemplary embodiment, the electronic device 70 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
Embodiments of the present application further provide a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for distributing code compilation tasks provided by any one of the above embodiments is implemented.
Illustratively, the computer readable storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
It should be understood that the above-described apparatus embodiments are merely illustrative and that the apparatus of the present application may be implemented in other ways. For example, the division of the modules in the above embodiments is only one logical function division, and there may be another division manner in actual implementation. For example, multiple modules may be combined, or may be integrated into another system, or some features may be omitted, or not implemented.
In addition, unless otherwise specified, each functional module in the embodiments of the present application may be integrated into one module, or each module may exist alone physically, or two or more modules may be integrated together. The integrated module can be realized in a form of hardware or a form of a software program module.
It should be understood that the above-described apparatus embodiments are merely illustrative and that the apparatus of the present application may be implemented in other ways. For example, the division of the modules in the above embodiments is only one logical function division, and there may be another division manner in actual implementation. For example, multiple modules or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented.
In addition, unless otherwise specified, each functional module in each embodiment of the present application may be integrated into one module, or each module may exist alone physically, or two or more modules may be integrated together. The integrated module can be realized in a form of hardware or a form of a software program module.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules referred to are not necessarily required in this application.
It should be further noted that, although the steps in the flowchart are shown in sequence as indicated by the arrows, the steps are not necessarily executed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. A code compiling task allocation method is applied to a master server, the master server is in communication connection with at least one slave server, and the method comprises the following steps:
acquiring historical compiling records, tasks to be compiled and available resource amounts of all slave servers, wherein the tasks to be compiled comprise code base identifications to be compiled and compiling demand information;
screening out at least one first-class candidate slave server with the available resource quantity meeting the execution requirement from each slave server according to the compiling requirement information and the available resource quantity of each slave server;
screening out a second type candidate slave server which executes a historical compiling task identical to the code base identifier to be compiled from each first type candidate slave server according to the code base identifier to be compiled and the historical compiling record;
and determining at least one target slave server according to the code library identification to be compiled and the compiling demand information, and distributing the tasks to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server.
2. The method of claim 1, wherein the compilation demand information includes compilation resource demand, and the screening at least one candidate slave server of a first type from each slave server whose available resource amount satisfies the execution requirement according to the compilation demand information and the available resource amount of each slave server comprises:
and determining the slave servers with the available resource quantity larger than the compiling resource demand quantity as candidate slave servers of the first class.
3. The method according to claim 1, wherein the determining at least one target slave server according to the to-be-compiled code library identifier and the compiling requirement information, and allocating the to-be-compiled task to each target slave server for execution comprises:
determining an expected compiling time length according to the code base identification to be compiled and the compiling demand information;
if the predicted compiling time length is smaller than or equal to the preset compiling time length, determining one of the second type candidate slave servers as a target slave server, and distributing the task to be compiled to the target slave server for execution;
and if the predicted compiling time length is determined to be larger than the preset compiling time length, determining at least one of the second type candidate slave servers as the target slave server according to the code base identification to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution.
4. The method of claim 3, wherein the compiling requirement information comprises testing requirement information and splitting requirement information, and the testing requirement information is no testing requirement or testing requirement;
the determining, according to the code library identifier to be compiled and the compiling demand information, at least one of the second-class candidate slave servers as the target slave server, and allocating a task to be compiled to each target slave server for execution includes:
if the test requirement information is determined to be free of test requirements, determining that the task to be compiled comprises a compiling step;
if the test requirement information is determined to have the test requirement, determining that the task to be compiled comprises a compiling step and at least one testing step;
determining at least one target compiling slave server for executing the compiling step according to the code library identification to be compiled and the splitting requirement information, and distributing the compiling step to each target compiling slave server for execution, wherein each target compiling slave server comprises at least one second-class candidate slave server;
and if the at least one testing step is determined to exist, determining at least one target testing slave server for executing each testing step according to the number of the testing steps, and distributing each testing step to each target testing slave server for execution.
5. The method of claim 4, wherein determining at least one target test slave server to perform each of the testing steps based on the number of testing steps comprises:
determining other slave servers except the target compiling slave server as a third type candidate slave server;
determining at least one candidate slave server of a third type as the target test slave server, wherein the number of the candidate slave servers of the third type is at most the same as that of the test steps;
and distributing each testing step to each target testing slave server to execute, and distributing at least one testing step to each target testing slave server.
6. The method of claim 4, wherein the split requirement information is with split requirement or without split requirement;
the determining, according to the code library identifier to be compiled and the splitting requirement information, at least one target compiling slave server for executing the compiling step, and allocating the compiling step to each target compiling slave server for execution, includes:
if the splitting requirement information is determined to be free of splitting requirements, determining a logic structure of a source code to be compiled in a code base to be compiled according to the code base identifier to be compiled, and determining at least one compiling sub-step included in the compiling step according to the logic structure of the source code to be compiled;
and determining each target compiling slave server according to the number of the compiling sub-steps and the number of the second type candidate slave servers, and distributing each compiling sub-step to each target compiling slave server to be executed.
7. The method of claim 6, wherein the determining each target compilation slave server according to the number of the compilation sub-steps and the number of the second type candidate slave servers and distributing each compilation sub-step to each target compilation slave server for execution comprises:
if the number M of the compiling substeps is determined to be less than the number N of the second type candidate slave servers, a first preset number P is set 1 Determines a second preset number P of candidate slave servers as target compiling slave servers 2 Is a first type candidate ofThe server determines to be a target compiling slave server; the first preset number P 1 ∈[1,M](ii) a The second preset number P 2 ∈[0,M-P 1 ];
A third predetermined number P if it is determined that the number M of compilation substeps is greater than or equal to the number N of candidate slave servers of the second class 3 Is determined as the target compiling slave server, and a fourth preset number P is set 4 The first type candidate slave server of (1) is determined as a target compiling slave server; the third preset number P 3 ∈[1,N](ii) a The fourth preset number P 4 ∈[0,M-P 1 ];
Each compiling sub-step is distributed to each target compiling slave server to be executed, and each target compiling slave server is distributed with at least one compiling sub-step.
8. The method of claim 6, wherein before determining each target compilation slave server according to the number of compilation sub-steps and the number of candidate slave servers of the second class and distributing each compilation sub-step to each target compilation slave server for execution, the method further comprises:
and if the splitting requirement information is determined to have the splitting requirement, determining at least two compiling sub-steps included in the compiling step according to the splitting requirement information.
9. A code compiling task distributing device is applied to a master server, the master server is in communication connection with each slave server, and the code compiling task distributing device comprises:
the acquisition module is used for acquiring the task to be compiled, the corresponding code library identifier to be compiled, compiling demand information, historical compiling records and the available resource amount of each slave server;
the first screening module is used for screening at least one first-class candidate slave server of which the available resource quantity meets the execution requirement from each slave server according to the compiling demand information and the available resource quantity of each slave server;
the second screening module is used for screening at least one second-class candidate slave server from each first-class candidate slave server according to the code base identifier to be compiled and the corresponding historical compiling record of the code base identifier to be compiled, and the second-class candidate slave server executes a historical compiling task comprising the code base identifier to be compiled;
and the distribution module is used for determining at least one target slave server according to the code library identifier to be compiled and the compiling demand information, and distributing the task to be compiled to each target slave server for execution, wherein each target slave server comprises at least one second-class candidate slave server.
10. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 1-8.
11. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the method of any one of claims 1-8.
CN202211418941.8A 2022-11-14 2022-11-14 Code compiling task allocation method, device, equipment and storage medium Pending CN115794384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211418941.8A CN115794384A (en) 2022-11-14 2022-11-14 Code compiling task allocation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211418941.8A CN115794384A (en) 2022-11-14 2022-11-14 Code compiling task allocation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115794384A true CN115794384A (en) 2023-03-14

Family

ID=85437315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211418941.8A Pending CN115794384A (en) 2022-11-14 2022-11-14 Code compiling task allocation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115794384A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116723225A (en) * 2023-06-16 2023-09-08 广州银汉科技有限公司 Automatic allocation method and system for game tasks

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116723225A (en) * 2023-06-16 2023-09-08 广州银汉科技有限公司 Automatic allocation method and system for game tasks
CN116723225B (en) * 2023-06-16 2024-05-17 广州银汉科技有限公司 Automatic allocation method and system for game tasks

Similar Documents

Publication Publication Date Title
CN108287694B (en) Application program construction method, system, computer device and storage medium
US10338956B2 (en) Application profiling job management system, program, and method
US20190324772A1 (en) Method and device for processing smart contracts
CN107766126B (en) Container mirror image construction method, system and device and storage medium
CN108829409B (en) Distributed system rapid deployment method and system
US10216509B2 (en) Continuous and automatic application development and deployment
US10977167B2 (en) Application monitoring with a decoupled monitoring tool
CN111176818B (en) Distributed prediction method, device, system, electronic equipment and storage medium
CN110389903B (en) Test environment deployment method and device, electronic equipment and readable storage medium
CN114244717B (en) Configuration method and device of virtual network card resources, computer equipment and medium
EP2893443A1 (en) Re-configuration in cloud computing environments
CN109032751B (en) Virtual machine deployment method and OMM virtual machine
US20230153158A1 (en) Method, apparatus, system, and storage medium for performing eda task
WO2019135133A1 (en) Dynamic delivery of software functions
CN111596927B (en) Service deployment method and device and electronic equipment
US10749984B2 (en) Processing requests for multi-versioned service
CN112769706B (en) Componentized routing method and system
CN115794384A (en) Code compiling task allocation method, device, equipment and storage medium
EP3754489A1 (en) Method for evaluating application deployment, apparatus, computer program product, and readable medium
CN114860204A (en) Program processing method, program operating device, terminal, smart card and storage medium
CN115098105A (en) Container cloud performance test evaluation realization method, device, equipment and medium
US11269596B2 (en) Automated microservice creation based on user interaction
Vani Building, deploying and validating a home location register (HLR) using Jenkins under the docker and container environment
Liu et al. A concurrent approach for improving the efficiency of Android CTS testing
CN114500268B (en) Method and device for deploying char resources, server and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination