Unmanned vehicle path planning method and device based on autonomous path planning model
By introducing the method of composite priority and importance sampling weights into the unmanned vehicle path planning model, the problem of poor sample data weight distribution in the existing technology is solved, and the accuracy and robustness of the autonomous vehicle path planning are improved. ensure the ability to handle unexpected situations in complex environments.
Patent Information
- Application Number
- CN202410572330.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-08-27
AI Technical Summary
Existing unmanned vehicle path planning models have problems in the weight distribution of sample data, resulting in poor model training results and low accuracy of autonomous path planning. It is especially difficult to ensure safety when dealing with unexpected situations.
Using a method based on the autonomous planning path model, by recording the current position, actions and rewards of the unmanned vehicle, calculating the composite priority, using priority exponential decay allocation and importance sampling weight, updating the experience playback array to improve the training effect of the model.
It improves the accuracy and robustness of autonomous vehicle path planning, ensures that unexpected situations can be effectively handled in complex environments, and improves the training effect of the model and the accuracy of path planning.
Smart Images

Figure CN118550290A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of unmanned vehicle path planning, and in particular to an unmanned vehicle path planning method and device based on an autonomous planning path model. Background Art
[0002] In the traditional experience replay mechanism, sample data is sampled only by random sampling and used for model training to update parameters, but different sample data have different importance. Assuming that autonomous behavior decision-making is used to train autonomous behavior decision-making of unmanned vehicles, most of the samples in the experience replay array are normal driving situations of vehicles, and only a few samples are unexpected situations, such as vehicles next to them forcibly changing lanes, pedestrians crossing the road, and police blocking roads and requiring detours. The importance of samples in the experience replay array is obviously different. There are a large number of samples of normal driving of vehicles, and normal driving situations are easy to handle, and the possibility of error is very small. There are very few samples of unexpected situations, but they are extremely important. If they are not handled properly, the car will be destroyed and people will die. Therefore, samples of unexpected situations should have higher weights and receive more attention. These two types of samples should not be treated equally. Therefore, the experience replay mechanism in the prior art has poor weight distribution of sample data, resulting in poor training effect of the model and low accuracy of autonomous planning path of unmanned vehicles. Summary of the invention
[0003] The purpose of the present invention is to provide a method and device for constructing an autonomous planning path model, which can improve the accuracy of unmanned vehicle path planning.
[0004] To achieve the above object, the present invention provides the following solutions:
[0005] In a first aspect, the present invention provides a method for unmanned vehicle path planning based on an autonomous planning path model, the method comprising:
[0006] When the unmanned vehicle interacts with the environment, the current position, action, reward generated by executing the action, and the position of the unmanned vehicle at each moment are recorded, and the current position, action, reward generated by executing the action, and the position of the unmanned vehicle at the next moment are combined into a four-tuple experience and stored in the experience pool to obtain an initial sample sequence;
[0007] Traversing the experience pool, calculating the composite priority of each quadruple experience, and obtaining a composite priority array;
[0008] Marking the trajectory of each of the four-tuple experiences in the initial sample sequence, and updating the composite priority array using a priority exponential decay allocation method to obtain an updated composite priority array;
[0009] The updated composite priority and the corresponding four-tuple experience are stored in the experience replay array according to the marked track; the importance sampling weight of each four-tuple experience in the experience replay array is calculated, and the experience replay array is sampled according to the importance sampling weight to obtain the sampled four-tuple experience;
[0010] The parameters of the autonomous planning path model are iteratively updated using the sampled quadruple experience to obtain the trained autonomous planning path model, which includes a policy network, a value network, and a target value network.
[0011] The trained policy network is used to perform online path planning for the unmanned vehicle, and the trained policy network gives the action of the unmanned vehicle according to the current position of the unmanned vehicle.
[0012] Furthermore, when the unmanned vehicle interacts with the environment, the four-tuple experience at time t is recorded as the current position, action, reward generated by executing the action, and the position at the next moment, and the composite priority of each four-tuple experience is calculated, including:
[0013] Calculating an immediate reward priority using the reward generated by the execution of the action;
[0014] Calculating the timing difference error priority using the timing difference error of the quadruple experience recorded at time t;
[0015] The composite priority is obtained by using the immediate reward priority and the temporal difference error priority.
[0016] Furthermore, the calculation formula of the immediate reward priority is:
[0017]
[0018] in, is the immediate reward priority of the i-th quadruple experience, i ranges from 1 to n, n is the number of quadruple experiences, r i is the reward in the i-th quadruple experience, || represents the absolute value, ∈ is a constant, and ∝ indicates proportionality.
[0019] The calculation formula of the timing differential error priority is:
[0020] p TDi ∝|δ i |+∈
[0021] Among them, p TDi is the temporal difference error priority of the i-th quadruple experience, δ i is the empirical time series difference error of the i-th quadruple, || represents the absolute value, ∈ is a constant, and ∝ indicates proportionality.
[0022] Furthermore, the calculation formula of the composite priority is:
[0023]
[0024]
[0025] Among them, rank(i) represents the order of the i-th quadruple experience in descending order of immediate reward priority. TD (i) indicates the order of the i-th quadruple experience according to the priority of the time difference error in descending order, rank s (i) indicates that the i-th quadruple experience is sorted in the composite reverse order of immediate reward priority and temporal difference error priority, P(i) is the composite priority of the i-th quadruple experience, μ and is the composite coefficient, and
[0026] Furthermore, the composite priority array is updated by using the priority exponential decay allocation method to obtain an updated composite priority array, including:
[0027] When recording a new quadruple experience, calculate the preset attenuation steps of the new quadruple experience, attenuate the composite priority of the new quadruple experience by the preset number of steps, and then distribute the attenuated composite priority to other quadruple experiences in the same trajectory to obtain an updated composite priority array.
[0028] Furthermore, the calculation formula of the priority decay allocation method is:
[0029] P SJ (n-1) = max{P(n)·ρ,P(n-1)}
[0030] P SJ (n-2) = max{P(n)·ρ 2 ,P(n-2)}
[0031] P SJ (n-3)=max{P(n)·ρ 3 ,P(n-3)} .......
[0033] P SJ (nw) = max{P(n)·ρ n-w ,P(1)}
[0034] Among them, ρ is the attenuation factor, W is the preset number of steps, P SJ (n-1) is the composite priority of the n-1th four-tuple experience after attenuation, P(n) is the composite priority of the nth four-tuple experience, and max is the maximum value.
[0035] Furthermore, the calculation formula of the preset number of steps is:
[0036] P(n)·ρ w ≤0.01;
[0037]
[0038] Where n is the number of quadruple experiences, P(n) is the composite priority of the nth quadruple experience, W is the preset number of steps, ρ is the attenuation factor, and ρ W is the attenuation factor after W attenuation preset steps.
[0039] Furthermore, the calculation formula of the importance sampling weight is:
[0040]
[0041]
[0042] Among them, k is the kth quadruple experience, w k is the importance sampling weight of the k-th quadruple experience, N is the preset number of quadruple experiences stored in the experience playback array, β is a hyperparameter, P(k) is the composite priority of the k-th quadruple experience, η is a hyperparameter, P(k) η is the nth power of the composite priority of the kth quadruple experience, m is the number of quadruple experiences stored in the experience playback array, ∑ m (P(k) η ) is the sum of the n-th powers of the composite priorities of the m four-tuple experiences.
[0043] Furthermore, the use of the sampled quadruple experience to iteratively update the parameters of the autonomous planning path model to obtain the trained autonomous planning path model includes:
[0044] The current position in the sampled quadruple experience is input into the policy network to obtain the action of the unmanned vehicle, and the next position in the sampled quadruple experience is input into the policy network to obtain the next action of the unmanned vehicle; the current position and the action are input into the value network to output the value of the action, and the next position and the next action are input into the target value network to obtain the value of the next action.
[0045] Iteratively train the policy network according to the value of the action and the action, update the parameters of the policy network, iteratively train the value network according to the value of the next action and the next action, update the parameters of the value network, and obtain a trained autonomous planning path model.
[0046] In a second aspect, the present invention provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the unmanned vehicle path planning method based on the autonomous planning path model as described in any one of the above claims.
[0047] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0048] The present invention plans the driving path of the unmanned vehicle by using an autonomous planning path model, uses importance sampling weights to perform sampling to obtain sampled quadruple experiences, uses the sampled quadruple experiences to calculate the loss function of the policy network and the loss function of the value network, and uses the stochastic gradient descent method to iteratively update the parameters of the autonomous planning path model according to the loss function of the policy network and the loss function of the value network to obtain a trained autonomous planning path model, wherein the composite priority array of the quadruple experiences is attenuated and allocated to obtain an updated composite priority array, and the updated composite priority is used to calculate the importance sampling weight of each quadruple experience in the experience reply data, so as to achieve different weights for the quadruple experiences according to different degrees of importance, thereby improving the training effect of the autonomous planning path model and further improving the accuracy of the autonomous planning path of the unmanned vehicle. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] 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 will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic flow chart of a method for unmanned vehicle path planning based on an autonomously planned path model provided in Example 1 of the present invention;
[0051] Figure 2 A schematic diagram of a method for calculating the empirical composite priority of a quadruple;
[0052] Figure 3 A flow chart for storing a new four-tuple experience back into the array;
[0053] Figure 4 Renderings for the Cliff Walk environment;
[0054] Figure 5 This is a diagram of the internal structure of a computer device. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0056] The purpose of the present invention is to provide a method and device for unmanned vehicle path planning based on an autonomous planning path model, aiming to improve the accuracy of the unmanned vehicle's autonomous planning path.
[0057] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0058] Example 1
[0059] like Figure 1 As shown, the autonomous planning path model method in this embodiment includes the following steps:
[0060] S101. When the unmanned vehicle interacts with the environment, the current position, action, reward generated by executing the action, and the position of the unmanned vehicle at each moment are recorded, and the current position, action, reward generated by executing the action, and the position of the unmanned vehicle at the next moment are combined into a four-tuple experience and stored in the experience pool to obtain an initial sample sequence.
[0061] When the unmanned vehicle interacts with the environment, the current position, current action, reward generated by executing the current action, and the position of the unmanned vehicle at each moment are recorded, and the current position, current action, reward generated by executing the current action, and the position of the unmanned vehicle at the next moment are combined into a four-tuple experience and stored in the experience pool. The specific storage form is e=<s,a,r,s’> The elements in the four-tuple experience are the current position, action, reward generated by executing the action, and the position at the next moment. The current position of the unmanned vehicle is s, which is recorded by the environment image at the current position. The position at the next moment is s', which is recorded by the environment image at the position at the next moment. The action a is the action of the unmanned vehicle when interacting with the system, including the control signals of power and direction. The reward r generated by executing the action is the reward corresponding to the action of the unmanned vehicle. The recorded four-tuple experiences are stored in the experience pool to obtain the initial sample sequence.
[0062] S102, traversing the experience pool, calculating the composite priority of each quadruple experience, and obtaining a composite priority array, wherein the composite priority array stores each composite priority corresponding to each quadruple experience.
[0063] The traditional priority experience replay mechanism only defines the priority based on the temporal difference error, i.e., TD-error. After a certain quadruple experience is sampled in the experience replay array and learned, its TD-error is calculated and updated. However, in the autonomous behavior decision-making algorithm in a complex environment, the neural network acts as a function approximator. The parameters of the neural network will change after each training. The parameter change will directly affect the TD-error related to it, resulting in a certain difference in the priority of the quadruple experience when it is added to the experience pool and when it is sampled. At the same time, TD-error indirectly represents the diversity of the quadruple experience, but does not fully consider the importance of the reward value for strategy optimization. To address this problem, the present invention proposes a measurement method of the composite priority, i.e., the composite priority, which is a composite indicator combining immediate reward and TD-error. The composite priority represents the probability of sampling the quadruple experience. For details, see Figure 2 , the method steps for calculating the empirical composite priority of the four-tuple include:
[0064] S201. Calculate the immediate reward priority using the reward generated by executing the action.
[0065] The calculation formula for immediate reward priority is:
[0066]
[0067] in, is the immediate reward priority of the i-th quadruple experience, i ranges from 1 to n, n is the number of quadruple experiences, r i is the reward in the i-th quadruple experience, || represents the absolute value, ∈ is a constant, and ∝ indicates proportionality.
[0068] S202: Calculate the timing difference error priority by using the timing difference error of the quadruple experience recorded at time t.
[0069] The calculation formula for the timing differential error priority is:
[0070] p TDi ∝|δ i |+∈ (2);
[0071] Among them, p TDi is the temporal difference error priority of the i-th quadruple experience, δ i is the empirical time series difference error of the i-th quadruple, || represents the absolute value, ∈ is a constant, and ∝ indicates proportionality.
[0072] S203: Obtain a composite priority using the immediate reward priority and the temporal difference error priority.
[0073] The formula for calculating the composite priority is:
[0074]
[0075]
[0076] Among them, rank(i) represents the order of the i-th quadruple experience in descending order of immediate reward priority. TD (i) indicates the order of the i-th quadruple experience according to the priority of the time difference error in descending order, rank s (i) indicates that the i-th quadruple experience is sorted in the composite reverse order of immediate reward priority and temporal difference error priority, P(i) is the composite priority of the i-th quadruple experience, μ and is the composite coefficient, and
[0077] Specifically, when the unmanned vehicle interacts with the environment, the four-tuple experience at time t is recorded as the current position s i 、Action a i , perform action a i The reward generated is r i and the position s' at time t+1 i , the four-tuple experience at time t is stored in the experience pool as the i-th four-tuple experience; the unmanned vehicle performs action a i Arrive at the next moment' i , record the current position s' at time t+1 i 、Action a' i , perform action a' i The reward generated is r' i and the position at time t+2, then the temporal difference error δ of the i-th quadruple experience i The calculation formula is:
[0078] δ i =r i +γQ φ (s' i ,a' i )-Q φ (s i ,a i ) (5);
[0079] Among them, γ is the attenuation factor, γ∈[0,1], Q φ (s i ,a i ) is the current position s at time t i and action a i The value of the assessment, Q φ (s' i ,a' i ) is the current position s' at time t+1 iand action a' i The value of the assessment.
[0080] Continue to see Figure 1 , S103, marking the trajectory of each quadruple experience in the initial sample sequence, and using the priority exponential decay allocation method to update the composite priority array to obtain an updated composite priority array.
[0081] A trajectory is a sample sequence of all four-tuple experiences of the autonomous vehicle moving from one position to another. A round is one in which the autonomous vehicle starts from the first position and stops at the last position.
[0082] Based on the priority exponential decay allocation method of the sample sequence, the trajectory to which the quadruple experience e belongs must be determined before each quadruple experience e is stored. After a round, the entire trajectory is divided into quadruple formats and sent to the experience playback array for storage. Then the trajectory is counted from T0 to T n-1 The number of quadruple experiences contained in each trajectory is not necessarily the same, but they are all counted from e0 until the end of the trajectory. Each quadruple experience in the corresponding trajectory has its own composite priority, as shown in the following formula:
[0083] T j =(e0,e1,e2,e3…e done ) (6);
[0084] P=(P0,P1,P2,…,P n-1 ) (7);
[0085] From the first e0 to the last e done Belong to T j The four-tuple experience of the trajectory, P is the composite priority of each trajectory, P j T j The composite priority of each quaternary experience in the trajectory, j ranges from 0 to n-1, with a total of n, where n is the number of quaternary experiences.
[0086] When a new quadruple experience is recorded, the preset attenuation steps of the new quadruple experience are calculated, and after the composite priority of the new quadruple experience is attenuated by the preset steps, the attenuated composite priority is distributed to other quadruple experiences in the same trajectory to obtain an updated composite priority array.
[0087] The calculation formula of the priority decay allocation method is:
[0088] .......
[0090] P SJ(nw) = max{P(n)·ρ n-w ,P(1)}
[0091] Among them, ρ is the attenuation factor, ρ∈[0,1], W is the preset number of steps, P SJ (n-1) is the composite priority of the n-1th four-tuple experience after attenuation, P(n) is the composite priority of the nth four-tuple experience, and max is the maximum value.
[0092] The calculation formula for the preset number of steps is:
[0093] P(n)·ρ w ≤0.01; (9)
[0094]
[0095] Where n is the number of quadruple experiences, P(n) is the composite priority of the nth quadruple experience, W is the preset number of steps, and ρ W is the attenuation factor after W attenuation preset steps.
[0096] Specifically, whenever a new quadruple experience is to be stored, that is, every time a time step t passes and the unmanned vehicle performs an action and obtains a reward, the composite priority of the new quadruple experience is calculated using the above formulas (1)-(4), and the trajectory to which the new quadruple experience belongs is marked. The trajectory to which the new quadruple experience to be stored in the experience replay array belongs is compared to see whether it belongs to the same trajectory as the previous quadruple experience stored in the experience replay array. If they belong to the same trajectory, the new quadruple experience is directly stored in the trajectory; if they do not belong to the same trajectory, the quadruple experience stored in the experience replay array is stored again in order before the new quadruple experience is stored.
[0097] The above formula (8) is used to perform decay distribution on the composite priority of the new four-tuple experience. After each decay, the composite priority array is updated to obtain an updated composite priority array.
[0098] Specifically, when the decay reaches the end of the round or the preset number of decay steps, the composite priority decay stops and is ready to be stored in the experience replay array.
[0099] When the composite priority decays to a certain number of steps, the calculated composite priority is negligible, resulting in the inability to reuse the four-tuple experience obtained by the interaction between the unmanned vehicle and the environment, thereby wasting computing resources and affecting the robustness and accuracy of the autonomous behavior decision-making strategy. Therefore, the present invention defines a preset decay step number, that is, the maximum decay step number W. When the preset step number is exceeded or the trajectory has decayed to the four-tuple experience of the initial position, the composite priority decay process will be stopped. In this embodiment, the critical value of the calculated composite priority P(n) is set to 1%. The critical value can also be set to other values according to the specific situation. If it is lower than 1%, it is considered invalid to continue the composite priority decay. Then the value of the preset step number W can be calculated according to the decay factor ρ, and the calculation formula is the above formula (9) and (10).
[0100] Each time a new quadruple experience is stored, the preset number of decay steps is calculated according to the composite priority of the new quadruple experience, and P is calculated according to the above formula (8) by cycling the decay of the preset number of steps W times. SJ (n-1) to P SJ (nw) realizes the reverse attenuation within the trajectory where the quadruple experience is located, and propagates the composite priority of the new quadruple experience to the previous quadruple experience in the same trajectory.
[0101] See also Figure 3 The unmanned vehicle interacts with the environment to obtain a new four-tuple experience, and calculates the composite priority of the new four-tuple experience. After that, the composite priority of the new four-tuple experience is allocated in reverse order from the current round through exponential decay. After decaying to the end of the round or the maximum number of decay steps, the updated composite priority and the corresponding four-tuple experience are stored in the experience playback array according to the marked trajectory.
[0102] Continue to see Figure 1 , S104, storing the updated composite priority and the corresponding four-tuple experience into the experience replay array according to the marked track; calculating the importance sampling weight of each four-tuple experience in the experience replay array, and sampling the experience replay array according to the importance sampling weight to obtain the sampled four-tuple experience.
[0103] In order to solve the problem that some quadruple experiences are difficult to replay, resulting in overfitting of the strategy and poor robustness of the autonomous behavior decision-making strategy of the unmanned vehicle, the present invention adopts the idea of trade-off, introduces the hyperparameter η, weighs the uniform random sampling and priority sampling, and adds some randomness to ensure that the experience with low composite priority can also be sampled. The calculation formula of the importance sampling weight is:
[0104]
[0105]
[0106] Among them, k is the kth quadruple experience, w k is the importance sampling weight of the k-th quadruple experience, N is the preset number of quadruple experiences stored in the experience playback array, β is a hyperparameter, P(k) is the composite priority of the k-th quadruple experience, η is a hyperparameter, P(k) η is the nth power of the composite priority of the kth quadruple experience, m is the number of quadruple experiences stored in the experience playback array, ∑ m (P(k) η ) is the sum of the n-th powers of the composite priorities of the m four-tuple experiences.
[0107] A hyperparameter β is introduced, β∈[0,1]. When β=1, it means that the importance sampling weight formula is fully used to correct the distribution deviation caused by compound priority experience replay, so that there is no difference between compound priority experience replay and ordinary experience replay; when β=0, it means that the distribution deviation caused by compound priority experience replay is not corrected.
[0108] The larger the composite priority of a quadruple experience, the greater the probability that it will be sampled compared to other quadruple experiences. It can be seen that η∈[0,1], when η=0, it is equivalent to uniform random sampling, and the probability of each quadruple experience being replayed is the same; when η=1, sampling is performed completely based on the distribution of composite priority.
[0109] Using the composite priority experience sampling method instead of the uniform random sampling method will change the uniform distribution in the original array in an uncontrolled form, resulting in a certain deviation in the final convergence value of the strategy. The present invention uses importance sampling weighted gradient update to fit the expected calculation of the experience distribution under uniform sampling. In short, this ensures that the probability of each quadruple experience being selected is different, thereby improving the training speed of the autonomous planning path model for autonomous behavior decision-making and its ability to respond to unexpected situations due to lack of quadruple experience, and can also ensure that their effects on gradient descent are the same, thereby ensuring that the autonomous planning path model learns an autonomous behavior decision-making strategy that is consistent with the task objectives.
[0110] S105. Iteratively update the parameters of the autonomous planning path model using the sampled quadruple experience to obtain a trained autonomous planning path model, where the autonomous planning path model includes a policy network, a value network, and a target value network.
[0111] The current position in the sampled quadruple experience is input into the policy network to obtain the action of the unmanned vehicle, and the next position in the sampled quadruple experience is input into the policy network to obtain the next action of the unmanned vehicle; the current position and action are input into the value network to output the value of the action, and the next position and next action are input into the target value network to obtain the value of the next action.
[0112] The policy network is iteratively trained according to the value of the action and the action, and the parameters of the policy network are updated. The value network is iteratively trained according to the value of the next action and the next action, and the parameters of the value network are updated to obtain the trained autonomous planning path model.
[0113] In this example, based on the Soft Actor-Critic (SAC) algorithm, the policy network π with parameter θ is θ Model and value network Q with parameters φ φ To make the strategy training more stable, a target value network Q with parameter φ'←φ is added. φ' Model. The policy network, value network, and target value network are all fully connected neural networks, each consisting of two hidden layers with (256, 256) neurons.
[0114] The autonomous planning path model is trained using the sampled four-tuple experience obtained in step S104. For example, the sampled four-tuple experience obtained by sampling is n sampled four-tuple experiences, respectively. <e1,e2,…,e n >, the i-th experience e i = i ,a i ,r i ,s' i >.
[0115] Sample the next position s' in the quadruple experience i Input to the policy network π θ Get the next action π of the driverless car θ (s' i ), that is, a' i ; Set the current position s i and action a i Input to the value network Q φ Output action a i The value of Q φ (s,a), the next position s' i and the next action a' i Input to the target value network Q φ' Get the next action a' i The value of Q φ' (s' i ,π θ (s' i )).
[0116] The loss function calculation formula of the policy network is:
[0117]
[0118] Among them, α is a hyperparameter used to control the size of the policy entropy weight.
[0119] The loss function calculation formula for calculating the value network is:
[0120]
[0121] Among them, γ is the attenuation factor.
[0122] Using the Adam optimizer, the policy network π is updated based on the loss function of the policy network and the calculation function of the value network using the stochastic gradient descent method. θ and value network Q φ The parameters of the target value network are updated by momentum encoding.
[0123] φ'←mφ+(1-m)φ' (15);
[0124] Among them, m is a hyperparameter used to control the update amplitude.
[0125] S106: Perform online path planning for the unmanned vehicle using the trained policy network, wherein the trained policy network gives the action of the unmanned vehicle according to the current position of the unmanned vehicle.
[0126] In order to intuitively illustrate the advantages of the priority exponential decay allocation method based on sample sequences, the present invention uses the task environment of Blind Cliffwalk to illustrate. The environment has n states, and in each state there are two selectable actions (correct rightward movement and incorrect leftward movement). The incorrect action of the unmanned vehicle in any state will result in the end of the round and return directly to the initial state. The unmanned vehicle must learn to choose the correct rightward movement in each state to reach the end point to obtain the reward mark. There is only one non-zero reward at the end, marked as Figure 3 The R curve in the middle means that only one action sequence can complete the task and obtain the reward value. Assuming there is a successful trajectory, the Priority Experience Replay (PER) independently calculates the priority of each sample. Then only the second-to-last sample has a high priority, which only increases the probability of this sample being sampled. The priority of other samples on this successful trajectory is equal to the priority of samples on other failed trajectories. Therefore, after one round of training, the unmanned vehicle can only learn to choose the correct action when facing the second-to-last state, and cannot learn to complete the task completely from the initial state.
[0127] The present invention utilizes the relationship between sequential samples and allocates the composite priority of each sample in this successful trajectory by means of priority decay, thereby increasing the probability of multiple samples in this trajectory being adopted. Therefore, the deep reinforcement learning method based on the composite priority sequence sample playback mechanism in the present invention can reuse high-value samples more efficiently, thereby making the autonomous planning path model converge faster and the sample efficiency higher.
[0128] In a second aspect, the present invention provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the unmanned vehicle path planning method based on the autonomous planning path model as described in any one of the above claims.
[0129] Example 2
[0130] A computer device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the unmanned vehicle path planning method of the autonomous planning path model in Example 1.
[0131] Example 3
[0132] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the unmanned vehicle path planning method of the autonomous planning path model in Example 1.
[0133] Example 4
[0134] A computer program product includes a computer program, which, when executed by a processor, implements the unmanned vehicle path planning method of the autonomous planning path model in Example 1.
[0135] Example 5
[0136] A computer device, which may be a database, may have an internal structure as shown in Figure 5As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the unmanned vehicle path planning method of the autonomous planning path model in Example 1 is implemented.
[0137] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present invention are all information and data authorized by the object or fully authorized by all parties.
[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present invention may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided by the present invention may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0139] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0140] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A path planning method for an unmanned vehicle based on an autonomous planning path model, characterized in that: The method comprises: When the unmanned vehicle interacts with the environment, the current position, action, reward generated by executing the action, and the position of the unmanned vehicle at each moment are recorded, and the current position, action, reward generated by executing the action, and the position of the unmanned vehicle at the next moment are combined into a four-tuple experience and stored in the experience pool to obtain an initial sample sequence; Traversing the experience pool, calculating the composite priority of each quadruple experience, and obtaining a composite priority array; Marking the trajectory of each of the four-tuple experiences in the initial sample sequence, and updating the composite priority array using a priority exponential decay allocation method to obtain an updated composite priority array; The updated composite priority and the corresponding four-tuple experience are stored in the experience replay array according to the marked track; the importance sampling weight of each four-tuple experience in the experience replay array is calculated, and the experience replay array is sampled according to the importance sampling weight to obtain the sampled four-tuple experience; The parameters of the autonomous planning path model are iteratively updated using the sampled quadruple experience to obtain the trained autonomous planning path model, which includes a policy network, a value network, and a target value network. The trained policy network is used to perform online path planning for the unmanned vehicle, and the trained policy network gives the action of the unmanned vehicle according to the current position of the unmanned vehicle.
2. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 1 is characterized in that: When the unmanned vehicle interacts with the environment, the four-tuple experience at time t is recorded as the current position, action, reward generated by executing the action, and the position at the next moment. The composite priority of each four-tuple experience is calculated, including: Calculating an immediate reward priority using the reward generated by the execution of the action; Calculating the timing difference error priority using the timing difference error of the quadruple experience recorded at time t; The composite priority is obtained by using the immediate reward priority and the temporal difference error priority.
3. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 2 is characterized in that: The calculation formula for the immediate reward priority is: in, is the immediate reward priority of the i-th quadruple experience, i ranges from 1 to n, n is the number of quadruple experiences, r i is the reward in the i-th quadruple experience, || represents the absolute value, ∈ is a constant, and ∝ indicates proportionality. The calculation formula of the timing differential error priority is: p TDi ∝|δ i |+∈ Among them, p TDi is the temporal difference error priority of the i-th quadruple experience, δ i is the empirical time series difference error of the i-th quadruple, || represents the absolute value, ∈ is a constant, and ∝ indicates proportionality.
4. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 1 is characterized in that: The calculation formula of the composite priority is: Among them, rank(i) represents the order of the i-th quadruple experience in descending order of immediate reward priority. TD (i) indicates the order of the i-th quadruple experience according to the priority of the time difference error in descending order, rank s (i) indicates that the i-th quadruple experience is sorted in the composite reverse order of immediate reward priority and temporal difference error priority, P(i) is the composite priority of the i-th quadruple experience, μ and is the composite coefficient, and 5. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 1 is characterized in that: The method of updating the composite priority array by using the priority exponential decay allocation method to obtain an updated composite priority array includes: When recording a new quadruple experience, calculate the preset attenuation steps of the new quadruple experience, attenuate the composite priority of the new quadruple experience by the preset number of steps, and then distribute the attenuated composite priority to other quadruple experiences in the same trajectory to obtain an updated composite priority array.
6. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 1 is characterized in that: The calculation formula of the priority decay allocation method is: P SJ (n-1)=max{P(n)·ρ,P(n-1)} P SJ (n-2)=max{P(n)·ρ 2 ,P(n-2)} P SJ (n-3)=max{P(n)·ρ 3 ,P(n-3)} ....... P SJ (nw)=max{P(n)·ρ n-w ,P(1)} Among them, ρ is the attenuation factor, W is the preset number of steps, P SJ (n-1) is the composite priority of the n-1th four-tuple experience after attenuation, P(n) is the composite priority of the nth four-tuple experience, and max is the maximum value.
7. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 5 is characterized in that: The calculation formula of the preset number of steps is: P(n)·ρ w ≤0.01; Where n is the number of quadruple experiences, P(n) is the composite priority of the nth quadruple experience, W is the preset number of steps, ρ is the attenuation factor, and ρ W is the attenuation factor after W attenuation preset steps.
8. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 1 is characterized in that: The calculation formula of the importance sampling weight is: Among them, k is the kth quadruple experience, w k is the importance sampling weight of the k-th quadruple experience, N is the preset number of quadruple experiences stored in the experience playback array, β is a hyperparameter, P(k) is the composite priority of the k-th quadruple experience, η is a hyperparameter, P(k) η is the nth power of the composite priority of the kth quadruple experience, m is the number of quadruple experiences stored in the experience playback array, ∑ m (P(k) η ) is the sum of the n-th powers of the composite priorities of the m four-tuple experiences.
9. The unmanned vehicle path planning method based on the autonomous planning path model according to claim 1, characterized in that: The method of iteratively updating the parameters of the autonomous planning path model by using the sampled quadruple experience to obtain the trained autonomous planning path model includes: The current position in the sampled quadruple experience is input into the strategy network to obtain the action of the unmanned vehicle, and the next position in the sampled quadruple experience is input into the strategy network to obtain the next action of the unmanned vehicle; the current position and the action are input into the value network to output the value of the action, and the next position and the next action are input into the target value network to obtain the action value of the next action. Iteratively train the policy network according to the value of the action and the action, update the parameters of the policy network, iteratively train the value network according to the value of the next action and the next action, update the parameters of the value network, and obtain a trained autonomous planning path model.
10. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the unmanned vehicle path planning method based on the autonomous planning path model as described in any one of claims 1-9.
