Resource allocation method and device based on optimal path planning
By combining greedy algorithms and dynamic programming algorithms, the inaccurate, unreasonable and low-efficiency resource allocation in traditional resource allocation methods are solved, and more efficient and reasonable resource allocation is achieved.
Patent Information
- Application Number
- CN202510333919.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-06-20
AI Technical Summary
The traditional resource allocation method lacks a global optimization strategy, which leads to inaccurate and unreasonable resource allocation, and is difficult to adapt to dynamically changing demand scenarios, resulting in slow response speed and inability to optimize in real time, resulting in low resource allocation efficiency.
The dynamic planning method based on greedy strategies is used to formulate resource scheduling plans, combine greedy algorithms and dynamic planning algorithms to formulate task plans and generate corresponding resource scheduling plans, and path planning for each task working group according to the resource scheduling plan to obtain the best path planning results.
It improves the accuracy and rationality of resource allocation, improves the efficiency of resource allocation, and can achieve efficient and reasonable resource allocation in a dynamic demand environment.
Smart Images

Figure CN120181503A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource allocation, and in particular to a resource allocation method and device based on optimal path planning. Background Art
[0002] Provide monitoring, intelligent analysis and rapid decision support in the process of carrying out work tasks to ensure the effective execution of tasks. With the increasing complexity of modern environments and task requirements, decision-making support software uses technologies such as multi-source data fusion, intelligent scheduling, and geographic information services to provide instant and accurate support for decision-making.
[0003] At present, traditional resource allocation methods usually lack global optimization strategies, which makes it easy for resource allocation to be concentrated in local areas, and fails to fully utilize all resources in the system. This situation will lead to inaccurate and unreasonable resource allocation, making some resources idle while others are overloaded, affecting the efficiency and stability of the overall system. In addition, traditional resource allocation methods may be based on static rules or manual decisions, which are difficult to adapt to dynamically changing demand scenarios. When resource demand changes, traditional resource allocation methods require a long adjustment time, resulting in slow response speed and inability to optimize in real time, which ultimately leads to low resource allocation efficiency.
[0004] In summary, the current traditional resource allocation method has the problems of inaccurate, unreasonable and low efficiency of resource allocation. Therefore, how to provide a more accurate, more reasonable and efficient resource allocation method has become a technical problem to be solved in this field. Summary of the invention
[0005] The purpose of this application is to provide a resource allocation method and device based on optimal path planning, which can improve the accuracy and rationality of resource allocation and enhance the efficiency of resource allocation.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In a first aspect, the present application provides a resource allocation method based on optimal path planning, the resource allocation method based on optimal path planning comprising the following steps:
[0008] Obtain application information from application documents;
[0009] According to the application information, a resource scheduling scheme is formulated using a dynamic programming method based on a greedy strategy; the dynamic programming method based on a greedy strategy refers to a method for formulating a task plan and generating a corresponding resource scheduling scheme obtained by combining a greedy algorithm with a dynamic programming algorithm;
[0010] According to the resource scheduling scheme, path planning is performed for each task working group to obtain the best path planning result.
[0011] Optionally, obtaining application information in the application document specifically includes the following steps:
[0012] Using the task unit to receive the application documents submitted by each demand unit;
[0013] Each of the application documents is parsed separately to obtain the application information.
[0014] Optionally, according to the application information, a resource scheduling plan is formulated using a dynamic programming method based on a greedy strategy, specifically comprising the following steps:
[0015] Analyze the working status of each existing task group and select the task group that can perform the task;
[0016] According to the task working group of the executable task and the application information, a greedy algorithm is used to schedule the existing resources and transportation capacity according to the time priority principle, and when the time consumption is the same, a dynamic programming algorithm is used to schedule according to the principle of minimum resource waste to obtain the resource scheduling plan.
[0017] Optionally, according to the task working group of the executable task and the application information, a greedy algorithm is used to schedule the existing resources and transportation capacity according to the time priority principle, and when the time consumption is the same, a dynamic programming algorithm is used to schedule according to the principle of minimum resource waste to obtain the resource scheduling plan, which specifically includes the following steps:
[0018] Constructing a resource scheduling optimization model according to the task working group of the executable task and the application information;
[0019] Using a greedy algorithm to solve the resource scheduling optimization model to obtain the resource scheduling solution;
[0020] Based on the resource scheduling scheme, when a new application task appears, a dynamic programming algorithm is used to dynamically adjust the resource scheduling scheme, and the dynamically adjusted resource scheduling scheme is used as the resource scheduling scheme.
[0021] Optionally, constructing a resource scheduling optimization model according to the task working group of the executable task and the application information specifically includes the following steps:
[0022] Assume there are task nodes (A1, A2, ..., A m )m, A i For the task nodes at this level or the task working group that is executing tasks and has resource surplus, each service node A i The available amount of resource p is The task objects are (B1, B2, …, B n ) n in number. The resource requirement of the j-th task object B j is The transportation time from the task node A i to the task object B j is t ij . Let the resource scheduling scheme for each task object be Among them, the resource scheduling scheme of the j-th task object d1, d2, …, d k is a combination of subsequences of the sequence 1, 2, …, m. It represents the amount of resources supplied by the d i -th task node, and there are the following constraint relationships:
[0023]
[0024] Let the number of resources required by the j-th task object B j be The required scheduling time is It is expressed as:
[0025]
[0026] For any The resource scheduling optimization model is expressed as:
[0027]
[0028] Optionally, a greedy algorithm is used to solve the resource scheduling optimization model to obtain the resource scheduling scheme, which specifically includes the following steps:
[0029] According to the resource scheduling optimization model, for the j-th task object B j , the following formula is used to calculate the demand priority δ j of the task object B j , and they are arranged in descending order according to the demand priority δ j to obtain the first sorting result as B1, B2, …, B n :
[0030]
[0031] Among them, δ j represents the demand priority of the j-th task object, and λ j and γ j respectively represent the importance degree of the resource requirement point and the resource requirement rate of the j-th task object. λ + , λ - , γ + , γ- are the positive ideal point and negative ideal point of the resource demand point importance and resource demand rate respectively, R j is the proximity of the demand priority of the j-th task object to the positive ideal point, r j is the proximity of the demand priority of the j-th task object to the negative ideal point, w1 and w2 are coefficients, β k is the k-th index value; α is the marker value; w k is the index weight;
[0032] According to the position coordinates and working status of the task working group, calculate the time t j from each task node to task object B ij ;
[0033] According to the time t j from each task node to task object B ij , arrange task node A i in ascending order of the time t j value for transporting to task object B ij to obtain the second sorting result as A1, A2, …, A m , where when the total resource volume of A1 is not enough for the demand of the task object, then according to the second sorting result, the resources of A2 are called, and so on to calculate the critical subscript k to determine the resource scheduling scheme for the j-th task object
[0034] Optimize the resource scheduling scheme for the j-th task object . For the task working group that is executing a task and has resource surplus, the corresponding time t ij is the sum of the transportation time from task node A i to task object B j and the task execution time of this task working group;
[0035] Repeat the steps from "For the j-th task object B j , calculate the demand priority δ j of task object B j using the following formula" to "Optimize the resource scheduling scheme for the j-th task object " for each task object to obtain the resource scheduling scheme corresponding to each said task object, forming a resource scheduling scheme
[0036] Optionally, according to the resource scheduling scheme, perform path planning for each task working group to obtain the best path planning result, which specifically includes the following steps:
[0037] According to the resource scheduling scheme, the Dijkstra algorithm is used to plan the paths of each task workgroup from the task node to the task object, and the paths are changed according to the actual road conditions to obtain the optimal path planning result.
[0038] In a second aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the resource allocation method based on optimal path planning described in the first aspect.
[0039] In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the resource allocation method based on optimal path planning described in the first aspect.
[0040] In a fourth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the resource allocation method based on optimal path planning described in the first aspect.
[0041] According to the specific embodiments provided by the present application, the present application has the following technical effects:
[0042] The present application provides a resource allocation method and device based on optimal path planning. By using a dynamic programming method based on a greedy strategy to formulate a resource scheduling scheme, the dynamic programming method based on a greedy strategy is a method obtained by combining a greedy algorithm and a dynamic programming algorithm for formulating a task plan and generating a corresponding resource scheduling scheme. After obtaining the resource scheduling scheme, according to the resource scheduling scheme, it is convenient, fast, and efficient to plan the paths of each task workgroup to obtain the optimal path planning result. The present application combines a greedy algorithm and a dynamic programming algorithm to form a dynamic programming method based on a greedy strategy. Through this dynamic programming method based on a greedy strategy, a reasonable resource scheduling scheme can be accurately formulated, so as to facilitate efficient resource scheduling and optimal path planning, effectively improving the accuracy and reasonableness of resource allocation and enhancing the efficiency of resource allocation. Description of the Drawings
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0044] Figure 1 It is an application environment diagram of a resource allocation method based on optimal path planning in an embodiment of the present application.
[0045] Figure 2 The flowchart of a resource allocation method based on optimal path planning provided by an embodiment of the present application.
[0046] Figure 3 The structural schematic diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0047] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0048] To make the above objects, features, and advantages of the present application more obvious and understandable, the present application will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0049] The resource allocation method based on optimal path planning provided by the embodiments of the present application can be applied to the application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set separately, integrated on the server 104, placed on the cloud or other servers. The terminal 102 can send the application file and its application information to the server 104. After receiving the application file and its application information, for the application file and its application information, the server 104 formulates a resource scheduling plan according to the application information by using a dynamic programming method based on the greedy strategy; the dynamic programming method based on the greedy strategy refers to a method obtained by combining the greedy algorithm and the dynamic programming algorithm for formulating task plans and generating corresponding resource scheduling plans; according to the resource scheduling plan, path planning is performed on each task workgroup to obtain the best path planning result. The server 104 can feedback the obtained best path planning result to the terminal 102. In addition, in some embodiments, the resource allocation method based on optimal path planning can also be implemented by the server 104 or the terminal 102 alone. For example, the terminal 102 can directly perform resource allocation processing such as resource scheduling and path planning for the application file and its application information, or the server 104 can obtain the application file and its application information from the data storage system and perform resource allocation processing such as resource scheduling and path planning for the application file and its application information.
[0050] Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.
[0051] In an exemplary embodiment, as Figure 2 shown, a resource allocation method based on optimal path planning is provided. This method is executed by a computer device, and specifically can be executed alone by a computer device such as a terminal or a server, or jointly executed by a terminal and a server. In the embodiments of the present application, taking this method applied to Figure 1 the server 104 in it as an example for illustration, it includes the following steps S1 to S3. Among them:
[0052] Step S1, obtain the application information in the application file.
[0053] In this embodiment, step S1 of obtaining the application information in the application file specifically includes the following steps:
[0054] Step S11, use the task unit to receive the application files submitted by each demand unit.
[0055] Step S12, respectively parse each of the application files to obtain the application information.
[0056] In this embodiment, the demand unit mainly refers to the unit that submits the application file, and the application file records the requirements for resource allocation and scheduling planning proposed by the demand unit. The task unit mainly refers to the unit that receives the application files proposed by the demand unit, and performs resource allocation processes such as resource scheduling and path planning according to the application information in the application file, so as to meet the requirements for resource allocation and scheduling planning proposed by the demand unit.
[0057] In this embodiment, the task unit receives the application file and obtains its key application information. Specifically, analyze the task application content in the application file, analyze the unit it needs to support, whether there are duplicate applications, the type of resources applied for, the quantity of resources applied for, and whether the quantity and transportation capacity of all the task resource types of this task node can support this task operation, etc., so as to formulate a resource scheduling plan according to the location information of the application unit, the type of resources applied for, and the quantity of resources applied for in the application file.
[0058] In this embodiment, after a certain requirement unit counts the requirements for a certain resource at a certain time, it applies to the superior task unit. The application is in the form of sending an application file, and the content of the application file mainly includes requirement unit information, requirement type, required resource type, and required resource quantity. According to the parsed content, the task unit queries whether its own resource type meets the requirements. If not, it applies for a task to the superior task node again.
[0059] Step S2: According to the application information, use the dynamic programming method based on the greedy strategy to formulate a resource scheduling plan. Among them, the dynamic programming method based on the greedy strategy refers to a method obtained by combining the greedy algorithm and the dynamic programming algorithm for formulating a task plan and generating a corresponding resource scheduling plan.
[0060] In this embodiment, the first problem to be considered in resource scheduling and task execution is to deliver the resources to the designated location as early as possible within the specified time. On this basis, the number of task nodes used should be minimized as much as possible. Therefore, the dynamic programming method based on the greedy strategy is used here for solving. According to the principle of scheduling in descending order of the demand priority of task objects, for any plan To make the time the smallest, it is necessary to schedule resources from the task node with the least time to the jth task object B j If the total resource quantity of the task node is less than the demand quantity of the task node then select the task node with the least time to the task object B from the remaining task nodes and schedule resources, and so on, until the requirements of the task object B j are met. Similarly, under the existing resource support conditions, determine the resource scheduling plan for the task object B j until all the resource scheduling plans of all task objects are determined or all resources are scheduled. When formulating a resource scheduling plan, it is necessary to note whether the local resources are insufficient after being allocated to a demand object. When the transportation capacity is insufficient, it is necessary to calculate the time and compare whether to wait for the local transportation capacity or apply to the superior for a transportation task. If a new resource application task appears after formulating the resource scheduling plan and before completing the task, the task object needs to be incorporated into the model to re-formulate the resource scheduling plan. However, in this process, it is necessary to adjust the demand priority of the task object, re-order it, and then formulate the resource scheduling plan. j j+1 j+1 In this embodiment, step S2 formulates a resource scheduling plan according to the application information by using the dynamic programming method based on the greedy strategy, which specifically includes the following steps:
[0061] In this embodiment, step S2 formulates a resource scheduling plan according to the application information by using the dynamic programming method based on the greedy strategy, which specifically includes the following steps:
[0062] Step S21: Analyze the working status of each existing task working group, and screen out the task working groups that can execute tasks.
[0063] Step S22: According to the task working groups that can execute tasks and the application information, use the greedy algorithm to schedule the existing resources and transport capacity according to the time priority principle, and when the time consumption is the same, use the dynamic programming algorithm to schedule according to the principle of minimizing resource waste, so as to obtain the resource scheduling plan.
[0064] In this embodiment, in step S22, according to the task working groups that can execute tasks and the application information, use the greedy algorithm to schedule the existing resources and transport capacity according to the time priority principle, and when the time consumption is the same, use the dynamic programming algorithm to schedule according to the principle of minimizing resource waste, so as to obtain the resource scheduling plan, which specifically includes the following steps:
[0065] Step S221: According to the task working groups that can execute tasks and the application information, construct a resource scheduling optimization model.
[0066] In this embodiment, when constructing the resource scheduling optimization model, the resource scheduling optimization model is the basic model of the task link. For different resource request types, this resource scheduling optimization model will be somewhat different, specifically as follows:
[0067] Suppose there are m task nodes (A1, A2,..., A m ), A i can be a local task node or a task working group that is executing a task and still has resource surplus (such as a transport vehicle on a mission). The available amount of resource p for each service node A i is The task objects are n (B1, B2,..., B n ), and the resource demand of the jth task object B j is The transportation time from task node A i to task object B j is t ij . Let the resource scheduling plan for each task object be Among them, the resource scheduling plan d1, d2,... d k of the jth task object is a combination of a subsequence of the sequence 1, 2,..., m. represents the amount of resources supplied by the d i th task node, and there are also the following constraint relationships:
[0068]
[0069] Let the jth task object Bj The quantity of required resources is The required scheduling time is It is expressed as:
[0070]
[0071] For any This problem can be expressed as the following resource scheduling optimization model:
[0072]
[0073] Step S222: Use the greedy algorithm to solve the resource scheduling optimization model to obtain the resource scheduling plan.
[0074] In this embodiment, step S222 uses the greedy algorithm to solve the resource scheduling optimization model to obtain the resource scheduling plan, which specifically includes the following steps:
[0075] Step S2221: According to the resource scheduling optimization model, for the j-th task object B j , use the following formula to calculate the demand priority δ j of the task object B j , and arrange them in descending order according to the demand priority δ j to obtain the first arrangement result as B1, B2,..., B n :
[0076]
[0077]
[0078] Among them, δ j represents the demand priority of the j-th task object, λ j and γ j respectively represent the importance degree of the resource demand point and the resource demand rate of the j-th task object, λ + , λ - , γ + , γ - are respectively the positive ideal point and the negative ideal point of the importance degree of the resource demand point and the resource demand rate, R j is the proximity degree of the demand priority of the j-th task object to the positive ideal point, r j is the proximity degree of the demand priority of the j-th task object to the negative ideal point, w1 and w2 are coefficients, β k is the k-th index value; α is a marker value. When the marker value α is 1, it means that resources are allocated to this task object, and when the marker value α is 0, it means that no tasks are performed on this task object; w k is the index weight.
[0079] In this embodiment, the demand priority δ of the computing task object B j is calculated, j and they are arranged in descending order of the demand priority values as B1, B2, …, B n . For the k-th index value β k , when k takes different values, β k has different meanings. β1 is the urgency of the demand task borne by the task object, β2 is the ease of scheduling resources to the task object, β3 is the probability of completing the task within the specified time, and β4 is the deadline for completing the task. These are determined by experts scoring according to the environment, and it is stipulated that 0 ≤ β k ≤ 1. The index weight w k is determined according to the importance of the demand object's ability to resume task execution as soon as possible, and it is required that Since the demand priority of the demand object is a multi-objective decision-making problem, the ideal point method is used to solve it here. The positive ideal point is a hypothetical best solution, and its various objective values reach the best values among all solutions; the negative ideal point is another hypothetical worst solution, and each objective value reaches the worst value among all solutions. Since the positive ideal point cannot be achieved in actual applications, when the objective values of a certain solution are closest to the positive ideal point and at the same time farthest from the negative ideal point, then this solution is considered to be the best solution. In order to balance the differences in the distances of each objective from its ideal point, the relative closeness to the ideal point is usually used to judge the quality of the solution.
[0080] Step S2222: According to the position coordinates and working status of the task working group, calculate the time t j from each task node to the task object B ij .
[0081] In this embodiment, for the task working group on standby at this level, only the transportation time from the warehouse to the task object, the vehicle fleet preparation time, and the loading and unloading time need to be calculated; for the return vehicle after completing the task, the return time plus the transportation time from the warehouse to the task object, the vehicle fleet preparation time, and the loading and unloading time need to be calculated; for the vehicles that are currently performing tasks, there are the following two cases: one is to accept a new task and go to the new task object, and the time is the transportation time from the current position of the vehicle to the position of the task object and the loading and unloading time, and the other is that it needs to complete the task and then perform a new task after returning, and the time is the time still required to reach the destination plus the return time plus the time required from the warehouse to the new task object, the vehicle preparation time, and the loading and unloading time.
[0082] Step S2223: According to the time t j from each task node to the task object B ij , for the task node A i in accordance with the time t j for transporting to the task object Bij Arrange the values in ascending order to obtain the second arrangement result as A1, A2, …, A m , where when the total resource amount of A1 is not enough for the demand of the task object, then according to the second arrangement result, call the resources of A2, and so on to calculate the critical subscript k, and determine the resource scheduling scheme for the jth task object
[0083] Step S2224, for the resource scheduling scheme of the jth task object Optimize it. For the task working group that is executing a task and has resource surplus, the corresponding time t ij is the sum of the transportation time from task node A i to task object B j and the task execution time of this task working group.
[0084] For the task working group that is executing a task and has resource surplus, the time t of using this resource scheduling scheme ij cannot be simply calculated as the transportation time from task node A i to task object B j , but also needs to add the task execution time of this task working group.
[0085] Step S2225, repeat the process of Step S2221 to Step S2224 for each task object to obtain the resource scheduling scheme corresponding to each task object, and form the resource scheduling scheme
[0086] Step S223, based on the resource scheduling scheme, when a new application task appears, use the dynamic programming algorithm to dynamically adjust the resource scheduling scheme, and use the dynamically adjusted resource scheduling scheme as the resource scheduling scheme.
[0087] In this embodiment, when a new application task appears, if a new application task appears after the resource scheduling scheme is output and before reaching the destination task object point, if the resources of the current-level task meet the requirements of this task, then the new task object needs to be added to the task object list, and the task object list is updated to (B1, B2, …, B n , B n+1 ), and at the same time, it is necessary to update the demand priority of each task object. Determine the values of β1, β2, β3, and β4 by experts scoring according to the environment and specific conditions. After the new application task appears, it is necessary to re-score these four values of β1, β2, β3, and β4 to obtain the demand priority of the task object. β2 is the ease of scheduling resources to the task object, and this value will be adjusted according to the distance from the destination. For example, when formulating the resource scheduling scheme for the first time, task object B jThe value of β2 is 0, but when the resource scheduling plan is formulated for the second time, the resource is quickly transported to task object B. j When β2 is equal to 0.95, β4 is the effective period of completing the task. j The value of β4 will decrease when a new resource scheduling plan is formulated for a new application task. After calculating the demand priority of each task object, re-sort it and then update the task node list. It is necessary to include the task work group on the way to the first planned departure into the task node list and then re-formulate the resource scheduling plan.
[0088] In this embodiment, the difference between different resource request types mainly includes two parts. The first part is the difference in task node selection. Some task nodes may be task work groups that have not yet completed tasks at the same level, task work groups that are currently executing other resource transport vehicle tasks and are about to become empty, and task work groups that have completed other resource transport vehicle tasks and are on their way back empty. Some task nodes may be task work groups that have not yet completed tasks at the same level, task work groups that are executing the same type of tasks but have not yet completed tasks, and vehicles that have completed tasks and are on their way back. The second part is to calculate the time t ij Different models have different calculation time factors to consider. Some models calculate the time t from each task node to the task object. ij Only the transportation time from the task node to the task object and the preparation time before the team departs need to be considered. In some cases, the type of task node increases, so when calculating the time t from the task team that is performing other resource transport tasks and is about to be empty to the task object, ij When considering the time it takes for the task group to complete the task, it is also necessary to consider the time it takes for the task group to complete the task.
[0089] Step S3: According to the resource scheduling scheme, path planning is performed for each task working group to obtain the best path planning result.
[0090] In this embodiment, step S3 performs path planning for each task working group according to the resource scheduling scheme to obtain the best path planning result, which specifically includes the following steps:
[0091] According to the resource scheduling plan, the Dijkstra algorithm is used to plan the path of each task working group from the task node to the task object, and the path is changed according to the actual road conditions to obtain the best path planning result, ensuring that the task working group can reach the demand unit for submitting application documents faster.
[0092] After completing resource scheduling, according to the obtained resource scheduling plan, determine the coordinate positions of the dispatched task workgroups and task objects, and after determining the starting point and ending point of the route, plan the shortest path. In this embodiment, the idea of the greedy algorithm is adopted, and the Dijkstra algorithm is used to calculate the shortest path. According to the locally optimal solution obtained each time, the globally optimal solution is deduced.
[0093] The Dijkstra algorithm is a greedy algorithm for solving the single-source shortest path problem in a graph. It mainly divides the points into two point sets. Among them, the point set A represents the set of nodes for which the shortest path from the starting node to this point has been found, and the point set B represents the set of nodes for which the shortest path from the starting node to this point has not been found. Maintain a vector d, where d[i] represents the length of the shortest path from the starting node to node i, and then continuously perform the following operations: (1) Find the node in the point set B with the smallest d[i], i ∈ B, and this node is the candidate node to enter the point set A; (2) Update the distance of the adjacent node by comparing that the path from the current node to a certain adjacent node is shorter than the known path, and put this node into the point set A; (3) Select the node with the shortest distance in the point set B as the next node to visit; (4) End until all nodes are placed in the point set A or the shortest path to the node to be reached has been found.
[0094] In this embodiment, first, initialize the data, create a distance dictionary distances (distance) to record the shortest distance from each node to the starting node. Initially, the distances of all nodes are set to infinity, except that the distance of the starting node is set to 0; create a priority queue to pop nodes according to the distance priority; secondly, construct a list N of geographical coordinate positions, a road distance relationship matrix G, and a road detour coefficient matrix K; where N represents the longitude and latitude geographical coordinate positions of all nodes in the road network, G represents the road distance between every two nodes in the road network, where g mn represents the road distance between the m-th node and the n-th node, K represents the road detour coefficient matrix between every two nodes in the road network, where k mn represents the road detour coefficient between the m-th node and the n-th node; then enter the main loop, take out a point with the shortest distance to the starting node from the point set as the current node, the current distance is the distance from the current node to the adjacent node, if the current path is shorter than the known path, then update the distance, and then take out the node with the shortest distance from the point set as the current node until all the nodes in the point set are taken out. Finally, update the weights in real time. In practical applications, it may occur that a certain road cannot be passed temporarily, then it is necessary to update the road distance relationship matrix G in real time and re-enter the main loop to re-plan the path.
[0095] In this embodiment, an application file is received from a task unit, and key application information is obtained by analyzing the content of the application file. A task plan is formulated according to the application information in the application file to generate a resource scheduling plan. Finally, the best path planning is performed on the task working group according to the resource scheduling plan, which can assist in making decisions for task execution in the current environment and improve the intelligent level of decision-making.
[0096] This embodiment provides a resource allocation method and device based on optimal path planning, which can help make scientific judgments and efficient resource allocations quickly in rapidly changing situations, improve the overall collaboration ability and task execution ability, and thus ensure the smooth completion of tasks. At the time from the task start time to the task execution time, relevant task units will send application files to the task node, and the task node will make an auxiliary decision according to the task application to formulate a task plan to obtain a resource scheduling plan. After receiving the task resource planning and path planning information, the relevant task working group will transport resources along the specified path at the specified time. After the transported resources arrive, the resource status of the relevant task unit will change, and the real-time update of the resource status is beneficial to improving the accuracy of task decision-making.
[0097] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 3 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store application files, application information, best path planning results, and other contents. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a resource allocation method based on optimal path planning.
[0098] Those skilled in the art can understand that Figure 3 the structure shown in
[0099] In an exemplary embodiment, a computer device is provided, which includes a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0100] In an exemplary embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0101] In an exemplary embodiment, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0102] Those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above method embodiments. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0103] In this embodiment, through the resource allocation method that combines the greedy algorithm and the dynamic programming algorithm, by using the local fast optimization characteristics of the greedy algorithm and combining the advantages of the global optimal search of the dynamic programming algorithm, the utilization rate and response speed of resources can be improved, the situations of redundancy and conflict can be reduced, and at the same time, efficient and reasonable allocation can be maintained in a dynamic demand environment, global optimality can be achieved, and the accuracy and efficiency of resource allocation can be improved.
[0104] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0105] Specific examples are used in this article to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A resource allocation method based on optimal path planning, characterized in that: The resource allocation method based on optimal path planning includes: Obtain application information from application documents; According to the application information, a resource scheduling scheme is formulated using a dynamic programming method based on a greedy strategy; the dynamic programming method based on a greedy strategy refers to a method for formulating a task plan and generating a corresponding resource scheduling scheme obtained by combining a greedy algorithm with a dynamic programming algorithm; According to the resource scheduling scheme, path planning is performed for each task working group to obtain the best path planning result.
2. The resource allocation method based on optimal path planning according to claim 1, characterized in that: Obtain application information from the application documents, including: Using the task unit to receive the application documents submitted by each demand unit; Each of the application documents is parsed separately to obtain the application information.
3. The resource allocation method based on optimal path planning according to claim 1, characterized in that: According to the application information, a resource scheduling plan is formulated using a dynamic programming method based on a greedy strategy, including: Analyze the working status of each existing task group and select the task group that can perform the task; According to the task working group of the executable task and the application information, a greedy algorithm is used to schedule the existing resources and transportation capacity according to the time priority principle, and when the time consumption is the same, a dynamic programming algorithm is used to schedule according to the principle of minimum resource waste to obtain the resource scheduling plan.
4. The resource allocation method based on optimal path planning according to claim 3, characterized in that: According to the task working group of the executable task and the application information, a greedy algorithm is used to schedule the existing resources and transportation capacity according to the time priority principle, and when the time consumption is the same, a dynamic programming algorithm is used to schedule according to the principle of minimum resource waste to obtain the resource scheduling plan, which specifically includes: Constructing a resource scheduling optimization model according to the task working group of the executable task and the application information; Using a greedy algorithm to solve the resource scheduling optimization model to obtain the resource scheduling solution; Based on the resource scheduling scheme, when a new application task appears, a dynamic programming algorithm is used to dynamically adjust the resource scheduling scheme, and the dynamically adjusted resource scheduling scheme is used as the resource scheduling scheme.
5. The resource allocation method based on optimal path planning according to claim 4, characterized in that: According to the task working group of the executable task and the application information, a resource scheduling optimization model is constructed, which specifically includes: Assume there are task nodes (A1, A2, ..., A m )m, A i For the task nodes at this level or the task working group that is executing tasks and has resource surplus, each service node A i The available amount of resource p is (i=1,2,…,m), the task object is (B1,B2,…,B n )n, the jth task object B j The resource demand is (j=1,2,…,n), from task node A i To task object B j The transportation time is t ij , let the resource scheduling scheme of each task object be Among them, the resource scheduling plan for the jth task object d1,d2,…d k is a combination of subsequences of the sequence 1, 2, ..., m, Indicates the d i The amount of resources supplied by each task node, and there are the following constraints: Let the jth task object B j The amount of resources required is The required scheduling time is It is expressed as: For any The resource scheduling optimization model is expressed as:
6. The resource allocation method based on optimal path planning according to claim 5, characterized in that: The resource scheduling optimization model is solved by using a greedy algorithm to obtain the resource scheduling solution, which specifically includes: According to the resource scheduling optimization model, for the jth task object B j , the task object B is calculated using the following formula j The demand priority δ j , and according to the demand priority δ j Arrange them in descending order, and the first arrangement result is B1, B2, ..., B n : Among them, δ j represents the demand priority of the jth task object, λ j and γ j They represent the resource demand point importance and resource demand rate of the jth task object, λ + , - , γ + , γ - are the positive ideal point and negative ideal point of resource demand point importance and resource demand rate, respectively. j is the proximity between the demand priority of the jth task object and the positive ideal point, r j is the proximity between the demand priority of the jth task object and the negative ideal point, w1 and w2 are coefficients, β k is the kth index value; α is the label value; w k is the indicator weight; According to the location coordinates and working status of the task working group, calculate the distance from each task node to the task object B. j Time t ij ; According to each task node to task object B j Time t ij , for task node A i According to the transport to task object B j Time t ij The values are arranged from small to large, and the second arrangement result is A1, A2, ..., A m , where when the total amount of resources of A1 is not enough to meet the demand of the task object, then according to the second arrangement result, the resources of A2 are called again, and the critical subscript k is calculated and the resource scheduling plan of the jth task object is determined. Resource scheduling plan for the jth task object For the task working group that is executing tasks and has resource surplus, the corresponding time t ij For task node A i To task object B j The sum of the delivery time and the task execution time of the task working group; Repeat for each task object "For the jth task object B j , the task object B is calculated using the following formula j The demand priority δ j "To" the resource scheduling plan φ for the jth task object j The step of "optimizing" is performed to obtain a resource scheduling plan corresponding to each of the task objects, thereby forming a resource scheduling plan φ.
7. The resource allocation method based on optimal path planning according to claim 1, characterized in that: According to the resource scheduling scheme, path planning is performed for each task working group to obtain the best path planning result, which specifically includes: According to the resource scheduling scheme, the Dijkstra algorithm is used to plan the path of each task working group from the task node to the task object, and the path is changed according to the actual road conditions to obtain the best path planning result.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the resource allocation method based on optimal path planning as described in any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the resource allocation method based on optimal path planning described in any one of claims 1 to 7 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the resource allocation method based on optimal path planning described in any one of claims 1 to 7 is implemented.