Multi-machine cooperation task allocation optimization method and system based on contract network
By introducing a scoring matrix and the Hungarian algorithm into the contract network, the allocation of multi-machine collaborative tasks is optimized, solving the problems of heavy computational burden on managers and high communication pressure on workers. This achieves optimal allocation of multi-task parallel scheduling, improving the overall efficiency and resource utilization of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG SUPCON RES
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies for multi-machine collaborative task allocation, the computational burden on managers is heavy, the communication pressure on workers is high, and the overall optimal allocation cannot be achieved when multiple tasks are executed in parallel, resulting in uneven resource utilization and suboptimal scheduling results.
A multi-machine collaborative task allocation optimization method based on contract network is introduced. The manager node generates task notification, the worker node calculates the score value and forms a score matrix, and the Hungarian algorithm is used to perform optimal task allocation, thereby reducing communication pressure and improving overall scheduling efficiency.
It significantly improves the fairness, efficiency, and system stability of task allocation, and is suitable for the automated task scheduling needs in multi-task, multi-entity collaborative scenarios.
Smart Images

Figure CN122019090A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial control automation, and in particular to a method and system for optimizing multi-machine collaborative task allocation based on contract networks. Background Technology
[0002] In multi-device collaborative scenarios such as industrial automation and intelligent manufacturing, the key to ensuring system efficiency and resource utilization lies in how to rationally allocate multiple tasks to different execution devices. Distributed task allocation methods, due to their high elasticity and scalability, are widely used in multi-machine collaborative task scheduling. Contract network collaboration is currently a widely applied distributed task collaboration method. This method borrows from the bidding mechanism in commercial contracts, dividing the participants into two roles: managers and workers. Managers issue task notifications, and workers decide whether to bid and execute tasks based on their own circumstances. The entire process includes four stages: bidding, tendering, awarding, and confirmation.
[0003] However, as the scale of collaboration expands and the number of tasks increases, the traditional contract network method has gradually revealed the following shortcomings: First, managers need to evaluate and select the best bid from a large number of bids, resulting in an excessive computational burden; second, each worker needs to submit complete bid content, leading to high system communication pressure; and third, in scenarios where multiple tasks are executed in parallel, this method usually processes tasks one by one in order, which cannot achieve optimal allocation of tasks as a whole, and is prone to problems such as uneven resource utilization and suboptimal scheduling results, thus limiting its application effect in large-scale multi-machine collaborative environments.
[0004] Therefore, an improved task allocation method is needed to simplify the communication process, reduce the burden on managers, and support the simultaneous optimization of multiple task allocations, so as to improve the overall scheduling efficiency and resource utilization of the system. Summary of the Invention
[0005] To address the aforementioned problems, the present invention aims to provide a multi-machine collaborative task allocation optimization and system based on a contract network, thereby resolving the issues in existing technologies such as heavy computational burden caused by managers needing to evaluate a large number of bids, high communication pressure caused by workers submitting complete bid content, and the inability to achieve global optimization through sequential allocation of multiple tasks. The above-mentioned objective of the present invention is achieved through the following technical solutions: This invention provides a method for optimizing multi-machine collaborative task allocation based on a contract network, comprising: Step S1: The manager node generates a corresponding task notification for one or more pending tasks and broadcasts it to multiple worker nodes. The task notification includes the task identifier, task content, and evaluation criteria for assessing task matching. Step S2: Based on the task notification, the worker node calculates the corresponding score value according to the task's evaluation criteria using a preset scoring function and forms a scoring matrix. The scoring results are then sent to the manager node. The scoring function is... Where S is the rating value and n is the evaluation dimension. This represents the weight of the i-th dimension. Represents the score in the i-th dimension; Step S3: The manager node constructs a rating matrix of the tasks to be assigned and worker nodes based on the received rating results, and uses the Hungarian algorithm to solve the rating matrix to obtain the optimal task assignment scheme that satisfies the task assignment constraints. Step S4: Based on the optimal task allocation scheme, the manager node issues task execution instructions to the selected worker nodes; Step S5: Each selected worker node executes the task according to the task execution instructions and feeds back the execution results to the manager node.
[0006] Furthermore, the manager node generates a corresponding task notification for one or more pending tasks and broadcasts it to multiple worker nodes. The task notification includes the task identifier, task content, and evaluation criteria for assessing task matching, including: The manager node obtains task description information for one or more tasks, including task identifier, task content, task type, and execution requirements; Based on task type and execution requirements, evaluation criteria are set for each task to assess task suitability; the evaluation criteria include task complexity, required resources and capabilities, priority, and time requirements. The task identifier and evaluation criteria are encapsulated into a task notification and sent to one or more worker nodes according to the broadcast policy.
[0007] Furthermore, the task notification also includes execution constraints, which include node resource limits, available time windows, task dependencies, or node role permission requirements.
[0008] Furthermore, based on the task notification, worker nodes calculate the corresponding score values using a preset scoring function according to the task's evaluation criteria, form a scoring matrix, and send the scoring results to the manager node, including: Worker nodes receive task notifications and parse the task identifier, task content, evaluation criteria, and execution constraints. Based on the evaluation criteria and execution constraints contained in the task notification, a scoring function is invoked to assess the matching degree and obtain the corresponding score. The score values corresponding to each task are formed into a score vector according to the order of the task identifiers and sent to the manager node.
[0009] Furthermore, the manager node constructs a rating matrix of the tasks to be assigned and the worker nodes based on the received rating results, including: Receive rating vectors from multiple worker nodes, where each rating vector corresponds to a worker node's rating of all pending tasks; Based on the rating vector of each worker node, the rating values are concatenated in rows or columns according to the preset task index order to construct a rating matrix of the task to be assigned and the worker node. Each element of the rating matrix represents the rating value of the corresponding worker node for the specified task. The scoring matrix is validated for integrity and standardized to ensure that all tasks receive valid scores and are compared under a unified scoring scale.
[0010] Furthermore, the rating matrix is as follows: Where m is the number of worker nodes and n is the number of tasks to be processed; each element in the scoring matrix represents the score value of the corresponding worker node for the corresponding task, and the score value is calculated by the scoring function according to the evaluation criteria and execution constraints in the task notification.
[0011] Furthermore, the Hungarian algorithm is used to solve the scoring matrix to obtain the optimal task allocation scheme that satisfies the task assignment constraints, including: The scoring matrix is used as input for dimension completion. If the number of worker nodes is greater than the number of tasks to be processed, mn columns of all zeros are added to the right side of the scoring matrix to construct a square m x m scoring matrix. ; Obtain the maximum element value k in the rating matrix, and construct a new assignment question matrix based on the maximum element value k. m represents the number of worker nodes, and n represents the number of tasks to be processed. Assignment Problem Matrix Perform a normalization operation to construct a matrix S''. The normalization operation includes subtracting the smallest element of each row from the elements of each row of matrix S', and then subtracting the smallest element of each column from the elements of each column of the resulting new coefficient matrix. Based on the normalized matrix S'', execute the Hungarian algorithm to output the corresponding assignment relationship between worker nodes and tasks.
[0012] Furthermore, based on the normalized matrix S'', the Hungarian algorithm is executed to output the corresponding assignment relationships between worker nodes and tasks, including: Step S31: Search for unique zero elements in the row and column of matrix S'' as initial assignment candidate elements; Step S32: If the number of selected worker nodes is the same as the number of tasks to be processed, then directly output the assignment relationship between the tasks and worker nodes; Step S32: Otherwise, from the matrix rows corresponding to the unassigned tasks, select the row containing only one zero element as the current assignment candidate, and mark the other zero elements in the column containing the zero element as exclusion elements to prevent duplicate assignment: Step S33: Repeat step S32 until no unique zero element that satisfies the condition can be selected, and obtain the currently feasible initial allocation scheme; Step S34: If there are still unmatched and unassigned task or worker nodes, construct a minimum coverage line set for the unassigned zero elements. Find the minimum non-zero value in the uncovered scoring matrix positions according to the minimum coverage line set. Subtract the minimum non-zero value from the elements of all uncovered positions and add it to the double-covered positions. Adjust the matrix in this way to generate a new scoring matrix S'''.
[0013] Step S35: Based on the updated rating matrix S''', repeat steps S31 to S34 until the optimal task allocation scheme in which all tasks and worker nodes form a unique assignment relationship is obtained.
[0014] Further, in step S34, constructing a minimum cover line set for the unassigned zero elements includes: Step S341: Mark all rows that do not contain any assigned marker elements; Step S342: Mark the columns containing zero elements in all marked rows; Step S343: Mark all rows in the marked columns that contain the assigned marker element; Step S344: Repeat steps S342 and S343 until no more marking behavior is added.
[0015] Step S345: Use all unmarked rows and all marked columns as line coverage paths to cover all zero elements in the matrix.
[0016] Based on the same inventive concept, this invention also provides a multi-machine collaborative task allocation optimization system based on a contract network, employing the multi-machine collaborative task allocation optimization method described above, including... The broadcast module is used by the manager node to generate corresponding task notifications for one or more pending tasks and broadcast them to multiple worker nodes. The task notifications include the task identifier, task content, and evaluation criteria for assessing task matching. The scoring calculation module is used to calculate the corresponding score value and form a scoring matrix based on the task notification and the worker node according to the task evaluation criteria using a preset scoring function, and then send the scoring results to the manager node. The allocation calculation module is used by the manager node to construct a scoring matrix of tasks to be assigned and worker nodes based on the received scoring results, and to solve the scoring matrix using the Hungarian algorithm to obtain the optimal task allocation scheme that satisfies the task assignment constraints. The instruction issuance module is used to issue task execution instructions from the manager node to the selected worker node according to the optimal task allocation scheme. The execution feedback module is used by each selected worker node to execute tasks according to the task execution instructions and to feed back the execution results to the manager node.
[0017] Compared with the prior art, the present invention has at least one of the following beneficial effects: This invention avoids the unfairness caused by subjective scoring by clearly setting evaluation criteria in the task notification and introducing a unified scoring function for worker nodes to calculate task matching degree. Furthermore, it uses a scoring matrix to organize the scoring results in a structured way and uses the Hungarian algorithm to achieve optimal matching between tasks and workers, ensuring that the allocation result has overall optimality under the constraints. This significantly improves the fairness, efficiency and system stability of task allocation, and is especially suitable for the automated task scheduling needs in multi-task and multi-agent collaborative scenarios. Attached Figure Description
[0018] Figure 1 This is a flowchart illustrating the steps of the multi-machine collaborative task allocation optimization method based on contract networks according to the present invention. Figure 2 This is a schematic diagram of the task allocation process under the Contract Network Protocol in an embodiment of the present invention; Figure 3 This is a flowchart of task scoring matrix optimization and task assignment based on the Hungarian algorithm in an embodiment of the present invention. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0021] First Embodiment To further illustrate the technical principles of the distributed task assignment method in this embodiment, the following is in conjunction with the appendix. Figure 1 This section describes the interaction flow of a typical contract network method. For example... Figure 1 As shown, Contract Network is currently the most widely used distributed task allocation method. Its core is to negotiate the solution of each problem through communication in order to prevent conflicts. Its idea comes from the contract mechanism used by people to manage goods and services in business processes.
[0022] In the contract network method, all parties are divided into two roles: managers and workers, and the process consists of four interactive stages: bidding, tendering, awarding the contract, and confirmation. Managerial Responsibilities: (1) Create a task notification for each task to be solved and send the task notification to the relevant worker entities; (2) Receive and evaluate bids from workers; (3) Select the most suitable worker from the bids and establish a contract with him / her; (4) Supervise the completion of tasks and summarize the results.
[0023] Worker's responsibilities: (1) Receive relevant task notifications; (2) Evaluate one's own qualifications; (3) Return task bids for subtasks of interest; (4) If the bid is accepted, perform the tasks assigned to you in accordance with the contract; (5) Report the solution results to the manager.
[0024] In the contract network collaboration method, there is no need to predefine the roles of the parties: any party becomes a manager by issuing a task notification; any party becomes a worker by responding to a task notification. This flexibility allows tasks to be hierarchically decomposed and assigned, forming a dynamically determined tree structure. However, because the manager must select the best option from all bids, the manager's workload is significant when the system contains multiple individual machines. Furthermore, each worker returns a bid proposal to the manager, placing considerable pressure on communication.
[0025] Furthermore, when multiple tasks need to be executed simultaneously, the Contract Network collaboration method sequentially processes each task through a bidding-tendering-winning-confirmation process. This approach does not always yield the optimal solution. For example, suppose a single machine's bids for Task 1 and Task 2 have scores of 41 and 80 respectively, and a single machine's bids for Task 1 and Task 2 have scores of 40 and 40 respectively. Task 1 and Task 2 have the same weight. If workers are assigned to Task 1 first, Task 1 will be assigned to single machine 1, and Task 2 can only be assigned to single machine 2. Clearly, assigning Task 2 to single machine 1 would result in a higher score, and this method is not always the optimal task allocation approach.
[0026] To address the growing demand for multi-machine collaboration, traditional contract network collaboration methods, due to their high burden on administrators and communication systems, are limited to small-scale multi-machine collaboration and suffer from unreasonable task allocation methods. This invention proposes an optimized task assignment strategy that incorporates a scoring matrix and the Hungarian algorithm, building upon the traditional contract network method to achieve optimal matching between tasks and worker nodes. The specific implementation is as follows: like Figure 1 As shown, this invention provides a method for optimizing multi-machine collaborative task allocation based on a contract network, comprising: Step S1: The manager node generates a corresponding task notification for one or more pending tasks and broadcasts it to multiple worker nodes. The task notification includes the task identifier, task content, and evaluation criteria for assessing task matching. Step S2: Based on the task notification, the worker node calculates the corresponding score value according to the task's evaluation criteria using a preset scoring function and forms a scoring matrix, then sends the scoring results to the manager node; the scoring function is... Where S is the rating value and n is the evaluation dimension. This represents the weight of the i-th dimension. Represents the score in the i-th dimension; Step S3: The manager node constructs a rating matrix of the tasks to be assigned and worker nodes based on the received rating results, and uses the Hungarian algorithm to solve the rating matrix to obtain the optimal task assignment scheme that satisfies the task assignment constraints. Step S4: Based on the optimal task allocation scheme, the manager node issues task execution instructions to the selected worker nodes; Step S5: Each selected worker node executes the task according to the task execution instructions and feeds back the execution results to the manager node.
[0027] Specifically, in response to the problems of traditional contract network collaboration methods in terms of task allocation efficiency and matching optimality, this embodiment optimizes and adjusts the responsibilities of manager nodes and worker nodes, and introduces a scoring mechanism and centralized solution strategy to improve the overall task allocation quality.
[0028] The responsibilities of the manager node include: (1) Create a task notification for each task to be solved, and send the task notification and the evaluation criteria for assessing the task matching degree to the relevant worker nodes. (2) Receive the scoring information calculated by the worker node according to the evaluation criteria; (3) Construct a rating matrix based on all rating results, and use an optimization algorithm (such as the Hungarian algorithm) to select the worker with the best matching degree and establish a contractual relationship with him; (4) Issue task execution instructions, supervise the task execution process, and conduct a comprehensive evaluation of the completion results.
[0029] The responsibilities of worker nodes include: (1) Receive task notifications and their corresponding evaluation criteria from the manager node; (2) Based on their own abilities, resources and other factors, they should score their own matching degree according to the evaluation criteria; (3) Feedback the scoring results to the manager node to complete the "bidding" action; (4) If the bid is accepted, that is, the scoring result is selected, the task shall be performed in accordance with the contract requirements; (5) After the task is completed, submit the execution results and feedback information to the manager node.
[0030] Through the aforementioned adjustments to responsibilities, the traditional item-by-item bidding and response mechanism is no longer relied upon. Instead, a unified scoring matrix collection and centralized optimization matching method significantly reduces communication overhead and allocation errors, improving task matching efficiency and global score optimization under multi-task parallel scheduling. After the adjustment, the responsibility for evaluating bids is borne by the workers themselves, distributing the workload among each worker and preventing excessive burden on managers. Simultaneously, the adjusted manager broadcast adds evaluation criteria for tasks, but workers do not need to return bid documents; they only need to return scores, thus reducing overall communication pressure. Furthermore, the manager node generates a corresponding task notification for one or more pending tasks and broadcasts it to multiple worker nodes. The task notification includes the task identifier, task content, and evaluation criteria for assessing task matching, including: The manager node obtains task description information for one or more tasks, including task identifier, task content, task type, and execution requirements; Based on task type and execution requirements, evaluation criteria are set for each task to assess task suitability; the evaluation criteria include task complexity, required resources and capabilities, priority, and time requirements. The task identifier and evaluation criteria are encapsulated into a task notification and sent to one or more worker nodes according to the broadcast policy.
[0031] Furthermore, the task notification also includes execution constraints, which include node resource limits, available time windows, task dependencies, or node role permission requirements.
[0032] Furthermore, based on the task notification, worker nodes calculate the corresponding score values using a preset scoring function according to the task's evaluation criteria, form a scoring matrix, and send the scoring results to the manager node, including: Worker nodes receive task notifications and parse the task identifier, task content, evaluation criteria, and execution constraints. Based on the evaluation criteria and execution constraints contained in the task notification, a scoring function is invoked to assess the matching degree and obtain the corresponding score. The score values corresponding to each task are formed into a score vector according to the order of the task identifiers and sent to the manager node.
[0033] Furthermore, the manager node constructs a rating matrix of the tasks to be assigned and the worker nodes based on the received rating results, including: Receive rating vectors from multiple worker nodes, where each rating vector corresponds to a worker node's rating of all pending tasks; Based on the rating vector of each worker node, the rating values are concatenated in rows or columns according to the preset task index order to construct a rating matrix of the task to be assigned and the worker node. Each element of the rating matrix represents the rating value of the corresponding worker node for the specified task. The scoring matrix is validated for integrity and standardized to ensure that all tasks receive valid scores and are compared under a unified scoring scale.
[0034] Furthermore, the rating matrix is as follows: Where m is the number of worker nodes and n is the number of tasks to be processed; each element in the scoring matrix represents the score value of the corresponding worker node for the corresponding task, and the score value is calculated by the scoring function according to the evaluation criteria and execution constraints in the task notification.
[0035] Furthermore, the Hungarian algorithm is used to solve the scoring matrix to obtain the optimal task allocation scheme that satisfies the task assignment constraints, including: The scoring matrix is used as input for dimension completion. If the number of worker nodes is greater than the number of tasks to be processed, mn columns of all zeros are added to the right side of the scoring matrix to construct a square m x m scoring matrix. ; Obtain the maximum element value k in the rating matrix, and construct a new assignment question matrix based on the maximum element value k. m represents the number of worker nodes, and n represents the number of tasks to be processed. Assignment Problem Matrix Perform a normalization operation to construct a matrix S''. The normalization operation includes subtracting the smallest element of each row from the elements of each row of matrix S', and then subtracting the smallest element of each column from the elements of each column of the resulting new coefficient matrix. Based on the normalized matrix S'', execute the Hungarian algorithm to output the corresponding assignment relationship between worker nodes and tasks.
[0036] Furthermore, based on the normalized matrix S'', the Hungarian algorithm is executed to output the corresponding assignment relationships between worker nodes and tasks, including: Step S31: Search for unique zero elements in the row and column of matrix S'' as initial assignment candidate elements; Step S32: If the number of selected worker nodes is the same as the number of tasks to be processed, then directly output the assignment relationship between the tasks and worker nodes; Step S32: Otherwise, from the matrix rows corresponding to the unassigned tasks, select the row containing only one zero element as the current assignment candidate, and mark the other zero elements in the column containing the zero element as exclusion elements to prevent duplicate assignment: Step S33: Repeat step S32 until no unique zero element that satisfies the condition can be selected, and obtain the currently feasible initial allocation scheme; Step S34: If there are still unmatched and unassigned task or worker nodes, construct a minimum coverage line set for the unassigned zero elements. Find the minimum non-zero value in the uncovered scoring matrix positions according to the minimum coverage line set. Subtract the minimum non-zero value from the elements of all uncovered positions and add it to the double-covered positions. Adjust the matrix in this way to generate a new scoring matrix S'''.
[0037] Step S35: Based on the updated rating matrix S''', repeat steps S31 to S34 until the optimal task allocation scheme in which all tasks and worker nodes form a unique assignment relationship is obtained.
[0038] Further, in step S34, constructing a minimum cover line set for the unassigned zero elements includes: Step S341: Mark all rows that do not contain any assigned marker elements; Step S342: Mark the columns containing zero elements in all marked rows; Step S343: Mark all rows in the marked columns that contain the assigned marker element; Step S344: Repeat steps S342 and S343 until no more marking behavior is added.
[0039] Step S345: Use all unmarked rows and all marked columns as line coverage paths to cover all zero elements in the matrix.
[0040] Specifically, such as Figure 3 As shown, this addresses the issue of an unreasonable allocation method. The manager receives the score for each task from all stakeholders, recorded as follows: (i refers to the i-th subject, j refers to the j-th task), assuming there are a total of m subjects and n tasks (m≥n), establish a matrix. Task allocation can be determined by assigning problem-solving methods, using the Hungarian solution as an example: Step 1: Add 0s from the mn columns to the right side of matrix S, and then complete matrix S into a square matrix. Then take Find the maximum value k in the matrix. S' is the coefficient matrix of the assignment problem. Then, S' is renamed to S'', such that each row and column of S'' contains a 0 element. (1) Subtract the smallest element of each row from the elements of matrix S'.
[0041] (2) Subtract the smallest element of each column from the elements of the new coefficient matrix.
[0042] The second step is to conduct trial assignments to find the optimal solution.
[0043] Find as many independent zero elements as possible in S'' (i.e., each row and column contains only one zero element). If m independent zero elements can be found, solve the matrix corresponding to these m independent zero elements. The optimal solution is obtained by setting the number of independent zero elements to 1 and the rest to 0. The common steps for finding independent zero elements are: (1) Starting with a row containing only one 0 element, circle that 0 element (marked as ◎), then cross out the other 0 elements in the same column (marked as ∅). This indicates that the task represented by this column has been assigned and no further consideration is needed.
[0044] (2) Circle the zero element in a column that contains only one zero element, and mark it as ◎. Then cross out the zero element in the same row, and mark it as ∅.
[0045] (3) Repeat steps (1) and (2) until as many 0 elements as possible are circled and crossed out.
[0046] (4) If there are still 0 elements that have not been circled, and there are at least two 0 elements in the same row (column), then start from the row (column) with the fewest remaining 0 elements, compare the number of 0 elements in the columns where each 0 element in this row is located, and select the 0 element in the column with fewer 0 elements and circle it. Then cross out the other 0 elements in the same row and column. This can be repeated until all 0 elements have been circled and crossed out.
[0047] (5) If the number x of ◎ is equal to the order m of the matrix, then the optimal solution of this assignment problem has been obtained. If x < m, then go to the next step.
[0048] The third step: Make the fewest horizontal and vertical lines to cover all 0 elements.
[0049] (1) Mark a √ for the rows without ◎; (2) Mark a √ for all the columns containing the element ∅ in the rows that have been marked with a √.
[0050] (3) Then mark a √ for the rows containing the element ◎ in the columns that have been marked with a √.
[0051] (4) Repeat (2) and (3) until no new rows and columns can be marked with a √.
[0052] (5) Draw a horizontal line for the rows that have not been marked with a √, and draw a vertical line for the columns that have been marked with a √. Among the elements that have not been covered, find the smallest element y, subtract 1 from the rows where this element is located that have not been covered, and add 1 to the covered columns.
[0053] (6) Repeat step two.
[0054] The second embodiment Based on the same inventive concept, the present invention also provides a multi - machine collaborative task assignment optimization system based on the contract net, which adopts the multi - machine collaborative task assignment optimization method as described above, including, A broadcast module, used for the manager node to generate corresponding task notices for one or more tasks to be processed and broadcast them to multiple worker nodes. The task notice contains the task identifier corresponding to the task, the task content, and the evaluation criteria for evaluating the task matching degree; A scoring calculation module, used for the worker nodes to calculate the corresponding scoring values based on the task notice according to the evaluation criteria of the task by using a preset scoring function and form a scoring matrix, and send the scoring result to the manager node; The allocation calculation module is used by the manager node to construct a scoring matrix of tasks to be assigned and worker nodes based on the received scoring results, and to solve the scoring matrix using the Hungarian algorithm to obtain the optimal task allocation scheme that satisfies the task assignment constraints. The instruction issuance module is used to issue task execution instructions from the manager node to the selected worker node according to the optimal task allocation scheme. The execution feedback module is used by each selected worker node to execute tasks according to the task execution instructions and to feed back the execution results to the manager node.
[0055] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.
[0056] It should be noted that the above embodiments can be freely combined as needed. The above description is only a preferred embodiment of the present invention. It should be pointed out that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for optimizing multi-machine collaborative task allocation based on contract networks, characterized in that, include: Step S1: The manager node generates a corresponding task notification for one or more pending tasks and broadcasts it to multiple worker nodes. The task notification includes the task identifier, task content, and evaluation criteria for assessing task matching degree. Step S2: Based on the task notification, the worker node calculates the corresponding score value according to the evaluation criteria of the task using a preset scoring function and forms a scoring matrix, then sends the scoring results to the manager node. The scoring function is... Where S is the rating value and n is the evaluation dimension. This represents the weight of the i-th dimension. The score of the i-th dimension is represented; Step S3: The manager node constructs a scoring matrix of the task to be assigned and the worker node based on the received scoring results, and solves the scoring matrix using the Hungarian algorithm to obtain the optimal task assignment scheme that satisfies the task assignment constraints. Step S4: According to the optimal task allocation scheme, the manager node issues task execution instructions to the selected worker nodes; Step S5: Each selected worker node executes the task according to the task execution instruction and feeds back the execution result to the manager node.
2. The multi-machine collaborative task allocation optimization method according to claim 1, characterized in that, The manager node generates a corresponding task notification for one or more pending tasks and broadcasts it to multiple worker nodes. The task notification includes a task identifier, task content, and evaluation criteria for assessing task matching, including: The manager node obtains task description information for one or more of the tasks, including the task identifier, the task content, the task type, and the execution requirements; Based on the task type and the execution requirements, an evaluation criterion is set for each task to assess the task matching degree; the evaluation criterion includes task complexity, required resource capacity, priority, and time requirement; The task identifier and the evaluation criteria are encapsulated into a task notification and sent to one or more worker nodes according to a broadcast strategy.
3. The multi-machine collaborative task allocation optimization method according to claim 1, characterized in that, The task notification also includes execution constraints, which include node resource limits, available time windows, task dependencies, or node role permission requirements.
4. The multi-machine collaborative task allocation optimization method according to claim 3, characterized in that, Based on the task notification, the worker node calculates the corresponding score value using a preset scoring function according to the evaluation criteria of the task and forms a scoring matrix, then sends the scoring results to the manager node, including: The worker node receives the task notification and parses the task identifier, the task content, the evaluation criteria, and the execution constraints. Based on the evaluation criteria and execution constraints contained in the task notification, the scoring function is invoked to evaluate the matching degree and obtain the corresponding score value. The score values corresponding to each task are arranged in the order of the task identifiers to form a score vector and sent to the manager node.
5. The multi-machine collaborative task allocation optimization method according to claim 4, characterized in that, The manager node constructs a scoring matrix between the task to be assigned and the worker node based on the received scoring results, including: Receive the rating vectors fed back from multiple worker nodes, wherein each rating vector corresponds to a rating value of a worker node for all the tasks to be processed; Based on the rating vectors of each worker node, the rating values are concatenated in rows or columns according to a preset task index order to construct the rating matrix of the task to be assigned and the worker node, wherein each element of the rating matrix represents the rating value of the corresponding worker node for the specified task. The scoring matrix is subjected to integrity verification and standardization to ensure that all tasks receive valid scores and are compared under a unified scoring scale.
6. The multi-machine collaborative task allocation optimization method according to claim 5, characterized in that, The rating matrix is as follows: Where m is the number of worker nodes and n is the number of tasks to be processed; each element in the scoring matrix represents the score value of the corresponding worker node for the corresponding task, and the score value is calculated by the scoring function according to the evaluation criteria and execution constraints in the task notification.
7. The multi-machine collaborative task allocation optimization method according to claim 6, characterized in that, The Hungarian algorithm is used to solve the scoring matrix to obtain the optimal task allocation scheme that satisfies the task assignment constraints, including: Using the rating matrix as input, dimension completion processing is performed. If the number of worker nodes is greater than the number of tasks to be processed, mn columns of all zeros are added to the right side of the rating matrix to construct a square m x m rating matrix. ; Obtain the maximum element value k in the rating matrix, and construct a new assignment question matrix based on the maximum element value k. m represents the number of worker nodes, and n represents the number of tasks to be processed. For the assignment problem matrix Perform a normalization operation to construct a matrix S''. The normalization operation includes subtracting the minimum element of each row from the elements of the matrix S', and then subtracting the minimum element of each column from the elements of the resulting new coefficient matrix. Based on the normalized matrix S'', the Hungarian algorithm is executed to output the corresponding assignment relationship between the worker node and the task.
8. The multi-machine collaborative task allocation optimization method according to claim 7, characterized in that, Based on the normalized matrix S'', the Hungarian algorithm is executed to output the corresponding assignment relationship between the worker nodes and the tasks, including: Step S31: Search for unique zero elements in the matrix S'' as initial assignment candidate elements; Step S32: If the number of selected worker nodes is the same as the number of tasks to be processed, then the assignment relationship between the tasks and the worker nodes is directly output. Step S32: Otherwise, from the matrix rows corresponding to the unassigned tasks, select the row containing only one zero element as the current assignment candidate, and mark the other zero elements in the column containing the zero element as exclusion elements to prevent duplicate assignment. Step S33: Repeat step S32 until no unique zero element that meets the conditions can be selected, and obtain the currently feasible initial allocation scheme; Step S34: When there are still unmatched and unassigned tasks or worker nodes, construct a minimum coverage line set for the unassigned zero elements, find the minimum non-zero value in the uncovered scoring matrix positions according to the minimum coverage line set, subtract the minimum non-zero value from the elements of all uncovered positions, and add it to the double-covered positions to adjust the matrix and generate a new scoring matrix S'''. Step S35: Based on the updated scoring matrix S''', repeat steps S31 to S34 until the optimal task allocation scheme in which all tasks and worker nodes form a unique assignment relationship is obtained.
9. The multi-machine collaborative task allocation optimization method according to claim 8, characterized in that, In step S34, constructing a minimum cover line set for the unassigned zero elements includes: Step S341: Mark all rows that do not contain any assigned marker elements; Step S342: Mark the columns in all marked rows that contain the zero element; Step S343: Mark all rows in the marked columns that contain the assigned marker element; Step S344: Repeat steps S342 and S343 until no more marking behavior is added; Step S345: Use all unmarked rows and all marked columns as line coverage paths to cover all zero elements in the matrix.
10. A multi-machine collaborative task allocation optimization system based on a contract network, employing the multi-machine collaborative task allocation optimization method as described in any one of claims 1 to 9, characterized in that, include, The broadcast module is used by the manager node to generate a corresponding task notification for one or more pending tasks and broadcast it to multiple worker nodes. The task notification includes the task identifier, task content and evaluation criteria for assessing the task matching degree. The scoring calculation module is used to calculate the corresponding score value and form a scoring matrix based on the task notification and the evaluation criteria of the task by the worker node using a preset scoring function, and then send the scoring results to the manager node. The allocation calculation module is used by the manager node to construct a scoring matrix between the task to be assigned and the worker node based on the received scoring results, and to solve the scoring matrix using the Hungarian algorithm to obtain the optimal task allocation scheme that satisfies the task assignment constraints. The instruction issuing module is used to issue task execution instructions from the manager node to the selected worker node according to the optimal task allocation scheme. The execution feedback module is used for each of the selected worker nodes to execute the task according to the task execution instruction and to feed back the execution result to the manager node.