Construction method of cost function, computer readable storage medium and program product
By constructing an initial cost function and using driving data to determine unknown parameters, the problem of the cost function relying on human experience is solved, thereby improving the stability and safety of the vehicle decision-making and planning system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG GEELY HLDG GRP CO LTD
- Filing Date
- 2025-05-29
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the cost function of vehicle decision planning systems relies on personal experience, resulting in high function randomness and parameters lacking physical meaning, making it difficult to improve performance.
By constructing an initial cost function based on target driving behavior indicators, obtaining a set of driving data, using data-driven methods to determine the estimated values of unknown parameters, constructing the target cost function, and ensuring the consistency and physical meaning of the function.
It eliminates subjective differences among engineers, improves the stability and functional safety of the decision-making and planning system, and enhances driver assistance capabilities.
Smart Images

Figure CN120256793B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of driver assistance technology, and in particular to a method for constructing a cost function, a computer-readable storage medium, and a program product. Background Technology
[0002] In assisted driving scenarios, the decision and planning system (DPS) is a core component of vehicle-assisted driving. On one hand, it generates vehicle trajectory and speed plans, enabling the vehicle to follow traffic rules and respond to various traffic participants and changes in road conditions. On the other hand, it uses a cost function to quantify the merits of different driving decisions, thereby determining the most suitable driving decision. The structural design and parameter configuration of the cost function directly determine the algorithmic efficiency, functional safety, and assisted driving capabilities of the DPS, thus affecting the quality of related products and user experience satisfaction.
[0003] In related technologies, the cost function in vehicle decision-making and planning systems is often designed based on the personal experience of automotive engineers. However, because this method relies too heavily on personal experience, the cost function becomes random, with significant differences in cost functions constructed by engineers of different skill levels. This leads to instability in the performance of the aforementioned decision-making and planning system. Furthermore, the parameter settings in the cost function lack physical meaning, resulting in blind and inefficient subsequent function debugging, making it difficult to improve performance even with significant time investment. Summary of the Invention
[0004] In view of this, this specification provides a method for constructing a cost function, a computer-readable storage medium, and a program product to address the shortcomings of related technologies.
[0005] Specifically, this specification is implemented through the following technical solution:
[0006] According to a first aspect of this specification, an initial cost function is provided for determining a corresponding target driving behavior index, wherein the initial cost function contains unknown parameters.
[0007] Obtain a set of driving data for the target driving behavior indicator, wherein the set of driving data includes the actual values of the target driving behavior indicator and its corresponding cost observations;
[0008] The estimated values of the unknown parameters are determined based on the driving data set, and a target cost function is constructed based on the estimated values and the initial cost function.
[0009] According to a second aspect of this specification, an apparatus for constructing a cost function is provided, the apparatus comprising:
[0010] An initial cost function determination unit is used to determine a corresponding initial cost function based on a target driving behavior index, wherein the initial cost function contains unknown parameters.
[0011] A driving data set acquisition unit is used to acquire a driving data set for the target driving behavior indicator, wherein the driving data set includes the actual values of the target driving behavior indicator and its corresponding cost observation values;
[0012] The target cost function construction unit is used to determine the estimated values of the unknown parameters based on the driving data set, and to construct a target cost function based on the estimated values and the initial cost function.
[0013] According to a third aspect of this specification, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0014] According to a fourth aspect of this specification, a computer program product includes a computer program / instructions that, when executed by a processor, implement the steps of the method described in the first aspect.
[0015] This specification avoids the problems of over-reliance on human experience and lack of physical meaning in cost function design by using a data-driven approach. Specifically, an initial cost function containing unknown parameters can be constructed based on the target driving behavior index. Simultaneously, a set of driving data, including the actual values of the target driving behavior index and their corresponding cost observations, is obtained. Parameter estimation is then performed based on this dataset, resulting in a quantifiable and optimizable mathematical problem. This process effectively eliminates the randomness of the function caused by subjective differences among engineers. A unified data fitting criterion ensures high consistency in cost functions constructed by engineers of different skill levels, significantly improving the stability of the decision-making and planning system. Furthermore, the estimated values of the unknown parameters in the initial cost function are derived from the inherent correlation of actual driving data, giving the unknown parameters clear physical meaning and providing a reliable basis for subsequent understanding, debugging, and optimization of the target cost function. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this specification, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of this specification, and those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0017] Figure 1 This is a flowchart illustrating a method for constructing a cost function according to an embodiment disclosed in this specification;
[0018] Figures 2a-2f This is a schematic diagram of the visualized target cost function shown in the embodiments disclosed in this specification;
[0019] Figure 3 This is a schematic diagram of the architecture of a cost function construction system shown in the embodiments disclosed in this specification;
[0020] Figure 4 This is a schematic structural diagram of an electronic device shown in the embodiments of this specification;
[0021] Figure 5 This is a block diagram of a cost function construction apparatus shown in an embodiment of this specification. Detailed Implementation
[0022] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification.
[0023] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0024] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0025] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. The collection, use and processing of related data shall comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals shall be provided for users to choose to authorize or refuse.
[0026] Figure 1This is a flowchart illustrating an exemplary embodiment disclosed in this specification, which may specifically include the following steps:
[0027] Step S102: Determine the corresponding initial cost function based on the target driving behavior index, wherein the initial cost function contains unknown parameters.
[0028] In vehicle decision-making and planning systems, the requirements for driving decisions typically revolve around three dimensions: safety, comfort, and efficiency. Therefore, the cost functions used to quantify and evaluate these driving decisions can also be categorized into these three types: safety cost function, comfort cost function, and efficiency cost function. Each type of cost function can be influenced by one or more driving behavior indicators, such as lateral distance to oncoming vehicles (or vehicles traveling in the same direction in adjacent lanes), following distance, lateral deviation of the vehicle, acceleration (acceleration, jerk), clearance, and distance to static obstacles.
[0029] The approach described in this specification first involves constructing an initial cost function based on the aforementioned target driving behavior indicators. This initial cost function, in addition to independent and dependent variables, also includes unknown parameters to be determined, such as parameters a, b, and c in the function y = ax² + bx + c, or parameter 'a' in the function y = ax. Therefore, compared to fixed functions where all parameters are known, this specification refers to functions containing unknown parameters as generalized functions. The core of this step lies in establishing a mathematical relationship between cost and driving behavior indicators based on the initial cost function, laying the foundation for subsequent data-driven optimization.
[0030] The initial cost function can be determined based on the function template corresponding to the target driving behavior index, thereby ensuring that the initial cost function can reasonably adapt to different driving needs.
[0031] In one embodiment, a set of driving behavior indicators can be determined based on a preset cost function design objective. For this set, at least one driving behavior indicator can be selected as the target driving behavior indicator. An initial cost function is then determined based on the target driving behavior indicator and a function template. The function template maintains a correspondence between each driving behavior indicator and a function structure. The cost function design objective can be considered as the aforementioned requirements for driving decisions, namely, safety design objectives, comfort design objectives, and efficiency design objectives. Different cost function design objectives correspond to different sets of driving behavior indicators. For example, a safety design objective corresponds to a set of driving behavior indicators including lateral distance to oncoming vehicles (or vehicles traveling in the same direction in adjacent lanes), following distance, and distance to static obstacles; a comfort design objective corresponds to a set of driving behavior indicators including lateral deviation, acceleration, and jerk; and an efficiency design objective corresponds to a set of driving behavior indicators including unit travel time and passability.
[0032] From a predefined set of driving behavior indicators, at least one indicator can be selected as the target driving behavior indicator using preset filtering rules such as blacklists / whitelists and multi-objective priority. Simultaneously, based on a preset function template, the selected target driving behavior indicator can be mapped to a corresponding function structure. The function template can constrain the function structure of the initial cost function to ensure the physical meaning of the parameters is clear. Furthermore, the function structure can employ linear and / or nonlinear functions, thus flexibly adapting to diverse driving scenarios. For example, when following distance is a target driving behavior that falls under the safety design objective, the function template can specify a nonlinear function such as the logistic function (also known as the sigmoid) or an exponential function as the initial cost function to accurately characterize the risk changes and driving safety trends across different following distance ranges. Alternatively, when acceleration is a target driving behavior that falls under the comfort design objective, the function template can specify a polynomial function such as a quadratic or quartic term as the initial cost function to smoothly quantify the accumulation of discomfort and more precisely reflect the relationship between vehicle driving status and user driving comfort. Or, when unit travel time is a target driving behavior that falls under the efficiency design objective, the function template can specify a linear function such as a piecewise linear function as the initial cost function to directly correlate time / distance loss.
[0033] Besides the sigmoid, exponential, polynomial, and piecewise linear functions mentioned earlier, the function structure of the initial cost function can also be determined based on spline curves or constructed using neural networks. Spline curves, with their good smoothness and continuity, can more naturally describe the relationship between the target driving behavior index and the corresponding cost observations. Similar to sigmoid and polynomial curves, they can flexibly adapt to cost variation trends under different driving scenarios. Neural networks, on the other hand, can automatically learn complex features and relationships in the data through multiple hidden layers. When dealing with complex driving scenarios such as multi-vehicle interactions and pedestrian interference on urban roads, neural networks can construct high-precision initial cost functions from large amounts of real-world driving data.
[0034] Of course, the correspondence between the above driving behavior indicators and function structures can be adjusted according to actual scenarios or business needs. For example, following distance can correspond to safety design goals and comfort design goals separately or simultaneously. Furthermore, the same driving behavior indicator under different design goals can also correspond to different function templates. This specification does not impose any restrictions on this.
[0035] The following table, using Table 1 as an example, illustrates the correspondence between different driving behavior indicators and function structures.
[0036] Table 1
[0037]
[0038] Among them, the cost functions corresponding to the two driving behavior indicators of lateral distance to oncoming vehicles and distance to obstacles both adopt sigmoid curves. Based on parameter b1, the cost y can be smoothly described as a function of variable x, ensuring a continuous transition of cost within a reasonable range and adapting to safety assessments in complex scenarios. For the function structures corresponding to the two driving behavior indicators of lateral offset, acceleration, and jerk, all three employ cubic polynomials to ensure continuous differentiability. Simultaneously, considering their impact on comfort, parameters k1~k6 are used to adjust and match the human body's perception of changes in offset, acceleration, and jerk in different directions. For the cost function corresponding to the driving behavior indicator of passability, a piecewise linear structure is adopted. The shorter the distance x, the worse the passability; when the distance exceeds maxTrajLength, the cost is 0, reflecting efficient vehicle passability.
[0039] Step S204: Obtain a set of driving data for the target driving behavior indicator, wherein the set of driving data includes the actual values of the target driving behavior indicator and its corresponding cost observation values.
[0040] After determining the initial cost function, to determine the values of the unknown parameters, a driving data set containing the actual values of the target driving behavior indicators and their corresponding cost observations can be collected. This driving data set can come from real road tests, driving simulators, or historical driving logs, ensuring coverage of various driving scenarios such as urban roads, highways, residential areas, and parking lots. This driving data set contains a rich set of driving behaviors, including acceleration, deceleration, steering, following, and avoidance maneuvers in different scenarios. The actual values of the target driving behavior indicators corresponding to these behaviors can be recorded, along with the corresponding cost observations. Based on these two, a driving data set with a "behavior-cost" pair structure can be constructed, providing a data foundation for calculating the unknown parameters in subsequent steps. The cost observations, as cost results obtained from actual observations, can be indirectly calibrated through expert rule scoring, passenger comfort feedback, or energy efficiency indicators, or generated through a pre-set multi-objective optimization model; this specification does not impose any limitations on this.
[0041] The following example uses the following distance and the cost observation value determined based on the safety score in a highway following scenario. The actual values of the driving data set can be represented as [10, 15, 20, 25, 30], and the cost observation value is [0.95, 0.85, 0.7, 0.5, 0.3]. The values of the two arrays correspond one-to-one in order. Assuming that the initial cost function is the Sigmoid function, as the following distance gradually increases from 10 meters to 30 meters, the safety score, which is used as the cost observation value, gradually decreases from a high cost representing high risk to a low cost representing low risk.
[0042] Furthermore, considering that the diversity and completeness of data directly affect the accuracy of parameter estimation, data cleaning and normalization can be used to eliminate noise and unify the dimensions, thus forming a high-quality driving data set.
[0043] Step 206: Determine the estimated values of the unknown parameters based on the driving data set, and construct a target cost function based on the estimated values and the initial cost function.
[0044] Based on the acquired driving data set, the estimated values of unknown parameters in the initial cost function can be calculated. Finally, the estimated values are substituted into the initial cost function to obtain a new target cost function. This target cost function combines theoretical rationality and data adaptability, accurately reflecting the mapping relationship between driving behavior and overall cost, and providing an interpretable quantitative evaluation basis for the vehicle system.
[0045] Regarding the process of determining the estimated values, this manual provides different methods to achieve this based on actual needs, balancing data adaptation with the efficiency of solving complex scenarios.
[0046] In one embodiment, a loss function is constructed based on the actual values in the aforementioned driving dataset and their corresponding cost observations. This loss function is then minimized using a numerical optimization algorithm to determine the estimated values. This embodiment quantifies the deviation between the initial cost function prediction and the actual cost observations by constructing the loss function, and iteratively solves for the optimal parameters using a numerical optimization algorithm to obtain the estimated values. Depending on the characteristics of the target driving behavior index, mean squared error (MSE), cross-entropy, or Huber loss can be selected as optimization objectives. The numerical optimization algorithms include first-order gradient methods suitable for large-scale data and nonlinear cost functions, such as stochastic gradient descent (SGD) and the Adam algorithm; second-order derivative methods that utilize derivative information to accelerate high-precision parameter convergence, such as Newton's method, quasi-Newton methods, and the Levenberg-Marquardt (LM) algorithm; and global optimization methods that support escaping local optima, such as genetic algorithms and particle swarm optimization algorithms. In summary, this embodiment clarifies the physical meaning of unknown parameters by directly utilizing data-driven optimization, making it suitable for efficient solutions of differentiable cost functions. It can be summarized as an unknown parameter determination method based on identification algorithms.
[0047] In another embodiment, the policy network or reward function of the reinforcement learning framework is initialized based on the aforementioned driving dataset, and the estimated values are determined according to the reinforcement learning framework. This embodiment can model the problem of calculating unknown parameters as a Markov Decision Process (MDP) and dynamically optimize the parameters through interaction between the agent and the environment. The policy network can output parameter adjustment actions, such as parameter increments, and the initial policy can be pre-trained based on the driving dataset; the reward function can be designed based on the matching degree between the cost observation and the predicted value. Simultaneously, an actor-critic framework or proximal policy optimization (PPO) can be used to update the estimated values of unknown parameters through a preset policy gradient. For example, in a highway scenario, the agent can try different unknown parameters of the cost function related to speed and acceleration. If the decision result allows the vehicle to maintain efficient driving while ensuring safety and a certain level of comfort, a positive reward is obtained; otherwise, a penalty is incurred. Through extensive iterative training, the aforementioned agent can find the unknown parameters of the cost function that are suitable for the scenario. This approach eliminates the reliance on expert driving data and focuses more on autonomous exploration and optimization in the real environment.
[0048] In another embodiment, a probabilistic model of the initial cost function is constructed based on the aforementioned cost observations. A Bayesian optimization framework is used to iteratively update the posterior distribution of the unknown parameters to determine the estimated values. This embodiment can construct a probabilistic surrogate model to guide the search for unknown parameters for cost functions with black-box or high-cost evaluation. Specifically, for the probabilistic model, prior distribution assumptions can be made about the parameter space, and then the posterior distribution is continuously updated based on existing observation data to determine the next parameter point most likely to optimize the initial cost function for testing. For example, when determining the unknown parameters of the comfort cost function, a prior distribution of the unknown parameters can be assumed first. Then, the comfort effects corresponding to different combinations of unknown parameters are tested under different driving scenarios. The posterior distribution of the parameters is updated based on these observations, gradually approaching the optimal unknown parameter values, i.e., the estimated values.
[0049] After obtaining the estimated values, they can be substituted into the initial cost function to construct the final target cost function. Simultaneously, this target cost function is visualized to generate a graphical interface representing the correspondence between the actual values of the target driving behavior indicator and the corresponding cost observations. This allows developers to intuitively verify the rationality of the estimated parameter values and improves debugging efficiency and decision interpretability. Specifically, the target cost function can be input into a preset visualization engine, and a dynamic curve showing the changes in the target driving behavior indicator can be generated through numerical simulation. For example, for the target cost function corresponding to the target driving behavior indicator of following distance, a distribution map of cost function values under different following distances can be plotted, and preset safety threshold critical points can be marked, intuitively reflecting the nonlinear penalty characteristics of the function for dangerous distances. Furthermore, parameter adjustment controls such as sliders and input boxes can be embedded in the graphical interface, allowing users to dynamically modify the parameter values in the target cost function and rendering the updated function curve in real time for comparison with the fitting effect of the driving data set. For example, when adjusting the weight coefficient of the trajectory smoothness function, the interface simultaneously displays the sensitivity distribution of parameter changes to the cost calculation results of historical trajectory data, aiding in verifying the rationality of the parameters.
[0050] Furthermore, the visualization module can identify outlier data points in the driving dataset that deviate from the prediction range of the target cost function, and annotate them in the graphical interface through highlighting or pop-up prompts. For example, if the cost observation value in an emergency braking scenario is significantly higher than the cost prediction value in the function, a visual alarm is triggered, prompting a re-evaluation of the function structure or parameter settings.
[0051] The following section, in conjunction with the initial cost function in Table 1, discusses... Figures 2a-2f The visualized objective cost function will be introduced below:
[0052] like Figure 2aAs shown, the horizontal axis ego2objLatDistance represents the lateral distance between the vehicle and the oncoming vehicle, in meters; the vertical axis ego2objLatSafetyCost represents the estimated cost of the lateral distance to the oncoming vehicle (hereinafter referred to as cost for ease of discussion). The curve ego2objLatSafetyCostFunction can show how the cost changes with distance, i.e., the cost function. Points such as (-1.2, 0.80) indicate that when the lateral distance is small, such as -1.2 meters, the safety cost is 0.80, meaning that the lateral distance to the oncoming vehicle is close and the safety risk is high. As the distance increases, such as at 0.4 meters, the cost drops to 0.17, indicating that when the distance is large enough, the safety risk is low and the cost begins to approach 0. The asterisk-marked points originalSamples are data points representing the actual values in the driving dataset and their corresponding cost observations. Combined with the curve, they can show the difference between the cost observation and the estimated cost for the same actual value.
[0053] like Figure 2b As shown, the horizontal axis `toEnvObstacleMinDistance` represents the minimum distance to obstacles in the environment, in meters, while the vertical axis `toEnvSafetyCost` represents the safety cost related to the distance to the obstacle. The curve `toEnvSafetyCostbia` indicates how the cost changes with the distance to the obstacle, i.e., the cost function. Points such as (-1.0, 1.00) indicate that when the distance is close, for example, at -1.0 meters, the safety cost is 1.00, meaning that being close to the obstacle poses a high risk. As the distance increases, for example, at 1.4 meters, the cost becomes 0.00, indicating that when the distance to the obstacle is sufficiently far, the safety risk is low, and the cost approaches 0.
[0054] like Figure 2c As shown, the horizontal axis `offset` represents the vehicle's lateral offset in meters, and the vertical axis `offsetCost` represents the cost of this lateral offset. The curve `offsetCostFunction` illustrates the relationship between the cost and the offset, i.e., the cost function. The marked point (0.0, 0.00) indicates that when the offset is at the ideal position of 0, the cost is 0.00. Offsets in the positive and negative directions, such as to -2.0 meters or 1.0 meter, increase the cost, indicating that the further the vehicle deviates from the ideal position, the greater the impact on driving comfort and the higher the cost.
[0055] like Figure 2dAs shown, the horizontal axis "acceleration" represents acceleration in meters per second squared, and the vertical axis "comfortAccCost" represents the comfort cost associated with acceleration. The curve "comfortAccCostFunction" reflects the cost as acceleration changes, i.e., the cost function. The point (0.0, 0.00) indicates that the cost is 0.00 when the offset is 0, the ideal position; points such as (-3.0, 2.85) and (2.0, 3.00) indicate that as the absolute value of acceleration increases, the cost rises, suggesting that the human body prefers a smooth acceleration.
[0056] like Figure 2e As shown, the horizontal axis "acceleration" represents acceleration in meters per second squared (m²), the vertical axis "jerk" represents jerk acceleration in meters per second cubic (m³), and the vertical axis "comfortCost" represents the comfort cost resulting from the combined effects of acceleration and jerk. The surface illustrates the impact of simultaneous changes in acceleration and jerk on the comfort cost. The closer to the origin, the smoother the changes in acceleration and jerk, and the lower the comfort cost. Further away from the origin, the cost increases, reflecting the human body's preference for smooth acceleration and jerk changes. When these changes are not smooth, the comfort cost increases.
[0057] like Figure 2f As shown, the horizontal axis *trajectoryLength* represents the trajectory length in meters, and the vertical axis *passabilityCost* represents the passability cost. The line graph shows the relationship between trajectory length and passability cost, i.e., the cost function. Points such as (-1.5, 1.00) and (11.5, 0.00) indicate that when the trajectory length is short, such as 1.0 meter or a small positive value, the cost is high, meaning that short trajectories are difficult to pass. As the trajectory length increases, the cost decreases, reaching 0.00 at 11.5 meters, meaning that longer trajectories are more advantageous for passage, while short trajectories have poor passability and high cost.
[0058] At this point, the estimated values of the unknown parameters can be saved and written into the code software for subsequent testing and evaluation. The initial construction process for the objective cost function has been completed, as follows: Figure 3 One embodiment of the local offline design flow illustrates a process that can be implemented by a server. This server can be a physical server containing a single host, or a virtual server hosted within a host cluster. During operation, the server can store and manage expert driving datasets as driving data sets, and provide computational support for parameter estimation methods based on, for example, identification algorithms. It also supports graphical visualization of the target cost function, i.e., generating dynamic curves and graphical interfaces of the cost function through computation, thereby providing feedback optimization for the initial cost function or expert driving datasets corresponding to multiple target driving behavior indicators.
[0059] After constructing the target cost function, it can be verified and iteratively optimized through online virtual simulation platforms and / or offline real-vehicle programs to ensure its robustness and generalization ability in real-world driving scenarios. Specifically, the target cost function can be integrated into simulation environments such as CARLA and Prescan, and then diverse test scenarios can be constructed, including extreme weather, complex traffic flow, and edge cases such as emergency braking or vehicle malfunctions. Driving behavior indicators can be recorded through simulation logs to verify the rationality of the cost function's decision-making in the virtual environment. Alternatively, the target cost function can be deployed to the decision-making and planning system of a real vehicle. Sensor data such as LiDAR point clouds, camera images, and millimeter-wave radar signals, as well as driving behavior feedback such as driver intervention frequency and passenger comfort scores, can be collected in closed environments and open roads. Then, the onboard computing unit can run adaptive filtering algorithms such as Kalman filtering or incremental learning models in real time to dynamically adjust the current parameters of the cost function based on real-vehicle data. Of course, virtual simulation platforms and offline real-vehicle programs can also collaboratively process the cost function across platforms.
[0060] Still with Figure 3 For example, after the local offline design process shown in the diagram is completed, the target cost function and its estimated values can be written into the engineering code used for testing to enter the real-vehicle online testing process. This process can rely on two testing platforms, Software-in-the-Loop (SiL) and Hardware-in-the-Loop (HiL), to conduct comprehensive testing of the cost function's performance. SiL testing focuses on verifying the cost function under real-vehicle scenarios. HiL testing centers on local data playback. The data recorded in the SiL test is played back on the HiL platform, and detailed charts of vehicle behavior and costs are generated as the output analysis results using analysis tools such as Excel and professional graphing software. Engineers can then deeply analyze the performance of the cost function under different operating conditions to determine whether it meets the requirements of safety, comfort, and efficiency, further supporting function feedback optimization. It is understandable that this process can be implemented on the same server equipment as the local offline design process, or it can be deployed independently on other server equipment.
[0061] It is worth mentioning that the estimated value of the objective cost function mentioned above is only a general parameter. The cost function construction method in this specification can further support the customization of personalized parameters for each user.
[0062] In one embodiment, a personal driving data set of the target user can first be obtained. Based on the estimated values and the personal driving data set, customized values for the unknown parameters are determined. A customized cost function is then constructed based on the customized values and the initial cost function. In this embodiment, the personal driving data set is essentially the same as the driving data set described above, except that it can be obtained by collecting long-term driving data from the target user through an on-board diagnostic (OBD) system, a smart cockpit system, or a mobile application (APP). This personal driving data set can be sent back to the server to redetermine customized values for the individual user. Simultaneously, by substituting the customized values into the initial cost function, a user-specific customized cost function can be generated, thus adapting to different users' driving styles.
[0063] Simultaneously, based on user driving preferences and vehicle performance constraints, a customized range for the estimated values can be determined. This ensures that the customized values determined based on the aforementioned personal driving data set fall within the estimated customized range, preventing the customization from deviating from the safety boundary. Specifically, user driving preferences can categorize users into at least two types: aggressive and conservative. For example, the safety distance threshold can be appropriately relaxed for the former, allowing for higher acceleration; while the latter can have a tighter safety threshold, limiting the jerk amplitude. Vehicle performance can be reflected in the vehicle's power performance, braking ability, and steering capability. For instance, a feasible domain for acceleration parameters can be set based on the upper limit of motor torque or fuel economy curves, or the maximum permissible following distance can be deduced from the braking distance.
[0064] Or with Figure 3 For example, both the aforementioned local offline design and real-vehicle online testing processes belong to the cost function design and development stage. Correspondingly, this corresponds to a vehicle-based data closed-loop system, as shown in the figure. During actual driving, mass-produced vehicles can acquire behavioral data during the driving process through user-controlled data collection, forming the aforementioned personal driving data set. This includes actual values of target driving behavior indicators such as lateral deviation, acceleration, and distance to obstacles, along with their corresponding cost observations. Simultaneously, the vehicle can feed this dataset back to the cost function design and development stage, providing real-world scenario data for the definition of the function structure and parameter estimation of the aforementioned generalized function, ultimately used to construct and optimize the customized cost function. The optimized customized cost function can be updated to the mass-produced vehicle via Over-the-Air (OTA) technology, enabling it to apply the new customized cost function. The vehicle continues to operate under the new customized cost function, collecting user driving data again to form a new personal driving data set, repeating the above process.
[0065] Figure 4 This is a schematic structural diagram of an electronic device according to an exemplary embodiment. Please refer to... Figure 4 At the hardware level, the electronic device includes a processor 402, an internal bus 410, a network interface 404, memory 406, and non-volatile memory 408, and may also include other necessary hardware. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it, forming a risk code detection device at the logical level. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.
[0066] Figure 5 This specification illustrates a block diagram of a cost function construction apparatus according to embodiments. Please refer to... Figure 5 This device can be applied to, for example Figure 4 The device shown, for implementing the technical solution described in this specification, includes:
[0067] The initial cost function determination unit 502 is used to determine the corresponding initial cost function based on the target driving behavior index, wherein the initial cost function contains unknown parameters.
[0068] The driving data set acquisition unit 504 is used to acquire a driving data set for the target driving behavior indicator, wherein the driving data set includes the actual value of the target driving behavior indicator and its corresponding cost observation value;
[0069] The target cost function construction unit 506 is used to determine the estimated value of the unknown parameter based on the driving data set, and construct the target cost function based on the estimated value and the initial cost function.
[0070] Optionally, the initial cost function determination unit 502 is specifically used for:
[0071] The set of corresponding driving behavior indicators is determined based on the preset cost function design objective;
[0072] Select at least one driving behavior indicator from the set of driving behavior indicators as the target driving behavior indicator;
[0073] The initial cost function is determined based on the target driving behavior index and the function template; the function template maintains the correspondence between each driving behavior index and the function structure.
[0074] Optionally, the function structure may employ linear and / or nonlinear functions.
[0075] Optionally, the objective cost function construction unit 506 is specifically used for:
[0076] A loss function is constructed based on the actual values in the driving dataset and their corresponding cost observations, and the loss function is minimized using a numerical optimization algorithm to determine the estimated value; or...
[0077] Initialize the policy network or reward function of the reinforcement learning framework based on the driving data set, and determine the estimated value based on the reinforcement learning framework; or,
[0078] Based on the cost observations, a probabilistic model of the initial cost function is constructed, and the posterior distribution of the parameters is iteratively updated using a Bayesian optimization framework to determine the estimated value.
[0079] Optionally, the device further includes:
[0080] The personal driving data set acquisition unit is used to acquire the personal driving data set of the target user;
[0081] The customized cost function construction unit determines the customized values of the unknown parameters based on the estimated values and the personal driving data set, and constructs a customized cost function based on the customized values and the initial cost function.
[0082] Optionally, the custom cost function construction unit is specifically used for:
[0083] The customization range for the estimated value is determined based on the target user's driving preference information and the vehicle information of the target vehicle driven by the user.
[0084] The customized value of the unknown parameter is determined based on the personal driving data set, and the customized value is within the customized range of the estimated value.
[0085] Optionally, the device further includes:
[0086] The function visualization unit is used to perform visualization analysis on the target cost function to generate a graphical interface that characterizes the correspondence between the actual values of the target driving behavior index and the corresponding cost observation values.
[0087] Optionally, the device further includes:
[0088] The function testing unit is used to input the target cost function into the online virtual simulation platform and / or the offline real vehicle program to test and optimize the target cost function.
[0089] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0090] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0091] Based on the same concept as the methods described above, this specification also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor performs the steps of the method as described in any of the above embodiments by executing the executable instructions.
[0092] Based on the same concept as the methods described above, this specification also provides a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0093] Based on the same concept as the methods described above, this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the methods as described in any of the above embodiments.
[0094] The embodiments of the subject matter and functional operation described in this specification can be implemented in the following ways: digital electronic circuits, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and their structural equivalents, or combinations thereof. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by a data processing apparatus or for controlling the operation of a data processing apparatus. Alternatively or additionally, the program instructions may be encoded on artificially generated propagation signals, such as machine-generated electrical, optical, or electromagnetic signals, which are generated to encode information and transmit it to a suitable receiving device for execution by the data processing apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or combinations thereof.
[0095] The processing and logic flow described in this specification can be executed by one or more programmable computers that execute one or more computer programs to perform corresponding functions by operating on input data and generating output. The processing and logic flow can also be executed by dedicated logic circuitry—such as FPGAs (Field-Programmable Gate Arrays) or ASICs (Application-Specific Integrated Circuits), and the device can also be implemented as dedicated logic circuitry.
[0096] Suitable computers for executing computer programs include, for example, general-purpose and / or special-purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit receives instructions and data from read-only memory and / or random access memory. The basic components of a computer include a central processing unit for implementing or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include one or more mass storage devices for storing data, such as disks, magneto-optical disks, or optical disks, or the computer will be operatively coupled to such mass storage devices to receive data from or transfer data to them, or both. However, a computer is not required to have such devices. Furthermore, a computer can be embedded in another device, such as a mobile phone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a global positioning system (GPS) receiver, or a portable storage device such as a universal serial bus (USB) flash drive, to name a few.
[0097] Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media, and memory devices, such as semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disks or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. Processors and memory may be supplemented by or incorporated into dedicated logic circuitry.
[0098] While this specification contains numerous specific implementation details, these should not be construed as limiting the scope of any invention or the scope of the claims, but rather are primarily intended to describe features of specific embodiments of a particular invention. Certain features described in the various embodiments herein may also be implemented in combination in a single embodiment. Conversely, various features described in a single embodiment may also be implemented separately in various embodiments or in any suitable sub-combination. Furthermore, while features may function in certain combinations as described above and even initially claimed in this way, one or more features from a claimed combination may be removed from that combination in some cases, and a claimed combination may refer to a sub-combination or a variation thereof.
[0099] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring these operations to be performed in the specific order shown or sequentially, or requiring all illustrated operations to be performed to achieve the desired result. In some cases, multitasking and parallel processing may be advantageous. Furthermore, the separation of various system modules and components in the above embodiments should not be construed as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
[0100] Therefore, specific embodiments of the subject matter have been described. Furthermore, the processes depicted in the figures are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0101] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.
Claims
1. A method for constructing a cost function, characterized in that, The method includes: An initial cost function is determined based on the target driving behavior index. The initial cost function contains unknown parameters. The function structure of the initial cost function adopts a linear function and / or a nonlinear function. The unknown parameters are parameters inside the function structure of the initial cost function. The unknown parameters are used to describe the mapping relationship between the actual value of the target driving behavior index and the corresponding cost observation value. Obtain a set of driving data for the target driving behavior indicator, wherein the set of driving data includes the actual values of the target driving behavior indicator and its corresponding cost observations; The estimated values of the unknown parameters are determined based on the driving data set, and a target cost function is constructed based on the estimated values and the initial cost function, so that the unknown parameters have a clear physical meaning. The target cost function is used to evaluate and select the vehicle driving trajectory for different driving decisions in the vehicle's decision planning system.
2. The method according to claim 1, characterized in that, The step of determining the corresponding initial cost function based on the target driving behavior index includes: The set of corresponding driving behavior indicators is determined based on the preset cost function design objective; Select at least one driving behavior indicator from the set of driving behavior indicators as the target driving behavior indicator; The initial cost function is determined based on the target driving behavior index and the function template; the function template maintains the correspondence between each driving behavior index and the function structure.
3. The method according to claim 1, characterized in that, The step of determining the estimated value of the unknown parameter based on the driving data set includes: A loss function is constructed based on the actual values in the driving dataset and their corresponding cost observations, and the loss function is minimized using a numerical optimization algorithm to determine the estimated value; or... Initialize the policy network or reward function of the reinforcement learning framework based on the driving data set, and determine the estimated value based on the reinforcement learning framework; or, Based on the cost observations, a probabilistic model of the initial cost function is constructed, and the posterior distribution of the parameters is iteratively updated using a Bayesian optimization framework to determine the estimated value.
4. The method according to claim 1, characterized in that, The method further includes: Obtain the target user's personal driving data set; Based on the estimated values and the personal driving data set, the customized values of the unknown parameters are determined, and a customized cost function is constructed based on the customized values and the initial cost function.
5. The method according to claim 4, characterized in that, The process of determining the customized value of the unknown parameter based on the estimated value and the personal driving data set includes: The customization range for the estimated value is determined based on the target user's driving preference information and the vehicle information of the target vehicle driven by the user. The customized value of the unknown parameter is determined based on the personal driving data set, and the customized value is within the customized range of the estimated value.
6. The method according to claim 1, characterized in that, The method further includes: The target cost function is visualized and analyzed to generate a graphical interface that characterizes the correspondence between the actual values of the target driving behavior index and the corresponding cost observations.
7. The method according to claim 1, characterized in that, The method further includes: The objective cost function is input into an online virtual simulation platform and / or an offline real vehicle program to test and optimize the objective cost function.
8. A device for constructing a cost function, characterized in that, The device includes: An initial cost function determination unit is used to determine the corresponding initial cost function based on the target driving behavior index. The initial cost function contains unknown parameters. The function structure of the initial cost function adopts a linear function and / or a nonlinear function. The unknown parameters are parameters inside the function structure of the initial cost function. The unknown parameters are used to describe the mapping relationship between the actual value of the target driving behavior index and the corresponding cost observation value. A driving data set acquisition unit is used to acquire a driving data set for the target driving behavior indicator, wherein the driving data set includes the actual values of the target driving behavior indicator and its corresponding cost observation values; The target cost function construction unit is used to determine the estimated value of the unknown parameter based on the driving data set, and construct a target cost function based on the estimated value and the initial cost function, so that the unknown parameter has a clear physical meaning. The target cost function is used to evaluate and select the vehicle driving trajectory for different driving decisions in the vehicle decision planning system.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 7.
10. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Vehicle, vehicle automatic driving control method and device and medium
CN118560503A