Abstract:
Systems and methods for dynamic allocation of compilation machines are disclosed. A method includes: initiating and storing a task to be compiled and marking the task in a waiting state to wait for compilation of a compilation machine; fetching a compile command, and analyzing a current compile state of the compilation machine and further determining based on the current compile state whether to set the task to be compiled to continue waiting for compilation or enter a compile stage, wherein if to continue waiting for compilation, then the task to be compiled may be further held in storage; otherwise if to enter the compile stage, then the task may be transmitted to the compilation machine for compilation. Thus, the tasks can be automatically assigned to the compilation machines to achieve efficient use of the compilation machines and reduce the otherwise potential error rate due to human intervention.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    The present application is a 35 U.S.C. §371 National Phase conversion of International (PCT) Patent Application No. PCT/CN2016/085248 filed Jun. 8, 2016, which claims foreign priority of Chinese Patent Application No. 201510658136.6, filed on Oct. 13, 2015 in the State Intellectual Property Office of China, the contents of all of which are hereby incorporated by reference. 
       TECHNICAL FIELD 
       [0002]    Embodiments of the present disclosure generally relate to compilation machines, and in particular to systems and methods for dynamic allocation of compilation machines. 
       BACKGROUND 
       [0003]    Today, intelligent terminals are developing at a rapid pace and have gained enormous popularity, meanwhile the software programs running on these intelligent terminals need to be released at increasingly higher frequency. Compilation machines are a requisite for software distribution, so how to achieve efficient software distribution with limited compilation machine resources has long been the subject the industry is constantly exploring. 
         [0004]    Most manufacturers still use the way of statically configuring the compilation machines, according to which current compilation machines may be deployed in an integration system, e.g., software integration system, e.g., Jenkins, which means there would be no database-based maintenance, and each software distribution release would require manually selecting one from among multiple compilation machines. Such way may have the following drawbacks: low compilation machine efficiency and demands for human intervention—hence resulting in a high cost and high potential error rate due to human involvement. 
       SUMMARY 
       [0005]    In view of the above, the present disclosure provides systems and methods for dynamic allocation of compilation machines, according to which tasks can be automatically allocated to the compilation machines to achieve efficient use of compilation machine and reduce the otherwise potential error rate. 
         [0006]    There is provided a method for dynamic allocation of compilation machines, the method comprising: initiating and storing a task to be compiled and further marking the task in a waiting state to wait for compilation of a compilation machine, where when saving the task to be compiled, three data tables may further be established to record project information, compilation machines information, and compilation tasks information, respectively; 
         [0007]    fetching a compile command, and analyzing a current compile state of the compilation machine and further determining based on the current compile state whether to set the task to be compiled to continue waiting for compilation or enter a compile stage, and if the task is to continue waiting for compilation, then holding the task to be compiled in storage; otherwise if the task is to enter the compile stage, transmitting the task to be compiled to the compilation machine for compilation; where the method may further comprise: 
         [0008]    acquiring a task compiling ability of the compilation machine, the task compiling ability comprising a first threshold number of tasks of a same type the compilation machine is able to compile simultaneously as well as a second threshold number of maximum tasks the compilation machine is able to compile simultaneously, the first threshold number being smaller than or equal to the second threshold number. 
         [0009]    Analyzing the current compile state of the compilation machine may comprise: 
         [0010]    determining a first time whether a number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number, and if the first determination result is no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine. 
         [0011]    The project information may comprise a type of the task to be compiled; the compilation machines information may comprise an IP address, name, types of tasks being compiled, and current remaining compilation space, of each compilation machine; and the compilation tasks information may comprise information of compilation machines that are currently working and information of tasks they are compiling. 
         [0012]    The method may further comprise: if the first determination result is yes, then determining a second time whether a number of tasks the compilation machine is currently compiling is greater than or equal to the second threshold number, and if the second determination result is yes, setting the task to be compiled to continue waiting for compilation. 
         [0013]    The method may further comprise: if the second determination result is no, then determining a third time whether the tasks the compilation machine is currently compiling is of a same type as the task to be compiled, and if the third determination result is no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine. 
         [0014]    The method may further comprise: if the third determination result is yes, then determining a fourth time whether a number of tasks of the same type as the task to be compiled is greater than or equal to the first threshold number, and if the fourth determination result is no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine; otherwise if the fourth determination result is yes, setting the task to be compiled to continue waiting for compilation. 
         [0015]    There is also provided another method for dynamic allocation of compilation machines, the method comprising: initiating and saving a task to be compiled and further marking the task in a waiting state to wait for compilation of a compilation machine; and fetching a compile command and analyzing a current compile state of the compilation machine and further determining based on the current compile state whether to set the task to be compiled to continue waiting for compilation or enter a compile stage, and if the task is to continue waiting for compilation, then holding the task to be compiled in storage; otherwise if the task is to enter the compile stage, transmitting the task to be compiled to the compilation for compilation. 
         [0016]    The method may further comprise: establishing three data tables to record project information, compilation machines information, and compilation tasks information, respectively, when saving the task to be compiled. 
         [0017]    The project information may comprise a type of the task to be compiled; the compilation machines information may comprise an IP address, name, types of tasks being compiled, and current remaining compilation space, of each compilation machine; and the compilation tasks information may comprise information of compilation machines that are currently working and information of tasks they are compiling. 
         [0018]    The method may further comprise: acquiring a task compiling ability of the compilation machine, the task compiling ability comprising a first threshold number of tasks of a same type the compilation machine is able to compile simultaneously as well as a second threshold number of maximum tasks the compilation machine is able to compile simultaneously, the first threshold number being smaller than or equal to the second threshold number. Analyzing the current compile state of the compilation machine may comprise: determining a first time whether a number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number, and if the first determination result is no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine. 
         [0019]    The method may further comprise: if the first determination result is yes, then determining a second time whether a number of tasks the compilation machine is currently compiling is greater than or equal to the second threshold number, and if the second determination result is yes, setting the task to be compiled to continue waiting for compilation. 
         [0020]    The method may further comprise: if the second determination result is no, then determining a third time whether the tasks the compilation machine is currently compiling is of a same type as the task to be compiled, and if the third determination result is no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine. 
         [0021]    The method may further comprise: if the third determination result is yes, then determining a fourth time whether a number of tasks of the same type as the task to be compiled is greater than or equal to the first threshold number, and if the fourth determination result is no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine; otherwise if the fourth determination result is yes, setting the task to be compiled to continue waiting for compilation. 
         [0022]    There is also provided a system for dynamic allocation of compilation machines, the system comprising: a customized mechanism configured to initiate a task to be compiled and further initiate a compile command; a database configured to store the task to be compiled; and an allocation mechanism configured to mark the task to be compiled that is stored in the database in a waiting state to wait for compilation of a compilation machine, and analyze, when receiving the compile command, a current compile state of the compilation machine and determine based on the current compile state whether to set the task to be compiled to continue waiting for compilation or enter a compile stage, where if the task is to continue waiting for compilation, then the database may be configured to hold the task to be compiled in storage; otherwise if the task is to enter the compile stage, the allocation mechanism may be configured to transmit the task to be compiled to the compilation machine for compilation. 
         [0023]    The allocation mechanism may further comprise: an acquisition unit configured to acquire a task compiling ability of the compilation machine, the task compiling ability comprising a first threshold number of tasks of a same type the compilation machine is able to compile simultaneously as well as a second threshold number of maximum tasks the compilation machine is able to compile simultaneously, the first threshold number being smaller than or equal to the second threshold number; a first determination unit configured to determine whether a number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number; and an assignment unit configured to, if the determination result of the first determination unit is no, set the task to be compiled to enter the compile stage and further transmit the task to be compiled to the compilation machine. 
         [0024]    The allocation mechanism may further comprise: a second determination unit configured to, if the determination result of the first determination unit is yes, further determine whether a number of tasks the compilation machine is currently compiling is greater than or equal to the second threshold number. The assignment unit may be configured to set the task to be compiled to continue waiting if the determination result of the second determination unit is yes. 
         [0025]    The allocation mechanism may further comprise: a third determination unit configured to, if the determination result of the second determination unit is no, further determine whether the tasks the compilation machine is currently compiling is of a same type as the task to be compiled. The assignment unit may further be configured to set the task to be compiled to enter the compile stage and further transmit the task to be compiled to the compilation machine if the determination result of the third determination unit is no. 
         [0026]    The allocation mechanism may further comprise: a fourth determination unit configured to, if the determination result of the third determination unit is yes, further determine whether a number of tasks of the same type as the task to be compiled is greater than or equal to the first threshold number. The assignment unit may be configured to, if the determination result of the fourth determination unit is no, set the task to be compiled to enter the compile stage and further transmit the task to be compiled to the compilation machine, and otherwise if the determination result of the fourth determination unit is yes, set the task to be compiled to continue waiting for compilation. 
         [0027]    According to the method for dynamic allocation of compilation machines disclosed by the present disclosure, a task to be compiled may first be initiated and saved and further marked in a waiting state to wait for the compilation of a compilation machine, then a compile command may be fetched and the current compile state of the compilation machine may be analyzed and further based on to determine whether to set the task to be compiled to continue waiting for compilation or enter the compile stage. If the task is to continue waiting for compilation, then it will be still held in storage; otherwise if it is to enter the compile stage, then the task would be transmitted to the compilation machine for compilation. Thus, the tasks can be automatically assigned to the compilation machines to achieve efficient use of the compilation machines and reduce the otherwise potential error rate due to human intervention. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0028]      FIG. 1  is a flowchart illustrating a method for dynamic allocation of compilation machines according to an embodiment of the disclosure. 
           [0029]      FIG. 2  is a flowchart illustrating a method for dynamic allocation of compilation machines according to another embodiment of the disclosure. 
           [0030]      FIG. 3  is a flowchart illustrating a method for dynamic allocation of compilation machines according to yet another embodiment of the disclosure. 
           [0031]      FIG. 4  is a block diagram illustrating a system for dynamic allocation of compilation machines according to an embodiment of the disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0032]    Referring to  FIG. 1 , a flowchart illustrating a method for dynamic allocation of compilation machines according to an embodiment of the disclosure is depicted. The method may comprise the following blocks. 
         [0033]    In S 1 , a task to be compiled may be initiated and stored, and may further be marked in a waiting state to wait for compilation of a compilation machine. 
         [0034]    In particular, attribute values in two fields can be preconfigured, including auto_flag and wait_flag, settings of which may comprise the following two cases. 
         [0035]    In a first case, auto_flag=1 may indicate the corresponding task is in the compiled state, i.e., it has entered the compile stage, and typically auto_flag would have a default 0; analogously, wait_flag=1 may denote the corresponding task is in the waiting state, and typically may have a default 1. 
         [0036]    In a second case, auto_flag=0 may indicate the corresponding task is in the compiled state, and typically may have a default 1; analogously, wait_flag=0 may denote the corresponding task is in the waiting state, and so may have a default 1. 
         [0037]    For convenience of description, hereinafter, meanings of the attribute values auto_flag and wait_flag will be in accordance with the first case. 
         [0038]    Therefore, in the present block of the method, the auto_flag of the task to be compiled may first be set to 0, and wait_flag set to 1, to denote a waiting state. 
         [0039]    In S 2 , a compile command may be fetched, and a current compile state of the compilation machine may be analyzed and based on to determine whether to set the task to be compiled to continue waiting for compilation or enter the compile stage. If the task to be compiled is to continue waiting for compilation, then it may still be held in storage; otherwise if to enter the compile stage, it would be transmitted to the compilation machine to be compiled. 
         [0040]    Further, a task compiling ability of the compilation machine may be acquired. The task compiling ability may comprise a first threshold number of tasks of a same type the compilation machine is able to compile simultaneously as well as a second threshold number of maximum tasks the compilation machine is able to compile simultaneously, wherein the first threshold number may be smaller than or equal to the second threshold number. 
         [0041]    Referring now to  FIG. 2 , in which a flowchart illustrating a method for dynamic allocation of compilation machines according to another embodiment of the disclosure is depicted and in which the specific determination process regarding the above block S 2  is further elaborated. Block S 2  may specifically comprise the following steps. 
         [0042]    In S 21 , the process may include determining whether a number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number. 
         [0043]    If the determination result is no, then the process may proceed to S 22 ; otherwise if the determination result is yes, proceed to S 23 . 
         [0044]    In S 22 , the task to be compiled may be set to enter the compile stage and further transmitted to the compilation machine. 
         [0045]    In particular, auto_flag of the task to be compiled may be set to 1, and wait_flag set to 0, to indicate the proceeding to the compile stage. 
         [0046]    In S 23 , the process may include determining whether a number of tasks the compilation machine is currently compiling is greater than or equal to the second threshold number. 
         [0047]    If the determination result is yes, then the process may proceed to S 24 ; otherwise if the determination result is no, proceed to S 25 . 
         [0048]    In S 24 , the task to be compiled may be set to continue waiting for compilation. 
         [0049]    Specifically, the setting in the present block may comprise two cases. 
         [0050]    First, if determining that the number of tasks the compilation machine is currently compiling is greater than the second threshold number by an amount larger than or equal to 2, then the task to be compiled may further be set from the current waiting state to entering a sleep stage, i.e., the auto_flag of the task to be compiled may be set to 0, and the wait_flag may also be set to 0. Until the number of tasks the compilation machine is currently compiling is greater than the second threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0051]    In a second case, if the number of tasks the compilation machine is currently compiling is greater than the second threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0052]    In the present block a waiting period may further be configured, e.g., 2 minutes, so that if the waiting period expires, new scans and judgments may be performed. 
         [0053]    In S 25 , the process may comprise determining whether the tasks the compilation machine is currently compiling is of the same type as the task to be compiled. 
         [0054]    If the determination result is no, then the process may proceed to S 26 ; otherwise if the determination result is yes, proceed to S 27 . 
         [0055]    In S 26 , the task to be compiled may be set to enter the compile stage and further transmitted to the compilation machine. 
         [0056]    In particular, auto_flag of the task to be compiled may be set to 1, and wait_flag set to 0, to indicate the proceeding to the compile stage. 
         [0057]    In S 27 , the process may include determining whether a number of tasks of the same type as the task to be compiled is greater than or equal to the first threshold number. 
         [0058]    If the determination result is no, then the process may proceed to S 28 ; otherwise if the determination result is yes, proceed to S 29 . 
         [0059]    In S 28 , the task to be compiled may be set to enter the compile stage and further transmitted to the compilation machine. 
         [0060]    In particular, auto_flag of the task to be compiled may be set to 1, and wait_flag set to 0, to indicate the proceeding to the compile stage. 
         [0061]    In S 29 , the task to be compiled may be set to continue waiting for compilation. 
         [0062]    The above setting in S 29  may particularly comprise the following two cases. 
         [0063]    First, if in S 27  it is determined that the number of tasks of the same type as the task to be compiled is greater than the first threshold number by an amount larger than or equal to 2, then the task to be compiled may further be set from the current waiting state to entering a sleep stage, in particular, the auto_flag of the task to be compiled may be set to 0, and the wait_flag set to 0. Until the number of tasks of the same type as the task to be compiled is greater than the first threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0064]    In a second case, if in S 27  the number of tasks of the same type as the task to be compiled is determined as greater than the first threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0065]    In the present block a waiting period may further be configured, e.g., 2 minutes, so that if the waiting period expires, new scans and judgments may be performed. 
         [0066]    Therefore, according to the present embodiment the tasks to be compiled can be allocated dynamically without the need for human intervention, thus achieving efficient compilation and reducing the otherwise potential error rate. 
         [0067]    Furthermore, in S 1  three data tables may also be established when saving the task to be compiled, including t_product, t_web_host_info, and t_web_create_perso, which may be used to record the project information, compilation machines information, and compilation tasks information, respectively. The project information may comprise a type of the task to be compiled. The compilation machines information may comprise an IP address, name, types of tasks being compiled, and current remaining compilation space, of each compilation machine. The compilation tasks information may comprise information of compilation machines that are currently working and information of tasks they are currently compiling. 
         [0068]    A compilation machine may need first be selected prior to setting the state of the compilation task in S 2 , the specific process of which may be as follows. First determine whether there is a vacant compilation machine. If there is none, then randomly select a compilation machine and associate the task to be compiled saved in S 1  with the selected compilation machine, i.e., send the task to be compiled to the compilation machine; or, analyze a number of tasks each working compilation machine is currently compiling, and so send the task to be compiled that is saved in S 1  to a compilation machine with relatively fewer compilation tasks. Typically, the task to be compiled may be sent to a compilation machine with relatively fewer compilation tasks which may be of the same type as the task to be compiled. 
         [0069]    If there are any vacant compilation machines, then further determine whether the number of the vacant compilation machines is greater than or equal to two, and if yes, randomly select one to compile the task to be compiled; otherwise if there is only one, select the one to compile the task. 
         [0070]    After having selected the corresponding compilation machine for the task to be compiled, typically the IP address of the selected compilation machine may need to be obtained such that the task to be compiled can be transmitted to the corresponding compilation machine with the IP address. 
         [0071]    Thus, according to the present embodiment both the compilation machines and the tasks to be compiled can be dynamically allocated, thereby achieving high compilation efficiency and reducing the potential error rate due to human involvement. 
         [0072]    Referring to  FIG. 3 , a flowchart illustrating a method for dynamic allocation of compilation machines according to yet another embodiment of the disclosure is depicted. It is worth noting that for purposes of illustration, the number of tasks of a same type that the compilation machine can simultaneously compile equals 1, and the maximum number of tasks the compilation machine can simultaneously compile equals 2. 
         [0073]    The method may comprise the following blocks. 
         [0074]    In S 30 , a task to be compiled may be initiated. There may be initiated a number of tasks to be compiled, such as 1, 2, 3, . . . , n, where n is a natural number. 
         [0075]    In S 31 , the method includes determining whether there is a vacant compilation machine. If the determination result is yes, then the process may proceed to S 32 ; otherwise if the determination result is no, proceed to S 33 . 
         [0076]    In S 32 , one compilation machine may be selected from the vacant compilation machines. The principles for selection are the same as mentioned above, and thus will not be detailed again. The method may then proceed to S 35  in which an IP address of the selected compilation machine may be obtained. 
         [0077]    In S 33 , the method may comprise determining whether a number of the vacant compilation machines is greater than or equal to 2. If the determination result is yes, then the process may proceed to S 34 ; otherwise if the determination result is no, proceed to S 35 . 
         [0078]    In S 34 , one compilation machine may be selected from the vacant compilation machines. Then the method may proceed to S 35  in which an IP address of the selected compilation machine may be obtained. 
         [0079]    In S 35 , the IP address of the only vacant compilation machine may be obtained. 
         [0080]    In S 36 , the task to be compiled may be set in a waiting state. Alternatively, block S 36  may also be executed in between blocks S 30  and S 31 . 
         [0081]    In S 37 , the method may include scanning the compile state of a compilation machine. In particular, scanning the compile state means scanning the number of tasks the compilation machine is currently compiling. 
         [0082]    In S 38 , the method may include determining whether the number of tasks currently being compiled is greater than two. If the determination result is yes, then the method may proceed to S 39 ; otherwise if the determination result is no, proceed to S 40 . 
         [0083]    In S 39 , the task to be compiled may be set in the waiting state, and a waiting period may be set to 2 minutes. If the waiting period expires, i.e., 2 minutes is past, then the method may return to S 37 , in which a new scan may be performed to detect the compile state of the compilation machine. 
         [0084]    In particular, regarding the task to be compiled in the waiting state, the auto_flag thereof may be set to 0, and the wait_flag may be set to 0. 
         [0085]    In S 40 , the method may include determining whether a number of tasks currently being compiled equals two. If the determination result is no, then the method may proceed to S 41 ; otherwise if the determination result is yes, proceed to S 42 . 
         [0086]    In S 41 , the task to be compiled may be set to enter a compile stage and may thus be transmitted to the suitable compilation machine. In particular, as to the task to be compiled, the auto_flag thereof may be set to 1, and the wait_flag may be set to 0. 
         [0087]    In S 42 , the method may include determining whether the two tasks are of a same type, if the determination result is yes, then the method may turn to S 39 ; otherwise if the determination result is no, turn to S 41 . 
         [0088]    In particular, if the method turns to S 39  after the present block, then the auto_flag of the task to be compiled in S 39  may be set to 0, while the wait_flag thereof may be set to 1. 
         [0089]    Referring now to  FIG. 4 , a block diagram illustrating a system for dynamic allocation of compilation machines according to an embodiment of the disclosure is depicted. The system  10  may comprise a customized mechanism  11 , a database  12 , and an allocation mechanism  13 . 
         [0090]    The customized mechanism  11  may be configured to initiate a task to be compiled, such as the task  1  to be compiled, task  2  to be compiled . . . , through task n to be compiled as mentioned above, where n is a natural number. The customized mechanism  11  may further be configured to initiate a compile command. 
         [0091]    The database  12  may be configured to store the tasks to be compiled. Further, three data tables may be established in the database, including t_product, t_web_host_info, and t_web_create_perso, which may record the project information, compilation machine information, and compilation tasks information, respectively. The contents contained in the project information, compilation machine information, and compilation tasks information are similar to those mentioned above, and thus will not be detailed again. 
         [0092]    The allocation mechanism  13  may be configured to mark the task to be compiled that is stored in the database  12  in a waiting state to wait for compilation of a compilation machine, and analyze, after receiving the compile command, a current compile state of the compilation machine  100  and determine based on the current compile state whether to set the task to be compiled to continue waiting for compilation or enter a compile stage. If the task to be compiled is to continue waiting for compilation, then the database  12  may still hold the task to be compiled in storage; otherwise if the task to be compiled is to enter the compile stage, then the allocation mechanism  13  may be configured to transmit the task to be compiled to the compilation machine  100  which may then perform compilation of the task to be compiled. 
         [0093]    In particular, as to the particular method of setting the task to be compiled in the waiting state or to enter the compile stage, attribute values in two fields can be preconfigured, including auto_flag and wait_flag, settings of which may comprise the following two cases. 
         [0094]    In a first case, auto flag=1 may indicate the corresponding task is in the compiled state, i.e., it has entered the compile stage, and auto_flag would typically have a default 0; analogously, wait_flag=1 may denote the corresponding task is in the waiting state, and may typically have a default 0. 
         [0095]    In a second case, auto_flag=0 may indicate the corresponding task is in the compiled state, and may have a default 1; analogously, wait_flag=0 may denote the corresponding task is in the waiting state, and may have a default 1. 
         [0096]    For convenience of description, hereinafter, meanings of the attribute values auto_flag and wait_flag will be in accordance with the first case. 
         [0097]    Therefore, the allocation mechanism  13  may be configured to first set the auto_flag of the task to be compiled that is stored in the database  12  to 0, and the wait_flag to 1, to denote a waiting state. If the tast to be compiled is to continue waiting for compilation, then the auto_flag thereof may be set to 0, while the wait_flag set to 1; or the auto_flag thereof may be set to 0, while the wait_flag also set to 0. If the task to be compiled is to enter the compile stage, then the auto_flag thereof may be set to 1, while the wait_flag set to 0. 
         [0098]    Optionally, the allocation mechanism  13  may further comprise an acquisition unit  131 , a determination unit  132 , and an assignment unit  133 . The acquisition unit  131  may be configured to acquire a task compiling ability of the compilation machine  100 , where the task compiling ability may comprise a first threshold number of tasks of a same type the compilation machine  100  is able to compile simultaneously as well as a second threshold number of maximum tasks the compilation machine  100  is able to compile simultaneously, wherein the first threshold number may be smaller than or equal to the second threshold number. The determination unit  132  may be configured to determine whether a number of tasks the compilation machine  100  is currently compiling is greater than or equal to the first threshold number. The assignment unit  133  may be configured to, if the determination result of the determination unit  132  is no, set the task to be compiled to enter the compile stage and further transmit the task to be compiled to the compilation machine  100 . In particular, auto_flag of the task to be compiled may be set to 1, and wait_flag set to 0, to indicate the proceeding to the compile stage. 
         [0099]    Further, the allocation mechanism  13  may further comprise a determination unit  134  configured to, if the determination result of the determination unit  132  is yes, further determine whether a number of tasks the compilation machine  100  is currently compiling is greater than or equal to the second threshold number. If the determination result of the determination unit  134  is yes, then the assignment unit  133  may be configured to set the task to be compiled to continue waiting for compilation. Specifically, the setting in the present block may comprise the following two cases. 
         [0100]    First, if determining that the number of tasks the compilation machine  100  is currently compiling is greater than the second threshold number by an amount larger than or equal to 2, then the task to be compiled may further be set from the current waiting state to entering a sleep stage, i.e., the auto_flag of the task to be compiled may be set to 0, and the wait_flag may also be set to 0. Until the number of tasks the compilation machine  100  is currently compiling is greater than the second threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0101]    In a second case, if the number of tasks the compilation machine  100  is currently compiling is greater than the second threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0102]    In the present embodiment, a waiting period may further be configured, e.g., 2 minutes, so that if the waiting period expires, new scans and judgments may be performed. 
         [0103]    Further, the allocation mechanism  13  may also comprise a determination unit  135  configured to, if the determination result of the determination unit  134  is no, further determine whether the tasks the compilation machine  100  is currently compiling is of the same type as the task to be compiled. The assignment unit  133  may be configured to, if the determination result of the determination unit  135  is no, set the task to be compiled to enter the compile stage and further transmit the task to be compiled to the compilation machine  100 . In particular, auto_flag of the task to be compiled may be set to 1, and wait_flag set to 0, to indicate the proceeding to the compile stage. 
         [0104]    Further, the allocation mechanism  13  may also comprise a determination unit  136  configured to, if the determination result of the determination unit  135  is yes, further determine whether the number of tasks of the same type as the task to be compiled is greater than or equal to the first threshold number. The assignment unit  133  may be configured to, if the determination result of the determination unit  136  is no, set the task to be compiled to enter the compile stage and further transmit the task to be compiled to the compilation machine  100 . In particular, auto_flag of the task to be compiled may be set to 1, and wait_flag set to 0, to indicate the proceeding to the compile stage. 
         [0105]    If the determination result of the determination unit  136  is yes, then the assignment unit  133  may be configured to set the task to be compiled to continue waiting for compilation. The above setting may particularly comprise the following two cases. 
         [0106]    First, if the determination unit  136  determines that the number of tasks of the same type as the task to be compiled is greater than the first threshold number by an amount larger than or equal to 2, then the task to be compiled may further be set from the current waiting state to a sleep stage, i.e., the auto_flag of the task to be compiled may be set to 0, and the wait_flag set to 0. Until the number of tasks of the same type as the task to be compiled is greater than the first threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0107]    In a second case, if the determination unit  136  determines that the number of tasks of the same type as the task to be compiled is greater than the first threshold number by 1, then the auto_flag of the task to be compiled may be set 0, and wait_flag value set to 1. 
         [0108]    In the present embodiment, a waiting period may further be configured, e.g., 2 minutes, so that if the waiting period expires, new scans and judgments may be performed. 
         [0109]    In summary, according to the dynamic compilation machine allocation solutions provided by the disclosure, the compilation machines can be dynamically allocated according to the tasks currently under compilation, thus eliminating the need to designate each time a specific compilation machine for a compilation task. Further, the compilation tasks can be continuously allocated during the compilation process, which means once a task is completed, a subsequent task would be automatically scanned, so that when there are multiple compilation tasks waiting in queue, the compilation machines will not be vacant for long periods of time hence leaving the compilation machines to be unused. Further, one compilation machine can support two or more simultaneous compilation tasks. Multiple compilation tasks can be performed simultaneously on different compilation machines and will not interfere with each other. Further, the entire compilation process does not require any manual operations, thus reducing the potential error rate associated with human intervention. In addition, once a compilation task is submitted, the suitable compilation machine can automatically be searched for, so in the case where a large number of compilation tasks need to be simultaneously performed, the compilation machines may gain a significant increase in their efficiency, thereby breaking the limitation that one compilation machine can only perform one compilation task at the same time. 
         [0110]    Furthermore, it is apparent to those skilled in the art that the present disclosure also provides a system for dynamic allocation of compilation machines, the system comprising a non-transitory program storage medium and one or more processors. The non-transitory program storage medium stores a program executable by the one or more processors to perform the methods as described above. Furthermore, it is apparent to those skilled in the art that various units or modules  11 - 13  and  131 - 136 , as shown in  FIG. 4 , can be software modules or software units. In another aspect, it is well-known that various software modules or software units can be inherently stored in the non-transitory program storage medium and executed by the one or more processors. 
         [0111]    The above description merely depicts some exemplary embodiments of the disclosure, but is not intended to limit the scope of the disclosure. Any equivalent structural or flow transformations made to the disclosure, or any direct or indirect applications of the disclosure on any other related fields, shall all fall in the scope of the disclosure.