Training method and device of confidence domain strategy optimization model, computer equipment, readable storage medium and program product

Through the confidence region strategy optimization model, the strategy network is trained to optimize engine torque, which solves the problem of traditional energy management strategies relying on expert experience and improves the vehicle performance and energy management efficiency of hybrid vehicles.

CN118569731APending Publication Date: 2024-08-30CHINA FAW CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410840301.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The energy management strategy of traditional hybrid vehicles relies on expert experience, and the vehicle performance is not high, making it difficult to achieve efficient power source management.

Method used

Using the confidence region strategy optimization model, by establishing an automotive system model and building a strategy network and evaluation network, a standard working condition training set is obtained, and the strategy network is trained to optimize engine torque and achieve more scientific energy management.

Benefits of technology

It improves the overall vehicle performance of hybrid vehicles, improves the scientificity and efficiency of energy management, and reduces reliance on expert experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118569731A
    Figure CN118569731A
Patent Text Reader

Abstract

The invention relates to a training method and device of a confidence domain strategy optimization model, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: establishing an automobile system model; constructing a confidence domain strategy optimization model to be trained, wherein the confidence domain strategy optimization model to be trained comprises a strategy network and an evaluation network; obtaining a standard working condition training set based on the automobile system model and the strategy network; the strategy network and the evaluation network are trained based on the standard working condition training set, a trained confidence domain strategy optimization model is obtained, and the trained confidence domain strategy optimization model is used for conducting energy management on the automobile. And the whole vehicle performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automobile technology, and in particular to a training method, apparatus, computer equipment, computer-readable storage medium, and computer program product for a trust region strategy optimization model. Background Art

[0002] Countries around the world have formulated strict emission regulations for fuel vehicles, which is not only a positive response to environmental protection, but also promotes the development of the new energy vehicle industry. Among them, hybrid vehicles have been favored by many manufacturers and scientific research institutions due to their high efficiency and zero emission characteristics, and have become the focus of their research and development. Since hybrid vehicles are usually equipped with multiple power sources, how to efficiently manage these power sources has become a crucial technical issue.

[0003] In traditional technology, energy management is usually performed based on pre-set energy management strategies. This method is relatively simple, but the control effect is overly dependent on expert experience and the performance of the entire vehicle is not high. Summary of the invention

[0004] Based on this, it is necessary to provide a training method, device, computer equipment, computer-readable storage medium and computer program product for a trust region strategy optimization model that can improve the performance of the entire vehicle in response to the above technical problems.

[0005] In a first aspect, the present application provides a training method for a trust region strategy optimization model, comprising:

[0006] Build automotive system models;

[0007] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0008] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0009] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0010] In one embodiment, the step of acquiring a standard operating condition training set based on the automobile system model and the policy network includes:

[0011] Acquire a current state quantity set of the automobile system model under the action of the current engine torque, wherein the current state quantity set includes a current speed, a current acceleration or a current remaining power state SOC;

[0012] Determine a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample;

[0013] Input the current state quantity set into the strategy network to obtain the engine torque prediction value; use the engine torque prediction value as the current engine torque, and repeat the above process to obtain the corresponding sample;

[0014] A standard working condition training set is constructed based on all the samples obtained.

[0015] In one embodiment, the training of the strategy network based on the standard operating condition training set includes:

[0016] Acquire batch samples from the standard working condition training set;

[0017] Inputting the state quantity set and the engine torque contained in each sample in the batch of samples into the evaluation network to obtain a value function;

[0018] Determine the discounted return corresponding to the batch of samples according to the reward contained in each sample in the batch of samples; determine the approximate expectation according to the state quantity set and engine torque contained in each sample in the batch of samples;

[0019] Based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, an update parameter of the policy network is determined, and the current parameter is updated based on the update parameter.

[0020] In one embodiment, determining the update parameters of the policy network based on the value function, the discounted return, the approximate expectation, and the current parameters of the policy network includes:

[0021] Constructing an objective function based on the value function, and approximating the objective function using the approximate expectation to obtain an approximate objective function;

[0022] Replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function;

[0023] The maximum value of the final objective function within the neighborhood of the current parameter of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained as the update parameter of the policy network.

[0024] In one embodiment, the method further comprises:

[0025] Recording the current parameters and the updated parameters;

[0026] Based on the current parameters and the updated parameters, the model loss is calculated using a pre-constructed loss function, and training is stopped if the calculated model loss meets a preset condition.

[0027] In one embodiment, the method further comprises:

[0028] Collect the current state quantity set of the car through sensors;

[0029] The current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the vehicle is driven according to the engine torque.

[0030] In a second aspect, the present application also provides a training device for a trust region strategy optimization model, comprising:

[0031] Establishing modules for building automotive system models;

[0032] A construction module, used to construct a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0033] An acquisition module, used for acquiring a standard operating condition training set based on the automobile system model and the strategy network;

[0034] A training module is used to train the strategy network and the evaluation network based on the standard working condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used to perform energy management on the vehicle.

[0035] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] Build automotive system models;

[0037] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0038] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0039] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0041] Build automotive system models;

[0042] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0043] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0044] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0046] Build automotive system models;

[0047] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0048] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0049] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0050] The training method, device, computer equipment, computer-readable storage medium and computer program product of the above-mentioned trust domain policy optimization model first establish an automobile system model; construct a trust domain policy optimization model to be trained, and the trust domain policy optimization model to be trained includes a policy network and an evaluation network; then, based on the automobile system model and the policy network, a standard operating condition training set is obtained; finally, based on the standard operating condition training set, the policy network and the evaluation network are trained to obtain a trained trust domain policy optimization model, and the trained trust domain policy optimization model is used for energy management of the automobile, making the automobile energy management more scientific and improving the performance of the entire vehicle. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A schematic diagram of a flow chart of a training method for a trust region strategy optimization model in an embodiment;

[0053] Figure 2 is a schematic diagram of an automobile system model in one embodiment;

[0054] Figure 3 A schematic flow chart of a training method for a trust region strategy optimization model in another embodiment;

[0055] Figure 4 A structural block diagram of a training device for a trust region strategy optimization model in an embodiment;

[0056] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0058] In one embodiment, Figure 1 As shown, a training method for a trust region policy optimization model is provided. This embodiment uses the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0059] Step 102: Establish a vehicle system model.

[0060] Optionally, a model for energy management of a hybrid vehicle may be obtained by training using the training method provided in the embodiment of the present application. In this scenario, this step is to establish a vehicle system model of the hybrid vehicle.

[0061] Optionally, the vehicle system model may include a vehicle dynamics model, a motor model, an engine model, and a battery system model.

[0062] Optionally, the vehicle dynamics model may be used to obtain the required power of the vehicle. Specifically, the required power may be calculated by the following formula:

[0063] P=Fv

[0064] Among them, F is the traction force, and v is the speed of the car. F=Fr+Fg+Fd+Fa, where Fr is the rolling resistance, Fg is the slope resistance, Fd is the air resistance, and Fa is the acceleration resistance. Fr=mgfcosθ, Fg=mgsinθ, Fd=1 / 2*ρACdv^2, Fa=ma; where m is the vehicle mass, g is the acceleration of gravity, f is the rolling resistance coefficient, θ is the slope angle, ρ is the air density, Cd is the air resistance coefficient, A is the vehicle's frontal area, v is the vehicle speed, and a is the vehicle acceleration.

[0065] Optionally, the motor model can be used to obtain the driving motor power of the car. Specifically, a bench test is used to obtain the motor efficiency diagram of the static model, and the motor efficiency is determined according to the motor torque and speed to obtain the driving motor power. Among them, the static model is a mathematical model used to describe the input-output relationship when the motor is running under steady-state conditions. It is usually used to analyze and design the steady-state performance of the motor, mainly to obtain the motor efficiency. The motor torque and speed of the motor at each working point can be obtained through bench testing. The ordinate of the motor efficiency diagram is the speed and the abscissa is the motor torque. A motor efficiency will be obtained at each point. Then the driving motor power Pm=Tm*nm*η, where Tm is the motor torque, nm is the motor speed, and η is the motor efficiency.

[0066] Optionally, the instantaneous fuel consumption rate can be obtained using an engine model. Specifically, the engine static model is obtained using bench data, and the instantaneous fuel consumption rate is obtained based on the engine torque and speed in the engine static model. The engine static model is a mathematical model used to describe the characteristics and behavior of the engine under stable operating conditions. The model assumes that the input and output parameters of the engine are stable at a given point in time in order to obtain parameters to solve the instantaneous fuel consumption rate. The instantaneous fuel consumption rate can be calculated using the following formula:

[0067] me=a*Te+b*ne+c

[0068] Among them, a, b, c are empirical coefficients obtained through experimental fitting, and the engine torque Te and speed ne are obtained through the engine static model.

[0069] Optionally, the battery system model can be used to obtain the remaining power state (State of Charge, referred to as SOC). Specifically, an equivalent model can be used to obtain the battery SOC based on the internal resistance and open circuit voltage. The internal resistance and open circuit voltage are both obtained from the change curve fitted by the experimental data. SOC(t)=-I(t) / Qb, where I is the battery current and Qb is the battery capacity when the battery is fully charged:

[0070]

[0071] Where V is the open circuit voltage, R is the internal resistance, Pb is the battery power (measured through experimental data), and (t) represents the time at time t, which is used to characterize an instantaneous quantity.

[0072] For example, see Figure 2 As shown, Figure 2 A parallel hybrid electric vehicle system model is shown, which includes: a vehicle dynamics model, a motor model, an engine model and a battery system model. The vehicle dynamics model includes a main reducer, a transmission, a controller, a clutch, wheels, etc.

[0073] Step 104: construct a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network.

[0074] Optionally, the policy network can use an ACTOR network to generate actions (engine torque prediction values) and interact with the environment (vehicle system model). The evaluation network can use a CRITIC network to evaluate the performance of the ACTOR network and guide its next action.

[0075] Among them, after the trust region policy optimization model to be trained is constructed, the model parameters of the trust region policy optimization model to be trained can be initialized. Since the trust region policy optimization model to be trained includes a policy network and an evaluation network, the parameters of the policy network and the evaluation network can be initialized.

[0076] Step 106: Acquire a standard operating condition training set based on the automobile system model and the strategy network.

[0077] Among them, a standard working condition training set can be obtained based on the automobile system model and the initialized strategy network.

[0078] In a possible implementation, an initial state quantity set may be set, including initial speed, initial acceleration or initial SOC, and the initial state quantity set is input into the initialized strategy network to obtain the engine torque prediction value, and the engine torque prediction value is applied to the vehicle system model to obtain the reward and the next state quantity set, and the next state quantity set, engine torque prediction value and reward constitute a sample. Based on the next state quantity set, the same method as above is used to construct the next sample. Thus, a standard working condition training set is obtained.

[0079] Step 108, training the strategy network and the evaluation network based on the standard operating condition training set to obtain a trained trust region strategy optimization model, wherein the trained trust region strategy optimization model is used for energy management of the automobile.

[0080] Optionally, after the trust region policy optimization model to be trained is constructed, the parameters of the policy network and the evaluation network can be initialized, and the parameters of the initialized policy network can be updated according to the iterative function of the trust region policy optimization to obtain the optimal energy management strategy (optimal engine torque). The gradient descent method can be used to update the parameters of the initialized evaluation network.

[0081] Optionally, each updated parameter can be recorded, and the model loss can be calculated based on the recorded parameters using a pre-built loss function. If the calculated model loss meets the preset conditions, the training is stopped.

[0082] Optionally, after obtaining the trained trust region strategy optimization model, the current state quantity set of the vehicle can be input into the trained trust region strategy optimization model during the driving of the vehicle, and the vehicle can be driven according to the engine torque output by the trained trust region strategy optimization model, thereby realizing energy management of the vehicle.

[0083] In the above embodiment, first, a vehicle system model is established; a trust domain policy optimization model to be trained is constructed, and the trust domain policy optimization model to be trained includes a policy network and an evaluation network; then, based on the vehicle system model and the policy network, a standard operating condition training set is obtained; finally, based on the standard operating condition training set, the policy network and the evaluation network are trained to obtain a trained trust domain policy optimization model, and the trained trust domain policy optimization model is used to perform energy management on the vehicle, making the vehicle energy management more scientific and improving the performance of the entire vehicle.

[0084] In some embodiments, based on the automobile system model and the strategy network, the step of obtaining a standard operating condition training set includes: obtaining a current state quantity set of the automobile system model under the current engine torque, the current state quantity set including the current speed, the current acceleration or the current remaining power state SOC; determining a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample; inputting the current state quantity set into the strategy network to obtain an engine torque prediction value; using the engine torque prediction value as the current engine torque, repeating the above process to obtain a corresponding sample; and constructing a standard operating condition training set based on all the obtained samples.

[0085] Optionally, an initial state quantity set can be set, which includes an initial speed, an initial acceleration or an initial SOC. The initial state quantity set is input into the initialized strategy network to obtain an engine torque prediction value, which is used as the current engine torque, and the current engine torque is applied to the vehicle system model.

[0086] Optionally, a current state quantity set of the automobile system model under the current engine torque may be obtained, where the current state quantity set includes the current speed, the current acceleration or the current remaining power state SOC.

[0087] Specifically, the current engine torque can be input into the vehicle system model, and the vehicle system model outputs the speed and acceleration after running for a preset time based on the current engine torque, and the speed is used as the current speed and the acceleration is used as the current acceleration. And use the above formula: To calculate the SOC of the automobile system model after running for a preset time based on the current engine torque, and use the SOC as the current SOC.

[0088] Optionally, the fuel consumption of the automobile system model under the current engine torque can be obtained. Specifically, the current engine torque can be input into the automobile system model. The automobile system model runs for a preset time based on the current engine torque. The above formula me=a*Te+b*ne+c can be used to obtain the instantaneous fuel consumption rate. The instantaneous fuel consumption rate and the preset time can be multiplied to obtain the fuel consumption of the automobile system model under the current engine torque.

[0089] Optionally, the reward can be calculated using the following formula:

[0090] r=-(Fc(t)+α(SOCref-SOC(t)))

[0091] Among them, Fc is the fuel consumption of the above-mentioned automobile system model under the current engine torque, SOCref is the expected SOC value, that is, the SOC expected value, SOC(t) is the current SOC, and α is the weight factor, which is a kind of hyperparameter.

[0092] After obtaining the current state quantity set of the automobile system model under the current engine torque and the corresponding reward, the current state quantity set, the current engine torque and the corresponding reward can be used as a sample.

[0093] After obtaining the current state quantity set of the automobile system model under the current engine torque, the current state quantity set can be input into the initialized strategy network, and the initialized strategy network will output the engine torque prediction value, which can be used as the current engine torque, and the above process can be repeated to obtain the corresponding sample. Each time the above process is repeated, a sample can be obtained, and thus many samples can be obtained, and a standard working condition training set can be constructed based on these samples.

[0094] In the above embodiment, a specific method for obtaining a standard working condition training set is provided, specifically, obtaining a current state quantity set of the automobile system model under the current engine torque, the current state quantity set including the current speed, the current acceleration or the current remaining power state SOC; determining a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample; inputting the current state quantity set into the strategy network to obtain the engine torque prediction value; using the engine torque prediction value as the current engine torque, repeating the above process to obtain the corresponding sample; and constructing a standard working condition training set based on all the obtained samples. This method of establishing an automobile system model in advance and constructing a standard working condition training set through the interaction between the strategy network and the automobile system model does not require collecting samples from actual driving data, thereby improving the efficiency of constructing a standard working condition training set.

[0095] In some embodiments, the step of training the policy network based on the standard operating condition training set includes: obtaining batch samples from the standard operating condition training set; inputting the state quantity set and engine torque contained in each sample in the batch samples into the evaluation network to obtain a value function; determining a discounted return based on the reward contained in each sample in the batch samples; determining an approximate expectation based on the state quantity set and engine torque contained in each sample in the batch samples; determining an update parameter of the policy network based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, and updating the current parameters based on the update parameter.

[0096] As described in the above-mentioned embodiment, after constructing the trust region policy optimization model to be trained, the parameters of the policy network and the evaluation network can be initialized, the initialized policy network can be used to construct a standard working condition training set, and the initialized policy network and the evaluation network can be trained based on the standard working condition training set.

[0097] Optionally, after obtaining the standard working condition training set, batch samples can be obtained from the standard working condition training set, and the number of samples contained in the batch samples can be flexibly set according to actual conditions. The state quantity set and engine torque contained in each sample in the batch samples can be input into the initialized evaluation network, and the evaluation network will output the value function corresponding to the batch samples.

[0098] Optionally, the discounted return can be calculated using the following formula:

[0099]

[0100] Among them, r i is the reward of the i-th sample in the i-th batch of samples, γ represents the weight ratio coefficient of the corresponding reward, and the value of γ can be set in advance.

[0101] Optionally, each sample in the batch samples includes speed, acceleration, SOC, engine torque and reward. The speed of all samples in the batch samples may be averaged, the acceleration of all samples in the batch samples may be averaged, the SOC of all samples in the batch samples may be averaged, and the engine torque of all samples in the batch samples may be averaged, and the approximate expectation may be determined based on these averages.

[0102] Optionally, the update parameters of the policy network can be determined based on the value function output by the initialized evaluation network, the above-mentioned discounted return, the above-mentioned approximate expectation, and the current parameters of the above-mentioned initialized policy network, and the current parameters can be updated based on the update parameters. In addition, the gradient descent method is used to update the parameters of the initialized evaluation network. As a result, the parameters of the policy network and the evaluation network are updated once, and a batch of samples can be obtained from the standard working condition training set again. By repeating the above process, the parameters of the policy network and the evaluation network can be updated again. The parameters updated each time can be recorded and brought into the loss function to obtain the model loss. When the model loss meets the preset conditions, it is considered that the energy management effect of the model has reached the optimal level. At this time, the training is stopped, that is, the above-mentioned parameter update process is stopped, and the trust domain policy optimization model finally obtained is used as the trained trust domain policy optimization model.

[0103] In the above embodiment, a specific process for training the policy network is provided, firstly, batch samples are obtained from the standard working condition training set; the state quantity set and engine torque contained in each sample in the batch samples are input into the evaluation network to obtain the value function; then, the discounted return is determined according to the reward contained in each sample in the batch samples; the approximate expectation is determined according to the state quantity set and engine torque contained in each sample in the batch samples; finally, the update parameters of the policy network are determined based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, and the current parameters are updated based on the update parameters. The convergence of the model can be significantly increased, thereby enhancing the ability of the policy to find the optimal solution, and can solve the impact on performance caused by the selection of hyperparameters that may occur in the reinforcement learning-based strategy in traditional technology, improve stability, and can further improve fuel economy while ensuring the power performance of hybrid vehicles.

[0104] In some embodiments, the update parameters of the policy network are determined based on the value function, the discounted reward, the approximate expectation and the current parameters of the policy network, including: constructing an objective function based on the value function, and approximating the objective function using the approximate expectation to obtain an approximate objective function; replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function; and obtaining the maximum value of the final objective function within the neighborhood of the current parameters of the policy network and under the condition that the divergence with the current parameters is within a preset range, as the update parameter of the policy network.

[0105] Optionally, the value function includes a state value function and an action value function, and the objective function can be constructed based on the state value function and the action value function:

[0106]

[0107] Where S is a series of states; A is a series of actions; π(A|s; θ) is the probability of taking action A in state S with weight θ; π(A|S; θold) is the probability of taking action A in state S with weight θold; ES[ ] is the expectation of state S; EA[ ] is the expectation of action A; Qπ(S, A) is the action value function for action A under strategy π and state S.

[0108] The objective function is subjected to Monte Carlo approximation processing using the approximate expectation to obtain an approximate objective function:

[0109]

[0110] Among them, L(θ|θold) is the Monte Carlo approximation of the objective function under weight θ based on weight θold; si is the i-th state observation; ai is the i-th action observation; Qπ(si, ai) is the action value function under action ai and state si; n is the number of observations; π(ai|si; θ) is the weight θ, and the state si takes the strategy of action ai; π(ai|si; θold) is the weight θold, and the state si takes the strategy of action ai.

[0111] Optionally, the action value function in the approximate objective function is replaced by the discounted reward to obtain the final objective function; the maximum value of the final objective function is obtained by the Lagrange multiplier method within the neighborhood of the current parameters of the policy network and under the condition that the divergence with the current parameters is within a preset range, as the update parameter of the policy network.

[0112] For example, see Figure 3 As shown, a training method for a trust region strategy optimization model is provided, firstly, a standard working condition training set is obtained, batch samples are obtained from the standard working condition training set, and a discounted return is determined according to the reward contained in each sample in the batch samples, and the state quantity set and engine torque contained in each sample in the batch samples are input into the evaluation network to obtain a value function, and then the steps of updating the parameters of the strategy network based on the trust region strategy optimization are performed, specifically including: constructing an objective function based on the state value function and the action value function; assuming that the batch samples contain n samples, and the intelligent agent represents a pre-established automobile system model, the mean of the n states and actions corresponding to the n samples can be calculated by the method of the above embodiment, and the approximate expectation is determined based on the mean. The objective function is approximated by the approximate expectation to obtain an approximate objective function. The discounted return corresponding to the batch samples can be calculated by the method of the above embodiment. The final objective function is obtained by Monte Carlo approximation of the approximate objective function based on the discounted return; the maximum value of the final objective function in the neighborhood of the current parameter (old parameter) of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained by the Lagrange multiplier method as the update parameter (new parameter) of the policy network. The gradient descent method is used to update the parameters of the initialized evaluation network.

[0113] In the above embodiment, a specific method for updating the parameters of the policy network is provided, which can improve the model convergence speed and accelerate the training process.

[0114] In some embodiments, the training method of the trust region strategy optimization model provided in the embodiments of the present application also includes: recording the current parameters and the updated parameters; based on the current parameters and the updated parameters, using a pre-constructed loss function to calculate the model loss, and stopping the training if the calculated model loss meets the preset conditions.

[0115] Each time the policy network and evaluation network parameters are updated, the current parameters (old parameters) and updated parameters (new parameters) are recorded. After each update, the model loss is calculated based on the recorded parameters using a pre-built loss function. If the difference between the model losses calculated for two consecutive updates is within a preset threshold, training can be stopped.

[0116] In the above embodiment, a cutoff condition for model training is provided, which can improve the model convergence speed and accelerate the training process.

[0117] In some embodiments, after obtaining a trained trust region strategy optimization model, energy management of the vehicle can be performed in the following manner: collecting a current state quantity set of the vehicle through sensors; inputting the current state quantity set into the trained trust region strategy optimization model to obtain the engine torque, and driving according to the engine torque.

[0118] After the car starts, during driving, the current state quantity set of the car is collected by sensors at a certain frequency, and the current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the car is driven according to the engine torque until the car stops.

[0119] The above embodiment provides how to apply the trained trust region strategy optimization model in actual driving scenarios. Specifically, the current state quantity set of the car is collected through sensors; the current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the car is driven according to the engine torque. Under the premise of ensuring the power performance of the hybrid vehicle, the fuel economy can be further improved.

[0120] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0121] Based on the same inventive concept, the embodiment of the present application also provides a training device for a trust region policy optimization model for implementing the training method of the trust region policy optimization model involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the training device for one or more trust region policy optimization models provided below can be referred to the limitations of the training method for the trust region policy optimization model above, and will not be repeated here.

[0122] In an exemplary embodiment, Figure 4 As shown, a training device for a trust region strategy optimization model is provided, comprising:

[0123] Establishing modules for building automotive system models;

[0124] A construction module, used to construct a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0125] An acquisition module, used for acquiring a standard operating condition training set based on the automobile system model and the strategy network;

[0126] A training module is used to train the strategy network and the evaluation network based on the standard working condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used to perform energy management on the vehicle.

[0127] In some embodiments, the acquisition module is specifically used to acquire a current state quantity set of the automobile system model under the action of the current engine torque, wherein the current state quantity set includes a current speed, a current acceleration, or a current remaining power state SOC;

[0128] Determine a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample;

[0129] Input the current state quantity set into the strategy network to obtain the engine torque prediction value; use the engine torque prediction value as the current engine torque, and repeat the above process to obtain the corresponding sample;

[0130] A standard working condition training set is constructed based on all the samples obtained.

[0131] In some embodiments, the training module is specifically used to obtain batch samples from the standard working condition training set;

[0132] Inputting the state quantity set and the engine torque contained in each sample in the batch of samples into the evaluation network to obtain a value function;

[0133] Determine the discounted return corresponding to the batch of samples according to the reward contained in each sample in the batch of samples; determine the approximate expectation according to the state quantity set and engine torque contained in each sample in the batch of samples;

[0134] Based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, an update parameter of the policy network is determined, and the current parameter is updated based on the update parameter.

[0135] In some embodiments, the training module is specifically used to construct an objective function based on the value function, and to approximate the objective function using the approximate expectation to obtain an approximate objective function;

[0136] Replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function;

[0137] The maximum value of the final objective function within the neighborhood of the current parameter of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained as the update parameter of the policy network.

[0138] In some embodiments, the training module is further used to record the current parameters and the updated parameters;

[0139] Based on the current parameters and the updated parameters, the model loss is calculated using a pre-constructed loss function, and training is stopped if the calculated model loss meets a preset condition.

[0140] In some embodiments, the training device of the trust region strategy optimization model further includes:

[0141] The application module is used to collect the current state quantity set of the car through sensors;

[0142] The current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the vehicle is driven according to the engine torque.

[0143] Each module in the training device of the above-mentioned trust region strategy optimization model can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0144] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 5 As 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 standard working condition training sets, trained trust region policy optimization models, etc. 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, a training method for a trust region policy optimization model is implemented.

[0145] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0146] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0147] Build automotive system models;

[0148] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0149] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0150] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0151] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0152] Acquire a current state quantity set of the automobile system model under the action of the current engine torque, wherein the current state quantity set includes a current speed, a current acceleration or a current remaining power state SOC;

[0153] Determine a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample;

[0154] Input the current state quantity set into the strategy network to obtain the engine torque prediction value; use the engine torque prediction value as the current engine torque, and repeat the above process to obtain the corresponding sample;

[0155] A standard working condition training set is constructed based on all the samples obtained.

[0156] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0157] Acquire batch samples from the standard working condition training set;

[0158] Inputting the state quantity set and the engine torque contained in each sample in the batch of samples into the evaluation network to obtain a value function;

[0159] Determine the discounted return corresponding to the batch of samples according to the reward contained in each sample in the batch of samples; determine the approximate expectation according to the state quantity set and engine torque contained in each sample in the batch of samples;

[0160] Based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, an update parameter of the policy network is determined, and the current parameter is updated based on the update parameter.

[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0162] Constructing an objective function based on the value function, and approximating the objective function using the approximate expectation to obtain an approximate objective function;

[0163] Replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function;

[0164] The maximum value of the final objective function within the neighborhood of the current parameter of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained as the update parameter of the policy network.

[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0166] Recording the current parameters and the updated parameters;

[0167] Based on the current parameters and the updated parameters, the model loss is calculated using a pre-constructed loss function, and training is stopped if the calculated model loss meets a preset condition.

[0168] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0169] Collect the current state quantity set of the car through sensors;

[0170] The current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the vehicle is driven according to the engine torque.

[0171] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0172] Build automotive system models;

[0173] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0174] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0175] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0177] Acquire a current state quantity set of the automobile system model under the action of the current engine torque, wherein the current state quantity set includes a current speed, a current acceleration or a current remaining power state SOC;

[0178] Determine a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample;

[0179] Input the current state quantity set into the strategy network to obtain the engine torque prediction value; use the engine torque prediction value as the current engine torque, and repeat the above process to obtain the corresponding sample;

[0180] A standard working condition training set is constructed based on all the samples obtained.

[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0182] Acquire batch samples from the standard working condition training set;

[0183] Inputting the state quantity set and the engine torque contained in each sample in the batch of samples into the evaluation network to obtain a value function;

[0184] Determine the discounted return corresponding to the batch of samples according to the reward contained in each sample in the batch of samples; determine the approximate expectation according to the state quantity set and engine torque contained in each sample in the batch of samples;

[0185] Based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, an update parameter of the policy network is determined, and the current parameter is updated based on the update parameter.

[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0187] Constructing an objective function based on the value function, and approximating the objective function using the approximate expectation to obtain an approximate objective function;

[0188] Replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function;

[0189] The maximum value of the final objective function within the neighborhood of the current parameter of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained as the update parameter of the policy network.

[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0191] Recording the current parameters and the updated parameters;

[0192] Based on the current parameters and the updated parameters, the model loss is calculated using a pre-constructed loss function, and training is stopped if the calculated model loss meets a preset condition.

[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0194] Collect the current state quantity set of the car through sensors;

[0195] The current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the vehicle is driven according to the engine torque.

[0196] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0197] Build automotive system models;

[0198] Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network;

[0199] Based on the automobile system model and the strategy network, obtaining a standard operating condition training set;

[0200] The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0202] Acquire a current state quantity set of the automobile system model under the action of the current engine torque, wherein the current state quantity set includes a current speed, a current acceleration or a current remaining power state SOC;

[0203] Determine a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample;

[0204] Input the current state quantity set into the strategy network to obtain the engine torque prediction value; use the engine torque prediction value as the current engine torque, and repeat the above process to obtain the corresponding sample;

[0205] A standard working condition training set is constructed based on all the samples obtained.

[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0207] Acquire batch samples from the standard working condition training set;

[0208] Inputting the state quantity set and the engine torque contained in each sample in the batch of samples into the evaluation network to obtain a value function;

[0209] Determine the discounted return corresponding to the batch of samples according to the reward contained in each sample in the batch of samples; determine the approximate expectation according to the state quantity set and engine torque contained in each sample in the batch of samples;

[0210] Based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, an update parameter of the policy network is determined, and the current parameter is updated based on the update parameter.

[0211] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0212] Constructing an objective function based on the value function, and approximating the objective function using the approximate expectation to obtain an approximate objective function;

[0213] Replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function;

[0214] The maximum value of the final objective function within the neighborhood of the current parameter of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained as the update parameter of the policy network.

[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0216] Recording the current parameters and the updated parameters;

[0217] Based on the current parameters and the updated parameters, the model loss is calculated using a pre-constructed loss function, and training is stopped if the calculated model loss meets a preset condition.

[0218] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0219] Collect the current state quantity set of the car through sensors;

[0220] The current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the vehicle is driven according to the engine torque.

[0221] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method 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 in the present application can include at least one of non-volatile memory 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), magnetic 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 in this application 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 to this. The processor involved in each embodiment provided in this application 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, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0222] 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 application.

[0223] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A training method for a trust region strategy optimization model, characterized in that: The method comprises: Build automotive system models; Constructing a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network; Based on the automobile system model and the strategy network, obtaining a standard operating condition training set; The strategy network and the evaluation network are trained based on the standard operating condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used for energy management of the automobile.

2. The method according to claim 1, characterized in that: The step of acquiring a standard operating condition training set based on the automobile system model and the strategy network includes: Acquire a current state quantity set of the automobile system model under the action of the current engine torque, wherein the current state quantity set includes a current speed, a current acceleration or a current remaining power state SOC; Determine a reward according to the fuel consumption, weight factor, SOC expected value and the current SOC of the automobile system model under the current engine torque; the current state quantity set, the current engine torque and the reward constitute a sample; Input the current state quantity set into the strategy network to obtain the engine torque prediction value; use the engine torque prediction value as the current engine torque, and repeat the above process to obtain the corresponding sample; A standard working condition training set is constructed based on all the samples obtained.

3. The method according to claim 1, characterized in that The training of the strategy network based on the standard operating condition training set includes: Acquire batch samples from the standard working condition training set; Inputting the state quantity set and the engine torque contained in each sample in the batch of samples into the evaluation network to obtain a value function; Determine the discounted return corresponding to the batch of samples according to the reward contained in each sample in the batch of samples; determine the approximate expectation according to the state quantity set and engine torque contained in each sample in the batch of samples; Based on the value function, the discounted return, the approximate expectation and the current parameters of the policy network, an update parameter of the policy network is determined, and the current parameter is updated based on the update parameter.

4. The method according to claim 3, characterized in that The step of determining update parameters of the policy network based on the value function, the discounted return, the approximate expectation, and current parameters of the policy network includes: Constructing an objective function based on the value function, and approximating the objective function using the approximate expectation to obtain an approximate objective function; Replacing the action value function in the approximate objective function with the discounted reward to obtain a final objective function; The maximum value of the final objective function within the neighborhood of the current parameter of the policy network and under the condition that the divergence with the current parameter is within a preset range is obtained as the update parameter of the policy network.

5. The method according to claim 3, characterized in that: The method further comprises: Recording the current parameters and the updated parameters; Based on the current parameters and the updated parameters, the model loss is calculated using a pre-constructed loss function, and training is stopped if the calculated model loss meets a preset condition.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Collect the current state quantity set of the car through sensors; The current state quantity set is input into the trained trust region strategy optimization model to obtain the engine torque, and the vehicle is driven according to the engine torque.

7. A training device for a trust region strategy optimization model, characterized in that: The device comprises: Establishing modules for building automotive system models; A construction module, used to construct a trust region policy optimization model to be trained, wherein the trust region policy optimization model to be trained includes a policy network and an evaluation network; An acquisition module, used for acquiring a standard operating condition training set based on the automobile system model and the strategy network; A training module is used to train the strategy network and the evaluation network based on the standard working condition training set to obtain a trained trust region strategy optimization model, and the trained trust region strategy optimization model is used to perform energy management on the vehicle.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.