Computing resource allocation systems, methods, apparatuses, and computer devices
By employing a tiered hierarchical setup of multiple resource allocation nodes and flexible switching of signal channels in the computing resource allocation system, the problem of malfunction caused by excessive pressure on the master node was solved, achieving stable and efficient computing resource allocation for the system.
Patent Information
- Application Number
- CN202010177684.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-13
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2040-03-13
AI Technical Summary
Traditional computer resource allocation methods can lead to delays and malfunctions when the master node is under excessive pressure, making it impossible to smoothly complete task allocation and affecting the normal operation of the entire computer system.
A tiered, hierarchical configuration of multiple resource allocation nodes is adopted. When a lower-level allocation node malfunctions, the resource allocation work is promptly transferred to a higher-level node and connected via a pre-defined signal channel to ensure normal system operation.
By using a tiered hierarchical setup and flexible switching of signal channels, the impact of abnormal states of allocation nodes on the system is reduced, the stability and efficiency of computing resource allocation are improved, and the overall system smoothness is guaranteed.
Smart Images

Figure CN111506400B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer, in particular to a computing resource allocation system, method, device, computer equipment and storage medium. BACKGROUND
[0002] Computer resource allocation is an important content in the field of computer. The traditional computer resource allocation method is that a master node obtains a computer task (for example, a main program) submitted by a user, the master node divides the computer task into multiple sub-tasks (sub-threads), and hands over the sub-tasks to other nodes for execution, thereby realizing distributed thread division. However, the traditional computer resource allocation method is based on the master node to complete task division, so when the master node is under great pressure, for example, when multiple users simultaneously submit multiple computer tasks, the master node will not be able to smoothly complete task division, thereby causing abnormal conditions such as delay to occur, and causing the entire computer system to run smoothly. SUMMARY
[0003] The main purpose of the present application is to provide a computing resource allocation system, method, device, computer equipment and storage medium, which aims to ensure the smoothness of the overall system operation.
[0004] In order to achieve the above-mentioned purpose of the application, the present application provides a computing resource allocation system, comprising multiple resource allocation nodes, a task acquisition node and multiple task execution nodes, wherein the multiple resource allocation nodes comprise a first allocation node, a second allocation node,..., an i-th allocation node,..., and an n-th allocation node; the multiple task execution nodes are respectively signal connected with the task acquisition node, n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n;
[0005] The first allocation node is configured to, when the first allocation node is in a normal state, the first allocation node is signal connected with the task acquisition node through a preset first channel;
[0006] The second allocation node is configured to, when the first allocation node is not in a normal state, the second allocation node is signal connected with the task acquisition node through a preset second channel, wherein the second channel comprises the first channel;
[0007] The i-th allocation node is configured to, when the (i-1)-th allocation node is not in a normal state, the i-th allocation node is signal connected with the task acquisition node through a preset i-th channel, wherein the i-th channel comprises the first channel, the second channel,..., and the (i-1)-th channel;
[0008] The nth distribution node is configured to be connected with the task acquisition node by a preset nth channel when the (n-1)th distribution node is not in a normal state, wherein the nth channel includes the first channel, the second channel,..., and the (n-1)th channel.
[0009] The task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource distribution nodes, receive allocation results of the computer task by the plurality of resource distribution nodes, and allocate the computer task to the plurality of task execution nodes according to the allocation results.
[0010] Further, the memory of the first distribution node, the second distribution node,..., the ith distribution node,..., and the nth distribution node increases in turn.
[0011] The application provides a computing resource allocation method, which is applied to the task acquisition node of any one of the above embodiments, and includes the following steps:
[0012] Acquiring a computer task input by a user;
[0013] Sending the computer task to the first distribution node through the first channel;
[0014] Determining whether a first allocation result sent by the first distribution node is received within a first preset time, wherein the first allocation result is a result of allocation of the computer task by the first distribution node;
[0015] If the first allocation result sent by the first distribution node is received within the first preset time, determining whether the first allocation result is normal according to a preset allocation result determination method;
[0016] If the first allocation result is normal, performing split processing on the computer task according to the first allocation result, thereby obtaining a plurality of subtasks;
[0017] Sending the plurality of subtasks to the plurality of task execution nodes respectively.
[0018] Further, the step of sending the computer task to the first distribution node through the first channel includes the following steps:
[0019] Sending an available memory acquisition request to the plurality of task execution nodes respectively;
[0020] Acquiring a plurality of available memory data returned by the plurality of task execution nodes respectively;
[0021] Determining whether there is abnormal memory data with a value less than a preset memory threshold in the plurality of available memory data.
[0022] If there is abnormal memory data with a value less than a preset memory threshold in the plurality of available memory data, the abnormal memory data is removed to obtain a plurality of normal available memory data, and a task execution node corresponding to the abnormal memory data is excluded from the plurality of task execution nodes;
[0023] The computer task and the plurality of normal available memory data are sent to the first allocation node through the first channel.
[0024] Further, the step of judging whether a first allocation result sent by the first allocation node is received within a first preset time, wherein the first allocation result is a result of allocation of the computer task by the first allocation node, comprises:
[0025] If the first allocation result sent by the first allocation node is not received within the first preset time, the computer task is sent to the second allocation node through the second channel;
[0026] Judging whether a second allocation result sent by the second allocation node is received within a second preset time, wherein the second allocation result is a result of allocation of the computer task by the second allocation node;
[0027] If the second allocation result sent by the second allocation node is received within the second preset time, judging whether the second allocation result is normal;
[0028] If the second allocation result is normal, the computer task is split according to the second allocation result to obtain a plurality of sub-tasks, and the plurality of sub-tasks are sent to a plurality of task execution nodes respectively.
[0029] Further, the first allocation result includes data allocation amounts respectively corresponding to the plurality of task execution nodes, and the step of judging whether the first allocation result is normal according to a preset allocation result judgment method comprises:
[0030] According to the size of the data allocation amount, the plurality of task execution nodes in the first allocation result are arranged in descending order to obtain a first sequence;
[0031] An available memory acquisition request is sent to the plurality of task execution nodes respectively, and a plurality of available memory data returned by the plurality of task execution nodes respectively is acquired;
[0032] According to the size of the plurality of available memory data, the plurality of task execution nodes are arranged in descending order to obtain a second sequence;
[0033] calculate a Levenshtein distance between the first sequence and the second sequence, and determine whether the Levenshtein distance is greater than a preset distance threshold;
[0034] If the Levenshtein distance is not greater than the preset distance threshold, it is determined that the first allocation result is normal.
[0035] The application provides a computing resource allocation apparatus, characterized in that it is applied to the task acquisition node as described in any of the above, and comprises:
[0036] A computer task acquisition unit is configured to acquire a computer task input by a user.
[0037] A computer task sending unit is configured to send the computer task to the first allocation node through the first channel.
[0038] A receiving and determining unit is configured to determine whether a first allocation result sent by the first allocation node is received within a first preset time, wherein the first allocation result is a result of allocation of the computer task by the first allocation node.
[0039] A first allocation result determining unit is configured to, if the first allocation result sent by the first allocation node is received within the first preset time, determine whether the first allocation result is normal according to a preset allocation result determining method.
[0040] A splitting processing unit is configured to, if the first allocation result is normal, split the computer task according to the first allocation result, thereby obtaining a plurality of subtasks.
[0041] A subtask sending unit is configured to send the plurality of subtasks to the plurality of task execution nodes respectively.
[0042] The application provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the steps of the method as described in any of the above when executing the computer program.
[0043] The application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the method as described in any of the above.
[0044] The computing resource allocation system, method, device, computer equipment and storage medium of the present application, wherein the system comprises a plurality of resource allocation nodes, a task acquisition node and a plurality of task execution nodes, wherein the plurality of resource allocation nodes comprise a first allocation node, a second allocation node,..., an i-th allocation node,..., and an n-th allocation node; the plurality of task execution nodes are respectively signal connected with the task acquisition node, n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n; the i-th allocation node is configured to be signal connected with the task acquisition node through a preset i-th channel when the i-1-th allocation node is not in a normal state, wherein the i-th channel comprises the first channel, the second channel,..., and the i-1-th channel; the task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource allocation nodes, receive an allocation result of the computer task by the plurality of resource allocation nodes, and allocate the computer task to the plurality of task execution nodes according to the allocation result, thereby ensuring the smoothness of the overall system operation. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 The structural schematic block diagram of the computing resource allocation system of an embodiment of the present application is shown in the figure.
[0046] Figure 2 The flowchart of the computing resource allocation method of an embodiment of the present application is shown in the figure.
[0047] Figure 3 The structural schematic block diagram of the computing resource allocation device of an embodiment of the present application is shown in the figure.
[0048] Figure 4 The structural schematic block diagram of the computer equipment of an embodiment of the present application is shown in the figure.
[0049] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the embodiments and the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present application and not used to limit the present application.
[0051] REFERENCE Figure 1The embodiment of the present application provides a computer resource allocation system, comprising a plurality of resource allocation nodes, a task acquisition node and a plurality of task execution nodes, wherein the plurality of resource allocation nodes comprise a first allocation node, a second allocation node, an i-th allocation node and an n-th allocation node; the plurality of task execution nodes are respectively connected with the task acquisition node in signal mode, n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n;
[0052] The first allocation node is configured to be connected with the task acquisition node in signal mode through a preset first channel when the first allocation node is in a normal state.
[0053] The second allocation node is configured to be connected with the task acquisition node in signal mode through a preset second channel when the first allocation node is not in the normal state, wherein the second channel comprises the first channel.
[0054] The i-th allocation node is configured to be connected with the task acquisition node in signal mode through a preset i-th channel when an (i-1)-th allocation node is not in the normal state, wherein the i-th channel comprises the first channel, the second channel,..., and an (i-1)-th channel.
[0055] The n-th allocation node is configured to be connected with the task acquisition node in signal mode through a preset n-th channel when an (n-1)-th allocation node is not in the normal state, wherein the n-th channel comprises the first channel, the second channel,..., and an (n-1)-th channel.
[0056] The task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource allocation nodes, receive allocation results of the computer task by the plurality of resource allocation nodes, and allocate the computer task to the plurality of task execution nodes according to the allocation results.
[0057] The computer resource allocation system of the present application adopts a special setting (see the attached Figure 1 ), that is, the resource allocation nodes are arranged in a stepped hierarchical mode, when the computer task to be allocated is too heavy to cause the bottom-level allocation nodes to be not in the normal state, the resource allocation work is timely transferred to the high-level allocation nodes to ensure the normal operation of the system. The signal channels used still comprise original signal channels, thereby saving the time for re-setting. The signal channels can be signal channels with entities (such as signal lines with entities) or signal channels without entities (such as wireless signal channels).
[0058] When the signal channel is a signal channel with entity, the interrelation between the first channel, the second channel and the nth channel can be set by means of signal switch, for example, a signal switch is arranged at the intersection of the first channel and the part of the second channel other than the first channel, which can control the direction of the signal (i.e. when the first distribution node is in normal state, the first distribution node is connected with the task acquisition node; when the first distribution node is in abnormal state, a non-first distribution node such as the second distribution node is connected with the task acquisition node). Wherein, the second channel includes the first channel, which means that the second channel includes all of the first channel, or the second channel includes at least part of the first channel.
[0059] When the signal channel is a signal channel without entity, the first channel is for example a first routing structure (path) between the task acquisition node and the first distribution node, which can be dynamic routing or static routing. When the second channel is needed, the second routing structure is constructed on the basis of the first routing structure, so that the task acquisition node is signal connected with the second distribution node. Wherein, the second channel includes the first channel, which means that the second channel includes all of the first channel, or the second channel includes at least part of the first channel.
[0060] The node in the present application can be any feasible node, for example, an independent computer terminal, etc. The execution subject in the present application is the task acquisition node, which is the hub of the whole system, signal connected with multiple task execution nodes and multiple resource distribution nodes, and is also used for acquiring computer task input by the user. However, the task acquisition node will divide the work of distributing computer task to multiple resource distribution nodes, so the actual load of the task acquisition node is not large, and compared with the traditional scheme in which all the work is completed in one node, the computing resource distribution system in the present application is more stable. Further, the multiple task execution nodes in the present application can also perform data coordination between the multiple task execution nodes after receiving the distributed sub-tasks. The implementation mode of the data coordination is for example: monitoring the available memory data of the task execution node, and when the available memory data is less than a predetermined value, at least part of the received sub-tasks are sent to other task execution nodes.
[0061] Further, the memory of the first allocation node, the second allocation node,..., the i-th allocation node,..., and the n-th allocation node in the computing resource allocation system of the present application increases in turn. The present application adopts a special resource allocation node, which is arranged in a stepped hierarchical manner, so as to reduce the impact of the allocation node in an abnormal state on the entire system. Further, the memory of the plurality of allocation nodes increases in turn, so that the computing power of the plurality of allocation nodes increases in turn. In this way, when the allocation node at the previous level is abnormal, the allocation node at the next level is more likely to undertake the allocation task that the allocation node at the previous level cannot complete. Further, the CPU frequency corresponding to the first allocation node, the second allocation node,..., the i-th allocation node,..., and the n-th allocation node increases in turn.
[0062] The computing resource allocation system of the present application comprises a plurality of resource allocation nodes, a task acquisition node, and a plurality of task execution nodes. The plurality of resource allocation nodes comprises a first allocation node, a second allocation node,..., an i-th allocation node,..., and an n-th allocation node. The plurality of task execution nodes are respectively connected to the task acquisition node. n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n. The i-th allocation node is configured to be connected to the task acquisition node through a preset i-th channel when the i-1-th allocation node is not in a normal state, wherein the i-th channel comprises the first channel, the second channel,..., and the i-1-th channel. The task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource allocation nodes, receive an allocation result of the computer task by the plurality of resource allocation nodes, and distribute the computer task to the plurality of task execution nodes according to the allocation result. In this way, the smoothness of the overall system operation is ensured.
[0063] Reference Figure 2 The embodiment of the present application provides a computing resource allocation method, which is applied to the task acquisition node as described in any of the above (i.e., any of the preceding embodiments) and comprises the following steps:
[0064] S1, acquiring a computer task input by a user;
[0065] S2, sending the computer task to the first allocation node through the first channel;
[0066] S3, judging whether a first allocation result sent by the first allocation node is received within a first preset time, wherein the first allocation result is a result of the first allocation node allocating the computer task;
[0067] S4, if the first distribution result sent by the first distribution node is received within the first preset time, judging whether the first distribution result is normal according to a preset distribution result judging method;
[0068] S5, if the first distribution result is normal, splitting the computer task according to the first distribution result, thereby obtaining a plurality of sub-tasks;
[0069] S6, sending the plurality of sub-tasks to the plurality of task execution nodes respectively.
[0070] The present application can acquire the computer task input by the user in any feasible way, for example, input through a preset input device, for example, input through a physical interface such as a U disk interface, or input the computer task through a remote signal transmission mode. The computer task is, for example, a complete program. The first channel can be a signal channel with entity or a signal channel without entity. In the initial stage, that is, the stage of not confirming the state of all distribution nodes, the computer task is sent to the first distribution node through the first channel. Under normal circumstances, the first distribution node will complete the distribution of the computer task within the first preset time and send it to the task acquisition node. Under abnormal circumstances, for example, the first distribution node crashes due to excessive load, so the first distribution node cannot complete the distribution and sending of the computer task within the first preset time. Thus, it can be initially judged whether the first distribution node is normal.
[0071] If the first distribution result sent by the first distribution node is received within the first preset time, it indicates that the first distribution node is preliminarily determined to be normal. The present application further judges the first distribution result sent by the first distribution node twice to judge whether the first distribution result is normal. The judging method can be any feasible method, for example, judging whether the first distribution result conforms to normal distribution, if the first distribution result conforms to normal distribution, it is determined that the first distribution result is normal.
[0072] Since the first distribution node is normal, the first distribution result generated thereby can be used, and the first channel does not need to be modified. Accordingly, the computer task is split according to the first distribution result, thereby obtaining a plurality of sub-tasks, and the plurality of sub-tasks are sent to the plurality of task execution nodes respectively, thereby completing the distribution of the computing resources.
[0073] The present application can be applied to any feasible scenario, for example, a user submits an application or a task to a computing resource allocation system of the present application, a task acquisition node in the computing resource allocation system receives the application or the task, the task acquisition node sends the application or the task to a first allocation node through a first channel; the first allocation node divides the application or the task using a preset task divider, and sends the division result to the task acquisition node; the task acquisition node specifically divides the application or the task according to the division result to obtain a plurality of sub-tasks; the task acquisition node sends the sub-tasks to a plurality of task execution nodes; and the task execution nodes construct threads corresponding to the sub-tasks and execute in a thread pool. The sending of the sub-tasks can be performed in a serialized manner. Serialization is a process of converting data into a form that can be stored or transmitted. During serialization, data is written to a temporary or persistent storage area. Later, the data can be recreated by deserialization from the storage area. Correspondingly, the task execution nodes can obtain specific sub-tasks through deserialization. Further, in the process of executing the sub-tasks by the task execution nodes, the status and progress of executing the sub-tasks are also sent to the task acquisition node, so that the task acquisition node can timely grasp the running state of the task execution nodes. Further, when the computer task is executed, the instruction for logging off and closing the computer task can be generated by the task execution nodes or the task acquisition node, thereby completing the allocation and final execution of the entire computer task.
[0074] In one embodiment, the step S2 of sending the computer task to the first allocation node through the first channel comprises:
[0075] S201, sending a request for available memory to each of the plurality of task execution nodes;
[0076] S202, obtaining a plurality of available memory data returned by the plurality of task execution nodes respectively;
[0077] S203, determining whether there is abnormal memory data with a value less than a preset memory threshold in the plurality of available memory data;
[0078] S204, if there is abnormal memory data with a value less than a preset memory threshold in the plurality of available memory data, removing the abnormal memory data to obtain a plurality of normal available memory data, and excluding the task execution node corresponding to the abnormal memory data from the plurality of task execution nodes;
[0079] S205, sending the computer task and the plurality of normal available memory data to the first allocation node through the first channel.
[0080] As mentioned above, the computer task is sent to the first distribution node through the first channel. The application further adopts abnormal memory data and abnormal task execution node exclusion, and uses available memory data as the basis for computing resource distribution to improve the accuracy of distribution. Since the application uses available memory data, it can achieve dynamic computing resource distribution, which is more flexible and efficient than traditional static computing resource distribution. Since the task execution node also has a full load running state, the available memory is very small, i.e., the abnormal memory data is less than the preset memory threshold, so it should not be listed as an actual task execution node, and it is excluded. The computer task and the plurality of normal available memory data are sent to the first distribution node through the first channel, so that the first distribution node has accurate basis for computing resource distribution.
[0081] In one embodiment, the step of judging whether the first distribution result sent by the first distribution node is received within a first preset time, wherein the first distribution result is the result of the distribution of the computer task by the first distribution node, is included after step S3.
[0082] S31, if the first distribution result sent by the first distribution node is not received within a first preset time, the computer task is sent to the second distribution node through the second channel;
[0083] S32, judging whether the second distribution result sent by the second distribution node is received within a second preset time, wherein the second distribution result is the result of the distribution of the computer task by the second distribution node;
[0084] S33, if the second distribution result sent by the second distribution node is received within a second preset time, judging whether the second distribution result is normal;
[0085] S34, if the second distribution result is normal, the computer task is split according to the second distribution result to obtain a plurality of sub-tasks, and the plurality of sub-tasks are sent to a plurality of task execution nodes respectively.
[0086] As described above, the multiple sub-tasks are respectively sent to the multiple task execution nodes. If the first allocation result sent by the first allocation node is not received within the first preset time, it indicates that the first allocation node is abnormal and cannot perform the work of computing resource allocation. Accordingly, by virtue of the special setting of the present application, i.e. the stepwise hierarchical setting of the resource allocation nodes, in the case of abnormality of the first allocation node, the first channel is modified to the second channel, and the computer task is sent to the second allocation node through the second channel, so that the computer resource allocation can continue to be executed. The second allocation result is completed in the second allocation node, but the splitting of the computer task is completed in the task acquisition node, thereby avoiding the waste of additional signal transmission and further improving the efficiency of the overall computing resource allocation and execution.
[0087] In one embodiment, the first allocation result includes the data allocation amount corresponding to the multiple task execution nodes respectively, and the step S4 of judging whether the first allocation result is normal according to the preset allocation result judgment method includes:
[0088] S401, arranging the multiple task execution nodes in the first allocation result in descending order according to the size of the data allocation amount, thereby obtaining a first sequence;
[0089] S402, sending an available memory acquisition request to the multiple task execution nodes respectively, and acquiring multiple available memory data returned by the multiple task execution nodes respectively;
[0090] S403, arranging the multiple task execution nodes in descending order according to the size of the multiple available memory data, thereby obtaining a second sequence;
[0091] S404, calculating the Levenshtein distance between the first sequence and the second sequence, and judging whether the Levenshtein distance is greater than a preset distance threshold;
[0092] S405, if the Levenshtein distance is not greater than the preset distance threshold, it is determined that the first allocation result is normal.
[0093] As described above, the first distribution result is analyzed according to the preset distribution result judgment method to determine whether the first distribution result is normal. The first distribution result is the analysis result of how the computer task should be distributed by the first distribution node. The application determines whether it is normal to improve the overall fluency. In order to avoid wasting too much computing power in the process of determining whether the first distribution result is normal, the application arranges the plurality of task execution nodes in the first distribution result in descending order according to the size of the data distribution amount, thereby obtaining a first sequence; arranges the plurality of task execution nodes in descending order according to the size of the plurality of available memory data, thereby obtaining a second sequence; and calculates the Levenshtein distance between the first sequence and the second sequence, and uses the Levenshtein distance as the basis for determining whether it is normal. The Levenshtein distance is a distance that measures the difference between two sequences, which is the minimum number of editing operations required to convert one sequence into another. The editing operations include replacement, insertion and deletion. The minimum value of the Levenshtein distance is 0, and when the Levenshtein distance is 0, it means that the two sequences are completely the same, that is, the division of the plurality of task execution nodes in the first distribution result is completely corresponding to the available memory data of the plurality of task execution nodes, so as to determine that the first distribution result is normal; when the Levenshtein distance is too large (i.e. the Levenshtein distance is greater than a preset distance threshold), it means that the two sequences are not the same, so as to determine that the first distribution result is not normal. The preset distance threshold is, for example, 2-10, preferably 3-5.
[0094] The computing resource distribution method of the application is applied to the task acquisition node in any one of the computing resource distribution systems described above, so that the computing resource distribution system is specially configured, that is, the system includes a plurality of resource distribution nodes, a task acquisition node and a plurality of task execution nodes, wherein the plurality of resource distribution nodes include a first distribution node, a second distribution node,..., an i-th distribution node,..., and an n-th distribution node; the plurality of task execution nodes are respectively connected with the task acquisition node; n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n; the i-th distribution node is configured to be connected with the task acquisition node through a preset i-th channel when the i-1-th distribution node is not in a normal state, wherein the i-th channel includes the first channel, the second channel,..., and the i-1-th channel; the task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource distribution nodes, receive the distribution results of the computer task by the plurality of resource distribution nodes, and distribute the computer task to the plurality of task execution nodes according to the distribution results. Thus, the fluency of the overall system operation is ensured.
[0095] Reference Figure 3The embodiment of the present application provides a kind of computing resource allocation device, it is applied to the task acquisition node as any one of the above described, comprising:
[0096] Computer task acquisition unit 10, for obtaining the computer task input by user;
[0097] Computer task sending unit 20, for sending the computer task to the first allocation node by the first channel;
[0098] Receiving judging unit 30, for judging whether the first allocation result sent by the first allocation node is received within first preset time, wherein the first allocation result is the result of the computer task being allocated by the first allocation node;
[0099] First allocation result judging unit 40, for if the first allocation result sent by the first allocation node is received within first preset time, then according to the preset allocation result judging method, judge whether the first allocation result is normal;
[0100] Split processing unit 50, for if the first allocation result is normal, then according to the first allocation result, the computer task is split and handled, so as to obtain multiple subtasks;
[0101] Subtask sending unit 60, for sending the multiple subtasks to the multiple task execution nodes respectively.
[0102] Wherein the unit for executing operation respectively with the steps of the computing resource allocation method of the foregoing embodiment one by one, no longer repeat here.
[0103] In one embodiment, the computer task sending unit 20 includes:
[0104] Memory acquisition request sending subunit, for sending available memory acquisition request to the multiple task execution nodes respectively;
[0105] Memory data acquisition subunit, for obtaining multiple available memory data returned by the multiple task execution nodes respectively;
[0106] Abnormal memory data judging subunit, for judging whether there is abnormal memory data with value less than preset memory threshold in the multiple available memory data;
[0107] Normal available memory data acquisition subunit, for if there is abnormal memory data with value less than preset memory threshold in the multiple available memory data, then remove the abnormal memory data to obtain multiple normal available memory data, and the task execution node corresponding to the abnormal memory data is excluded from the multiple task execution nodes;
[0108] a computer task sending subunit configured to send the computer task and the plurality of normal available memory data to the first allocation node via the first channel.
[0109] The above subunits are respectively configured to perform operations corresponding to the steps of the computer resource allocation method of the foregoing embodiments, and thus no further description is provided herein.
[0110] In an embodiment, the apparatus comprises:
[0111] a computer task re-sending subunit configured to send the computer task to the second allocation node via the second channel if the first allocation result sent by the first allocation node is not received within a first preset time;
[0112] a second allocation result receiving and judging subunit configured to judge whether a second allocation result sent by the second allocation node is received within a second preset time, wherein the second allocation result is a result of allocation of the computer task by the second allocation node;
[0113] a second allocation result judging subunit configured to judge whether the second allocation result is normal if the second allocation result sent by the second allocation node is received within the second preset time;
[0114] a plurality of subtask obtaining subunits configured to obtain a plurality of subtasks by splitting the computer task according to the second allocation result if the second allocation result is normal, and send the plurality of subtasks to a plurality of task execution nodes respectively.
[0115] The above subunits are respectively configured to perform operations corresponding to the steps of the computer resource allocation method of the foregoing embodiments, and thus no further description is provided herein.
[0116] In an embodiment, the first allocation result comprises data allocation amounts respectively corresponding to the plurality of task execution nodes, and the first allocation result judging subunit 40 comprises:
[0117] a first sequence obtaining subunit configured to arrange the plurality of task execution nodes in the first allocation result in descending order according to sizes of the data allocation amounts, thereby obtaining a first sequence;
[0118] an available memory data obtaining subunit configured to send available memory obtaining requests to the plurality of task execution nodes respectively, and obtain a plurality of available memory data returned by the plurality of task execution nodes respectively;
[0119] a second sequence obtaining subunit configured to arrange the plurality of task execution nodes in descending order according to sizes of the plurality of available memory data, thereby obtaining a second sequence;
[0120] a Levenshtein distance calculation subunit configured to calculate a Levenshtein distance between the first sequence and the second sequence, and determine whether the Levenshtein distance is greater than a preset distance threshold;
[0121] a first distribution result normality determination subunit configured to determine that the first distribution result is normal if the Levenshtein distance is not greater than the preset distance threshold.
[0122] The subunits described above are respectively configured to perform operations corresponding to the steps of the computing resource distribution method of the foregoing embodiments, and thus will not be described again here.
[0123] The computing resource distribution device of the present application is applied to a task acquisition node in any one of the computing resource distribution systems described above, so that the computing resource distribution system is specially configured, i.e., the system includes a plurality of resource distribution nodes, a task acquisition node, and a plurality of task execution nodes, wherein the plurality of resource distribution nodes include a first distribution node, a second distribution node,..., an i-th distribution node,..., and an n-th distribution node; the plurality of task execution nodes are respectively signal-connected to the task acquisition node, n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n; the i-th distribution node is configured to be signal-connected to the task acquisition node through a preset i-th channel when the (i-1)-th distribution node is not in a normal state, wherein the i-th channel includes the first channel, the second channel,..., and the (i-1)-th channel; the task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource distribution nodes, receive distribution results of the computer task by the plurality of resource distribution nodes, and distribute the computer task to the plurality of task execution nodes according to the distribution results, so as to ensure the smoothness of the overall system operation.
[0124] Reference Figure 4 In the embodiments of the present application, a computer device, which can be a server, is also provided, and the internal structure of the computer device can be as shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The database of the computer device is configured to store data used by the computing resource distribution method. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a computing resource distribution method.
[0125] The processor executes the above-mentioned computing resource allocation method, wherein the steps included in the method correspond to the steps of executing the computing resource allocation method of the foregoing embodiments one by one, and will not be described here again.
[0126] The computer device of the present application implements a computing resource allocation method, and the method is applied to a task acquisition node in the computing resource allocation system described in any one of the foregoing embodiments, so that the computing resource allocation system is specially configured, that is, the system includes a plurality of resource allocation nodes, a task acquisition node and a plurality of task execution nodes, wherein the plurality of resource allocation nodes include a first allocation node, a second allocation node,..., an i-th allocation node,..., and an n-th allocation node; the plurality of task execution nodes are respectively signal-connected with the task acquisition node, n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n; the i-th allocation node is configured to be signal-connected with the task acquisition node through a preset i-th channel when the (i-1)-th allocation node is not in a normal state, wherein the i-th channel includes the first channel, the second channel,..., and the (i-1)-th channel; the task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource allocation nodes, receive allocation results of the computer task by the plurality of resource allocation nodes, and allocate the computer task to the plurality of task execution nodes according to the allocation results, so as to ensure the smoothness of the overall system operation.
[0127] Those skilled in the art can understand that the structures shown in the figures are only block diagrams of part of the structures related to the schemes of the present application, and do not constitute a limitation on the computer device to which the schemes of the present application are applied.
[0128] An embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement a computing resource allocation method, wherein the steps included in the method correspond to the steps of executing the computing resource allocation method of the foregoing embodiments one by one, and will not be described here again.
[0129] The computer readable storage medium of the present application implements a computing resource allocation method, and the method is applied to a task acquisition node in any one of the computing resource allocation systems described above, so that the computing resource allocation system is specially set, that is, the system includes a plurality of resource allocation nodes, a task acquisition node and a plurality of task execution nodes, wherein the plurality of resource allocation nodes include a first allocation node, a second allocation node,..., an i-th allocation node,..., and an n-th allocation node; the plurality of task execution nodes are respectively connected with the task acquisition node in signal; n is an integer greater than 1, and i is an integer greater than 1 and less than or equal to n; the i-th allocation node is configured to be connected with the task acquisition node in signal through a preset i-th channel when the i-1-th allocation node is not in a normal state, wherein the i-th channel includes the first channel, the second channel,..., and the i-1-th channel; the task acquisition node is configured to acquire a computer task input by a user, send the computer task to the plurality of resource allocation nodes, receive allocation results of the computer task by the plurality of resource allocation nodes, and allocate the computer task to the plurality of task execution nodes according to the allocation results, so as to ensure the smoothness of the overall system operation.
[0130] It can be understood by those skilled in the art that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium provided by the present application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0131] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a", "comprising", or "comprises" does not, without further restriction, exclude the existence of additional elements of the process, method, article, or apparatus that comprises the element.
[0132] The preferred embodiments of the present application have been described above with the specific details of the preferred embodiments to provide complete understanding of the application. However, it will be apparent to persons having ordinary skill in the technology that, without departing from the spirit and scope of the application, they can make equivalent changes or modifications to the preferred embodiments and variations based on the technical contents of the present application as well as prior art technology and that such changes or modifications also fall within the scope of patent protection of the present application.
Claims
1. A method for allocating computing resources, characterized in that, This is applied to a computing resource allocation system, which includes multiple resource allocation nodes, task acquisition nodes, and multiple task execution nodes. The multiple resource allocation nodes include a first allocation node, a second allocation node, ..., an i-th allocation node, ..., an n-th allocation node; the multiple task execution nodes are respectively signal-connected to the task acquisition nodes, where n is an integer greater than 1 and i is an integer greater than 1 and less than or equal to n. The first allocation node is configured such that, when the first allocation node is in a normal state, the first allocation node connects to the task acquisition node signal through a preset first channel; The second allocation node is configured such that when the first allocation node is not in a normal state, the second allocation node connects to the task acquisition node signal through a preset second channel, wherein the second channel includes the first channel; The i-th allocation node is configured such that when the (i-1)-th allocation node is not in a normal state, the i-th allocation node is connected to the task acquisition node signal through a preset i-th channel, wherein the i-th channel includes the first channel, the second channel, ..., the (i-1)-th channel; The nth allocation node is configured such that when the (n-1)th allocation node is not in a normal state, the nth allocation node is connected to the task acquisition node signal through a preset nth channel, wherein the nth channel includes the first channel, the second channel, ..., the (n-1)th channel; The task acquisition node is configured to acquire a computer task input by the user, send the computer task to the plurality of resource allocation nodes, receive the allocation results of the computer task from the plurality of resource allocation nodes, and allocate the computer task to the plurality of task execution nodes according to the allocation results. The memory of the first allocation node, the second allocation node, ..., the i-th allocation node, ..., the n-th allocation node increases sequentially, and the CPU clock frequency corresponding to the first allocation node, the second allocation node, ..., the i-th allocation node, ..., the n-th allocation node increases sequentially. The resource allocation nodes are set up in a tiered manner. The computing resource allocation method includes: The task acquisition node acquires the computer task input by the user; The computer task is sent to the first allocation node through the first channel; Determine whether a first allocation result sent by the first allocation node is received within a first preset time period, wherein the first allocation result is the result of the first allocation node allocating the computer task; If a first allocation result sent by the first allocation node is received within a first preset time, then the first allocation result is judged to determine whether it conforms to a normal distribution according to a preset allocation result judgment method. If the first allocation result conforms to a normal distribution, the first allocation result is determined to be normal. Then, the computer task is split according to the first allocation result to obtain multiple sub-tasks. The multiple subtasks are sent to the multiple task execution nodes respectively.
2. The computing resource allocation method according to claim 1, characterized in that, The step of sending the computer task to the first allocation node through the first channel includes: Send available memory acquisition requests to the multiple task execution nodes respectively; Obtain the available memory data returned by the multiple task execution nodes respectively; Determine whether there is any abnormal memory data among the multiple available memory data that has a value less than a preset memory threshold; If there is abnormal memory data among the multiple available memory data with a value less than a preset memory threshold, then the abnormal memory data is removed to obtain multiple normal available memory data, and the task execution node corresponding to the abnormal memory data is excluded from the multiple task execution nodes; The computer task and the multiple normally available memory data are sent to the first allocation node through the first channel.
3. The computing resource allocation method according to claim 1, characterized in that, The step of determining whether a first allocation result sent by the first allocation node is received within a first preset time period, wherein the first allocation result is the result of the first allocation node allocating the computer task, includes the following: If no first allocation result is received from the first allocation node within a first preset time, the computer task is sent to the second allocation node through the second channel. Determine whether a second allocation result sent by the second allocation node is received within a second preset time, wherein the second allocation result is the result of the second allocation node allocating the computer task; If a second allocation result sent by the second allocation node is received within a second preset time, then it is determined whether the second allocation result is normal. If the second allocation result is normal, the computer task is split according to the second allocation result to obtain multiple subtasks, and the multiple subtasks are sent to multiple task execution nodes respectively.
4. The computing resource allocation method according to claim 1, characterized in that, The first allocation result includes the data allocation amount corresponding to each of the plurality of task execution nodes. The step of determining whether the first allocation result is normal according to a preset allocation result judgment method includes: Based on the amount of data allocated, the multiple task execution nodes in the first allocation result are sorted in descending order to obtain the first sequence; Send available memory acquisition requests to the multiple task execution nodes respectively, and obtain multiple available memory data returned by the multiple task execution nodes respectively; Based on the size of the available memory data, the multiple task execution nodes are arranged in descending order to obtain a second sequence; Calculate the Lewinstein distance between the first sequence and the second sequence, and determine whether the Lewinstein distance is greater than a preset distance threshold; If the Levenstein distance is not greater than a preset distance threshold, then the first allocation result is determined to be normal.
5. A computing resource allocation device, characterized in that, To implement the computing resource allocation method according to any one of claims 1-4, comprising: The computer task acquisition unit is used to acquire computer tasks input by the user. A computer task sending unit is used to send the computer task to the first allocation node through the first channel; A receiving and judging unit is used to judge whether a first allocation result sent by the first allocation node is received within a first preset time, wherein the first allocation result is the result of the first allocation node allocating the computer task; The first allocation result judgment unit is used to determine whether the first allocation result is normal according to the preset allocation result judgment method if the first allocation result sent by the first allocation node is received within a first preset time. The splitting processing unit is used to split the computer task according to the first allocation result if the first allocation result is normal, thereby obtaining multiple sub-tasks. The subtask sending unit is used to send the plurality of subtasks to the plurality of task execution nodes respectively.
6. The computing resource allocation device according to claim 5, characterized in that, The computer task sending unit includes: The memory acquisition request sending subunit is used to send available memory acquisition requests to the multiple task execution nodes respectively; The memory data acquisition subunit is used to acquire multiple available memory data returned by the multiple task execution nodes respectively; An abnormal memory data determination subunit is used to determine whether there is any abnormal memory data among the multiple available memory data whose value is less than a preset memory threshold; The normal available memory data acquisition subunit is used to remove abnormal memory data with a value less than a preset memory threshold from the multiple available memory data to obtain multiple normal available memory data, and to exclude the task execution node corresponding to the abnormal memory data from the multiple task execution nodes. The computer task sending subunit is used to send the computer task and the plurality of normally available memory data to the first allocation node through the first channel.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Task processing method and system
CN104731663A
Distributed task scheduling system and method
CN106909451A