Vehicle path planning method, device, readable storage medium and electronic device

By processing data through the path planning model and attention mechanism, the probability of vehicle selection of customers is optimized, which solves the problem of high calculation overhead of path planning in vehicle delivery services in the existing technology, and achieves efficient path selection strategies and low penalty allocation.

CN113778094BInactive Publication Date: 2024-09-06BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111074313.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-14
Publication Date
2024-09-06
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing vehicle delivery services, there is a problem of how to efficiently allocate vehicles to serve customers while minimizing vehicle path length and time window violation penalties. Existing methods are computationally expensive and difficult to obtain high-quality solutions.

Method used

By creating a path planning model, inputting customer and vehicle information, using matrix calculation and attention mechanism to process the data, setting the path recorder of the gated cycle unit, calculating the probability of the vehicle selecting the customer, and optimizing the path selection through the objective function expression, it is achieved Fast and efficient path planning.

Benefits of technology

It achieves rapid acquisition of efficient path selection strategies in a small amount of calculations, reduces computational overhead, improves the quality of allocation strategies, and reduces penalties for violating time windows.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113778094B
    Figure CN113778094B
Patent Text Reader

Abstract

The present application discloses a vehicle path planning method and device, the method comprising: creating a path planning model; inputting user information of each customer and initial information of each vehicle into the path planning model; calculating the user result data of each customer according to the preset parameters in the model and the input user information of each customer; setting a path recorder based on a gated cyclic unit for each vehicle within a preset time step, obtaining the current state value of each vehicle according to the preset parameters in the model and the path recorder of each vehicle; calculating the probability of each vehicle selecting each customer according to the current state value of each vehicle and the user result data of each customer; selecting a qualified customer for each vehicle according to the probability; the path planning model outputs the path selection result through a first preset method. Through the technical solution of the present invention, a small amount of calculation can quickly give a responsive solution and obtain an efficient path selection strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of vehicle dispatch control technology, and in particular to a vehicle path planning method, device, readable storage medium and electronic device. Background Art

[0002] In the prior art, the application of vehicle delivery services is becoming more and more common. Usually, in the process of vehicle delivery services, there are several customers and several vehicles. Each customer has a soft time window constraint. The vehicle is required to serve the customer within the specified time window as much as possible. Serving the customer outside the time window will be subject to certain penalties. Specifically, the size of the penalty is linearly related to the time when the customer is served and the distance from the customer's time window. Each vehicle has a rated load, and the sum of the cargo demands of the customers served by each vehicle cannot exceed the maximum load of the vehicle. How to minimize the sum of the path lengths of all vehicles after all customers are served and the penalties for violating the time window?

[0003] In order to solve this problem, the commonly used methods are heuristic algorithms. One type of method is intelligent optimization algorithm. This type of method often requires a lot of time to iteratively search the solution space to solve the problem, which is time-consuming and easy to fall into the local optimal solution. Another type of method is the local search method, which starts from an initial solution and searches and selects the optimal solution from the neighborhood of the current solution at each step. The quality of the solution is very dependent on the quality of the initial solution. There is also a type of construction algorithm that generates the solution corresponding to the problem through specific rules. The above methods often require a lot of computational overhead or it is difficult to obtain high-quality solutions. Therefore, how to obtain an efficient allocation strategy to generate high-quality solutions has become an urgent problem to be solved. Summary of the invention

[0004] The present invention provides a vehicle path planning method, device, readable storage medium and electronic device, which can quickly provide a responsive solution by performing a small amount of calculation through a path planning model, thereby obtaining an efficient path selection strategy.

[0005] In a first aspect, the present invention provides a vehicle path planning method, comprising:

[0006] Create a path planning model;

[0007] Inputting user information of each customer and initial information of each vehicle into the path planning model;

[0008] The user result data of each customer is obtained by calculating according to the preset parameters in the model and the user information of each customer input;

[0009] At a preset time step, a path recorder based on a gated recurrent unit is set for each vehicle, and the current state value of each vehicle is obtained according to the preset parameters in the model and the path recorder of each vehicle;

[0010] Calculate the probability of each vehicle selecting each customer based on the current state value of each vehicle and the user result data of each customer;

[0011] Select eligible customers for each vehicle based on probability;

[0012] The path selection result in the path planning model is outputted through a first preset method.

[0013] Optionally, the step of calculating the user result data of each customer according to the preset parameters in the model and the input user information of each customer specifically includes:

[0014] Initially encoding the user information of each customer according to the preset parameters by using a matrix calculation method;

[0015] The initial encoded data is processed using an attention mechanism to obtain result data for each customer.

[0016] Optionally, the step of providing a path recorder based on a gated cycle unit for each vehicle specifically includes:

[0017] Set the starting position information of each vehicle;

[0018] A local route recorder is assigned to each vehicle, and a global route recorder is set.

[0019] Preferably, obtaining the current state value of each vehicle according to the preset parameters in the model and the path recorder of each vehicle specifically includes:

[0020] Get the value of the local path recorder and the value of the global path recorder on each vehicle;

[0021] The current state value of each vehicle is obtained in turn according to the value of the local path recorder and the value of the global path recorder on each vehicle.

[0022] Further preferably, the probability of each vehicle selecting each customer is calculated according to the current state value of each vehicle and the user result data of each customer, specifically including:

[0023] Obtaining the initial customer probability value that the current vehicle will serve according to the current state value of each vehicle, the result data of each customer and the preset parameters;

[0024] When the customer has been served or the demand exceeds the remaining load of the vehicle, the initial customer probability value is set to a preset value, and the probability of each vehicle selecting each customer is calculated according to the preset algorithm based on the initial customer probability value.

[0025] Optionally, after the path planning model outputs the path selection result by the first preset method, the method further includes:

[0026] The path planning model calculates the path length of each vehicle and the penalty value for violating the time window when each vehicle in the path serves the customer through the objective function expression according to the path selection result;

[0027] The objective function value is calculated by the objective function expression according to the path length of each vehicle and the penalty value of each vehicle violating the time window when serving customers;

[0028] Wherein, the objective function expression is as follows:

[0029] Select the path length for each vehicle in the route

[0030] The penalty value for violating the time window when selecting each vehicle in the route to serve the customer

[0031] The objective function value is obtained based on the path length of each vehicle and the penalty value for violating the time window when each vehicle serves a customer.

[0032] Among them, r i represents the path of the i-th vehicle, represents the jth point in the path of vehicle i, t i,j represents the time it takes for vehicle i to reach the jth customer in its route, e j ,l j represents the time window corresponding to each vehicle, α and β are the coefficients of the penalty term, when t i,j <e j When k e =1, otherwise 0, when t i,j > j When k l =1, otherwise 0.

[0033] Optionally, the method further comprises:

[0034] The second preset method and the third preset method are used to train the preset parameters in the path planning model so that the path planning model obtains the best result.

[0035] In a second aspect, the present invention provides a vehicle path planning device, comprising:

[0036] Create a module for creating a path planning model;

[0037] A management module, used to input user information of each customer and initial information of each vehicle into the path planning model;

[0038] A strategy module, used to calculate the user result data of each customer according to the preset parameters in the model and the input user information of each customer; and also used to output the path selection result in the path planning model by a first preset method;

[0039] The strategy module is also used to set a path recorder based on a gated cyclic unit for each vehicle within a preset time step, and obtain the current state value of each vehicle according to the preset parameters in the model and the path recorder of each vehicle; it is also used to calculate the probability of each vehicle selecting each customer according to the current state value of each vehicle and the user result data of each customer; and it is also used to select qualified customers for each vehicle according to the probability.

[0040] Optionally, the device further includes: a training module, configured to train preset parameters in the path planning model using a second preset method and a third preset method, so that the path planning model obtains an optimal result.

[0041] In a third aspect, the present invention provides a computer-readable storage medium for storing computer-readable instructions, which, when executed by a computer, enables the computer to execute the vehicle path planning method.

[0042] In a fourth aspect, the present invention provides an electronic device, comprising: a processor, a memory and a bus; the memory is used to store execution instructions, the processor is connected to the memory through the bus, and when the electronic device is running, the processor executes the execution instructions stored in the memory so that the processor executes the vehicle path planning method.

[0043] The present invention provides a vehicle path planning method, device, readable storage medium and electronic device. The method creates a path planning model, calculates in the model according to the user information of each customer and the information of each vehicle to obtain the user result data of each customer and the current state value of each vehicle, and calculates the probability of each vehicle selecting each customer, thereby selecting a qualified customer for each vehicle according to the probability, outputting the path selection result through a first preset method, and through the technical solution of the present invention, a small amount of calculation can quickly give a response solution, thereby obtaining an efficient path selection strategy. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of this specification or the existing technical solutions, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0045] Figure 1 A schematic diagram of a flow chart of a path planning method provided by an embodiment of the present invention;

[0046] Figure 2 A schematic diagram of a flow chart of another path planning method provided by an embodiment of the present invention;

[0047] Figure 3 A schematic diagram of the structure of a path planning device provided by an embodiment of the present invention;

[0048] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0050] like Figure 1 As shown, an embodiment of the present invention provides a path planning method, including:

[0051] Step 101, creating a path planning model;

[0052] Step 102, inputting user information of each customer and initial information of each vehicle into a path planning model;

[0053] Step 103, calculating the user result data of each customer according to the preset parameters in the model and the input user information of each customer;

[0054] Step 104, within a preset time step, a path recorder based on a gated recurrent unit is set for each vehicle, and the current state value of each vehicle is obtained according to the preset parameters in the model and the path recorder of each vehicle;

[0055] Step 105, calculating the probability of each vehicle selecting each customer according to the current state value of each vehicle and the user result data of each customer;

[0056] Step 106, selecting qualified customers for each vehicle according to probability;

[0057] Step 107: output the path selection result in the path planning model through a first preset method.

[0058] In this embodiment, the method creates a path planning model, calculates in the model according to the user information of each customer and the information of each vehicle to obtain the user result data of each customer and the current state value of each vehicle, and calculates the probability of each vehicle selecting each customer, thereby selecting qualified customers for each vehicle according to the probability, and outputs the path selection result through the first preset method. Through the technical solution of the present invention, a small amount of calculation can quickly give a response solution, and an efficient path selection strategy is obtained.

[0059] In an optional embodiment of the present invention, the user result data of each customer is obtained by calculating according to the preset parameters in the model and the input user information of each customer, specifically including:

[0060] Initially encoding the user information of each customer according to the preset parameters by using a matrix calculation method;

[0061] The initial encoded data is processed using an attention mechanism to obtain result data for each customer.

[0062] In an optional embodiment of the present invention, the step of providing a path recorder based on a gated cycle unit for each vehicle specifically includes:

[0063] Set the starting position information of each vehicle;

[0064] A local route recorder is assigned to each vehicle, and a global route recorder is set.

[0065] In a preferred embodiment of the present invention, the current state value of each vehicle is obtained according to the preset parameters in the model and the path recorder of each vehicle, specifically including:

[0066] Get the value of the local path recorder and the value of the global path recorder on each vehicle;

[0067] The current state value of each vehicle is obtained in turn according to the value of the local path recorder and the value of the global path recorder on each vehicle.

[0068] In a further preferred embodiment of the present invention, the probability of each vehicle selecting each customer is calculated based on the current state value of each vehicle and the user result data of each customer, specifically including:

[0069] Obtaining the initial customer probability value that the current vehicle will serve according to the current state value of each vehicle, the result data of each customer and the preset parameters;

[0070] When the customer has been served or the demand exceeds the remaining load of the vehicle, the initial customer probability value is set to a preset value, and the probability of each vehicle selecting each customer is calculated according to the preset algorithm based on the initial customer probability value.

[0071] In an optional embodiment of the present invention, after the path planning model outputs the path selection result by the first preset method, the following further comprises:

[0072] The path planning model calculates the path length of each vehicle and the penalty value for violating the time window when each vehicle in the path serves the customer through the objective function expression according to the path selection result;

[0073] The objective function value is calculated by the objective function expression according to the path length of each vehicle and the penalty value of each vehicle violating the time window when serving customers;

[0074] Wherein, the objective function expression is as follows:

[0075] Select the path length for each vehicle in the route

[0076] The penalty value for violating the time window when selecting each vehicle in the route to serve the customer

[0077] The objective function value is calculated by the objective function expression based on the path length of each vehicle and the penalty value of each vehicle violating the time window when serving customers.

[0078] Among them, r i represents the path of the i-th vehicle, represents the jth point in the path of vehicle i, t i,j represents the time it takes for vehicle i to reach the jth customer in its route, e j ,l j represents the time window corresponding to each vehicle, α and β are the coefficients of the penalty term, when t i,j <e j When k e =1, otherwise 0, when t i,j > j When k l =1, otherwise 0.

[0079] In an optional embodiment of the present invention, the method further comprises:

[0080] The second preset method and the third preset method are used to train the preset parameters in the path planning model so that the path planning model obtains the best result.

[0081] Based on the technical solution provided by the present application, the technical solution is explained in detail below. Figure 2 As shown, it is a processing flow chart of a possible implementation of the path planning method provided by the present application.

[0082] Step 201: Create a path planning model.

[0083] In a possible implementation, in the above step 201, the path planning model specifically includes: a management module and a strategy module, wherein the strategy module includes a first encoding unit and a second decoding unit.

[0084] Step 202: Input the user information of each customer and the initial information of each vehicle into the first encoding unit of the strategy module through the management module.

[0085] In a possible implementation, the above step 201 specifically includes: inputting the user information of each customer and the initial information of each vehicle into the first encoding unit of the strategy module in the path planning model through the management module.

[0086] For example, the management module generates a series of questions based on a certain probability distribution, including N c customers and N v vehicles, assign customers and their corresponding visit order to each vehicle to obtain the best result, where each customer can be represented by c = (x, y, d, s, e, l), where x, y are the customer's coordinate location information, d is the customer's cargo demand, s is the customer's service time, that is, the time required for the vehicle to unload the cargo after arriving at the customer, e, l are time window restrictions, and vehicles visiting customers outside the time window will be penalized. Each vehicle has a rated load, and all vehicles start from the origin (x0, y0) and eventually return to the origin.

[0087] Step 203: The first encoding unit performs initial encoding on the user information of each customer through matrix calculation to obtain initial encoding data.

[0088] In a possible implementation, the above step 203 specifically includes: constructing a matrix group according to preset parameters and user information of each customer, completing initial encoding of user information of each customer, and obtaining initial encoding data;

[0089] Specifically, the encoding can be performed according to the following formula:

[0090]

[0091] Among them, c i Represents the user information of each customer, w0 and b0 are preset parameters.

[0092] Step 204: The first encoding unit uses multiple attention layers to process the initial encoding data and preset parameters to obtain user result data, and inputs the user result data into the second decoding unit.

[0093] In a possible implementation, in the above step 204, the attention layer specifically includes a multi-head attention layer (Multi-head attention, MHA) and a feed-forward calculation layer (feed-forward, FF), and the MHA layer adopts a multi-head attention mechanism;

[0094] In a specific implementation, the first encoding unit uses multiple attention layers to process the initial encoding data and preset parameters to obtain user result data, which specifically includes: the first encoding unit uses a multi-head attention layer to process the initial encoding data and preset parameters to obtain a first data group, inputs the first data group into a deep residual network to obtain a residual attention data group, and then performs a batch standardization operation on the residual attention data group to obtain a second data group, inputs the second data group into a feedforward calculation layer, and the feedforward calculation layer processes the second data group to obtain a third data group, inputs the third data group into a deep residual network to obtain a residual attention data group, and then performs a batch standardization operation on the residual attention data group to obtain a fourth data group, and uses the fourth data group as the user result data.

[0095] Specifically, the calculation formula of the attention mechanism is:

[0096]

[0097] The calculation formula of the multi-head attention mechanism is:

[0098] head i =Attention(QW i Q ,KW i K ,VW i V )# (3)

[0099] MultiHead(Q,K,V)=Concat(head1,head2,…,head h )W O # (4)

[0100] Among them, assume that the output of the l-1th layer is Then the calculation method of Q, K, and V is

[0101] In the above formula, d K Represents the length of the vector of parameters K.

[0102] Specifically, the formula for inputting a data set into a deep residual network is:

[0103] X0=F(X)+X# (5)

[0104] Where X represents the input of the MHA layer or FF layer.

[0105] Specifically, when performing the batch normalization operation, assuming that m problems are calculated simultaneously, the output of the MHA layer or the FF layer is X, then the formula for performing the batch normalization operation is:

[0106]

[0107]

[0108]

[0109]

[0110] Among them, ∈ is a very small number, γ and β are preset parameters.

[0111] Specifically, the formula used by the feedforward computing layer to process the second data group to obtain the third data group is:

[0112] FF(X)=W2(Relu(W1X+b1))+b2# (10)

[0113] Repeat the above formulas (2)-(10) N times l After several times, the output of the first encoding unit is:

[0114] Step 205: The second decoding unit sets the current time as the time step, allocates a local path recorder to each vehicle, and sets a global path recorder.

[0115] In a possible implementation, in the above step 205, every time the set time step is reached, the second decoding unit cyclically executes steps 205 to 207;

[0116] Among them, both the local path recorder and the global path recorder are path recorders based on the gated recurrent unit (GRU);

[0117] In this embodiment, the location information and current load of the vehicle are input into the local path recorder, and the location information of each vehicle and the load corresponding to each vehicle are input into the global path recorder.

[0118] Step 206 , the second decoding unit obtains the value of the local path recorder of each vehicle and the value of the global path recorder, and calculates the current state value of each vehicle according to preset parameters, the value of the local path recorder of each vehicle and the value of the global path recorder.

[0119] In a possible implementation, in step 206, the second decoding unit obtains the value of the local path recorder of each vehicle and the value of the global path recorder, specifically including: the second decoding unit calculates the value of the local path recorder of each vehicle and the value of the global path recorder according to a formula;

[0120] Specifically, the formula for calculating the value of the path recorder is:

[0121] r=σ(W ir x+b ir +W hr h+b hr )# (11)

[0122] z=σ(W iz x+b iz +W hz h+b hz )# (12)

[0123] n=tanh(W in x+b in +r*(W hn h+b hn ))#(13)

[0124] h′=(1-z)*n+z*h# (14)

[0125] Where x is the current state of the vehicle, including the vehicle's position and current load, and h is the hidden state of the path recorder at the previous moment.

[0126] In a possible implementation, the current state value of each vehicle is calculated based on the preset parameters, the value of the local path recorder of each vehicle, and the value of the global path recorder, specifically including: the second decoding unit adds the value of the global path recorder and the value output of the local path recorder of vehicle i to obtain the current state value s of vehicle i i .

[0127] Step 207, the second decoding unit calculates the probability of each vehicle selecting each customer according to the current state value of each vehicle and the user result data of each customer;

[0128] In a possible implementation, the above step 207 specifically includes: the second decoding unit calculates the current state value of each vehicle and the user result data of each customer according to a formula to obtain the probability of each vehicle selecting each customer;

[0129] Specifically, the calculation formula for the probability of each vehicle selecting each customer is:

[0130] q i =W q s i # (15)

[0131]

[0132]

[0133] In one possible implementation, in order to prevent the vehicle from selecting a currently unavailable customer, such as a customer who has been served or a customer whose demand exceeds the vehicle's remaining capacity, if customer j is currently unavailable, c is set i,j =-∞, based on this setting, the probability of the vehicle selecting each customer is calculated. The specific calculation formula is:

[0134]

[0135] Step 208, the second decoding unit selects a qualified customer for each vehicle according to the calculated probability;

[0136] In a possible implementation, in the above step 208, the second decoding unit selects a qualified customer for each vehicle according to the calculated probability. Specifically, the second decoding unit selects a qualified customer for each vehicle according to the calculated probability.

[0137] For example, if the condition is met, that is, the probability value is the largest, the second decoding unit selects the customer with the largest probability value for the current vehicle.

[0138] Step 209: The second decoding unit outputs the path selection result by using a first preset method.

[0139] In a possible implementation, in the above step 209, the second decoding unit outputs the information of each vehicle in the route selection result and the corresponding user information of each customer to the management module;

[0140] In a possible implementation, the management module calculates the path length of each vehicle and the penalty value for violating the time window when each vehicle in the selected path serves a customer through the objective function expression according to the path selection result; calculates the objective function value through the objective function expression according to the path length of each vehicle and the penalty value for violating the time window when each vehicle serves a customer;

[0141] For example, the objective function expression can be expressed as:

[0142]

[0143]

[0144]

[0145] In a possible implementation, the method further includes the following steps:

[0146] Step 210, using the second preset method and the third preset method to train the preset parameters in the path planning model so that the path planning model obtains the best result.

[0147] In a possible implementation, the above step 210 is specifically as follows: for a path selection problem with multiple customers and multiple vehicles, the path planning model outputs path selection result data, and assuming that a preset parameter in the path planning model is represented as a first parameter, the parameter in the path planning model can be trained according to the expected target and the path selection result data according to a preset formula;

[0148] In a possible implementation, the preset formula is:

[0149]

[0150] It is assumed that the preset parameter in the path planning model is represented as the first parameter θ, represents the desired goal, and Cost(R|P) represents the solution obtained based on the path selection result data.

[0151] In one possible implementation, the above step 210 specifically includes: assuming that the model training has E cycles, each cycle has M batches of data, and each batch has B questions, the preset parameters in the path planning model can be trained according to the third preset method to enable the path planning model to obtain the best solution.

[0152] Specifically, the third preset method is a gradient descent method, which can be expressed as:

[0153]

[0154] Among them, logp θ (R i |P i ) represents the path planning model according to the problem P i Get the solution R i The logarithm of the probability, R i is the order of each customer point, and formula (18) gives the probability of selecting each customer.

[0155] For example, if the solution to the problem is 1, 2, 3, then the probability of getting this solution is the logarithm of the probability of 1 when choosing 1 plus the logarithm of the probability of 2 when choosing 2 plus the logarithm of the probability of 3 when choosing 3.

[0156] in, Indicates partial derivative of network parameters;

[0157] Specifically, step 211 is as follows: according to a set of preset parameters in the participating path planning model, the results of M problems are calculated, and the first target value Cost (R i |P i ), and then calculate the results of M problems based on another set of parameters in the path planning model, and calculate the second target value Cost (R i |P i ), the gradient descent method is used to calculate the results according to the first target value and the second target value, and the preset parameters are updated according to the obtained results.

[0158] Based on the same concept as the embodiment of the method of the present invention, Figure 3 As shown, the embodiment of the present invention further provides a vehicle path planning device 300, comprising:

[0159] A creation module 301 is used to create a path planning model;

[0160] A management module 302, for inputting user information of each customer and initial information of each vehicle into a path planning model;

[0161] The strategy module 303 is used to calculate the user result data of each customer according to the preset parameters in the model and the input user information of each customer; and is also used to output the path selection result in the path planning model through the first preset method;

[0162] The strategy module 303 is also used to set a path recorder based on a gated cyclic unit for each vehicle within a preset time step, and obtain the current state value of each vehicle according to the preset parameters in the model and the path recorder of each vehicle; it is also used to calculate the probability of each vehicle selecting each customer according to the current state value of each vehicle and the user result data of each customer; it is also used to select qualified customers for each vehicle according to the probability.

[0163] In an optional embodiment of the present invention, the device further includes: a training module, which is used to train the preset parameters in the path planning model using the second preset method and the third preset method so that the path planning model obtains the best result.

[0164] Figure 4 : is a schematic diagram of the structure of an electronic device of an embodiment of this specification. At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the electronic device may also include hardware required for other services.

[0165] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0166] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0167] In one possible implementation, the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, and can also obtain the corresponding computer program from other devices to form a vehicle path planning device at the logical level. The processor executes the program stored in the memory to implement the path planning method provided in any embodiment of the present invention through the executed program.

[0168] The path planning execution method provided in the above embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0169] The steps of the method disclosed in the embodiments of this specification can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0170] The embodiments of this specification also propose a computer-readable storage medium for storing computer-readable instructions. When the computer-readable instructions are executed by a computer, the computer executes the vehicle path planning method.

[0171] The devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0172] For the convenience of description, the above devices are described as various units or modules according to their functions. Of course, when implementing this specification, the functions of each unit or module can be implemented in the same or multiple software and / or hardware.

[0173] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, devices or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0174] This specification is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses, and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0175] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0176] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0177] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0178] Memory may include non-permanent storage in a computer-readable storage medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable storage medium.

[0179] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0180] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0181] It will be appreciated by those skilled in the art that the embodiments of this specification may be provided as methods, devices or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0182] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0183] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0184] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A vehicle path planning method, characterized in that: include: Create a path planning model; Inputting user information of each customer and initial information of each vehicle into the path planning model; The user result data of each customer is obtained by calculating according to the preset parameters in the model and the user information of each customer input; At a preset time step, a path recorder based on a gated recurrent unit is set for each vehicle, and the current state value of each vehicle is obtained according to the preset parameters in the model and the path recorder of each vehicle; Calculate the probability of each vehicle selecting each customer based on the current state value of each vehicle and the user result data of each customer; Select eligible customers for each vehicle based on probability; Outputting the path selection result in the path planning model by a first preset method; The user result data of each customer is obtained by calculating according to the preset parameters in the model and the user information of each customer input, specifically including: Initially encoding the user information of each customer according to the preset parameters by using a matrix calculation method; Using the attention mechanism to process the data obtained by the initial encoding to obtain result data of each customer; The path recorder based on the gated cycle unit is provided for each vehicle, specifically including: Set the starting position information of each vehicle; Assign a local path recorder to each vehicle and set a global path recorder; The method of obtaining the current state value of each vehicle according to the preset parameters in the model and the path recorder of each vehicle specifically includes: Get the value of the local path recorder and the value of the global path recorder on each vehicle; The current state value of each vehicle is obtained in turn according to the value of the local path recorder on each vehicle and the value of the global path recorder; the probability of each vehicle selecting each customer is calculated according to the current state value of each vehicle and the user result data of each customer, specifically including: Obtaining the initial customer probability value that the current vehicle will serve according to the current state value of each vehicle, the result data of each customer and the preset parameters; When a customer has been served or the demand exceeds the remaining load of the vehicle, the initial customer probability value is set to a preset value, and the probability of each vehicle selecting each customer is calculated according to the initial customer probability value according to the preset algorithm. The calculation formula of the attention mechanism is: The calculation formula of the multi-head attention mechanism is: i =Attention(QW i Q ,KW i K ,VW i V )(3) MultiHead(Q,K,V)=Concat(head1,head2,…,head h )W O (4) Among them, assume that the output of the l-1th layer is Then the calculation method of Q, K, and V is In the above formula, d K Represents the vector length of parameter K; The formula for inputting the data set into the deep residual network is: X0=F(X)+X(5); where X represents the input of the MHA layer or the FF layer; When performing batch standardization, it is assumed that m problems are calculated simultaneously, and the output of the MHA layer or FF layer is X. Then the formula for performing batch standardization is: Wherein, ∈ is a very small number, γ and β are preset parameters; the feedforward calculation layer processes the second data set to obtain the third data set using the formula: FF(X) = W2(Relu(W1X+b1))+b2(10); repeat the above formulas (2)-(10) N times l After several times, the output of the first encoding unit is: The second decoding unit sets the current time as the time step, allocates a local path recorder to each vehicle, and sets a global path recorder; wherein the local path recorder and the global path recorder are both path recorders based on the gated loop unit; the vehicle's position information and current load are input into the local path recorder, and the position information of each vehicle and the load corresponding to each vehicle are input into the global path recorder; the second decoding unit obtains the value of the local path recorder of each vehicle and the value of the global path recorder, and calculates the current state value of each vehicle according to the preset parameters, the value of the local path recorder of each vehicle and the value of the global path recorder; the second decoding unit obtains the value of the local path recorder of each vehicle and the value of the global path recorder, specifically including: the second decoding unit calculates the value of the local path recorder of each vehicle and the value of the global path recorder according to the formula; the formula for calculating the value of the path recorder is: r = σ(W ir x+b ir +W hr h+b hr )(11) z=σ(W iz x+b iz +W hz h+b hz ) (12) n=tanh(W in x+b in +r*(W hn h+b hn )) (13) h′ = (1-z)*n+z*h (14) Where x is the current state of the vehicle, including the vehicle's position and current load, and h is the hidden state of the path recorder at the previous moment.

2. The method according to claim 1, characterized in that After the path planning model outputs the path selection result by the first preset method, the method further includes: The path planning model calculates the path length of each vehicle and the penalty value for violating the time window when each vehicle in the path serves the customer through the objective function expression according to the path selection result; The objective function value is calculated by the objective function expression according to the path length of each vehicle and the penalty value of each vehicle violating the time window when serving customers; Wherein, the objective function expression is as follows: Select the path length for each vehicle in the route The penalty value for violating the time window when selecting each vehicle in the route to serve the customer The objective function value is obtained based on the path length of each vehicle and the penalty value for violating the time window when each vehicle serves a customer. Among them, r i represents the path of the i-th vehicle, v ri(j) represents the jth point in the path of vehicle i, t i,j represents the time it takes for vehicle i to reach the jth customer in its route, e j ,l j represents the time window corresponding to each vehicle, α and β are the coefficients of the penalty term, when t i,j <e j When k e =1, otherwise 0, when t i,j > j When k l =1, otherwise 0.

3. The method according to claim 2, characterized in that The method also includes: using a second preset method and a third preset method to train preset parameters in the path planning model so that the path planning model obtains the best result.

4. A vehicle path planning device, based on the vehicle path planning method according to any one of claims 1 to 3, characterized in that: include: Create a module for creating a path planning model; A management module, used to input user information of each customer and initial information of each vehicle into the path planning model; The strategy module is used to calculate the user result data of each customer according to the preset parameters in the model and the input user information of each customer; it is also used to output the path selection result in the path planning model through a first preset method; the strategy module is also used to set a path recorder based on a gated cyclic unit for each vehicle within a preset time step, and obtain the current state value of each vehicle according to the preset parameters in the model and the path recorder of each vehicle; it is also used to calculate the probability of each vehicle selecting each customer according to the current state value of each vehicle and the user result data of each customer; it is also used to select qualified customers for each vehicle according to the probability.

5. A computer-readable storage medium, characterized in that: Used to store computer-readable instructions, when the computer-readable instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 3.

6. An electronic device, characterized in that: include: processor, memory, and bus; The memory is used to store execution instructions, the processor is connected to the memory via the bus, and when the electronic device is running, the processor executes the execution instructions stored in the memory, so that the processor executes the method as described in any one of claims 1 to 3.