A task allocation method and device

By establishing a matrix matching of task and node characteristics, the problem of uneven task distribution is solved, fast and balanced task distribution is achieved, and distribution efficiency is improved.

CN111949401BActive Publication Date: 2024-09-20CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010760295.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-31
Publication Date
2024-09-20
Estimated Expiration
2040-07-31

AI Technical Summary

Technical Problem

Task allocation in the existing technology is unbalanced and unreasonable. Nodes actively select or randomly allocate tasks and often have uneven task volumes, resulting in low allocation efficiency.

Method used

By establishing a node-available task matrix and an allocation matrix, matching task characteristics and node characteristics, and using matrix calculations to achieve fast and balanced task distribution.

Benefits of technology

It achieves fast, balanced and as much distribution of tasks as possible, improves distribution efficiency and avoids the problem of unreasonable distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111949401B
    Figure CN111949401B
Patent Text Reader

Abstract

The present invention discloses a task allocation method and device, and relates to the field of computer technology. A specific implementation of the method includes: obtaining task feature data of the features required for the task, and node feature data of the features possessed by the node; based on the feature order in the feature ordered set, determining the initial node-can-do-task matrix according to the task feature data and the node feature data; generating an allocation matrix according to the initial node-can-do-task matrix, and allocating the task to the node according to the allocation matrix. This implementation can establish a node-can-do-task matrix according to the features required for the task and the features possessed by the node, and then determine the allocation matrix according to the node-can-do-task matrix, and then allocate tasks to the node according to the allocation matrix, and calculation based on the matrix can facilitate computer processing, thereby achieving the effect of quickly, evenly, and allocating as many tasks as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a task allocation method and device. Background Art

[0002] In task allocation application scenarios, there are usually multiple tasks to be solved that need to be assigned to multiple nodes (operators) that can handle the tasks; in some scenarios, each task requires different characteristics (capabilities), and each node has different characteristics (capabilities). In this case, when allocating tasks, each task needs to be assigned to a node that meets the characteristic requirements of the task.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] In the prior art, nodes (operators) usually actively select appropriate tasks based on their characteristics, or randomly assign tasks to appropriate nodes (operators); it often happens that the amount of tasks assigned to nodes (operators) is uneven, or the task allocation is unreasonable (for example, tasks that are difficult to execute cannot be assigned). Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a task allocation method and device, which establishes a node-capable task matrix according to the required characteristics of the task and the characteristics of the node, and then determines an allocation matrix according to the node-capable task matrix, and then can allocate tasks to the nodes according to the allocation matrix, and calculations based on the matrix can be convenient for computer processing, thereby achieving the effect of quickly, evenly, and allocating as many tasks as possible.

[0006] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present invention, a task allocation method is provided, comprising: obtaining task feature data of features required for the task, and node feature data of features possessed by the node; based on the feature order in the feature ordered set, determining an initial node-capable task matrix according to the task feature data and the node feature data; generating an allocation matrix according to the initial node-capable task matrix, and allocating the task to the node according to the allocation matrix.

[0007] Optionally, the feature includes: a numerical feature and a non-numerical feature; the feature data includes: a feature identifier and a feature value; wherein the feature value of the numerical feature is a natural number; and the feature value of the non-numerical feature is 0 or 1.

[0008] Optionally, based on the feature order in the feature ordered set, according to the task feature data and the node feature data, determining an initial matrix of tasks that can be performed by nodes, including: based on the feature identification order in the feature order, according to the task feature data and the node feature data, respectively determining a task feature vector for each task and a node feature vector for each node; determining an initial matrix of tasks that can be performed by nodes according to the task feature vectors and the node feature vectors; and determining the initial matrix of tasks that can be performed by nodes according to the initial matrix.

[0009] Optionally, based on the feature order, the task feature vector of each task and the node feature vector of each node are determined respectively according to the task feature data and the node feature data, including: sorting the feature values ​​in the task feature data of each task according to the feature identification order to obtain a task feature value series of each task, and using the task feature value series as the task feature vector of each task; and sorting the feature values ​​in the node feature data of each node according to the feature identification order to obtain a node feature value series of each node, and using the node feature value series as the node feature vector of each node.

[0010] Optionally, determining the initial matrix of tasks that a node can perform based on the task feature vector and the node feature vector includes: traversing each task feature vector and each node feature vector in turn; comparing the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capacity value of the node for processing the task; and using the initial capacity value of each node for processing each task as an element in the initial matrix.

[0011] Optionally, the task feature vector is compared with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capability value of the node for processing the task, including: for each feature identifier, determining whether the node feature value corresponding to the feature identifier is not less than the task feature value corresponding to the feature identifier; if not, taking 0 as the initial capability value of the node for processing the task; if both are true, for the first feature identifier corresponding to the task feature value that is not 0, determining the task feature value f1 corresponding to the first feature identifier, and the node feature value f2 corresponding to the first feature identifier; and as the feature capability value of the node for processing the task with respect to the first feature identifier; for the second feature identifier corresponding to the task feature value of 0, a value of 1 is used as the feature capability value of the node for processing the task with respect to the second feature identifier; wherein, Express The value determined after rounding down; the product of all characteristic capability values ​​of the node for processing the task is used as the initial capability value of the node for processing the task.

[0012] Optionally, determining the initial node-task matrix based on the initial matrix includes: for each node, determining an initial capacity value series for the node to process each task in the initial matrix; determining a minimum value a among non-zero values ​​in the initial capacity value series; copying the initial capacity value series of the node to a number, and updating all non-zero values ​​in the a initial capacity value series of the node to a value of 1 as a target capacity value series of the node; and generating the initial node-task matrix based on all target capacity value series of all nodes.

[0013] Optionally, generating an allocation matrix based on the initial node-capable-task matrix includes: generating an all-0 matrix with the same number of rows and columns as the initial node-capable-task matrix as a candidate matrix; based on a preset algorithm, performing N complete updates on the initial node-capable-task matrix and the candidate matrix respectively, to obtain N pairs of updated node-capable-task matrices and updated candidate matrices; wherein N is a preset number; and selecting an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix.

[0014] Optionally, based on the preset algorithm, the initial node-can-do-task matrix and the candidate matrix are completely updated, including: traversing the rows and columns in the initial node-can-do-task matrix, deleting the rows and columns with all 0 elements from the initial node-can-do-task matrix as preprocessing of the initial node-can-do-task matrix; repeatedly performing the following steps to update the preprocessed node-can-do-task matrix and the candidate matrix until the end condition is met: traversing the rows and columns in the preprocessed node-can-do-task matrix, and determining whether there is a unique 1-value element in the row or column; if so, selecting a 1-value element from the row or column with the unique 1-value element according to a preset random algorithm; element; if not, determine the row or column containing the least number of 1-value elements from the rows or columns of the preprocessed node-can-do task matrix, and select a 1-value element therefrom according to a preset random algorithm; delete the row and column where the selected 1-value element is located from the preprocessed node-can-do task matrix to update the node-can-do task matrix; and determine the target coordinates according to the node information and task information indicated by the selected 1-value element, and update the elements of the target coordinates in the candidate matrix to 1 to update the candidate matrix; wherein the end condition includes: the updated node-can-do task matrix is ​​an all-0 matrix, or the updated node-can-do task matrix is ​​an empty matrix.

[0015] Optionally, when the end condition satisfied is that the updated node available task matrix is ​​an all-zero matrix, the method further includes: repeatedly executing the following steps to update the updated node available task matrix and the updated candidate matrix for a second time until a second end condition is satisfied: determining unassigned nodes and unassigned tasks according to the updated node available task matrix; and determining assigned nodes and assigned tasks according to the updated candidate matrix; selecting one of the unassigned tasks as the task to be assigned; and determining the reallocated nodes corresponding to the task to be assigned from the assigned nodes and the assigned tasks, respectively, based on a preset search algorithm; points, reallocate tasks, and determine nodes to be allocated from the unallocated nodes; re-pair the tasks to be allocated, reallocated nodes, reallocated tasks, and nodes to be allocated; and perform a secondary update on the updated node-available-task matrix and the updated candidate matrix according to the re-pairing result, wherein the secondary update includes: deleting rows and columns in the updated node-available-task matrix, and adjusting the values ​​of elements in the updated candidate matrix according to the re-pairing result; wherein the second termination condition includes: the node-available-task matrix after the secondary update is updated to an empty matrix, or the time taken for the secondary update reaches a time threshold.

[0016] Optionally, the task allocation method further includes: the capability feature ordered set is determined according to the required features of the task; and when the required features of the task are updated, the capability feature ordered set is updated.

[0017] According to another aspect of an embodiment of the present invention, there is provided a task allocation device, comprising:

[0018] An acquisition module is used to acquire task feature data of features required for the task and node feature data of features possessed by the node; a determination matrix module is used to determine an initial node-capable-task matrix based on the feature order in the feature ordered set and according to the task feature data and the node feature data; an allocation module is used to generate an allocation matrix based on the initial node-capable-task matrix and allocate the task to the node based on the allocation matrix.

[0019] Optionally, the feature includes: a numerical feature and a non-numerical feature; the feature data includes: a feature identifier and a feature value; wherein the feature value of the numerical feature is a natural number; and the feature value of the non-numerical feature is 0 or 1.

[0020] Optionally, the matrix determination module determines an initial node-capable-task matrix based on the feature order in the feature ordered set according to the task feature data and the node feature data, including: determining a task feature vector of each task and a node feature vector of each node respectively according to the task feature data and the node feature data based on the feature identification order in the feature order; determining an initial matrix of node-capable-tasks according to the task feature vectors and the node feature vectors; and determining the initial node-capable-task matrix according to the initial matrix.

[0021] Optionally, the determination matrix module determines the task feature vector of each task and the node feature vector of each node based on the feature order and according to the task feature data and the node feature data, including: sorting the feature values ​​in the task feature data of each task according to the feature identification order to obtain a task feature value series for each task, and using the task feature value series as the task feature vector of each task; and sorting the feature values ​​in the node feature data of each node according to the feature identification order to obtain a node feature value series for each node, and using the node feature value series as the node feature vector of each node.

[0022] Optionally, the determination matrix module determines an initial matrix of tasks that a node can perform based on the task feature vector and the node feature vector, including: traversing each task feature vector and each node feature vector in turn; comparing the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine an initial capacity value of the node for processing the task; and using the initial capacity value of each node for processing each task as an element in the initial matrix.

[0023] Optionally, the determination matrix module compares the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capability value of the node to process the task, including: for each feature identifier, judging whether the node feature value corresponding to the feature identifier is not less than the task feature value corresponding to the feature identifier; if not, taking 0 as the initial capability value of the node to process the task; if both are true, for the first feature identifier corresponding to the task feature value that is not 0, determining the task feature value f1 corresponding to the first feature identifier, and the node feature value f2 corresponding to the first feature identifier; and as the feature capability value of the node for processing the task with respect to the first feature identifier; for the second feature identifier corresponding to the task feature value of 0, a value of 1 is used as the feature capability value of the node for processing the task with respect to the second feature identifier; wherein, Express The value determined after rounding down; the product of all characteristic capability values ​​of the node for processing the task is used as the initial capability value of the node for processing the task.

[0024] Optionally, the determination matrix module determines the initial node-task matrix based on the initial matrix, including: for each node, determining the initial capacity value series for the node to process each task in the initial matrix; determining the minimum value a among the non-zero values ​​in the initial capacity value series; copying the initial capacity value series of the node to a number, and updating all non-zero values ​​in the a initial capacity value series of the node to a value of 1 as the a target capacity value series of the node; generating the initial node-task matrix based on all target capacity value series of all nodes.

[0025] Optionally, the allocation module generates an allocation matrix based on the initial node-available-task matrix, including: generating an all-0 matrix with the same number of rows and columns as the initial node-available-task matrix as a candidate matrix; based on a preset algorithm, performing N complete updates on the initial node-available-task matrix and the candidate matrix respectively, to obtain N pairs of updated node-available-task matrices and updated candidate matrices; wherein N is a preset number; and selecting an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix.

[0026] Optionally, the allocation module performs a complete update on the initial node-can-do-task matrix and the candidate matrix based on a preset algorithm, including: traversing the rows and columns in the initial node-can-do-task matrix, and deleting the rows and columns with all 0 elements from the initial node-can-do-task matrix as preprocessing of the initial node-can-do-task matrix; repeatedly performing the following steps to update the preprocessed node-can-do-task matrix and the candidate matrix until an end condition is met: traversing the rows and columns in the preprocessed node-can-do-task matrix, and determining whether there is a unique 1-value element in the row or column; if so, selecting a 1-value element from the row or column with the unique 1-value element according to a preset random algorithm; value element; if not, determine the row or column containing the least number of 1-value elements from the rows or columns of the preprocessed node-can-do task matrix, and select a 1-value element therefrom according to a preset random algorithm; delete the row and column where the selected 1-value element is located from the preprocessed node-can-do task matrix to update the node-can-do task matrix; and determine the target coordinates according to the node information and task information indicated by the selected 1-value element, and update the elements of the target coordinates in the candidate matrix to 1 to update the candidate matrix; wherein the end condition includes: the updated node-can-do task matrix is ​​an all-0 matrix, or the updated node-can-do task matrix is ​​an empty matrix.

[0027] Optionally, when the termination condition satisfied is that the updated node available task matrix is ​​an all-zero matrix, the allocation module is further used to: repeatedly perform the following steps to perform a second update on the updated node available task matrix and the updated candidate matrix until a second termination condition is satisfied: determine unallocated nodes and unallocated tasks according to the updated node available task matrix; and determine allocated nodes and allocated tasks according to the updated candidate matrix; select one of the unallocated tasks as the task to be allocated; and determine the heavy nodes corresponding to the task to be allocated from the allocated nodes and the allocated tasks respectively based on a preset search algorithm. Allocate nodes, reallocate tasks, and determine nodes to be allocated from the unallocated nodes; re-pair the tasks to be allocated, reallocated nodes, reallocated tasks, and nodes to be allocated; perform a secondary update on the updated node-available-task matrix and the updated candidate matrix according to the re-pairing result, wherein the secondary update includes: deleting rows and columns in the updated node-available-task matrix, and adjusting the values ​​of elements in the updated candidate matrix according to the re-pairing result; wherein the second termination condition includes: the node-available-task matrix after the secondary update is updated to an empty matrix, or the time taken for the secondary update reaches a time threshold.

[0028] Optionally, the acquisition module is further used to: determine the ordered set of capability characteristics according to the characteristics required for the task; and update the ordered set of capability characteristics when the characteristics required for the task are updated.

[0029] According to another aspect of an embodiment of the present invention, there is provided a task allocation electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the task allocation method provided by the present invention.

[0030] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the task allocation method provided by the present invention is implemented.

[0031] An embodiment of the above invention has the following advantages or beneficial effects: because a technical means is adopted to establish a node task matrix according to the characteristics required by the task and the characteristics possessed by the node, and then an allocation matrix is ​​determined according to the node task matrix, and then tasks can be allocated to the nodes according to the allocation matrix, it overcomes the technical problems of unreasonable and unbalanced allocation caused by the nodes actively selecting tasks or randomly allocating tasks to nodes in the prior art, thereby achieving the effect of quickly, evenly and allocating as many tasks as possible; and, calculations based on the matrix can also be facilitated by computer processing, making the allocation efficiency higher.

[0032] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0034] Figure 1 is a schematic diagram of the main process of a task allocation method according to the first embodiment of the present invention;

[0035] Figure 2 is a schematic diagram of the main process of a task allocation method according to a second embodiment of the present invention;

[0036] Figure 3 is a schematic diagram of main modules of a task allocation device according to a third embodiment of the present invention;

[0037] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0038] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0040] Figure 1 is a schematic diagram of the main process of a task allocation method according to the first embodiment of the present invention. Figure 1As shown, it includes: step S101, obtaining task feature data of features required for the task, and node feature data of features possessed by the node; step S102, based on the feature order in the feature ordered set, determining an initial node-capable task matrix according to the task feature data and the node feature data; step S103, generating an allocation matrix according to the initial node-capable task matrix, and allocating the task to the node according to the allocation matrix.

[0041] In some task allocation scenarios, since the required features (capability requirements) of each task are different and the features (capabilities) of each node (operator) are also different, it is necessary to first determine the initial node task matrix based on the acquired task feature data and node feature data; the initial node task matrix can indicate the tasks that each node can handle, and the elements in the matrix can be 0 or 1. Specifically, a value of 1 can indicate that the node can handle the task, and a value of 0 can indicate that the node cannot handle the task;

[0042] Based on the initial node, a task matrix is ​​made and transformed using a preset algorithm to obtain the allocation matrix, which can indicate the final pairing relationship between nodes and tasks; the preset algorithm is used to pair as many nodes as possible with as many tasks as possible; the elements in the allocation matrix can be 0 or 1, specifically, a value of 1 can be used to indicate that a node is assigned to a task, and a value of 0 can be used to indicate that a node is not assigned to a task.

[0043] According to the method of the present invention, a node-capable task matrix can be established according to the characteristics required for the task and the characteristics possessed by the node, and then an allocation matrix can be determined according to the node-capable task matrix, and then tasks can be allocated to the nodes according to the allocation matrix, and calculations based on the matrix can be facilitated by computer processing, thereby achieving the effect of quickly, evenly, and distributing as many tasks as possible.

[0044] In some embodiments, the features include: numerical features and non-numerical features; the feature data include: feature identifiers and feature values; wherein the feature values ​​of the numerical features are natural numbers; and the feature values ​​of the non-numerical features are 0 or 1.

[0045] The feature value of the non-numerical feature can be used to indicate the existence of the feature. Specifically, a value of 0 can be used to indicate that the task does not require the feature or the node does not have the feature, and a value of 1 can be used to indicate that the task requires the feature or the node has the feature. For example, a non-numerical feature can be "having a maximum value search function", "having a certain qualification certificate", "having a voice recognition function", etc.; a numerical feature can be a feature that can be digitized, and the feature value of a numerical feature can be used to indicate the existence of the feature, and can also be used to indicate the degree of the feature. For example, the task is "printing a document", and the feature required for the task is "the node can control a printer". For example, if there is a node that can control two printers, then the node can be considered to have this feature, and the feature value is 2. For example, if the task is "translate 500 words from Chinese to English within 10 minutes", and the required feature of the task is "the node can translate Chinese into English", if there is a node that can translate Chinese into English and according to historical data, it can be known that the node can translate 1500 words within 10 minutes, then the node can be considered to have this feature, and the feature value is 3. In some practical applications, the feature value of a numerical feature can also be used only to indicate the existence of the feature. Specifically, 1 or 0 is used to indicate the existence or non-existence of the feature, respectively.

[0046] In some embodiments, the initial matrix of tasks that can be performed by nodes is determined based on the feature order in the feature ordered set and according to the task feature data and the node feature data, including: based on the feature identification order in the feature order and according to the task feature data and the node feature data, respectively determining the task feature vector of each task and the node feature vector of each node; determining the initial matrix of tasks that can be performed by nodes according to the task feature vectors and the node feature vectors; and determining the initial matrix of tasks that can be performed by nodes according to the initial matrix.

[0047] The task feature vector of each task can be determined based on the feature identification order and the acquired task feature data, and the task feature vector can present the feature information required for the task in the form of a vector (ordered series); similarly, the node feature vector of each node can be determined based on the feature identification order and the acquired node feature data, and the node feature vector can present the feature information required for the node in the form of a vector (ordered series); each task feature vector and each node feature vector can be used for comparison, and then the value of the element in the initial matrix can be determined based on the comparison result, and then the initial matrix can be transformed to obtain the initial node-task matrix.

[0048] In some embodiments, based on the feature order, the task feature vector of each task and the node feature vector of each node are determined respectively according to the task feature data and the node feature data, including: sorting the feature values ​​in the task feature data of each task according to the feature identification order to obtain a task feature value series for each task, and using the task feature value series as the task feature vector of each task; and sorting the feature values ​​in the node feature data of each node according to the feature identification order to obtain a node feature value series for each node, and using the node feature value series as the node feature vector of each node.

[0049] To facilitate understanding of the above method, the following example is given:

[0050] Assume that the feature identification order is (c1, c2, c3), there are three nodes P1, P2, P3, and four tasks T1, T2, T3, T4; take node P1 as an example: assume that the feature data of node P1 obtained is: node P1 has feature c1 and its value is 2, node P1 has feature c2 and its value is 3, and node P1 does not have feature c3; then the node feature value series of node P1 can be determined as: (2, 3, 0), and it is used as the node feature vector of node P1; similarly, the node feature vector of each node can be obtained according to the node feature data of each node, and the task feature vector of each task can be obtained according to the task feature data of each task.

[0051] In some embodiments, determining the initial matrix of tasks that a node can perform based on the task feature vector and the node feature vector includes: traversing each task feature vector and each node feature vector in turn; comparing the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capacity value of the node to process the task; and using the initial capacity value of each node to process each task as an element in the initial matrix.

[0052] Further, in some embodiments, the task feature vector is compared with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capability value of the node to process the task, including: for each feature identifier, determining whether the node feature value corresponding to the feature identifier is not less than the task feature value corresponding to the feature identifier; if not, using 0 as the initial capability value of the node to process the task; if both are true, for the first feature identifier corresponding to the task feature value that is not 0, determining the task feature value f11 corresponding to the first feature identifier, and the node feature value f2 corresponding to the first feature identifier; using as the feature capability value of the node for processing the task with respect to the first feature identifier; for the second feature identifier corresponding to the task feature value of 0, a value of 1 is used as the feature capability value of the node for processing the task with respect to the second feature identifier; wherein, Express The value determined after rounding down; the product of all characteristic capability values ​​of the node for processing the task is used as the initial capability value of the node for processing the task.

[0053] The task feature vector can be compared with the elements corresponding to the same feature identifier in the node feature vector to determine whether, for each feature, the feature data provided by the node satisfies the feature data required by the node; specifically, when the node feature value corresponding to each feature identifier is not less than the task feature value corresponding to the feature identifier, it can be considered that the node has the ability to process the task; otherwise, it can be considered that the node is unable to process the task; in some practical applications, the initial capacity value of the node to process the task can be further determined based on the feature values ​​in the task feature vector and the node feature vector, and the initial capacity value can be understood as the number of the same tasks that the node can process under the same conditions.

[0054] To facilitate understanding of the above method, the following example is given:

[0055] Assume that the feature identification order is (c1, c2, c3); the node feature vector of node P1 is (2, 3, 1), and the node feature vector of node P2 is (0, 1, 3); the task feature vector of task T1 is (1, 1, 0), and the task feature vector of task T2 is (0, 1, 2);

[0056] For node P1 and task T1, since for features c1, c2, c3, respectively:

[0057] (2≥1), (3≥1), (1≥0), so it can be determined that for each feature, the node feature value is not less than the task feature value, and then As the initial capacity value of node P1 for processing task T1, that is, the initial capacity value of node P1 for processing task T1 is 6;

[0058] For node P1 and task T2, since for feature c3, (1<2) exists, the value 0 is used as the initial capacity value of node P1 to process task T2;

[0059] For node P2 and task T1, since for feature c1, there exists (0<1), the value 0 is used as the initial capability value of node P2 to process task T1;

[0060] For node P2 and task T2, since for features c1, c2, c3, respectively:

[0061] (0≥0), (1≥1), (3≥2), so it can be determined that for each feature, the node feature value is not less than the task feature value, and then As the initial capacity value of node P1 for processing task T1, the initial capacity value of node P2 for processing task T2 is 1.

[0062] In some embodiments, determining the initial node-capable task matrix based on the initial matrix includes: for each node, determining the initial capacity value series for the node to process each task in the initial matrix; determining the minimum value a among the non-zero values ​​in the initial capacity value series; copying the initial capacity value series of the node to a number, and updating all non-zero values ​​in the a initial capacity value series of the node to a value of 1 as the a target capacity value series of the node; generating the initial node-capable task matrix based on all target capacity value series of all nodes.

[0063] According to the above method, the node is copied according to the initial capacity value of the node for processing each task, and each copied capacity value (i.e., the element in the matrix) is updated to 1. It can be regarded as splitting the capacity value of the node for processing tasks in a manner of copying the node, and splitting it according to the minimum value a among the non-zero values ​​in the initial capacity value series of the node. The elements in the matrix can be transformed from natural numbers to the form of 0 or 1 without losing the capacity value information of the node; the matrix elements are 0 or 1, which can be convenient for computer processing in the subsequent step of generating the allocation matrix; according to the above method, the ability of the node to process tasks can be taken into consideration to achieve the effect of balanced distribution of tasks.

[0064] For example, assuming that the initial capacity value of a node for processing three tasks is 2, it can be considered that the node can accept and process two of the three tasks; then a capacity value series for the node can be generated, and the elements in the two capacity value series of the node can be updated to 1, so as to achieve the effect of not losing the capacity value information of the node processing tasks, and making the element values ​​in the capacity value series in the form of 0 or 1, which can facilitate computer processing in the subsequent step of generating the allocation matrix.

[0065] To facilitate understanding of the steps in the above method, the following example is given:

[0066] Assume there are three nodes P1, P2, P3, four tasks T1, T2, T3, T4, and the initial matrix:

[0067] Each row can represent the initial capacity value of a node to process each task; each column can represent the initial capacity value of each node that can process a task; specifically, it can be:

[0068]

[0069] According to the above method, for the first row of the initial matrix, that is, for the row vector indicated by the node P1, it can be determined that the minimum value of the non-zero values ​​is 2, and the row vector can be transformed to become:

[0070] Similarly, the row vectors indicated by the nodes P2 and P3 can be transformed respectively to become:

[0071] Finally, we get the initial node task matrix: Among them, node P 1_1 and node P 1_2 It is generated by copying node P1. In the subsequent allocation process, when node P 1_1 and node P 1_2 All are assigned to tasks, and can be considered to be assigned to node P1.

[0072] In some embodiments, generating an allocation matrix based on the initial node-available-task matrix includes: generating an all-0 matrix with the same number of rows and columns as the initial node-available-task matrix as a candidate matrix; based on a preset algorithm, performing N complete updates on the initial node-available-task matrix and the candidate matrix respectively, to obtain N pairs of updated node-available-task matrices and updated candidate matrices; wherein N is a preset number; and selecting an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix.

[0073] After the above transformation method, an updated node task matrix and an updated candidate matrix can be obtained; wherein, the updated candidate matrix can indicate allocation information, and the 1-value element therein can indicate that the node / task corresponding to the row / column where the 1-value is located is paired, and then in the subsequent steps, the tasks can be allocated to the nodes according to the allocation matrix selected from the updated candidate matrix; selecting an updated candidate matrix with the most 1-value elements can achieve the effect of allocating as many tasks as possible; the N value can be set to a positive integer according to actual conditions, such as 1, 10, 50, etc.; it can be understood that there can be the same matrix in these N updated candidate matrices, or there can be multiple matrices with the same maximum number of 1-value elements; selecting one of them as the allocation matrix does not affect the final allocation effect, that is: allocating as many tasks as possible to the nodes.

[0074] In some embodiments, based on the preset algorithm, the initial node-can-do-task matrix and the candidate matrix are completely updated, including: traversing the rows and columns in the initial node-can-do-task matrix, deleting the rows and columns with all 0 elements from the initial node-can-do-task matrix as preprocessing of the initial node-can-do-task matrix; repeatedly performing the following steps to update the preprocessed node-can-do-task matrix and the candidate matrix until the end condition is met: traversing the rows and columns in the preprocessed node-can-do-task matrix, and determining whether there is a unique 1-value element in the row or column; if so, selecting a 1-value element from the row or column with the unique 1-value element according to the preset random algorithm; value element; if not, determine the row or column containing the least number of 1-value elements from the rows or columns of the preprocessed node-can-do task matrix, and select a 1-value element therefrom according to a preset random algorithm; delete the row and column where the selected 1-value element is located from the preprocessed node-can-do task matrix to update the node-can-do task matrix; and determine the target coordinates according to the node information and task information indicated by the selected 1-value element, and update the elements of the target coordinates in the candidate matrix to 1 to update the candidate matrix; wherein the end condition includes: the updated node-can-do task matrix is ​​an all-0 matrix, or the updated node-can-do task matrix is ​​an empty matrix.

[0075] The rows and columns of all 0 elements can be considered as nodes that are originally unable to process any tasks, and tasks that are originally unable to be processed by any node; the initial node can be pre-processed as a task matrix, and these nodes and tasks are deleted, which can avoid unnecessary calculations in subsequent steps and improve the overall calculation efficiency; using the preset random algorithm, different 1-value elements can be selected during the update process, and more different update results can be obtained, that is, different updated candidate matrices can be obtained, and then one with the most 1-value elements can be selected from these different updated candidate matrices as the allocation matrix, which can avoid falling into the local optimum.

[0076] According to the above method, the pairing relationship between a node and a task can be determined after each time a 1-value element is selected; and the number of 1-value elements in a row or column can be regarded as the degree of freedom of selection of the node or task. The more 1-value elements a node or task has, the higher its degree of freedom of selection. By pairing according to the above method, 1-value elements are preferentially selected from tasks or nodes with lower degree of freedom of selection, which can achieve the effect of making selections faster due to the smaller number of 1-value elements, thereby reducing the amount of calculation and improving overall efficiency.

[0077] To facilitate understanding of the above update process, the following example is given:

[0078] Assume that the task matrix of the preprocessed nodes is: is a 4×4 matrix; where the node P 1_1 and node P 1_2 It is generated by copying the node P1;

[0079] Then a 4×4 matrix of all zeros can be generated as the candidate matrix;

[0080] By traversing the preprocessed node task matrix, it can be determined that there is a unique 1-value element in the row indicated by node P2, in the column indicated by task T2, and in the column indicated by task T4; the preset random algorithm can be used to select the unique 1-value element in the column indicated by task T4, and then update the preprocessed node task matrix and the candidate matrix, respectively, to obtain:

[0081]

[0082] By traversing again, it can be determined that there is a unique 1-value element in the row indicated by node P2 and in the column indicated by task T2; the preset random algorithm can be used to select the unique 1-value element in the column indicated by node P2, and then the pre-processed node task matrix and the candidate matrix are updated to obtain:

[0083]

[0084] Then traverse, the current updated node can be used as the task matrix. There is no unique 1-value element in the rows and columns, and the number of 1-value elements in the rows and columns is 2; therefore, the preset random algorithm can be used to select the node P in the column indicated by task T1. 1_1 The corresponding 1-value element is then used to update the preprocessed node task matrix and the candidate matrix, and the following are obtained:

[0085]

[0086] By traversing again, we can determine that at node P 1_2 There is a unique 1-valued element in the row indicated by task T3; the preset random algorithm can be used to select node P 1_2 The unique 1-value element in the indicated column, and then update the preprocessed node task matrix and the candidate matrix, respectively obtaining:

[0087]

[0088] After this update, the updated node task matrix becomes an empty matrix, which can confirm that a complete update is completed;

[0089] The updated candidate matrix is: It can be regarded as a distribution method: tasks T1 and T3 are assigned to node P1, task T2 is assigned to node P2, and task T4 is assigned to node P3.

[0090] In some embodiments, when the termination condition satisfied is that the updated node available task matrix is ​​an all-zero matrix, the process further includes: repeatedly executing the following steps to update the updated node available task matrix and the updated candidate matrix for a second time until a second termination condition is satisfied: determining unassigned nodes and unassigned tasks according to the updated node available task matrix; and determining assigned nodes and assigned tasks according to the updated candidate matrix; selecting one of the unassigned tasks as the task to be assigned; and determining the reassigned nodes and the assigned tasks corresponding to the task to be assigned from the assigned nodes and the assigned tasks, respectively, based on a preset search algorithm; Assign nodes, reallocate tasks, and determine nodes to be assigned from the unassigned nodes; re-pair the tasks to be assigned, reallocated nodes, reallocated tasks, and nodes to be assigned; perform a secondary update on the updated node-can-do task matrix and the updated candidate matrix according to the re-pairing result, wherein the secondary update includes: deleting rows and columns in the updated node-can-do task matrix, and adjusting the values ​​of elements in the updated candidate matrix according to the re-pairing result; wherein the second termination condition includes: the node-can-do task matrix after the secondary update is updated to an empty matrix, or the time taken for the secondary update reaches a time threshold.

[0091] When the updated node-available-task matrix is ​​a matrix of all zeros, it can be considered that there are still unassigned nodes and unassigned tasks; in the preprocessed node-available-task matrix, these unassigned nodes and unassigned tasks have corresponding tasks and nodes, so the paired nodes-tasks can also be adjusted, the unassigned nodes and unassigned tasks can be reallocated, and the corresponding rows and columns in the updated node-available-task matrix can be deleted until the updated node-available-task matrix is ​​an empty matrix, thereby obtaining a candidate matrix with more 1-valued elements, thereby achieving the effect of allocating as many tasks as possible.

[0092] The following is an example of the above adjustment and reallocation process:

[0093] Assume there is an unassigned task T x , and the task T x As the task to be assigned, the task T can be found in the preprocessed node available task matrix. x The corresponding 1-value node (i.e., find the node that can handle task T x All nodes of P a , P b , we can transform the node Pa , P b As the reallocation node; then determine the node P according to the updated candidate matrix a , P b The tasks that have been successfully assigned are: T a , T b , the task T a , T b As a reassignment task; the task T can be found in the preprocessed node available task matrix. a , T b The corresponding 1-value node (i.e., find the node that can handle task T a , T b All nodes), these nodes are regarded as extended nodes; if there is an unassigned node P in the extended node x , then the unassigned node P x As the node to be allocated, the tasks to be allocated, the reallocated nodes, the reallocated tasks, and the nodes to be allocated are reallocated; specifically, assuming that the task T b Can process node P x , then the paired P b -T b Unpack and assign task T b Assigned to node P x , set task T x Assigned to node P b , so that the unassigned task T x and unassigned nodes P x All nodes and tasks were re-matched;

[0094] Then, the updated node available task matrix and the updated candidate matrix are updated for a second time according to the adjustment result, until the node available task matrix after the second update is an empty matrix;

[0095] In the above example, if there are no unallocated nodes in the extended nodes, the search can continue according to the preprocessed node available task matrix and the updated candidate matrix to expand the scope of reallocated nodes and reallocated tasks, and then expand the scope of the extended nodes until there is an unallocated node in the extended nodes, and then make adjustments and reallocations; in some practical applications, a search count threshold can also be set for the secondary end condition. In the process of expanding the scope of the extended nodes, when the search count reaches the search count threshold, the node allocation for the to-be-allocated task can be abandoned, and the column indicated by the to-be-allocated task can be directly deleted from the updated node available task matrix, and then one of the unallocated tasks is selected as the to-be-allocated task, and the above adjustment and reallocation process is carried out.

[0096] It is understandable that, in the above adjustment and reallocation process, a node to be allocated may be determined first, and then the reallocation task, the reallocation node, and the task to be allocated may be determined, and then the adjustment and reallocation may be performed, without affecting the final allocation result; it is also understandable that, in the present invention, nodes and tasks may be represented by rows and columns in a matrix, or by columns and rows in a matrix, respectively, without affecting the final allocation result;

[0097] Through the above adjustment and reallocation process, we can further avoid falling into the local optimal problem, and thus achieve the effect of allocating as many tasks as possible.

[0098] Figure 2 is a schematic diagram of the main process of a task allocation method according to the second embodiment of the present invention. Figure 2 As shown, including:

[0099] Step S201, obtaining task feature data of features required for the task;

[0100] Step S202: Determine the task feature vector of each task according to the task feature data;

[0101] Step S203, obtaining node feature data of the features possessed by the node;

[0102] Step S204: determining a node feature vector of each node according to the node feature data;

[0103] Step S205, determining an initial matrix of tasks that a node can perform according to the task feature vector and the node feature vector;

[0104] Step S206, determining an initial node-available task matrix according to the initial matrix;

[0105] Step S207, generating a candidate matrix according to the initial node-available task matrix;

[0106] Step S208: Based on a preset algorithm, the initial node-available-task matrix and the candidate matrix are completely updated N times respectively, to obtain N pairs of updated node-available-task matrix and updated candidate matrix; wherein N is a preset number;

[0107] Step S209, selecting an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix;

[0108] Step S210: Allocate tasks to nodes according to the allocation matrix.

[0109] Understandably, Figure 2In the flowchart shown, the execution order of step S201-step S202 and step S203-step S204 is not limited. For example, step S201-step S202 may be executed first, and then step S203-step S204; or step S203-step S204 may be executed first, and then step S201-step S202; or step S201-step S203 may be executed first, and then step S202-step S204. Those skilled in the art will understand that the change of the above order does not affect the concept of the present disclosure.

[0110] In some embodiments, generating an allocation matrix based on the initial node-available-task matrix may also include: determining a corresponding bipartite graph based on the initial node-available-task matrix; solving the maximum matching problem of the bipartite graph using the Hungarian algorithm to obtain a maximum matching result; constructing the allocation matrix shown according to the maximum matching result: setting the elements on the coordinates indicated by the paired nodes and tasks in the allocation matrix to 1, and setting the remaining coordinates to 0.

[0111] In some practical applications, when the number of nodes and tasks is lower than a preset threshold, the initial node-task matrix can be converted into a corresponding bipartite graph, and the Hungarian algorithm can be used to solve the maximum matching problem of the bipartite graph, and then the allocation matrix shown is constructed to obtain the allocation result.

[0112] In some embodiments, the task allocation method further includes: the ordered set of capability characteristics is determined according to the required characteristics of the task; and when the required characteristics of the task are updated, the ordered set of capability characteristics is updated.

[0113] Figure 3 is a schematic diagram of main modules of a task allocation device according to a third embodiment of the present invention, such as Figure 3 As shown, the task allocation device 300 includes: an acquisition module 301, which is used to acquire task feature data of features required for the task, and node feature data of features possessed by the node; a determination matrix module 302, which is used to determine an initial node-available-task matrix based on the feature order in the feature ordered set, according to the task feature data and the node feature data; an allocation module 303, which is used to generate an allocation matrix based on the initial node-available-task matrix, and allocate the task to the node based on the allocation matrix.

[0114] In some task allocation scenarios, since the required features (capability requirements) of each task are different and the features (capabilities) of each node (operator) are also different, it is necessary to first determine the initial node task matrix based on the acquired task feature data and node feature data; the initial node task matrix can indicate the tasks that each node can handle, and the elements in the matrix can be 0 or 1. Specifically, a value of 1 can indicate that the node can handle the task, and a value of 0 can indicate that the node cannot handle the task;

[0115] Based on the initial node, a task matrix is ​​made and transformed using a preset algorithm to obtain the allocation matrix, which can indicate the final pairing relationship between nodes and tasks; the preset algorithm is used to pair as many nodes as possible with as many tasks as possible; the elements in the allocation matrix can be 0 or 1, specifically, a value of 1 can be used to indicate that a node is assigned to a task, and a value of 0 can be used to indicate that a node is not assigned to a task.

[0116] According to the method of the present invention, a node-capable task matrix can be established according to the characteristics required for the task and the characteristics possessed by the node, and then an allocation matrix can be determined according to the node-capable task matrix, and then tasks can be allocated to the nodes according to the allocation matrix, and calculations based on the matrix can be facilitated by computer processing, thereby achieving the effect of quickly, evenly, and distributing as many tasks as possible.

[0117] In some embodiments, the features include: numerical features and non-numerical features; the feature data include: feature identifiers and feature values; wherein the feature values ​​of the numerical features are natural numbers; and the feature values ​​of the non-numerical features are 0 or 1.

[0118] The feature value of the non-numerical feature can be used to indicate the existence of the feature. Specifically, a value of 0 can be used to indicate that the task does not require the feature or the node does not have the feature, and a value of 1 can be used to indicate that the task requires the feature or the node has the feature. For example, a non-numerical feature can be "having a maximum value search function", "having a certain qualification certificate", "having a voice recognition function", etc.; a numerical feature can be a feature that can be digitized, and the feature value of a numerical feature can be used to indicate the existence of the feature, and can also be used to indicate the degree of the feature. For example, the task is "printing a document", and the feature required for the task is "the node can control a printer". For example, if there is a node that can control two printers, then the node can be considered to have this feature, and the feature value is 2. For example, if the task is "translate 500 words from Chinese to English within 10 minutes", and the required feature of the task is "the node can translate Chinese into English", if there is a node that can translate Chinese into English and according to historical data, it can be known that the node can translate 1500 words within 10 minutes, then the node can be considered to have this feature, and the feature value is 3. In some practical applications, the feature value of a numerical feature can also be used only to indicate the existence of the feature. Specifically, 1 or 0 is used to indicate the existence or non-existence of the feature, respectively.

[0119] In some embodiments, the determination matrix module determines an initial node-capable-task matrix based on the feature order in the feature ordered set according to the task feature data and the node feature data, including: based on the feature identification order in the feature order, determining the task feature vector of each task and the node feature vector of each node according to the task feature data and the node feature data; determining an initial matrix of node-capable-tasks according to the task feature vectors and the node feature vectors; and determining the initial node-capable-task matrix according to the initial matrix.

[0120] The task feature vector of each task can be determined based on the feature identification order and the acquired task feature data, and the task feature vector can present the feature information required for the task in the form of a vector (ordered series); similarly, the node feature vector of each node can be determined based on the feature identification order and the acquired node feature data, and the node feature vector can present the feature information required for the node in the form of a vector (ordered series); each task feature vector and each node feature vector can be used for comparison, and then the value of the element in the initial matrix can be determined based on the comparison result, and then the initial matrix can be transformed to obtain the initial node-task matrix.

[0121] In some embodiments, the determination matrix module determines the task feature vector of each task and the node feature vector of each node based on the feature order, according to the task feature data and the node feature data, including: sorting the feature values ​​in the task feature data of each task according to the feature identification order to obtain a task feature value series for each task, and using the task feature value series as the task feature vector of each task; and sorting the feature values ​​in the node feature data of each node according to the feature identification order to obtain a node feature value series for each node, and using the node feature value series as the node feature vector of each node.

[0122] To facilitate understanding of the above method, the following example is given:

[0123] Assume that the feature identification sequence is (c1, c2, c3), there are three nodes P1, P2, P3, and four tasks T1, T2, T3, T4; take node P1 as an example:

[0124] Assume that the acquired feature data of node P1 is: node P1 has feature c1 and its value is 2, node P1 has feature c2 and its value is 3, and node P1 does not have feature c3; then the node feature value sequence of node P1 can be determined as: (2,3,0), and it is used as the node feature vector of node P1;

[0125] Similarly, the node feature vector of each node can be obtained according to the node feature data of each node, and the task feature vector of each task can be obtained according to the task feature data of each task.

[0126] In some embodiments, the determination matrix module determines an initial matrix of tasks that a node can perform based on the task feature vector and the node feature vector, including: traversing each task feature vector and each node feature vector in turn; comparing the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capacity value of the node to process the task; and using the initial capacity value of each node to process each task as an element in the initial matrix.

[0127] Further, in some embodiments, the determination matrix module compares the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capability value of the node to process the task, including: for each feature identifier, determining whether the node feature value corresponding to the feature identifier is not less than the task feature value corresponding to the feature identifier; if not, using 0 as the initial capability value of the node to process the task; if both are true, for the first feature identifier corresponding to the task feature value that is not 0, determining the task feature value f1 corresponding to the first feature identifier, and the node feature value f2 corresponding to the first feature identifier; using as the feature capability value of the node for processing the task with respect to the first feature identifier; for the second feature identifier corresponding to the task feature value of 0, a value of 1 is used as the feature capability value of the node for processing the task with respect to the second feature identifier; wherein, Express The value determined after rounding down; the product of all characteristic capability values ​​of the node for processing the task is used as the initial capability value of the node for processing the task.

[0128] The task feature vector can be compared with the elements corresponding to the same feature identifier in the node feature vector to determine whether, for each feature, the feature data provided by the node satisfies the feature data required by the node; specifically, when the node feature value corresponding to each feature identifier is not less than the task feature value corresponding to the feature identifier, it can be considered that the node has the ability to process the task; otherwise, it can be considered that the node is unable to process the task; in some practical applications, the initial capacity value of the node to process the task can be further determined based on the feature values ​​in the task feature vector and the node feature vector, and the initial capacity value can be understood as the number of the same tasks that the node can process under the same conditions.

[0129] In some embodiments, the determination matrix module determines the initial node-task matrix based on the initial matrix, including: for each node, determining the initial capacity value series of the node in the initial matrix for processing each task; determining the minimum value a among the non-zero values ​​in the initial capacity value series; copying the initial capacity value series of the node to a number, and updating all non-zero values ​​in the a initial capacity value series of the node to a value of 1 as the a target capacity value series of the node; generating the initial node-task matrix based on all target capacity value series of all nodes.

[0130] According to the above method, the node is copied according to the initial capacity value of the node for processing each task, and each copied capacity value (i.e., the element in the matrix) is updated to 1. It can be regarded as splitting the capacity value of the node for processing tasks in a manner of copying the node, and splitting it according to the minimum value a among the non-zero values ​​in the initial capacity value series of the node. The elements in the matrix can be transformed from natural numbers to the form of 0 or 1 without losing the capacity value information of the node; the matrix elements are 0 or 1, which can be convenient for computer processing in the subsequent step of generating the allocation matrix; according to the above method, the ability of the node to process tasks can be taken into consideration to achieve the effect of balanced distribution of tasks.

[0131] For example, assuming that the initial capacity value of a node for processing three tasks is 2, it can be considered that the node can accept and process two of the three tasks; then a capacity value series for the node can be generated, and the elements in the two capacity value series of the node can be updated to 1, so as to achieve the effect of not losing the capacity value information of the node processing tasks, and making the element values ​​in the capacity value series in the form of 0 or 1, which can facilitate computer processing in the subsequent step of generating the allocation matrix.

[0132] In some embodiments, the allocation module generates an allocation matrix based on the initial node-available-task matrix, including: generating an all-0 matrix with the same number of rows and columns as the initial node-available-task matrix as a candidate matrix; based on a preset algorithm, performing N complete updates on the initial node-available-task matrix and the candidate matrix respectively, to obtain N pairs of updated node-available-task matrices and updated candidate matrices; wherein N is a preset number; and selecting an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix.

[0133] After the above transformation method, an updated node task matrix and an updated candidate matrix can be obtained; wherein the updated candidate matrix can indicate allocation information, and the 1-value element therein can indicate that the node / task corresponding to the row / column where the 1-value is located is paired, and then in the subsequent steps, tasks can be allocated to nodes according to the allocation matrix selected from the updated candidate matrix; selecting an updated candidate matrix with the most 1-value elements can achieve the effect of allocating as many tasks as possible;

[0134] The N value can be set to a positive integer according to actual conditions, such as 1, 10, 50, etc.;

[0135] It is understandable that the N updated candidate matrices may contain the same matrix or multiple matrices with the same maximum number of 1-valued elements; selecting one of them as the allocation matrix does not affect the final allocation effect, that is, allocating as many tasks as possible to nodes.

[0136] In some embodiments, the allocation module performs a complete update on the initial node-available-as-task matrix and the candidate matrix based on a preset algorithm, including: traversing the rows and columns in the initial node-available-as-task matrix, and deleting the rows and columns with all 0 elements from the initial node-available-as-task matrix as preprocessing of the initial node-available-as-task matrix; repeatedly performing the following steps to update the preprocessed node-available-as-task matrix and the candidate matrix until an end condition is met: traversing the rows and columns in the preprocessed node-available-as-task matrix, and determining whether there is a unique 1-value element in the row or column; if so, selecting a unique 1-value element from the row or column according to a preset random algorithm; 1-value element; if not, determine the row or column containing the least number of 1-value elements from the rows or columns of the preprocessed node-can-do task matrix, and select a 1-value element therefrom according to a preset random algorithm; delete the row and column where the selected 1-value element is located from the preprocessed node-can-do task matrix to update the node-can-do task matrix; and determine the target coordinates according to the node information and task information indicated by the selected 1-value element, and update the elements of the target coordinates in the candidate matrix to 1 to update the candidate matrix; wherein the termination condition includes: the updated node-can-do task matrix is ​​an all-0 matrix, or the updated node-can-do task matrix is ​​an empty matrix.

[0137] The rows and columns of all 0 elements can be considered as nodes that are originally unable to process any tasks, and tasks that are originally unable to be processed by any node; the initial node can be pre-processed as a task matrix, and these nodes and tasks are deleted, which can avoid unnecessary calculations in subsequent steps and improve the overall calculation efficiency; using the preset random algorithm, different 1-value elements can be selected during the update process, and more different update results can be obtained, that is, different updated candidate matrices can be obtained, and then one with the most 1-value elements can be selected from these different updated candidate matrices as the allocation matrix, which can avoid falling into the local optimum.

[0138] According to the above method, the pairing relationship between a node and a task can be determined after each time a 1-value element is selected; and the number of 1-value elements in a row or column can be regarded as the degree of freedom of selection of the node or task. The more 1-value elements a node or task has, the higher its degree of freedom of selection. By pairing according to the above method, 1-value elements are preferentially selected from tasks or nodes with lower degree of freedom of selection, which can achieve the effect of making selections faster due to the smaller number of 1-value elements, thereby reducing the amount of calculation and improving overall efficiency.

[0139] In some embodiments, when the termination condition satisfied is that the updated node available task matrix is ​​an all-zero matrix, the process further includes: repeatedly executing the following steps to update the updated node available task matrix and the updated candidate matrix for a second time until a second termination condition is satisfied: determining unassigned nodes and unassigned tasks according to the updated node available task matrix; and determining assigned nodes and assigned tasks according to the updated candidate matrix; selecting one of the unassigned tasks as the task to be assigned; and determining the reassigned nodes and the assigned tasks corresponding to the task to be assigned from the assigned nodes and the assigned tasks, respectively, based on a preset search algorithm; Assign nodes, reallocate tasks, and determine nodes to be assigned from the unassigned nodes; re-pair the tasks to be assigned, reallocated nodes, reallocated tasks, and nodes to be assigned; perform a secondary update on the updated node-can-do task matrix and the updated candidate matrix according to the re-pairing result, wherein the secondary update includes: deleting rows and columns in the updated node-can-do task matrix, and adjusting the values ​​of elements in the updated candidate matrix according to the re-pairing result; wherein the second termination condition includes: the node-can-do task matrix after the secondary update is updated to an empty matrix, or the time taken for the secondary update reaches a time threshold.

[0140] When the updated node-can-do-task matrix is ​​a matrix of all zeros, it can be considered that there are still unassigned nodes and unassigned tasks; in the preprocessed node-can-do-task matrix, these unassigned nodes and unassigned tasks have corresponding tasks and nodes, so the paired nodes-tasks can be adjusted, the unassigned nodes and unassigned tasks can be reallocated, and the corresponding rows and columns in the updated node-can-do-task matrix can be deleted until the updated node-can-do-task matrix is ​​an empty matrix, thereby obtaining a candidate matrix with more 1-valued elements, so as to achieve the effect of allocating as many tasks as possible;

[0141] By adjusting and reallocating the process, we can further avoid falling into the local optimal problem and achieve the effect of allocating as many tasks as possible.

[0142] In some embodiments, the allocation module generates an allocation matrix based on the node-available-task matrix, including: determining a corresponding bipartite graph based on the initial node-available-task matrix; solving the maximum matching problem of the bipartite graph using the Hungarian algorithm to obtain a maximum matching result; constructing the allocation matrix shown in the maximum matching result: setting the elements on the coordinates indicated by the paired nodes and tasks in the allocation matrix to 1, and setting the remaining coordinates to 0. In some practical applications, when the number of nodes and tasks is lower than a preset threshold, the initial node-available-task matrix can be converted into a corresponding bipartite graph, and the maximum matching problem of the bipartite graph is solved using the Hungarian algorithm, and then constructing the allocation matrix shown in the figure to obtain an allocation result.

[0143] In some embodiments, the acquisition module is further used to: determine the ordered set of capability characteristics according to the characteristics required for the task; and update the ordered set of capability characteristics when there is an update to the characteristics required for the task.

[0144] Figure 4 An exemplary system architecture 400 is shown to which the task allocation method or task allocation apparatus according to the embodiment of the present invention can be applied.

[0145] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0146] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0147] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0148] Server 405 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using terminal devices 401, 402, and 403. The backend management server may analyze and process received data such as product information query requests, and feed back the processing results to the terminal device.

[0149] It should be noted that the task allocation method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the task allocation device is generally disposed in the server 405 .

[0150] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0151] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0152] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0153] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0154] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0155] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0156] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0157] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be arranged in a processor, for example, it may be described as follows: a processor includes an acquisition module, an acquisition unit, a determination matrix module, and an allocation module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0158] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: step S101, obtaining task feature data of features required for the task, and node feature data of features possessed by the node; step S102, based on the feature order in the feature ordered set, determining the initial node-available task matrix according to the task feature data and the node feature data; step S103, generating an allocation matrix according to the initial node-available task matrix, and allocating the task to the node according to the allocation matrix.

[0159] According to the technical solution of the embodiment of the present invention, a node-capable task matrix is ​​established according to the characteristics required for the task and the characteristics possessed by the node, and then an allocation matrix is ​​determined according to the node-capable task matrix, and then tasks can be allocated to the nodes according to the allocation matrix. Therefore, the technical problem of unreasonable and unbalanced allocation caused by the active selection of tasks by nodes or random allocation of tasks to nodes in the prior art is overcome, thereby achieving the effect of quickly, evenly and distributing as many tasks as possible; and matrix-based calculations can also be facilitated by computer processing, so that the allocation efficiency is higher.

[0160] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A task allocation method, characterized in that: include: Obtaining task feature data of features required by the task and node feature data of features possessed by the node; Based on the feature sequence in the feature ordered set, according to the task feature data and the node feature data, determining an initial node-available-task matrix, including: based on the feature identification sequence in the feature sequence, according to the task feature data and the node feature data, respectively determining a task feature vector of each task and a node feature vector of each node; determining an initial matrix of node-available-tasks according to the task feature vectors and the node feature vectors; determining the initial node-available-task matrix according to the initial matrix; Generate an allocation matrix according to the initial node-available-task matrix, including: generate an all-0 matrix with the same number of rows and columns as the initial node-available-task matrix as a candidate matrix; based on a preset algorithm, perform N complete updates on the initial node-available-task matrix and the candidate matrix respectively, to obtain N pairs of updated node-available-task matrices and updated candidate matrices; wherein N is a preset number; select an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix; The method of performing a complete update of the initial node-can-do-task matrix and the candidate matrix based on a preset algorithm includes: traversing the rows and columns in the initial node-can-do-task matrix, and deleting the rows and columns with all 0 elements from the initial node-can-do-task matrix as a preprocessing of the initial node-can-do-task matrix; Repeat the following steps to update the preprocessed node task matrix and the candidate matrix until the end condition is met: Traversing the preprocessed nodes can be used to perform rows and columns in the task matrix to determine whether there is a unique 1-valued element in the row or column; If yes, select a 1-valued element from the row or column with the unique 1-valued element according to a preset random algorithm; if no, determine the row or column with the least number of 1-valued elements from the rows or columns of the preprocessed node-taskable matrix, and select a 1-valued element therefrom according to a preset random algorithm; The row and column where the selected 1-value element is located are deleted from the preprocessed node-can-do-task matrix to update the node-can-do-task matrix; and the target coordinates are determined according to the node information and task information indicated by the selected 1-value element, and the elements of the target coordinates are updated to 1 in the candidate matrix to update the candidate matrix; wherein the end condition includes: the updated node-can-do-task matrix is ​​an all-0 matrix, or the updated node-can-do-task matrix is ​​an empty matrix; And the tasks are allocated to the nodes according to the allocation matrix.

2. The method according to claim 1, characterized in that The features include: numerical features and non-numerical features; The feature data includes: a feature identifier and a feature value; wherein the feature value of the numerical feature is a natural number; and the feature value of the non-numerical feature is 0 or 1.

3. The method according to claim 1, characterized in that: The determining of the task feature vector of each task and the node feature vector of each node based on the feature sequence and according to the task feature data and the node feature data respectively includes: According to the feature identification sequence, the feature values ​​in the task feature data of each task are sorted to obtain a task feature value sequence of each task, and the task feature value sequence is used as a task feature vector of each task; and According to the feature identification sequence, the feature values ​​in the node feature data of each node are sorted to obtain a node feature value sequence of each node, and the node feature value sequence is used as a node feature vector of each node.

4. The method according to claim 1, characterized in that: The determining, according to the task feature vector and the node feature vector, an initial matrix of tasks that can be performed by a node comprises: Traverse each task feature vector and each node feature vector in turn; Compare the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine an initial capability value of the node for processing the task; The initial capability value of each node in processing each task is used as an element in the initial matrix.

5. The method according to claim 4, characterized in that The comparing the task feature vector with the elements corresponding to the same feature identifier in the node feature vector to determine the initial capability value of the node for processing the task includes: For each feature identifier, determine whether the node feature value corresponding to the feature identifier is not less than the task feature value corresponding to the feature identifier; If no, a value of 0 is used as the initial capability value of the node to process the task; If both are true, for the first feature identifier corresponding to the task feature value that is not 0, determine the task feature value f1 corresponding to the first feature identifier, and the node feature value f2 corresponding to the first feature identifier; as the feature capability value of the node for processing the task with respect to the first feature identifier; for the second feature identifier corresponding to the task feature value of 0, a value of 1 is used as the feature capability value of the node for processing the task with respect to the second feature identifier; wherein, Express The value determined after rounding down; the product of all characteristic capability values ​​of the node for processing the task is used as the initial capability value of the node for processing the task.

6. The method according to claim 1, characterized in that The step of determining the initial node-available-task matrix according to the initial matrix includes: For each node, determining an initial capability value sequence of the node in the initial matrix for processing each task; Determine the minimum value a among the non-zero values ​​in the initial capability value sequence; Copy the initial capability value sequence of the node to a, and update all non-zero values ​​in the a initial capability value sequence of the node to 1, as the a target capability value sequence of the node; The initial node-capable task matrix is ​​generated according to the target capability value series of all nodes.

7. The method according to claim 1, characterized in that When the end condition satisfied is that the updated node task matrix is ​​an all-0 matrix, the method further includes: Repeat the following steps to perform a second update on the updated node task matrix and the updated candidate matrix until the second end condition is met: Determine unassigned nodes and unassigned tasks according to the updated node-assignable task matrix; and determine assigned nodes and assigned tasks according to the updated candidate matrix; Select one from the unassigned tasks as the task to be assigned; based on a preset search algorithm, determine the reallocated node and the reallocated task corresponding to the task to be assigned from the allocated nodes and the allocated tasks, respectively, and determine the node to be assigned from the unassigned nodes; Re-pairing the tasks to be assigned, the reallocated nodes, the reallocated tasks, and the nodes to be assigned; performing a secondary update on the updated node-available-task matrix and the updated candidate matrix according to the re-pairing result, wherein the secondary update includes: deleting rows and columns in the updated node-available-task matrix, and adjusting the values ​​of elements in the updated candidate matrix according to the re-pairing result; The second termination condition includes: the node task matrix after the second update is updated to an empty matrix, or the time taken for the second update reaches a time threshold.

8. The method according to claim 1, characterized in that include: The ordered set of capability characteristics is determined based on the characteristics required for the described task; as well as, When the required features of the task are updated, the ordered set of capability features is updated.

9. A task allocation device, characterized in that: include: An acquisition module, used to acquire task feature data of features required by the task, and node feature data of features possessed by the node; A matrix determination module is used to determine an initial node-capable-task matrix based on the feature sequence in the feature ordered set, according to the task feature data and the node feature data, including: determining a task feature vector of each task and a node feature vector of each node based on the feature identification sequence in the feature sequence, according to the task feature data and the node feature data; determining an initial matrix of nodes that can perform tasks based on the task feature vectors and the node feature vectors; determining the initial node-capable-task matrix based on the initial matrix; The allocation module is used to generate an allocation matrix according to the initial node-can-do-task matrix, including: generating an all-0 matrix with the same number of rows and columns as the initial node-can-do-task matrix as a candidate matrix; based on a preset algorithm, completely updating the initial node-can-do-task matrix and the candidate matrix N times respectively, to obtain N pairs of updated node-can-do-task matrices and updated candidate matrices; wherein N is a preset number; selecting an updated candidate matrix with the most 1-valued elements from the N updated candidate matrices as the allocation matrix; and allocating the tasks to the nodes according to the allocation matrix; The method of performing a complete update of the initial node-can-do-task matrix and the candidate matrix based on a preset algorithm includes: traversing the rows and columns in the initial node-can-do-task matrix, and deleting the rows and columns with all 0 elements from the initial node-can-do-task matrix as a preprocessing of the initial node-can-do-task matrix; Repeat the following steps to update the preprocessed node task matrix and the candidate matrix until the end condition is met: Traversing the preprocessed nodes can be used to perform rows and columns in the task matrix to determine whether there is a unique 1-valued element in the row or column; If yes, select a 1-valued element from the row or column with the unique 1-valued element according to a preset random algorithm; if no, determine the row or column with the least number of 1-valued elements from the rows or columns of the preprocessed node-taskable matrix, and select a 1-valued element therefrom according to a preset random algorithm; The row and column where the selected 1-value element is located are deleted from the preprocessed node-available-task matrix to update the node-available-task matrix; and the target coordinates are determined according to the node information and task information indicated by the selected 1-value element, and in the candidate matrix, the elements of the target coordinates are updated to 1 to update the candidate matrix; wherein the termination condition includes: the updated node-available-task matrix is ​​an all-0 matrix, or the updated node-available-task matrix is ​​an empty matrix.

10. An electronic device for task allocation, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.