# US 2017/0286166 A1 · Systems and methods for dynamic allocation of compilation machines

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0286166 A1
- Document ID: US20170286166A1
- Status: Published application
- Kind: A1
- Application number: 15/318,639
- Filed: 2016-06-08
- Published: 2017-10-05
- Earliest claimed: 2015-10-13
- Assignees: Huizhou Tcl Mobile Communication Co., Ltd.
- Applicants: Huizhou TCL Mobile Communication Co., Ltd
- Inventors: Fan YANG; Qiujuan XIE; Enli XIANG; Julan CHEN; Jiaqiong FENG
- Web page: https://patentgrep.com/patent/US20170286166A1

## CPC

- G06F 9/505: {considering the load}
- G06F 8/47: {Retargetable compilers}
- G06F 9/5033: {considering data affinity}
- G06F 8/41: Compilation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## 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.

## Claims

### Claim 1

A method for dynamic allocation of compilation machines, comprising:
initiating and storing a task to be compiled and marking the task in a waiting state to wait for compilation of a compilation machine, wherein when storing the task to be compiled, three data tables are also established and configured to record project information, compilation machines information, and compilation tasks information, respectively;
acquiring 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;
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, 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;
wherein if a number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number, the task to be compiled is to enter the compile stage and further transmitted to the compilation machine.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the project information comprises a type of the task to be compiled;
the compilation machines information comprises an IP address, name, type of tasks under compilation, and current remaining compilation space, of each compilation machine; and
the compilation tasks information comprises information of compilation machines that is currently working and information of tasks they are currently compiling.

### Claim 3 (depends on 1)

The method according to claim 1, further comprising: if the number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number, determining whether the number of tasks the compilation machine is currently compiling is greater than or equal to the second threshold number, and, if yes, setting the task to be compiled to continue waiting for compilation.

### Claim 4 (depends on 3)

The method according to claim 3, further comprising: if the number of tasks the compilation machine is currently compiling is not greater than or equal to the second threshold number, determining whether there are any tasks the compilation machine is currently compiling that is of a same type as the task to be compiled, and, when there is none, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine.

### Claim 5 (depends on 4)

The method according to claim 4, further comprising: if there are any tasks of the same type as the task to be compiled that is currently compiled on the compilation machine, 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, and, if 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 yes, setting the task to be compiled to continue waiting for compilation.

### Claim 6

A method for dynamic allocation of compilation machines, comprising:
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, and if the task is to continue waiting for compilation, 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.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising establishing three data tables to record project information, compilation machines information, and compilation tasks information, respectively, when storing the task to be compiled.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the project information comprises a type of the task to be compiled;
the compilation machine information comprises an IP address, name, types of tasks compiled, and current remaining compilation space, of each compilation machine; and
the compilation tasks information comprises information of compilation machines that is currently working and information of tasks they are currently compiling.

### Claim 9 (depends on 6)

The method according to claim 6, further comprising:
acquiring 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; wherein analyzing the current compile state of the compilation machine comprises:
determining whether a number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number, and if no, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine.

### Claim 10 (depends on 9)

The method according to claim 9, further comprising: if the number of tasks the compilation machine is currently compiling is greater than or equal to the first threshold number, determining whether a number of tasks the compilation machine is currently compiling is greater than or equal to the second threshold number, and if yes, setting the task to be compiled to continue waiting for compilation.

### Claim 11 (depends on 10)

The method according to claim 10, further comprising: if the number of tasks the compilation machine is currently compiling is not greater than or equal to the second threshold number, determining whether there are any tasks the compilation machine is currently compiling that is of a same type as the task to be compiled, and if there is none, setting the task to be compiled to enter the compile stage and further transmitting the task to be compiled to the compilation machine.

### Claim 12 (depends on 11)

The method according to claim 11, further comprising: if there are any tasks of the same type as the task to be compiled that is currently compiled on the compilation machine, 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, and if 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 yes, setting the task to be compiled to continue waiting for compilation.

### Claim 13

A system for dynamic allocation of compilation machines, comprising one or more processors and a non-transitory program storage medium containing a program product executable by the processors, the program product 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, after 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, wherein if the task is to continue waiting for compilation, the database is configured to hold the task to be compiled in storage; otherwise if the task is to enter the compile stage, the allocation mechanism is configured to transmit the task to be compiled to the compilation machine for compilation.

### Claim 14 (depends on 13)

The system according to claim 13, wherein the allocation mechanism further comprises:
an acquisition unit configured to acquire 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.

### Claim 15 (depends on 14)

The system according to claim 14, wherein the allocation mechanism further comprises:
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; wherein
the assignment unit is configured to set the task to be compiled to continue waiting for compilation if the determination result of the second determination unit is yes.

### Claim 16 (depends on 15)

The system according to claim 15, wherein the allocation mechanism further comprises:
a third determination unit configured to, if the determination result of the second determination unit is no, further determine whether there are any tasks the compilation machine is currently compiling that is of a same type as the task to be compiled; wherein
the assignment unit configured to, when the determination result of the third 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.

### Claim 17 (depends on 16)

The system according to claim 16, wherein the allocation mechanism further comprises:
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 that the compilation machine is currently compiling is greater than or equal to the first threshold number; wherein
the assignment unit is 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.

### Claim 18 (depends on 3)

The method according to claim 3, further comprising:
if 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 two, further setting the task to be compiled from the current waiting state to a sleep stage; and
until the number of tasks the compilation machine is currently compiling is greater than the second threshold number by one, returning the task to be compiled to the waiting state.

### Claim 19 (depends on 10)

The method according to claim 10, further comprising:
if 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 two, further setting the task to be compiled from the current waiting state to a sleep stage; and
until the number of tasks the compilation machine is currently compiling is greater than the second threshold number by one, returning the task to be compiled to the waiting state.

### Claim 20 (depends on 15)

The system according to claim 15, wherein the assignment unit is further configured to: if the second determination unit determines 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 two, set the task to be compiled from the current waiting state to entering a sleep stage; and until the number of tasks the compilation machine is currently compiling is greater than the second threshold number by one, return the task to be compiled to the waiting state.
