Dynamic symbolic execution and constraint parsing method based on abstract syntax tree of automobile code

Through dynamic symbol execution and constraint analysis methods based on the car code abstract syntax tree, the feasibility analysis and signal transmission frequency determination of the vehicle code path are solved, and the executability of the vehicle code is improved.

CN118760614BActive Publication Date: 2025-03-04BEIJING KEYWARE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411250246.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-03-04
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

The existing vehicle code lacks the runability analysis of the code path after solving, which makes some codes unable to respond during execution.

Method used

The dynamic symbol execution and constraint analysis method based on the automotive code abstract syntax tree is adopted, and the abstract syntax tree is generated through the parsing programming language, and the dynamic symbol execution engine is initialized to traverse the abstract syntax tree, simulate and explore the execution path, process path constraints, determine feasible paths, and determine the signal transmission frequency.

Benefits of technology

Through the feasibility analysis of the code path and the determination of signal transmission frequency, it is ensured that the code execution information can reach the instruction target, increase the executability of the code, and ensure that the code can respond and complete tasks during the execution process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760614B_ABST
    Figure CN118760614B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of code path analysis, and in particular to a dynamic symbolic execution and constraint parsing method based on an abstract syntax tree of automobile code, including: parsing a programming language to generate an abstract syntax tree; initializing a dynamic symbolic execution engine, traversing the abstract syntax tree using the dynamic symbolic execution engine, and accessing and analyzing the nodes of the abstract syntax tree; simulating and exploring the instruction execution path according to a predetermined operation instruction, and determining an executable code execution information transmission path according to the operation of the code; processing the code execution information transmission path constraint through a constraint solver, solving the path constraint, and determining whether there is a feasible solution; determining the instruction path that can complete the instruction path or alarming the instruction path with problems; and determining the signal sending frequency for the code execution information transmission path that can transmit the instruction. The present invention ensures that the information that can be executed in the code can reach the instruction target, thereby increasing the executable nature of the code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of code path analysis, and in particular to a dynamic symbolic execution and constraint parsing method based on an abstract syntax tree of automobile code. Background Art

[0002] In modern society, with the rapid advancement of technology and people's constant pursuit of travel safety, efficiency, and comfort, vehicle automation technology has emerged. Traditional vehicle operation relies primarily on the operation and judgment of human drivers. However, human factors inevitably lead to problems such as fatigue, delayed response, and operational errors, which increase the risk of traffic accidents. To address these issues, vehicle automation technology has gradually become a hot topic of research and development. Vehicle automation requires efficient and stable code execution. As the core of the vehicle control system, code is responsible for processing data collected by sensors, making decisions, and sending instructions to the vehicle's actuators, thereby implementing operations such as automatic acceleration, deceleration, and steering. Code execution requires a high degree of real-time performance and accuracy. For example, in an emergency, vehicle code must be able to react within milliseconds to avoid collisions. At the same time, the code must have strong fault tolerance to cope with various complex road conditions and unexpected situations. The development of vehicle automation and code execution technology is of great significance for improving traffic safety, traffic efficiency, and providing a more comfortable travel experience.

[0003] Chinese patent publication number CN116775067A discloses a reprogramming code distribution algorithm for intelligent connected vehicles based on adaptive clustering and reinforcement learning. The algorithm uses an adaptive clustering algorithm to cluster acquired vehicle driving data, grouping adjacent vehicles with similar driving patterns into the same cluster; explicitly defines key elements such as the state space, action space, and reward function, and models the problem as a Markov decision process; and uses a reinforcement learning-based method to solve the problem and determine the optimal code distribution strategy.

[0004] This shows that after the current vehicle code is solved, there is a lack of analysis of the runnability of the code path, resulting in some codes being unable to respond during execution. Summary of the Invention

[0005] To this end, the present invention provides a dynamic symbolic execution and constraint parsing method based on the abstract syntax tree of automobile code, which is used to overcome the problem in the prior art that after the current vehicle code is solved, the runnability of the code path is lacking, resulting in some codes being unable to respond during execution.

[0006] To achieve the above objectives, the present invention provides a dynamic symbolic execution and constraint parsing method based on an abstract syntax tree of automobile code, comprising:

[0007] Parse the programming language and generate an abstract syntax tree;

[0008] Initialize the dynamic symbolic execution engine, use the dynamic symbolic execution engine to traverse the abstract syntax tree, and access and analyze the nodes of the abstract syntax tree;

[0009] Simulate and explore the instruction execution path according to the established operation instructions. During the execution process, determine the executable code execution information transmission path according to the code operation;

[0010] The constraint solver processes the code execution information transmission path constraints, solves the path constraints, and determines whether there is a feasible solution;

[0011] Determine whether the instruction path can be completed or issue an alarm for an instruction path with problems;

[0012] For a code execution information transmission path capable of instruction transmission, a signal transmission frequency is determined.

[0013] Furthermore, the dynamic symbolic execution engine is used to traverse the abstract syntax tree and access and analyze the nodes of the abstract syntax tree, including:

[0014] Number each node of the abstract syntax tree;

[0015] Perform a trial visit to the node to determine the node status;

[0016] Node status includes access node, disconnected node, and probabilistic access node;

[0017] Among them, the path node is a node with a node information pass rate of 100%, the disconnected node is a node with a node information pass rate of 0%, and the probability path node is a node with a node information pass rate within the interval of (0%, 100%).

[0018] Furthermore, accessing and analyzing the nodes of the abstract syntax tree also includes,

[0019] The passing rate of the probability path nodes is divided into levels.

[0020] Further, determining the executable code execution information transmission path according to the code operation includes:

[0021] For any code containing target instructions, the code execution information transmission path is determined by analyzing the data call relationship;

[0022] Based on the determined code execution information transmission path, determine the nodes included in the path, and analyze the feasibility of the code execution information transmission path based on the states of the included nodes;

[0023] For codes that can call data through multiple paths, the feasibility of the information transmission path executed by each code is analyzed one by one to determine the feasible transmission path or alarm.

[0024] Furthermore, the feasibility of the transmission path is determined by calculating a stability evaluation parameter of the code execution information transmission path;

[0025] The stability evaluation parameter is determined by evaluating the node pass rate and the number of nodes of each node in the code execution information transmission path.

[0026] Furthermore, the code execution information transmission path is divided into three transmission levels: good data transmission, average data transmission and poor data transmission based on the stability evaluation parameters.

[0027] For codes that can call data through multiple paths, the status of the code execution information transmission path is determined or an alarm is issued by analyzing the transmission level of each corresponding code execution information transmission path and the number of transmission levels.

[0028] Furthermore, the status of the code execution information transmission path includes:

[0029] The code execution information transmission path is the main transmission path;

[0030] The code execution information transmission path is a backup path;

[0031] The code execution information transmission path is a normal transmission path;

[0032] The code execution information transmission path is an interconnection transmission path;

[0033] For code that can call data through multiple paths,

[0034] If there is more than one code execution information transmission path with good data transmission degree among the paths corresponding to the code that can complete the relevant target instructions, the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter is selected as the main transmission path, and the code execution information transmission path corresponding to the second largest value of the stability evaluation parameter is selected as the backup path;

[0035] If there is only one code execution information transmission path with good data transmission degree among the paths corresponding to the code that can complete the relevant target instructions, the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter is selected as the normal transmission path;

[0036] If there is no code execution information transmission path with good data transmission degree among the paths corresponding to the code that can complete the relevant target instructions, and there are at least two code execution information transmission paths with average data transmission degree, then the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter and the second largest value of the stability evaluation parameter is selected as the interconnection transmission path;

[0037] If there is no code execution information transmission path with good data transmission level in the path corresponding to the code that can complete the relevant target instruction, and there are less than two code execution information transmission paths with average data transmission level, then it is determined that the completion probability of the target instruction corresponding to the code does not meet the standard, and an alarm is issued for the path that can complete the relevant target instruction.

[0038] Furthermore, for any determined code execution information transmission path, the signal sending frequency is determined according to the stability evaluation parameter corresponding to the transmission path; the signal sending frequency is positively correlated with the stability evaluation parameter.

[0039] Furthermore, when calculating the signal transmission frequency, a first calculation compensation parameter of the signal transmission frequency related to the state of the code execution information transmission path is set.

[0040] Furthermore, when calculating the signal sending frequency, a second calculation compensation parameter of the signal sending frequency related to the node instruction occupancy rate is set.

[0041] Compared with the prior art, the beneficial effect of the present invention is that, for each code execution information transmission path, it is composed of several execution nodes, and each execution node will be in a different state during actual operation, which will lead to different possible states of the code execution information transmission path. After completing the determination of the code instruction path, the present application analyzes the feasibility of the instruction path to determine whether the path to complete the code is actually feasible, thereby ensuring that the code execution information transmission path of the code execution can indeed complete the task of code release. At the same time, for the determined code execution information transmission path, by determining the signal sending frequency of the execution information, it is ensured that the execution information can reach the instruction target, thereby completing the execution of the code. The present application performs feasibility analysis and signal sending frequency analysis on the determined code execution information transmission path, thereby ensuring that the execution information within the code can reach the instruction target, thereby increasing the executableness of the code.

[0042] Furthermore, each data node through which the data flows is checked for pass rate and graded, thereby ensuring the accuracy of the data path flow of the code.

[0043] Furthermore, for codes that have multiple paths for data calls, the transmission of the paths is divided into levels to ensure the reasonable and complete transmission of data.

[0044] Furthermore, for each path that can execute code, the stability evaluation parameters of the path are calculated and the operation stability of the path is digitized, which can more intuitively determine the status of each path, thereby making it possible to determine a certain success rate for code transmission and data calls, ensuring that the execution information within the code can reach the instruction target, thereby increasing the executable nature of the code.

[0045] Furthermore, when calculating the stability evaluation parameters, different calculation adjustment values ​​are set according to the different states of the nodes included in the path, and the lower the node pass rate, the smaller the calculation adjustment value. Different calculation compensation values ​​are set according to the number of nodes in the path. The larger the number of nodes, the smaller the calculation compensation value. The larger the number of nodes, the greater the uncontrollability of the risk. Therefore, the smaller the calculation compensation value is set, the data rationality of the calculated stability evaluation parameters is guaranteed, and the information that can be executed in the code is guaranteed to reach the instruction target, thereby increasing the executable nature of the code.

[0046] Furthermore, as instructions of different levels have different required priorities and success rates, evaluating the stability evaluation value of instructions with high levels can ensure the stability of high-level data transmission and increase the executableness of the code.

[0047] Furthermore, for those that can have multiple transmission paths, the number and mode of the transmission paths are determined according to the determined types of the transmission paths, thereby ensuring that the executable information within the code can reach the instruction target, thereby increasing the executable nature of the code.

[0048] Furthermore, when calculating the signal sending frequency, a first calculation compensation parameter of the signal sending frequency is set. For the ordinary transmission path, since there is only one path for data transmission, the value of the first calculation compensation parameter of the signal sending frequency of the ordinary transmission path is the largest; for the interconnected transmission path, since there are two code execution information transmission paths with a general data transmission degree when transmitting, the value of the corresponding first calculation compensation parameter of the signal sending frequency is relatively large; for the main transmission path, since there is also a code execution information transmission path with a good data transmission degree when transmitting, the value of the corresponding first calculation compensation parameter of the signal sending frequency is relatively small; for the backup path, since it is an alternative path used when the main transmission path cannot be transmitted, the value of the corresponding first calculation compensation parameter of the signal sending frequency is the smallest; for different categories of code execution information transmission paths, the corresponding value of the first calculation compensation parameter of the signal sending frequency is selected to ensure that the information that can be executed within the code can reach the instruction target, thereby increasing the executable nature of the code.

[0049] Furthermore, for any node, if there are more corresponding code execution information transmission paths, the single node instruction occupancy rate may be larger because more data may flow through the node. Therefore, by calculating the comprehensive node instruction occupancy rate of a certain code execution information transmission path as a whole, the degree of instruction conflict of the nodes within it is determined, and the value of the second calculation compensation parameter of the signal sending frequency is determined, which ensures that the execution information within the code can reach the instruction target, thereby increasing the executable nature of the code. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 Flowchart of a dynamic symbolic execution and constraint parsing method based on an abstract syntax tree of automobile code in an embodiment;

[0051] Figure 2 Flowchart of accessing and analyzing nodes of an abstract syntax tree in an embodiment;

[0052] Figure 3 This is a flow chart of determining an executable code execution information transmission path based on code operations in an embodiment;

[0053] Figure 4 Flowchart for determining the code execution information transmission path status in an embodiment. DETAILED DESCRIPTION

[0054] In order to make the objects and advantages of the present invention more clearly understood, the present invention is further described below in conjunction with embodiments; it should be understood that the specific embodiments described herein are merely used to explain the present invention and are not intended to limit the present invention.

[0055] The preferred embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0056] It should be noted that, in the description of the present invention, terms such as "up", "down", "left", "right", "inside", and "outside" indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. This is only for the convenience of description and does not indicate or imply that the device or element must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on the present invention.

[0057] Furthermore, it should be noted that, in the description of the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," and "connected" should be understood in a broad sense. For example, they may refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; and internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0058] See also Figures 1-4 As shown, Figure 1 Flowchart of a dynamic symbolic execution and constraint parsing method based on an abstract syntax tree of automobile code in an embodiment; Figure 2 Flowchart of accessing and analyzing nodes of an abstract syntax tree in an embodiment; Figure 3 This is a flow chart of determining an executable code execution information transmission path based on code operations in an embodiment; Figure 4 Flowchart for determining the code execution information transmission path status in an embodiment.

[0059] Dynamic symbolic execution and constraint parsing method based on abstract syntax tree of automobile code, including:

[0060] S1, parses the programming language and generates an abstract syntax tree;

[0061] S2, initialize the dynamic symbolic execution engine, use the dynamic symbolic execution engine to traverse the abstract syntax tree, and access and analyze the nodes of the abstract syntax tree;

[0062] S3, simulate and explore the instruction execution path according to the established operation instructions, and during the execution process, determine the executable code execution information transmission path according to the code operation;

[0063] S4, processing the code execution information transmission path constraints through the constraint solver, solving the path constraints, and determining whether there is a feasible solution;

[0064] S5, confirming that the instruction path can be completed or issuing an alarm for an instruction path with problems;

[0065] S6, determining the signal sending frequency for the code execution information transmission path capable of instruction transmission.

[0066] For each code, the code execution information transmission path is composed of several execution nodes. Each execution node will be in a different state during actual operation, which may lead to different states of the code execution information transmission path. After completing the determination of the code instruction path, this application analyzes the feasibility of the instruction path to determine whether the path to complete the code is actually feasible, thereby ensuring that the code execution information transmission path of the code execution can indeed complete the task of code release. At the same time, for the determined code execution information transmission path, by determining the signal sending frequency of the execution information, it is ensured that the execution information can reach the instruction target, thereby completing the execution of the code. This application ensures that the execution information within the code can reach the instruction target by performing feasibility analysis and signal sending frequency analysis on the determined code execution information transmission path, thereby increasing the executableness of the code.

[0067] Specifically, when using the dynamic symbolic execution engine to traverse the abstract syntax tree and access and analyze the nodes of the abstract syntax tree, including:

[0068] S21, number the nodes of the abstract syntax tree, and record them as the first node A1, the second node A2, ..., the nth node An, where n is the number of nodes.

[0069] S22, perform a trial visit to the node to determine the node status;

[0070] Node status includes: access node, disconnect node, probability access node,

[0071] Among them, the path node is a node with a node information pass rate of 100%, the disconnected node is a node with a node information pass rate of 0%, and the probability path node is a node with a node information pass rate within the interval of (0%, 100%).

[0072] The trial visit is that for any node Ai, S instruction messages are sent to the target node within the specified unit time T. Every time the instruction message reaches the node Ai, the node Ai will send a feedback message. The number of times the node Ai sends feedback messages is counted, and the number of feedback messages is compared with the number of instruction messages sent to determine the node information pass rate.

[0073] S23, for any node Ai, i=1, 2, ...n, its node information passing rate is Bi. If the node Ai is a probability path node, the node passing rate is graded;

[0074] If Bi≤B01, the pass rate of node Ai is determined to be a low pass rate;

[0075] If B01<Bi≤B02, the pass rate of node Ai is determined to be medium pass rate;

[0076] If Bi>B02, the pass rate of node Ai is determined to be a high pass rate;

[0077] Among them, B01 is the first evaluation parameter of the pass rate, and B02 is the second evaluation parameter of the pass rate.

[0078] In this embodiment, B01=0.6, B02=0.9.

[0079] Each data node through which the data flows is checked for pass rate and graded, thus ensuring the accuracy of the data path flow of the code.

[0080] Specifically, determining the executable code execution information transmission path based on the code operation includes:

[0081] S31, for any code containing target instructions, determine the code execution information transmission path by analyzing the data call relationship;

[0082] S32, based on the determined code execution information transmission path, determine the nodes included in the path, and analyze the feasibility of the code execution information transmission path based on the states of the included nodes;

[0083] S33: For codes that can call data through multiple paths, the feasibility of each code execution information transmission path is analyzed one by one to determine the main transmission path and the backup path.

[0084] For codes with multiple paths for data calls, the transmission of the paths is divided into different levels to ensure the reasonable and complete transmission of data.

[0085] Specifically, for any code execution information transmission path Ch, the number of nodes it contains is m, and the number of nodes contained is renumbered and recorded as the first path node ChD1 of the code execution information transmission path Ch, the second path node ChD2 of the code execution information transmission path Ch, ..., the mth path node ChDm of the code execution information transmission path Ch,

[0086] For any path node ChDj, j=1, 2, ..., m, of the code execution information transmission path Ch, its node pass rate is ChBj.

[0087] For any code execution information transmission path Ch, calculate its path stability and set the stability evaluation parameter of any code execution information transmission path Ch as PCh.

[0088]

[0089] Among them, r is the calculated compensation value of the stability evaluation parameter, Dj is the calculated adjustment value of the node pass rate ChBj, and the value of Dj is different for different pass rate values. The value of the calculated compensation value r is negatively correlated with the number of nodes m.

[0090] For each path that can execute code, by calculating the path's stability evaluation parameters and digitizing the path's operational stability, the status of each path can be determined more intuitively, thereby making it possible to determine a certain success rate for code transmission and data calls, ensuring that the information within the code can reach the instruction target and increasing the code's executableness.

[0091] Specifically, in this embodiment,

[0092] When ChBj=100%, Dj=1;

[0093] When ChBj=0, Dj=0;

[0094] When ChBj has a low pass rate, Dj=0.3;

[0095] When ChBj belongs to the medium pass rate, Dj=0.7;

[0096] When ChBj has a high pass rate, Dj=0.9.

[0097] Specifically, in this embodiment,

[0098] When m=1, r=1;

[0099] When 1<m≤3, r=0.98;

[0100] When 3<m≤5, r=0.95;

[0101] When m>5, r=0.9.

[0102] Specifically, the calculated stability evaluation parameter PCh is compared with the preset first stability evaluation value Pp1 and the second stability evaluation value Pp2, wherein Pp1>Pp2;

[0103] If PCh≥Pp1, it is determined that the data transmission degree of the code execution information transmission path Ch is good;

[0104] If Pp2≤PCh<Pp1, it is determined that the data transmission level of the code execution information transmission path Ch is normal;

[0105] If PCh<Pp2, it is determined that the data transmission level of the code execution information transmission path Ch is poor.

[0106] When calculating the stability evaluation parameters, different calculation adjustment values ​​are set according to the different states of the nodes included in the path, and the lower the node pass rate, the smaller the calculation adjustment value. Different calculation compensation values ​​are set according to the number of nodes in the path. The larger the number of nodes, the smaller the calculation compensation value. The larger the number of nodes, the greater the uncontrollability of the risk. Therefore, the smaller the calculation compensation value is set, the data rationality of the calculated stability evaluation parameters is guaranteed, and the information executed in the code is guaranteed to reach the instruction target, thereby increasing the executable nature of the code.

[0107] Specifically, the values ​​of the first stability evaluation value Pp1 and the second stability evaluation value Pp2 are related to the instruction level of the target instruction code, and the higher the instruction level, the larger the value.

[0108] As instructions of different levels, they require different priorities and success rates. For instructions with high levels, evaluating the stability evaluation value can ensure the stability of high-level data transmission and increase the executableness of the code.

[0109] Specifically, for any code W containing a target instruction, the number of paths s that can complete the relevant target instruction is counted, and the paths are numbered, recorded as the first code execution information transmission path Ch1, the second code execution information transmission path Ch2, ..., the sth code execution information transmission path Chs. The stability evaluation parameter PChk of each code execution information transmission path is calculated one by one, k=1,2,...,s, and the data transmission degree of each code execution information transmission path is analyzed.

[0110] Specifically, for code W,

[0111] If there is more than one code execution information transmission path with good data transmission degree among the corresponding paths capable of completing the relevant target instructions, the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter is selected as the main transmission path, and the code execution information transmission path corresponding to the second largest value of the stability evaluation parameter is selected as the backup path;

[0112] If there is only one code execution information transmission path with good data transmission degree among the corresponding paths that can complete the relevant target instructions, the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter is selected as the normal transmission path;

[0113] If there is no code execution information transmission path with good data transmission degree among the corresponding paths that can complete the relevant target instructions, and there are at least two code execution information transmission paths with average data transmission degree, then the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter and the second largest value of the stability evaluation parameter is selected as the interconnection transmission path;

[0114] If there is no code execution information transmission path with good data transmission degree in the corresponding path that can complete the relevant target instruction, and there are less than two code execution information transmission paths with average data transmission degree, then it is determined that the completion probability of the target instruction corresponding to code W does not meet the standard, and an alarm is issued for the path that can complete the relevant target instruction.

[0115] For those that can have multiple transmission paths, the number and mode of transmission paths are determined according to the determined transmission path category, thereby ensuring that the information within the code can reach the instruction target and increasing the executability of the code.

[0116] For any determined code execution information transmission path Chk, the signal transmission frequency QChk is determined according to the stability evaluation parameter PChk corresponding to the transmission path, and is set. ,

[0117] The compensation parameter is calculated first when the α signal is sent at a frequency other than the β signal.

[0118] Specifically, the value of the first calculation compensation parameter α of the signal sending frequency is related to the state of the code execution information transmission path, and the state refers to whether the code execution information transmission path is one of the main transmission path, the backup path, the ordinary transmission path, and the interconnected transmission path.

[0119] When the code execution information transmission path is determined to be the main transmission path, α=2;

[0120] When the code execution information transmission path is determined to be a backup path, α = 1.5;

[0121] When the code execution information transmission path is determined to be a normal transmission path, α=3;

[0122] When the code execution information transmission path is determined to be an interconnection transmission path, α=2.5.

[0123] Specifically, the value of the second calculation compensation parameter β of the signal transmission frequency is related to the comprehensive node instruction occupancy rate in Chk of the code execution information transmission path, and the comprehensive node instruction occupancy rate is determined by the single node instruction occupancy rate.

[0124] The single node instruction occupancy rate refers to the probability of any node being called when executing different target instructions.

[0125] When calculating the signal sending frequency, a first calculation compensation parameter of the signal sending frequency is set. For the ordinary transmission path, since there is only one path for data transmission, the value of the first calculation compensation parameter of the signal sending frequency of the ordinary transmission path is the largest; for the interconnected transmission path, since there are two code execution information transmission paths with a general data transmission degree when transmitting, the value of the corresponding first calculation compensation parameter of the signal sending frequency is relatively large; for the main transmission path, since there is also a code execution information transmission path with a good data transmission degree when transmitting, the value of the corresponding first calculation compensation parameter of the signal sending frequency is relatively small; for the backup path, since it is an alternative path used when the main transmission path cannot be transmitted, the value of the corresponding first calculation compensation parameter of the signal sending frequency is the smallest; for different categories of code execution information transmission paths, the corresponding value of the first calculation compensation parameter of the signal sending frequency is selected to ensure that the information that can be executed within the code can reach the instruction target, thereby increasing the executable nature of the code.

[0126] For any path node ChDj, its single node instruction occupancy is ChHj;

[0127] Calculate the comprehensive node instruction occupancy ChHz of the code execution information transmission path Chk, set, .

[0128] If ChHz ≥ Hz1, then β = 3;

[0129] If Hz2<ChHz≤Hz1, then β=2.5;

[0130] If ChHz≤Hz2, then β=1.5.

[0131] Among them, Hz1 is the first evaluation value of the comprehensive node instruction occupancy rate, and Hz2 is the second evaluation value of the comprehensive node instruction occupancy rate.

[0132] For any node, if there are more corresponding code execution information transmission paths, the single node instruction occupancy rate may be larger, because there may be more data flowing through the node. Therefore, by calculating the comprehensive node instruction occupancy rate of a code execution information transmission path as a whole, the degree of instruction conflict of the nodes within it is determined, and the value of the second calculation compensation parameter of the signal sending frequency is determined, which ensures that the execution information within the code can reach the instruction target and increases the executableness of the code.

[0133] Thus far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art may make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will fall within the scope of protection of the present invention.

[0134] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.

Claims

1. A dynamic symbolic execution and constraint parsing method based on an abstract syntax tree of automobile code, characterized in that: Parse the programming language and generate an abstract syntax tree; Initialize the dynamic symbolic execution engine, use the dynamic symbolic execution engine to traverse the abstract syntax tree, and access and analyze the nodes of the abstract syntax tree; Simulate and explore the instruction execution path according to the established operation instructions. During the execution process, determine the executable code execution information transmission path according to the code operation; The constraint solver processes the code execution information transmission path constraints, solves the path constraints, and determines whether there is a feasible solution; Determine whether the instruction path can be completed or issue an alarm for an instruction path with problems; For a code execution information transmission path capable of transmitting instructions, determining a signal transmission frequency; Use the dynamic symbolic execution engine to traverse the abstract syntax tree and access and analyze the nodes of the abstract syntax tree, including: Number each node of the abstract syntax tree; Trial access to the node to determine the node status; Node states include access nodes, disconnected nodes, and probability access nodes; The access node is a node with a node information passing rate of 100%, the disconnected node is a node with a node information passing rate of 0%, and the probability access node is a node with a node information passing rate within the interval of (0%, 100%); Determine the executable code execution information transmission path based on the code operation, including: For any code containing target instructions, the code execution information transmission path is determined by analyzing the data call relationship; According to the determined code execution information transmission path, nodes included in the path are determined, and feasibility of the code execution information transmission path is analyzed according to the states of the included nodes; For codes that can call data through multiple paths, the feasibility of each code execution information transmission path is analyzed one by one to determine the feasible transmission path or alarm; The feasibility of the transmission path is determined by calculating the stability evaluation parameter of the code execution information transmission path; The stability evaluation parameter is determined by the node pass rate and the number of nodes of each node in the code execution information transmission path being evaluated; The code execution information transmission path is divided into three transmission levels: good data transmission, average data transmission and poor data transmission through stability evaluation parameters. For codes that can call data through multiple paths, the status of the code execution information transmission path is determined or an alarm is issued by analyzing the transmission level of each corresponding code execution information transmission path and the number of transmission levels at each transmission level.

2. The dynamic symbolic execution and constraint parsing method based on the automobile code abstract syntax tree according to claim 1 is characterized in that: Access and analyze the nodes of the abstract syntax tree, including: The passing rate of the probabilistic path nodes is graded.

3. The dynamic symbolic execution and constraint parsing method based on the automobile code abstract syntax tree according to claim 2 is characterized in that: The status of the code execution information transmission path includes: The code execution information transmission path is the main transmission path; The code execution information transmission path is a backup path; The code execution information transmission path is a normal transmission path; The code execution information transmission path is an interconnection transmission path; For code that can call data through multiple paths, If there is a code execution information transmission path with good data transmission degree in the path corresponding to the code that can complete the relevant target instruction, the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter is selected as the main transmission path, and the code execution information transmission path corresponding to the second largest value of the stability evaluation parameter is selected as the backup path; If there is only one code execution information transmission path with good data transmission degree in the path corresponding to the code that can complete the relevant target instruction, the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter is selected as the common transmission path; If there is no code execution information transmission path with good data transmission degree in the path corresponding to the code that can complete the relevant target instruction, and there are at least two code execution information transmission paths with average data transmission degree, then the code execution information transmission path corresponding to the maximum value of the stability evaluation parameter and the second largest value of the stability evaluation parameter is selected as the interconnection transmission path; If there is no code execution information transmission path with good data transmission degree in the path corresponding to the code that can complete the relevant target instruction, and there are less than two code execution information transmission paths with average data transmission degree, then it is determined that the completion probability of the target instruction corresponding to the code does not meet the standard, and an alarm is issued for the path that can complete the relevant target instruction.

4. The dynamic symbolic execution and constraint parsing method based on the automobile code abstract syntax tree according to claim 3 is characterized in that: For any determined code execution information transmission path, the signal sending frequency is determined according to the stability evaluation parameter corresponding to the transmission path; the signal sending frequency is positively correlated with the stability evaluation parameter.

5. The dynamic symbolic execution and constraint parsing method based on the automobile code abstract syntax tree according to claim 4 is characterized in that: When calculating the signal transmission frequency, a first calculation compensation parameter of the signal transmission frequency related to the state of the code execution information transmission path is set.

6. The dynamic symbolic execution and constraint parsing method based on the automobile code abstract syntax tree according to claim 5 is characterized in that: When calculating the signal transmission frequency, a second calculation compensation parameter of the signal transmission frequency related to the node instruction occupancy rate is set.

Citation Information

Patent Citations

  • Intelligent networked automobile reprogramming code distribution algorithm based on adaptive clustering and reinforcement learning

    CN116775067A

  • Method for realizing adaptive adjustment of path search depth based on abstract syntax tree

    CN115659356A

  • Small program data flow analysis method based on abstract syntax tree and related equipment

    CN116719528A