Vending machine and control method and system thereof
By combining the A* and Dijkstra algorithms and introducing dynamic programming, hierarchical backtracking and reinforcement learning technologies, the path planning method of vending machines solves the path planning problem under the influence of multi-objective states, achieving more efficient and accurate path planning.
Patent Information
- Application Number
- CN202411979634.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-25
AI Technical Summary
The existing vending machines fail to comprehensively consider the impact of multi-target states such as power, distance and time when building the optimal path, resulting in insufficient accuracy and efficiency of path planning.
The path planning method combining the A* algorithm and the Dijkstra algorithm is adopted, and dynamic programming, hierarchical backtracking and reinforcement learning technology is introduced to define the power consumption model and cost function, and the node transfer strategy is optimized through the backtracking method and reinforcement learning, and the weight is dynamically adjusted to meet actual needs.
It has achieved flexible response to insufficient power or sudden demands in dynamic changing scenarios, comprehensively balancing multiple target needs such as time, power and distance, improving the accuracy and efficiency of path planning, and avoiding the local optimal traps in traditional methods.
Smart Images

Figure CN119886484A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vending machine control, and in particular to an automatic vending machine and a control method and system thereof. Background Art
[0002] In the operation of a vending machine, if the control center inputs a control instruction to the vending machine to move to a target position, the vending machine needs to instantly build an optimal path based on the target position and the current position and reach the target position based on this path. This not only enables remote control of the vending machine, but also ensures that the vending machine reaches the preset target position to sell goods.
[0003] At present, when constructing the optimal path, the vending machine is affected by power, distance and time during movement; and the planning method commonly used at present is a greedy algorithm or a simple dynamic planning method, which can only guarantee the global optimality and cannot comprehensively weigh the overall situation. Therefore, how to consider the influence of the multi-objective state of the vending machine (power, distance, etc.) and combine the dynamic change scenario method to realize the path planning of the vending machine to improve the accuracy and efficiency of the path planning of the vending machine is a problem that needs to be solved at present. Summary of the invention
[0004] In view of the above-mentioned shortcomings of the prior art, the present invention provides a vending machine and a control method and system thereof, which can effectively solve the problem that the prior art does not take into account the influence of the multi-target state of the vending machine, and the dynamically changing scene method to realize the path planning of the vending machine, which affects the accuracy and efficiency of the path planning of the vending machine.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0006] The present invention provides a vending machine control method, which at least comprises the following steps:
[0007] The vending machine receives the input control command and specifies the target location to be reached;
[0008] By A * The algorithm is combined with the Dijkstra algorithm to plan the path of the vending machine.
[0009] Define power consumption models based on environmental factors and clarify power consumption between nodes;
[0010] The total priority is defined by defining the heuristic function and the cost function, and the path planning is performed by the backtracking method to obtain the final path set;
[0011] Dynamic programming and path hierarchical backtracking optimization nodes are introduced to determine the path with the minimum cost to re-execute path planning, where:
[0012] Define the cost function through environmental constraints, define the state table based on the cost function and the optimal cumulative cost, and calculate the cumulative cost from each node to the target node based on the state table;
[0013] Reinforcement learning is introduced to optimize the node transfer strategy, and dynamic feedback is provided according to the immediate reward to adjust the target weight of the cost function. The candidate point set is screened based on hierarchical backtracking and the final path set is re-optimized to generate mobile control instructions for the vending machine and execute them.
[0014] Furthermore, the expression of the power consumption model is:
[0015] E(n i ,n j )=distance(n i ,n j )×β1+weight crg ×β2+(1+α1T+α2W+α3P+α4R)
[0016] Among them, E(n i ,n j ) represents the current node n i To adjacent node n j The power consumed, β1 represents the power consumption per unit distance, weight crg represents the cargo weight, β2 is the weight coefficient, T represents the temperature, W represents the wind speed, P represents the road slope, R represents the road type, and α1, α2, α3, and α4 are the corresponding weight coefficients respectively.
[0017] Furthermore, the overall priority is determined as follows:
[0018] Define the heuristic function h(n i ), then there is,
[0019]
[0020] Among them, x m ,y m Indicates the coordinates of the final target node, x n ,y n Indicates the coordinates of the current node;
[0021] Define the cost function g(n i ), then there is,
[0022]
[0023] Among them, distance(n i ,n i+1 ) represents the length of the path segment, E(ni ,n i+1 ) represents the power consumption of the path segment, t move (n i ,n i+1 ) represents the moving time, m represents the total number of nodes in the path, where:
[0024]
[0025] Where v represents the moving speed of the vending machine;
[0026] Based on the heuristic function h(n i ) and the cost function g(n i ) and sum to get the total priority f(n i ).
[0027] Furthermore, by constructing an open list and a closed list, we select f(n i ) the smallest node and moves it to the closed list, thereby checking the adjacent nodes n′ of the smallest node j , and perform the following steps:
[0028] Calculate the current node n i To the adjacent node n′ j The path segment length distance(n i ,n′ j );
[0029] Calculate the current node n i To the adjacent node n′ j The power consumption E(n i ,n′ j );
[0030] Calculate the heuristic estimate h(n′) from the neighboring node n′j to the final target node j );
[0031] Calculate the adjacent nodes n′ j The actual cost g(n′ j ):
[0032] g(n′)=g(n)+distance(n i ,n′ j )+E(n i ,n′ j )
[0033] Calculate the total priority f(n′ j ), obtained by summing the heuristic function and the actual cost function;
[0034] Update the open list, where
[0035] If the adjacent node n′ j If it is not in the open list, add it and set the predecessor node;
[0036] If the adjacent node n′ j In the open list, and the new actual cost function g(n′ j ) is smaller, then update g(n′ j ) and f(n′ j ), and set the current node ni as the predecessor node;
[0037] Using the backtracking method to construct the path, we have,
[0038] P={n1,n2,···,n m}
[0039] Among them, P represents the final path set, which is arranged in order from the starting node to the final target node, n1 represents the starting node of the path, and n m Represents the final destination node of the path.
[0040] Furthermore, the expression of the state table is:
[0041]
[0042] Among them, DP[i][t] represents the state table, describing the current node n i The cumulative minimum cost at time t, φ(i) represents the current node n i DP[k][t+1] represents the set of all adjacent nodes of k To the target node n m The optimal cumulative cost, C(n i ,n k ) means from the current node n i To adjacent node n k The cost function of .
[0043] Furthermore, the cost function is expressed as:
[0044] C(n i ,n k )=ω d ·d(n i ,n k )+ω e ·e(n i ,n k )+ω t ·t(n i ,n k )
[0045] Among them, d(n i ,nk ) represents the distance cost, e(n i ,n k ) represents the power consumption cost, t(n i ,n k ) represents the time cost, ω d ,ω e ,ω t Represents the corresponding weight coefficient.
[0046] Furthermore, reinforcement learning optimizes the node transfer strategy and provides dynamic feedback to adjust the target weight of the cost function based on the immediate reward: π(a|s)=P(a|s)∝exp(-Q(s,a))
[0047] Among them, π(a|s) represents the probability of selecting action a in state s, action a represents the transfer from the current node to the adjacent node, state s represents the current node and time state (ni, t), and Q(s, a) represents the quality value of action a;
[0048] Update the value function to make Q(s,a) close to the actual cumulative benefit, then we have,
[0049]
[0050] Among them, α represents the learning rate, γ represents the depreciation factor, and R(s,a) represents the immediate reward. represents the maximum quality value of all possible actions in the next state s′ after executing action a, and a′ represents the action in the next state s′;
[0051] ω d ,ω e ,ω t According to the immediate reward R(s,a), we have:
[0052]
[0053] Among them, ω j represents the current weight corresponding to target j, η represents the adjustment step size, R j (s,a) represents the contribution of the immediate reward to target j, Σ k Rk(s,a) represents the total contribution of the immediate reward to all objectives.
[0054] Furthermore, the method of screening the candidate point set based on hierarchical backtracking and re-optimizing the final path set is:
[0055] According to the cost function C(n i ,n k ) hierarchical screening of candidate nodes, then we have,
[0056]
[0057] Among them, ζ(t) represents the set of candidate points at time t, n g represents a candidate node, g represents the index in the node set, and ε represents the cost threshold of the candidate node;
[0058] Perform dynamic path update to get the optimized final path set P:
[0059] P={n′1,n′2,···,n′ m}
[0060] Among them, n′1 represents the optimized starting point node, n′ m Represents the final target node after optimization;
[0061] The path meets the following conditions:
[0062]
[0063] Among them, Cost total Represents the minimum comprehensive cost of the entire path, n′ i represents the i-th optimized node in the path, and m represents the total number of nodes in the path.
[0064] The present invention also provides:
[0065] The control system of the vending machine is implemented according to the control method of the vending machine mentioned above. You may refer to the above method and will not elaborate on it here.
[0066] A vending machine, applied to the control method of the above-mentioned vending machine, comprising:
[0067] Goods storage devices are used to store goods, usually with partition designs for placing goods of different specifications;
[0068] A spring-loaded cargo lane provided in a cargo storage structure for dispensing bottled or canned beverages;
[0069] Transmission device, used to push the spring cargo channel to deliver the goods;
[0070] And a delivery port arranged in the cargo storage device is used for delivering the cargo.
[0071] Compared with the known prior art, the technical solution provided by the present invention has the following beneficial effects:
[0072] By optimizing route planning, it can flexibly respond to problems such as insufficient power or sudden demand in dynamically changing scenarios, while comprehensively balancing multiple objective requirements such as time, power and distance;
[0073] The path optimization method combines dynamic programming, hierarchical backtracking and reinforcement learning to achieve the global optimal path planning, avoid the local optimal trap in traditional methods, and dynamically adjust the weights through instant reward signals to adapt to actual needs;
[0074] In addition, the introduction of hierarchical backtracking reduces the complexity of path calculation, and the reinforcement learning strategy further improves real-time performance and adaptability, thereby reducing energy consumption and providing efficiency assistance for the intelligent operation of unmanned vending machines. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0076] Figure 1 It is a schematic diagram of the overall method of the present invention. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0078] The present invention will be further described below in conjunction with the embodiments.
[0079] Example 1 (see Figure 1 ): A control method for a vending machine comprises the following steps:
[0080] The vending machine receives the input control command and obtains the target position to which the vending machine needs to move through the control command. The control command is usually the command information input by the control center. Based on the target position and the current position of the vending machine, A * The algorithm is combined with the Dijkstra algorithm to plan the path of the vending machine so that the vending machine reaches the target location.
[0081] In the above, the method for planning the path of the vending machine is:
[0082] S100, define current node n i (x i ,y i ), x i ,yi Indicates the coordinates of the current node. In path planning, the environment (such as streets, roads, etc.) is usually discretized into a grid or topological graph. Each discrete unit or a point in the graph can be regarded as a node. For example, in a street map, each intersection or crossroad can be a node.
[0083] S200, define current node n i To adjacent node n j The path segment length distance(n i ,n j )(In path planning, the length of the path segment directly affects the power consumption and driving time), then,
[0084]
[0085] Among them, x j ,y j n i and adjacent nodes n j The coordinates of
[0086] S300, define a power consumption model of the vending machine based on environmental factors (currently, the vending machine has a built-in battery, so that it can reach the target location based on the current location. Therefore, when constructing the path, it is necessary to consider the power factor, starting from the current node n i To adjacent node n j Power consumption), where environmental factors include temperature, wind speed, road slope and road type, then:
[0087] E(n i ,n j )=dis tan ce(n i ,n j )×β1+weight crg ×β2+(1+α1T+α2W+α3P+α4R)
[0088] Among them, E(n i ,n j ) represents the current node n i To adjacent node n j The power consumed, β1 represents the power consumption per unit distance, the unit is power / meter, weight crgrepresents the weight of the cargo, β2 is the weight coefficient, T represents the temperature, W represents the wind speed (as the temperature rises or the wind speed increases, the power consumption will increase accordingly, and the same is true for the power affected by subsequent features), P represents the road slope (the unit is angle, uphill is positive, downhill is negative), R represents the road type (different road types are assigned corresponding values, such as 1 for flat roads, 2 for rugged roads, etc.), α1, α2, α3, and α4 are the corresponding weight coefficients respectively.
[0089] S400, define heuristic function and cost function:
[0090] Define the heuristic function h(n i ), which represents the shortest distance from the current node to the final target node, then,
[0091]
[0092] Among them, x m ,y m Indicates the coordinates of the final target node, x n ,y n Indicates the coordinates of the current node;
[0093] Define the cost function g(n i ), which represents the actual cost from the starting point to the current node. Considering the length of the path segment, the power consumption and the moving time, we have,
[0094]
[0095] Among them, distance(n i ,n i+1 ) represents the length of the path segment, E(n i ,n i+1 ) represents the power consumption of the path segment, t move (n i ,n i+1 ) represents the moving time, m represents the total number of nodes in the path, where:
[0096]
[0097] Where v represents the moving speed of the vending machine.
[0098] Furthermore, based on the heuristic function h(n i ) and the cost function g(n i ) and sum to get the total estimated cost f(n i ) (i.e., total priority), which represents the total estimated cost from the starting point to the target node.
[0099] S500: Execute path planning of vending machine:
[0100] Construct an open list, where the open list is a priority queue that stores the nodes to be processed, and the priority is based on f(n i ) to determine, each time f(n i ) The smallest node is processed. This process is to ensure that the system optimally explores the path, minimizes the amount of calculation, and can quickly find the shortest path from the starting point to the target;
[0101] Construct a closed list to store processed nodes to avoid repeated processing and improve computing efficiency;
[0102] Select f(n) from the open list i ) and moves it to the closed list (at this time, the selected node represents the node that is most likely to lead to the target on the current path), thereby checking n i The neighboring nodes n′ j , and perform the following steps:
[0103] Determine the path segment length: Calculate the current node n i To the adjacent node n′ j The path segment length distance(n i ,n′ j ), (same as above, no further details here);
[0104] Determine power consumption: Calculate the current node n i To the adjacent node n′ j The power consumption E(n i ,n′ j )(The same as above, no further details here);
[0105] Determine the heuristic function: Calculate the number of nodes n′ from the neighboring nodes j The heuristic estimate h(n′) to the final target node j )(Refer to the above and will not be repeated here);
[0106] Determine the actual cost function: Calculate the neighboring nodes n′ j The actual cost g(n′ j ), including the path segment length, moving time and power consumption, then we have,
[0107] g(n′)=g(n)+dis tan ce(n i ,n′ j )+E(n i ,n′ j )
[0108] Calculate the total priority f(n′) in the same way as above j), according to the sum of the heuristic function and the actual cost function (for the minimum f(n′ j ) is considered the optimal next path choice).
[0109] S600, update the open list, then there is,
[0110] If the adjacent node n′ j If it is not in the open list, add it and set the predecessor node;
[0111] If the adjacent node n′ j In the open list, and the new actual cost function g(n′ j ) is smaller, then update g(n′ j ) and f(n′ j ), and sets the current node ni as the predecessor node.
[0112] It should be noted that in this solution, since the vending machine needs to consider the impact of power when moving, if there is a charging station on the path, the charging time T needs to be considered. ch arg e For the total time t total The location and charging time of the charging station will affect the choice of route, especially in the case of long distance or low battery.
[0113]
[0114] Where m represents the total number of nodes, t move (n i ,n i+1 ) represents the current node n i To node n i+1 moving time.
[0115] Furthermore, based on the above scheme, the backtracking method is used to construct the path (backtracking means starting from the final target node to the starting point node, and finally outputting the path in the correct order), backtracking from the final target node to the starting point, and gradually obtaining the path to ensure that the unmanned vending machine can reach the destination according to the optimal path, then,
[0116] P={n1,n2,···,n m}
[0117] Among them, P represents the final path set, which is arranged in order from the starting node to the final target node, n1 represents the starting node of the path, and n m Represents the final destination node of the path.
[0118] It is worth noting that, considering the latest time T for reaching the target position max(preset time length, generally speaking, the latest time is the content of the received control instruction, where the control instruction is usually issued by the control center of the vending machine for the vending machine to combine the situation of the instruction information), therefore, when planning the path, it is necessary to ensure that t total No more than T max , otherwise the path is considered infeasible.
[0119] Furthermore, considering that the above-mentioned backtracking method for constructing paths may lead to inefficient performance and repeated calculations, in this solution, dynamic programming and path hierarchical backtracking are used to optimize node selection to find the path with the minimum comprehensive cost, as follows:
[0120] Define the state table DP[i][t], which represents the current node n i The cumulative minimum cost at time t;
[0121] Dynamic programming calculates the minimum cumulative cost of each node by recursion:
[0122]
[0123] Among them, φ(i) represents the current node n i DP[k][t+1] represents the set of all adjacent nodes of k To the final destination node n m The optimal cumulative cost, C(n i ,n k ) means from the current node n i To adjacent node n k The cost function is introduced by introducing environmental constraints, including distance, power consumption and time to define the cost function. It can select the global optimal path by integrating multiple factors, rather than being limited to a single goal. When the environment changes (such as the remaining power), the cost function can adaptively adjust the weight to ensure that the path planning is consistent with the current demand. Therefore, the cost function is:
[0124] C(n i ,n k )=ω d ·d(n i ,n k )+ω e ·e(n i ,n k )+ω t ·t(n i ,n k )
[0125] Among them, d(n i ,n k ) represents the distance cost, e(n i ,nk ) represents the power consumption cost, t(n i ,n k ) represents the time cost, ω d ,ω e ,ω t represents the corresponding weight coefficient;
[0126] Adjacent nodes are used to adapt to the real-time environment (such as dynamic changes in path costs) to flexibly adjust the global path according to changes in local paths, avoiding the irrationality of static initial paths.
[0127] Furthermore, by optimizing the node transfer strategy through reinforcement learning, we have:
[0128] π(a|s)=P(a|s)∝exp(-Q(s,a))
[0129] Among them, π(a|s) represents the probability of selecting action a in state s, action a represents the transfer from the current node to the adjacent node, and state s represents the current node and time state (n i ,t), Q(s,a) represents the quality value of action a, which means the expected cumulative benefit from state s to the target node via a;
[0130] Among them, the value function is updated to make Q(s,a) close to the actual cumulative benefit, then,
[0131]
[0132] Among them, α represents the learning rate, which ranges from [0,1], controls the impact of each update on the current Q(s,a), and balances the new and old information. γ represents the depreciation factor, which ranges from [0,1], weighs the relative importance of immediate rewards and future rewards. When it is close to 1, it pays more attention to long-term benefits. R(s,a) represents the immediate reward, which is defined by the cost function, R(s,a)=-C(n i ,n k ), immediate feedback of the benefit of the current action, It represents the maximum quality value of all possible actions in the next state s′ after executing action a, describing the selection of the best action to update the current Q(s,a). a′ represents the possible actions in the next state s′, which is used to find the best action.
[0133] Reinforcement learning is used to provide adaptive strategies for path planning, dynamically optimize transfer behaviors, and adjust path selection rules based on actual feedback.
[0134] In order to dynamically balance multiple optimization objectives (such as distance, power, time, etc.) and enhance the multi-objective adaptability of path planning, the following are required:
[0135] Based on the ω in the above scheme d,ω e ,ω t According to the adaptive adjustment of the immediate reward R(s,a), we have:
[0136]
[0137] Among them, ω j represents the current weight corresponding to target j (category, such as time consumption, distance, power consumption), and represents the relative importance of the jth factor in the cost function, such as distance, power consumption, and time. η represents the adjustment step size, ranging from [0,1], which controls the magnitude of each weight adjustment. A smaller η ensures a smooth adjustment, while a larger η can accelerate the convergence of the weight. R j(s,a) It represents the contribution of the immediate reward to the target j, describing the direct benefit or cost of action a to a specific target (such as distance, power consumption, etc.) in state s, which is usually inversely proportional to the corresponding cost function term. k R k (s,a) represents the total contribution of the immediate reward to all goals, which is used for normalization to ensure that the contribution ratio of each goal is comparable;
[0138] Therefore, according to the feedback signal of the immediate reward, each target weight ω is automatically updated j , so that the weight distribution is more in line with the actual scene requirements, and when the environment changes and causes a significant change in the immediate reward of a certain target, the weight ω j It will respond and adjust quickly to ensure that the model can dynamically balance multi-objective requirements and improve the flexibility and accuracy of path planning or strategy selection.
[0139] Based on the above scheme, according to the cost function C(n i ,n k ) hierarchical screening of candidate nodes, then we have,
[0140]
[0141] Among them, ζ(t) represents the set of candidate points at time t, storing the nodes that meet the cost conditions for the next step of path update and optimization, n g Represents a candidate node, g represents the index in the node set, describing the number of a candidate node, and screening out nodes close to the optimal solution. ε represents the cost threshold of the candidate node. Then, in the process of path generation, high-priority nodes are screened layer by layer to reduce the computational complexity and ensure the global optimal solution. That is, the path is gradually optimized through the hierarchical structure, and the cost and candidate set of each node are defined hierarchically to improve the robustness of path generation. It is ensured that each layer of the path gradually reaches the global optimal on the basis of local optimization, so as to solve the local optimal trap problem caused by the mutual influence between layers in the path search problem.
[0142] Then, the dynamic path update is performed, and the path is dynamically adjusted through the candidate node set ζ(t) to generate the final path with the minimum cost, and the optimized final path set P is obtained:
[0143] P={n′1,n′2,···,n′ m}
[0144] Among them, n′1 represents the optimized starting point node, n′ m Represents the final target node after optimization;
[0145] It is worth noting that the path satisfies the following conditions:
[0146]
[0147] Among them, Cost total Represents the minimum comprehensive cost of the entire path, describes the sum of the costs of measuring the generated path, and optimizes the path to meet the global optimum, n′ i represents the i-th optimized node in the path, and m represents the total number of nodes in the path, which determines the length of the path.
[0148] Therefore, based on the above scheme, if the optimal path is determined, a mobile control instruction is generated to the vending machine so that the vending machine can reach the target location based on the optimal path, thereby improving the convenience and efficiency of the vending machine reaching the target location.
[0149] Finally, the present invention also provides a vending machine, which is applied to the control method of the vending machine mentioned above, and comprises:
[0150] Goods storage devices are used to store goods, usually with partition designs for placing goods of different specifications;
[0151] A spring-loaded cargo lane provided in a cargo storage structure for dispensing bottled or canned beverages;
[0152] Transmission device, used to push the spring cargo channel to deliver the goods;
[0153] And a delivery port arranged in the cargo storage device (such as a box) for delivering the cargo.
[0154] It should be noted that the structure of the vending machine mentioned above is a conventional structure of current vending machines, and this solution does not impose too many restrictions on this structure.
[0155] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A vending machine control method comprising the following steps: The vending machine receives the input control command and specifies the target location to be reached; By A * The algorithm is combined with the Dijkstra algorithm to plan the path of the vending machine, which is characterized by: Define power consumption models based on environmental factors and clarify power consumption between nodes; The total priority is defined by defining the heuristic function and the cost function, and the path planning is performed by the backtracking method to obtain the final path set; Dynamic programming and path hierarchical backtracking optimization nodes are introduced to determine the path with the minimum cost to re-execute path planning, where: Define the cost function through environmental constraints, define the state table based on the cost function and the optimal cumulative cost, and calculate the cumulative cost from each node to the target node based on the state table; Reinforcement learning is introduced to optimize the node transfer strategy, and dynamic feedback is provided according to the immediate reward to adjust the target weight of the cost function. The candidate point set is screened based on hierarchical backtracking and the final path set is re-optimized to generate mobile control instructions for the vending machine and execute them.
2. The vending machine control method according to claim 1, characterized in that: The expression of the power consumption model is: E(n i ,n j )=distance(n i ,n j )×β1+weight crg ×β2+(1+α1T+α2W+α3P+α4R) Among them, E(n i ,n j ) represents the current node n i To adjacent node n j The power consumed, β1 represents the power consumption per unit distance, weight crg represents the cargo weight, β2 is the weight coefficient, T represents the temperature, W represents the wind speed, P represents the road slope, R represents the road type, and α1, α2, α3, and α4 are the corresponding weight coefficients respectively.
3. The vending machine control method according to claim 1, characterized in that: The method for determining the overall priority is: Define the heuristic function h(n i ), then there is, Among them, x m ,y m Indicates the coordinates of the final target node, x n ,y n Indicates the coordinates of the current node; Define the cost function g(n i ), then there is, Among them, distance(n i ,n i+1 ) represents the length of the path segment, E(n i ,n i+1 ) represents the power consumption of the path segment, t move (n i ,n i+1 ) represents the moving time, m represents the total number of nodes in the path, where: Where v represents the moving speed of the vending machine; Based on the heuristic function h(n i ) and the cost function g(n i ) and sum to get the total priority f(n i ).
4. The vending machine control method according to claim 3, characterized in that: By constructing an open list and a closed list, select f(n i ) the smallest node and moves it to the closed list, thereby checking the adjacent nodes n′ of the smallest node j , and perform the following steps: Calculate the current node n i To the adjacent node n′ j The path segment length distance(n i ,n′ j ); Calculate the current node n i To the adjacent node n′ j The power consumption E(n i ,n′ j ); Calculate from the adjacent node n′ j The heuristic estimate h(n′) to the final target node j ); Calculate the adjacent nodes n′ j The actual cost g(n′ j ): g(n′)=g(n)+distance(n i ,n′ j )+E(n i ,n′ j ) Calculate the total priority f(n′ j ), obtained by summing the heuristic function and the actual cost function; Update the open list, where If the adjacent node n′ j If it is not in the open list, add it and set the predecessor node; If the adjacent node n′ j In the open list, and the new actual cost function g(n′ j ) is smaller, then update g(n′ j ) and f(n′ j ), and the current node n i Set as the predecessor node; Using the backtracking method to construct the path, we have, P={n1,n2,···,n m } Among them, P represents the final path set, which is arranged in order from the starting node to the final target node, n1 represents the starting node of the path, and n m Represents the final destination node of the path.
5. The automatic vending machine control method according to claim 4, characterized in that: The expression of the state table is: Among them, DP[i][t] represents the state table, describing the current node n i The cumulative minimum cost at time t, φ(i) represents the current node n i DP[k][t+1] represents the set of all adjacent nodes of k To the final destination node n m The optimal cumulative cost, C(n i ,n k ) means from the current node n i To adjacent node n k The cost function of .
6. The automatic vending machine control method according to claim 5, characterized in that: The expression of the cost function is: C(n i ,n k )=ω d ·d(n i ,n k )+ω e ·e(n i ,n k )+ω t ·t(n i ,n k ) Among them, d(n i ,n k ) represents the distance cost, e(n i ,n k ) represents the power consumption cost, t(n i ,n k ) represents the time cost, ω d ,ω e ,ω t Represents the corresponding weight coefficient.
7. The automatic vending machine control method according to claim 6, characterized in that: The method of optimizing the node transfer strategy through reinforcement learning and adjusting the target weight of the cost function by providing dynamic feedback according to the immediate reward is as follows: π(a|s)=P(a|s)∝exp(-Q(s,a)) Among them, π(a|s) represents the probability of selecting action a in state s, and Q(s,a) represents the quality value of action a; To update the value function, we have: Among them, α represents the learning rate, γ represents the depreciation factor, R(s,a) represents the immediate reward, and a′ represents the action in the next state s′; ω d ,ω e ,ω t According to the immediate reward R(s,a), we have: Among them, ω j represents the current weight corresponding to target j, η represents the adjustment step size, R j(s,a) represents the contribution of the immediate reward to target j, Σ k R k(s,a) Represents the total contribution of immediate rewards to all objectives.
8. The vending machine control method according to claim 5, characterized in that: The method of screening the candidate point set based on hierarchical backtracking and re-optimizing the final path set is: According to the cost function C(n i ,n k ) hierarchical screening of candidate nodes, then we have, Among them, ζ(t) represents the set of candidate points at time t, n g represents a candidate node, g represents the index in the node set, and ε represents the cost threshold of the candidate node; Perform dynamic path update to get the optimized final path set P: P={n′1,n′2,···,n′ m } Among them, n′1 represents the optimized starting point node, n′ m Represents the final target node after optimization; The path meets the following conditions: Among them, Cost total Represents the minimum comprehensive cost of the entire path, n′ i represents the i-th optimized node in the path, and m represents the total number of nodes in the path.
9. A vending machine control system, characterized in that: The system is implemented according to the vending machine control method described in claim 1.
10. A vending machine, applied to the control method of the vending machine according to claim 1, characterized in that: include: Cargo storage device, used for storing goods; A spring-loaded cargo lane provided in a cargo storage structure for dispensing bottled or canned beverages; Transmission device, used to push the spring cargo channel to deliver the goods; And a delivery port arranged in the cargo storage device is used for delivering the cargo.
Citation Information
Cited By
Intelligent mobile unmanned selling cabinet and movement control method
CN121634967A