CAN2.0 remote frame predictive request optimization method and system
By establishing multi-dimensional scene feature vectors and hierarchical reinforcement learning models in the CAN2.0 network, the remote frame request is optimized, solving the communication delay problem caused by traditional passive response, and realizing efficient data transmission and system performance improvement for intelligent connected vehicles.
Patent Information
- Application Number
- CN202511869347.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-01-09
AI Technical Summary
The traditional CAN2.0 remote frame request mechanism, with its passive response method, cannot predict upcoming data demands, leading to communication delays. This is especially problematic in intelligent connected vehicles under high load conditions, which can easily cause bus congestion and delays in important data transmission, affecting system response speed and safety.
By collecting vehicle operating status and environmental information, a multi-dimensional scene feature vector is established. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score, identify the highest priority remote frame request sequence, and establish a predictive control strategy using a hierarchical reinforcement learning method to pre-allocate communication resources for data transmission.
It improves the accuracy and reliability of remote frame requests, reduces communication latency, enhances the efficiency of communication resource utilization, and ensures the real-time performance and safety reliability of intelligent connected vehicles.
Smart Images

Figure CN121309687A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to vehicle communication technology, and more particularly to a method and system for optimizing predictive requests for CAN2.0 remote frames. Background Technology
[0002] With the rapid development of automotive electronics technology, the complexity of in-vehicle network systems is constantly increasing. The Controller Area Network (CAN) bus, as one of the most important communication networks within a vehicle, undertakes the crucial task of data interaction between various electronic control units. The CAN 2.0 protocol defines two message types: data frames and remote frames. Remote frames are used to request other nodes to send data frames with specific identifiers. In the traditional CAN network communication mechanism, when a node needs to obtain specific data, it actively sends a remote frame as a request, and the receiving node sends the corresponding data frame after responding. This request-response mechanism works well in simple in-vehicle network scenarios. However, with the development of intelligent connected vehicles, vehicle electronic control systems are becoming increasingly complex, the number of sensors is surging, and the data interaction needs between control units are exhibiting highly dynamic and sudden characteristics. The traditional passive remote frame request mechanism faces numerous challenges.
[0003] Current CAN bus remote frame processing technologies suffer from the following main problems: Traditional remote frame request mechanisms employ a passive response approach, initiating requests only when nodes explicitly require data. This method cannot anticipate upcoming data demands, leading to inherent communication delays. In safety-critical scenarios with extremely high real-time requirements, such as emergency braking and collision warnings, this delay impacts system response speed and poses safety hazards. Furthermore, existing technologies lack intelligent perception and correlation analysis capabilities regarding vehicle operating scenarios. They cannot predict subsequent remote frame request demands based on the current driving scenario, vehicle status, and environmental information. This results in a consistently passive allocation of communication resources, making bus congestion prone to occur under high load conditions. Important data transmission is delayed or even lost, affecting the collaborative performance of the entire vehicle control system. Summary of the Invention
[0004] This invention provides a method and system for optimizing predictive requests for CAN2.0 remote frames, which can solve the problems in the prior art.
[0005] A first aspect of the present invention provides a CAN2.0 remote frame predictive request optimization method, comprising: Vehicle operating status information is collected, and information about the vehicle's surrounding environment is obtained. Based on the vehicle operating status information and the information about the vehicle's surrounding environment, a multi-dimensional scene feature vector is established. Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score. The probability distribution of remote frame requests in the current scene is determined based on the scene similarity score. Based on the probability distribution of the remote frame requests, the sequence of remote frame requests with the highest priority is identified; a hierarchical reinforcement learning method is used to establish a predictive control strategy, the remote frame request sequence is divided into hierarchical levels according to data type, an independent state space and reward function are set for each level, and the optimal prediction time window is determined through policy iteration optimization to achieve hierarchical predictive control of remote frame requests; Execute predictive control commands, allocate communication resources in advance, and complete remote frame data transmission.
[0006] Based on the vehicle operating status information and the surrounding environment information, a multi-dimensional scene feature vector is established, including: The vehicle operating status information is subjected to feature extraction in chronological order to obtain operating status features reflecting the dynamic changes of the vehicle; the surrounding environment information of the vehicle is subjected to spatial feature extraction to obtain environmental features reflecting the distribution of the environment; the correlation degree between the operating status features and the environmental features is calculated, and feature combinations are generated based on the correlation degree. The feature combination is dimensionality reduced to obtain simplified features. The continuous values in the simplified features are converted into discrete values. The information contribution of each discrete value is calculated. Features with information contribution exceeding a preset contribution threshold are selected to construct a multi-dimensional scene feature vector.
[0007] Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a Long Short-Term Memory (LSTM) network to generate scene similarity scores, including: Set a time window length and a sliding step size, sample historical remote frame request data based on the time window length and the sliding step size to obtain multiple request sample segments, calculate the time interval and request frequency of remote frame requests in each request sample segment, and generate request time sequence features; combine the request time sequence features with scene data within the corresponding time period to form a scene-request association sequence; The scene-request association sequence is input into a long short-term memory network for training. The long short-term memory network constructs a scene-request association model by extracting long-term dependency features of the scene-request association sequence. Based on the scene-request association model, the matching degree between the current scene and historical scenes is calculated, and a scene similarity score is generated.
[0008] The scene-request association sequence is input into a Long Short-Term Memory (LSTM) network for training. The LSM network constructs a scene-request association model by extracting long-term dependency features from the scene-request association sequence, including: The scenario-request association sequence is preprocessed temporally to calculate the temporal correlation between scenario features and request features, generating a feature association matrix; the scenario-request association sequence is then normalized based on the feature association matrix to obtain a standardized association sequence. A long short-term memory network is constructed. The standardized association sequence is input into the long short-term memory network. Long-term temporal dependency features are extracted through forward propagation, and the network parameters are optimized through backpropagation to obtain the trained scene-request association model.
[0009] Based on the remote frame request probability distribution, the highest priority remote frame request sequence is identified; a hierarchical reinforcement learning method is used to establish a prediction control strategy, and the remote frame request sequences are hierarchically divided according to data type, including: Calculate the priority weight of each request in the probability distribution of the remote frame requests. The priority weight is obtained by weighting the request time urgency, priority level and request frequency. The time urgency is calculated based on the request deadline and the request frequency is obtained based on historical statistical data. Sort the requests according to the priority weight and select the requests with the highest weight to form a priority request sequence. The remote frames in the priority request sequence are divided into three levels according to data type: control data, sensor data, and diagnostic data; a hierarchical reinforcement learning algorithm is used to construct state-action spaces for each of the three levels.
[0010] The remote frames in the priority request sequence are divided into three levels according to data type: control data, sensor data, and diagnostic data. A hierarchical reinforcement learning algorithm is used to construct state-action spaces for each of the three levels, including: The priority request sequence is layered according to the remote frame data type. Remote frames with real-time requirements are assigned to the control data layer, remote frames with periodic characteristics are assigned to the sensor data layer, and remote frames with non-real-time characteristics are assigned to the diagnostic data layer, forming a layered request set. The number of requests, data size, and processing latency of remote frames in each layer are calculated to generate a layered state vector. A hierarchical reinforcement learning algorithm is applied to the hierarchical request set to construct an independent state space and action space for each layer.
[0011] A second aspect of the present invention provides a CAN2.0 remote frame predictive request optimization system, comprising: The acquisition unit is used to acquire vehicle operating status information and vehicle surrounding environment information. Based on the vehicle operating status information and the vehicle surrounding environment information, a multi-dimensional scene feature vector is established. Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score. The probability distribution of remote frame requests in the current scene is determined based on the scene similarity score. The identification unit is used to identify the highest priority remote frame request sequence according to the probability distribution of the remote frame request; a hierarchical reinforcement learning method is used to establish a prediction control strategy, the remote frame request sequence is divided into hierarchical levels according to data type, an independent state space and reward function are set for each level, and the optimal prediction time window is determined through policy iteration optimization to realize hierarchical prediction control of remote frame requests. The execution unit is used to execute predictive control instructions, pre-allocate communication resources, and complete remote frame data transmission.
[0012] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0013] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0014] The beneficial effects of this application are as follows: This invention collects vehicle operating status information and surrounding environment information to establish a multi-dimensional scene feature vector, and uses a long short-term memory network to construct a scene-request association model. This can accurately identify the probability distribution of remote frame requests in the current scene, effectively improving the accuracy and reliability of remote frame request prediction, and avoiding the communication delay problem caused by the traditional passive response mode.
[0015] This invention employs a hierarchical reinforcement learning method to establish a predictive control strategy. It divides the remote frame request sequence into hierarchical levels according to data type, sets independent state spaces and reward functions for different levels, and determines the optimal prediction time window through policy iteration optimization. This achieves differentiated processing of data with different priorities, significantly improves the utilization efficiency of communication resources, and reduces bus load pressure.
[0016] This invention, through a predictive request optimization method, can pre-allocate communication resources and complete remote frame data transmission, effectively shortening data response time, reducing waiting delays in vehicle control systems, improving the real-time performance of in-vehicle network communication and overall system performance, and providing technical support for the safe and reliable operation of intelligent connected vehicles. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the CAN2.0 remote frame predictive request optimization method according to an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0020] Figure 1 This is a flowchart illustrating the CAN2.0 remote frame predictive request optimization method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes: Vehicle operating status information is collected, and information about the vehicle's surrounding environment is obtained. Based on the vehicle operating status information and the information about the vehicle's surrounding environment, a multi-dimensional scene feature vector is established. Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score. The probability distribution of remote frame requests in the current scene is determined based on the scene similarity score. Based on the probability distribution of the remote frame requests, the sequence of remote frame requests with the highest priority is identified; a hierarchical reinforcement learning method is used to establish a predictive control strategy, the remote frame request sequence is divided into hierarchical levels according to data type, an independent state space and reward function are set for each level, and the optimal prediction time window is determined through policy iteration optimization to achieve hierarchical predictive control of remote frame requests; Execute predictive control commands, allocate communication resources in advance, and complete remote frame data transmission.
[0021] In one optional implementation, establishing a multi-dimensional scene feature vector based on the vehicle operating status information and the vehicle's surrounding environment information includes: The vehicle operating status information is subjected to feature extraction in chronological order to obtain operating status features reflecting the dynamic changes of the vehicle; the surrounding environment information of the vehicle is subjected to spatial feature extraction to obtain environmental features reflecting the distribution of the environment; the correlation degree between the operating status features and the environmental features is calculated, and feature combinations are generated based on the correlation degree. The feature combination is dimensionality reduced to obtain simplified features. The continuous values in the simplified features are converted into discrete values. The information contribution of each discrete value is calculated. Features with information contribution exceeding a preset contribution threshold are selected to construct a multi-dimensional scene feature vector.
[0022] The process of establishing a multi-dimensional scene feature vector begins with collecting vehicle operating status information, including parameters such as vehicle speed, acceleration, steering wheel angle, brake pedal depth, and accelerator pedal opening. These parameters are arranged chronologically to form time-series data, with a sampling frequency set to 20 times per second. The continuously collected data is divided into 5-second time windows, with each window containing 100 sampling points. Feature extraction is performed on the data within each time window, calculating the average, maximum, minimum, and standard deviation of vehicle speed, as well as the rate of change of acceleration. For example, within a certain time window, the average vehicle speed is 45 km / h, the maximum is 52 km / h, the minimum is 38 km / h, the standard deviation is 4.2 km / h, and the rate of change of acceleration is 0.8 m / s². These statistical values reflect the dynamic change trend of the vehicle within that time period, forming the operating status characteristics.
[0023] Information about the vehicle's surrounding environment is collected through multiple sensors, including the distance and type of obstacles in front, behind, to the left, and to the right, road width, lane position, and traffic light status. The area around the vehicle is divided into eight sector areas, each covering a 45-degree angle. Environmental information within each area is encoded: obstacles less than 5 meters are labeled 1, 5 to 15 meters are labeled 2, 15 to 30 meters are labeled 3, and greater than 30 meters are labeled 4. Obstacle types include pedestrians, vehicles, and stationary obstacles, coded as 1, 2, and 3 respectively. Road width is labeled as 10, 20, and 30 for single-lane, two-lane, and three-lane or more roads respectively. These encoded values are combined to form an environmental feature vector. For example, a feature vector of distance level 3, obstacle type 2, and road width 20 for the sector area in front indicates that a vehicle is present 15 to 30 meters ahead, and the vehicle is currently traveling on a two-lane road.
[0024] The correlation between operational status features and environmental features is calculated using a mutual information quantification method. Vehicle speed, a key operational status feature, is categorized into three levels: low speed, medium speed, and high speed, corresponding to 0-30 km / h, 30-60 km / h, and above 60 km / h, respectively. The frequency of vehicle speed at each level under different environmental conditions is statistically analyzed. For example, when the distance to the obstacle is less than 5 meters, the low-speed state occurs 80 times, the medium-speed state 15 times, and the high-speed state 5 times. When the distance to the obstacle is greater than 30 meters, the low-speed state occurs 10 times, the medium-speed state 40 times, and the high-speed state 50 times. Conditional probability distributions are calculated based on these frequencies to derive the mutual information value between the operational status features and environmental features. A higher mutual information value indicates a stronger correlation between the two features. A correlation threshold of 0.3 is set; when the mutual information value is greater than 0.3, the two features are considered to be significantly correlated, and these correlated features are then combined. The mutual information value between vehicle speed and distance to the obstacle in front is 0.65, the mutual information value between acceleration and distance to the obstacle in front is 0.58, and the mutual information value between steering wheel angle and distance to the obstacle to the side is 0.42. These feature pairs are selected to form feature combinations.
[0025] Principal component analysis (PCA) is used to reduce the dimensionality of the feature combination. The high-dimensional data matrix formed by the feature combination is centered, and the eigenvalues and eigenvectors of the covariance matrix are calculated. The eigenvalues reflect the variance of the data along the corresponding principal component direction. Assuming the original feature combination contains 20 feature dimensions, 20 eigenvalues are calculated and sorted from largest to smallest: 12.5, 8.3, 5.6, 3.2, 2.1, 1.8, 1.2, 0.9, 0.6, 0.4, etc. The top principal components with a cumulative contribution rate of 85% are selected. In this example, the first 6 principal components have a cumulative contribution rate of 86.7%. The original 20-dimensional features are projected onto the subspace formed by these 6 principal components, resulting in a simplified 6-dimensional feature.
[0026] Simplifying continuous numerical values in features requires converting them into discrete values for subsequent processing. An equal-frequency binning method is used for discretization, sorting the values of each feature dimension by size and dividing them into several intervals based on the number of samples. For example, if a feature dimension contains 1000 sample values, it is divided into 10 intervals, each containing 100 samples. The first interval's value range is -3.5 to -1.2, the second interval is -1.2 to -0.5, and so on. Each interval is assigned a discrete label, numbered from 0 to 9. The sample value is assigned the corresponding discrete label based on which interval it falls into.
[0027] The information gain method is used to calculate the information contribution of each discrete value. Driving scenarios are divided into two categories: safe scenarios and risky scenarios. The distribution of these two scenarios under different discrete value conditions is statistically analyzed. For example, the discrete value 0 of a certain feature appears 200 times, with 180 occurrences in safe scenarios and 20 in risky scenarios. The discrete value 5 appears 150 times, with 50 occurrences in safe scenarios and 100 in risky scenarios. The entropy of the entire dataset and the conditional entropy under each discrete value of this feature are calculated; the difference between the two is the information gain. The information gain for discrete value 5 is 0.42, and the information gain for discrete value 0 is 0.08. A preset contribution threshold of 0.25 is set. Discrete values with an information contribution exceeding the threshold are selected, while discrete values with an information contribution below the threshold are discarded. All discrete values of simplified features are filtered, retaining feature dimensions with information contributions exceeding the threshold. Finally, a multi-dimensional scene feature vector with four dimensions is constructed, where each dimension takes the filtered discrete label. This feature vector effectively represents the key characteristics of the vehicle's scenario, providing a basis for subsequent decision-making.
[0028] In one optional implementation, historical remote frame request data is sampled using a sliding time window method, and a scene-request association model is constructed using a Long Short-Term Memory (LSTM) network to generate a scene similarity score, including: Set a time window length and a sliding step size, sample historical remote frame request data based on the time window length and the sliding step size to obtain multiple request sample segments, calculate the time interval and request frequency of remote frame requests in each request sample segment, and generate request time sequence features; combine the request time sequence features with scene data within the corresponding time period to form a scene-request association sequence; The scene-request association sequence is input into a long short-term memory network for training. The long short-term memory network constructs a scene-request association model by extracting long-term dependency features of the scene-request association sequence. Based on the scene-request association model, the matching degree between the current scene and historical scenes is calculated, and a scene similarity score is generated.
[0029] The system reads all remote frame request records from the user over the past 30 days from the remote frame request database. Each record includes a request timestamp, request type, scene identifier, and request result. A time window length of 5 minutes and a sliding step of 1 minute are set, meaning a new sampling segment is generated after each 1-minute window movement. For example, the first window covers the time range from 0:00:00 to 0:05:00, and the second window covers the time range from 0:01:00 to 0:06:00. In this way, the system traverses all historical data and extracts 8640 request sample segments.
[0030] For each request sample segment, the time interval of the remote frame requests it contains is calculated. Specifically, all requests within the segment are sorted in ascending order by timestamp, and the time difference between two adjacent requests is calculated. Assuming a segment contains 5 requests with timestamps of 0 seconds, 45 seconds, 90 seconds, 180 seconds, and 240 seconds, the time interval sequence is 45 seconds, 45 seconds, 90 seconds, and 60 seconds. The system further calculates the average, minimum, maximum, and standard deviation of this sequence as time interval features. In this example, the average time interval is 60 seconds, the minimum interval is 45 seconds, the maximum interval is 90 seconds, and the standard deviation is 20.5 seconds.
[0031] Request frequency is calculated based on the number of requests per unit time. Since the time window length is fixed at 5 minutes (300 seconds), the system divides the total number of requests within a segment by the time window length to obtain the request frequency per second. For a segment containing 5 requests, the request frequency is 0.0167 requests per second. To enhance feature representation, the system also calculates the distribution ratio of different request types within the segment. Assuming that 3 out of 5 requests are rendering requests and 2 are data synchronization requests, then rendering requests account for 60%, and data synchronization requests account for 40%. These statistics, together with the time interval feature, constitute the request time series feature vector. This vector has 8 dimensions and includes the average interval, minimum interval, maximum interval, interval standard deviation, request frequency, rendering request ratio, data synchronization request ratio, and other request ratios.
[0032] Scene data acquisition relies on the scene monitoring module of the remote application system. This module records the scene type of the user's current operation in real time, including document editing, 3D model browsing, video playback, and code compilation scenarios. Each scene is converted into a numerical vector through one-hot encoding. For example, the document editing scene is encoded as vector 10000, and the 3D model browsing scene is encoded as vector 01000. The system also records detailed parameters of the scene. For the 3D model browsing scene, parameters include model complexity, number of vertices, and texture resolution. Assuming that a user is browsing a 3D model containing 500,000 vertices with a texture resolution of 2048×2048 pixels during a certain time period, the system normalizes these values and concatenates them with the scene type encoding to form a 12-dimensional scene feature vector.
[0033] The construction of the scene-request association sequence is achieved through a time alignment mechanism. For each request sample segment, the system searches for scene data records that completely overlap with its time window. Since scene data is recorded at the second level, while the request sample segment spans 5 minutes, the system uses a time-weighted average method of scene features to generate representative scene vectors. Specifically, the duration of each scene within the time window is statistically calculated, the sum of the products of each scene feature vector and its duration is calculated, and then divided by the total duration. Assuming that the first 2 minutes within the 5-minute window are a document editing scene and the last 3 minutes are a 3D model browsing scene, the final scene vector is the result of multiplying the document editing scene vector by 0.4 and adding the 3D model browsing scene vector multiplied by 0.6. This scene vector is concatenated with the corresponding request time-series feature vector to form a combined vector of dimension 20, which serves as the input for a single time step of the scene-request association sequence.
[0034] The Long Short-Term Memory (LSTM) network is constructed using a three-layer stacked structure. The input layer receives a sequence of scene-request association vectors with a dimension of 20 and a sequence length of 30, representing data from 30 consecutive sliding windows. The first LSM unit contains 128 hidden neurons, responsible for the initial extraction of temporal dependencies. Each unit contains three gating mechanisms: an input gate, a forget gate, and an output gate. The input gate determines how much of the current input information is retained in the cell state, the forget gate determines how much of the cell state from the previous time step is forgotten, and the output gate determines how much of the cell state is output to the hidden state. Through the synergistic effect of these gating mechanisms, the network can selectively memorize long-term dependency information and filter out irrelevant noise.
[0035] The second layer, Long Short-Term Memory (LST) units, contains 64 hidden neurons. It receives the output sequence from the first layer and performs higher-level feature abstraction. This layer focuses on capturing the correlation between scene transitions and changes in request patterns. The third layer is a fully connected layer that maps the hidden state of the last time step of the second layer to a single numerical output, representing the scene-request correlation strength. Mean squared error is used as the loss function during network training, and backpropagation is used to optimize the network parameters. The training dataset contains historical data from the previous 20 days, the validation dataset contains data from the next 5 days, and the test dataset contains data from the last 5 days. The network converged after 50 training iterations, and the loss value on the validation set stabilized at 0.035.
[0036] The scene similarity score is generated based on a trained scene-request association model. When a user enters a new scene, the system extracts the feature vector of the current scene and collects the request time-series features of the most recent 30 time windows to construct a current scene-request association sequence. This sequence is input into a trained Long Short-Term Memory (LSTM) network, which outputs a predicted value representing the association between the current scene and the request pattern. Simultaneously, the system retrieves all historical scene records from historical data, extracts their corresponding scene-request association sequences one by one, and inputs them into the model to obtain predicted values. The predicted value of the current scene is compared with the predicted value of each historical scene, and the absolute value of the difference is calculated and converted into a similarity score from 0 to 100. The smaller the difference, the more similar the scenes are, and the higher the score. For example, if the predicted value of the current scene is 0.75 and the predicted value of a certain historical scene is 0.78, the difference is 0.03, and the converted similarity score is 97. The system sorts all historical scenes in descending order of similarity score and selects the top 10 scenes with the highest scores as a set of similar scenes for subsequent remote frame request prediction and resource scheduling optimization.
[0037] In one optional implementation, the scene-request association sequence is input into a Long Short-Term Memory (LSTM) network for training. The LSM network constructs a scene-request association model by extracting long-term dependency features from the scene-request association sequence, including: The scenario-request association sequence is preprocessed temporally to calculate the temporal correlation between scenario features and request features, generating a feature association matrix; the scenario-request association sequence is then normalized based on the feature association matrix to obtain a standardized association sequence. A long short-term memory network is constructed. The standardized association sequence is input into the long short-term memory network. Long-term temporal dependency features are extracted through forward propagation, and the network parameters are optimized through backpropagation to obtain the trained scene-request association model.
[0038] When performing time-series preprocessing on the scene-request association sequence, it is necessary to compare and analyze the timestamps between each scene feature and request feature. Assume that scene features include three dimensions: location information, ambient temperature, and light intensity; and request features include three dimensions: request type, request frequency, and request priority. Each feature corresponds to a timestamp. By traversing each record in the scene-request association sequence, the time difference between the occurrence time of the scene feature and the occurrence time of the request feature is extracted. In specific implementation, for the first record, the timestamp of the scene feature is 1609459200 seconds, and the timestamp of the request feature is 1609459205 seconds, resulting in a calculated time difference of 5 seconds. After collecting the time differences from all records, the distribution of the time differences is statistically analyzed to identify feature pairs with strong time correlation.
[0039] When calculating the temporal correlation between scene features and request features, a sliding time window mechanism is used, with a time window size of 10 seconds. The number of times scene features and request features co-occur within this window is counted. For the scene feature of location information, the request type feature co-occurs 8 times within the window, so the temporal correlation value for this feature pair is 8. For the feature pair of ambient temperature and request frequency, they co-occur 5 times within the same window, so the temporal correlation value is 5. For the feature pair of light intensity and request priority, they co-occur 3 times within the window, so the temporal correlation value is 3. The temporal correlation values of all feature pairs are arranged according to the scene feature dimension and the request feature dimension, forming a 3x3 feature correlation matrix. The element in the first row and first column of the matrix is 8, the element in the second row and second column is 5, the element in the third row and third column is 3, and the remaining positions are filled according to the co-occurrence count of the corresponding feature pairs.
[0040] When normalizing the scene-request association sequence based on the feature association matrix, a reference benchmark needs to be determined. The maximum value in the feature association matrix is used as the normalization benchmark; assuming the maximum value is 8, each element in the matrix is divided by this benchmark value. After normalization, the element value in the first row and first column of the matrix becomes 1.0, the element value in the second row and second column becomes 0.625, and the element value in the third row and third column becomes 0.375. The normalized feature association matrix is then used as weighting coefficients to weight each record in the scene-request association sequence. For example, if the feature value of location information in a record is 120, multiplying it by the corresponding weighting coefficient 1.0 still results in 120; the feature value of ambient temperature is 25, multiplying it by the weighting coefficient 0.625 results in 15.625; and the feature value of light intensity is 300, multiplying it by the weighting coefficient 0.375 results in 112.5. All the weighted feature values are then recombine to generate a standardized association sequence.
[0041] When constructing the Long Short-Term Memory (LSTM) network, the network structure is set to include an input layer, a hidden layer, and an output layer. The number of nodes in the input layer is consistent with the feature dimensions in the standardized association sequence. In this embodiment, there are a total of six dimensions for scene features and request features, so the input layer contains six nodes. The hidden layer adopts a LSM unit structure, with 128 LSM units. Each LSM unit contains an input gate, a forget gate, an output gate, and a memory unit state. The input gate controls how much of the current input information is retained in the memory unit state, the forget gate controls how much of the memory unit state from the previous time step is forgotten, and the output gate controls how much of the memory unit state is output to the current hidden state. The number of nodes in the output layer is determined according to the prediction objective of the scene-request association model. Assuming that the request type to appear in the next time step needs to be predicted, and there are 10 request types, then the output layer contains 10 nodes.
[0042] The standardized associated sequences are input sequentially into the input layer of the Long Short-Term Memory (LSTM) network. For the first record, the six feature values are 120, 15.625, 112.5, 2, 4, and 1, respectively, and these six values are simultaneously input to the six input layer nodes. The input layer nodes then pass these values to the 128 LSM units in the hidden layer. Within each LSM unit, the input gate receives the current input value and the previous hidden state, and calculates its activation value using an activation function. Assuming the activation value for the first LSM unit is 0.7, the forget gate similarly receives the current input value and the previous hidden state, calculating its activation value, assumed to be 0.3. The current input value is multiplied by the input gate activation value to obtain the amount of information to be added to the memory unit state. The previous memory unit state is multiplied by the forget gate activation value to obtain the amount of historical information to be retained. The newly added information and the retained historical information are added together to update the current memory unit state. The output gate calculates its activation value (let's say 0.8) based on the current input value, the previous hidden state, and the current memory cell state. The current memory cell state, after being processed by the activation function, is multiplied by the output gate activation value to obtain the current hidden state output value.
[0043] During forward propagation, the hidden state output values of 128 Long Short-Term Memory (LSTM) units are passed to 10 nodes in the output layer. Each node in the output layer performs a weighted sum of the received hidden state output values and converts them into a probability distribution using an activation function. Assuming the weighted sum of the first node in the output layer yields a probability of 0.15 after the activation function, it indicates a 15% probability of the first request type occurring in the next time step. The predicted result of the output layer is compared with the actual request type in the standardized association sequence for the next time step. Assuming the actual request type is the third type, the target probability of the third node should be 1.0, and the target probabilities of the other nodes should be 0. The error between the predicted probability and the target probability is calculated; the error for the first node is 0.15, and the error for the third node is -0.85.
[0044] The backpropagation process begins at the output layer. Based on the error value, the weight adjustment from the output layer to the hidden layer is calculated. For the weight connecting the first Long Short-Term Memory (LSTM) unit in the hidden layer to the first node in the output layer, assuming the current weight is 0.5, based on an error of 0.15 and a learning rate of 0.01, the calculated weight adjustment is -0.0015, resulting in an updated weight of 0.4985. The error is then propagated further into the hidden layer, calculating the weight adjustment for each gate unit within the hidden layer. For the input gate weight of the first LSM unit, the weight adjustment is calculated based on the propagated error and the input value of that unit, and the input gate weight parameters are updated. The weight parameters of the forget gate and output gate are also adjusted based on the error. The error is then propagated further into the input layer, updating the connection weights from the input layer to the hidden layer.
[0045] The forward and backward propagation processes are repeated, traversing all records in the standardized association sequence. Each iteration is considered complete after traversing all records. The number of iterations is set to 500, and the network parameters are continuously optimized and adjusted during each iteration. After the 100th iteration, the prediction error of the output layer decreases from the initial 0.85 to 0.42; after the 300th iteration, the prediction error decreases to 0.18; and after the 500th iteration, the prediction error decreases to 0.05. At this point, the weight parameters of each layer of the Long Short-Term Memory network have converged to a stable state, and the network can accurately extract long-term temporal dependency features from the scene-request association sequence, forming the trained scene-request association model. This model can be used to predict upcoming request features based on the current scene features.
[0046] In one optional implementation, based on the remote frame request probability distribution, the highest priority remote frame request sequence is identified; a hierarchical reinforcement learning method is used to establish a predictive control strategy, which involves hierarchically classifying the remote frame request sequences according to data type, including: Calculate the priority weight of each request in the probability distribution of the remote frame requests. The priority weight is obtained by weighting the request time urgency, priority level and request frequency. The time urgency is calculated based on the request deadline and the request frequency is obtained based on historical statistical data. Sort the requests according to the priority weight and select the requests with the highest weight to form a priority request sequence. The remote frames in the priority request sequence are divided into three levels according to data type: control data, sensor data, and diagnostic data; a hierarchical reinforcement learning algorithm is used to construct state-action spaces for each of the three levels.
[0047] In the specific implementation of remote frame request priority identification and hierarchical control, the probability distribution data of received remote frame requests is comprehensively analyzed. The system obtains the basic attribute information for each request, including the request identifier code, data type identifier, timestamp information, and preset priority level identifier. In a specific example, a control-type remote frame request has an identifier code of 0x3A5, a data type identifier of control data, a timestamp of the 1000th millisecond of the system clock, and a preset priority level of three.
[0048] When calculating time urgency, the deadline information carried by each request is extracted and compared with the current system time. The deadline is set by the request initiator and reflects the time node when the request must be completed. The system records the current time as 1000 milliseconds, and the deadline for a certain request is set to 1200 milliseconds. The difference between the two is 200 milliseconds, which is taken as the remaining processing time. The system calculates the ratio of the remaining processing time to a preset standard processing cycle, which is set to 500 milliseconds. The ratio of the remaining time to the standard cycle for this request is 0.4. The system then performs a reciprocal conversion on this ratio, obtaining a value of 2.5, which is used as the initial quantification value of time urgency. The shorter the remaining time, the larger the reciprocal value, indicating a higher time urgency.
[0049] In the priority level quantization process, a five-level numerical mapping relationship is preset: the highest priority corresponds to a value of 5.0, the second highest priority corresponds to a value of 4.0, the medium priority corresponds to a value of 3.0, the second lowest priority corresponds to a value of 2.0, and the lowest priority corresponds to a value of 1.0. If a sensor data request is preset to the second highest priority, the system directly extracts the corresponding value of 4.0 as the priority level quantization result.
[0050] Request frequency statistics are calculated cumulatively based on request record data within a historical time window. The statistical time window is set to the most recent 10,000 milliseconds period, and historical records with the same request characteristics are retrieved within this window. If a certain type of request appears 25 times within the time window, the system uses this count as the raw data for the request frequency. The system then calculates the ratio of the request frequency to the time window length to obtain the average request frequency per unit time; in this example, the result is 0.0025 times per millisecond. The system amplifies this frequency value by multiplying it by a scaling factor of 1000, resulting in a normalized request frequency value of 2.5.
[0051] In the comprehensive calculation of priority weights, weight coefficients are configured for three dimensions: time urgency, priority level, and request frequency. The weight coefficient for time urgency is set to 0.5, the weight coefficient for priority level is set to 0.3, and the weight coefficient for request frequency is set to 0.2. The system multiplies the time urgency value of a request (2.5) by its weight coefficient (0.5) to obtain 1.25, multiplies the priority level value (4.0) by its weight coefficient (0.3) to obtain 1.2, and multiplies the request frequency value (2.5) by its weight coefficient (0.2) to obtain 0.5. The system then sums these three weighted results to obtain the final priority weight value of 2.95 for the request.
[0052] All requests are sorted in descending order according to their calculated priority weights. Assuming there are 120 remote frame requests to be processed, the system creates a sorted list based on the priority weight of each request. The request with the highest weight is placed first, with weights decreasing sequentially. The system determines the length of the priority request sequence based on a preset selection threshold, which is set to select the top 30% of requests by weight, corresponding to 36 requests. The system extracts the first 36 requests from the sorted list to form the priority request sequence for subsequent processing.
[0053] In the data type classification operation, the data type identifier field carried by each request in the priority request sequence is read. The data type identifier adopts a predefined encoding rule: the encoding range of 0x01 to 0x0F represents control data, the encoding range of 0x10 to 0x1F represents sensor data, and the encoding range of 0x20 to 0x2F represents diagnostic data. A request has a data type identifier of 0x05; the system recognizes this encoding as falling within the control data range and classifies the request into the control data level. Another request has a data type identifier of 0x18; the system recognizes this encoding as falling within the sensor data range and classifies it into the sensor data level. After traversal processing, the 36 requests in the priority request sequence are assigned to three levels: the control data level contains 12 requests, the sensor data level contains 18 requests, and the diagnostic data level contains 6 requests.
[0054] The state space construction of the hierarchical reinforcement learning algorithm is performed independently for each level. The state space of the control data level includes four dimensions: the current position state of the actuator, the target position state, the velocity state, and the acceleration state. The actuator position state is discretized, with the position range divided into 100 discrete intervals, the velocity state into 50 discrete levels, and the acceleration state into 20 discrete levels. At a certain moment, the state vector of the control data is represented as position interval number 45, target position number 78, velocity level 15, and acceleration level 8, constituting a complete state description for that level.
[0055] The state space design at the sensor data level includes sensor data freshness status, data integrity status, transmission delay status, and buffer occupancy status. Data freshness status is quantified based on the interval between the data acquisition time and the current time; an interval less than 50 milliseconds is marked as level 5, and an interval between 50 and 100 milliseconds is marked as level 4. Data integrity status is set based on the data packet verification results; completely correct data is marked as level 10, and the presence of a single byte error is marked as level 7. Transmission delay status is divided into 15 levels based on the delay time fed back from the network layer, and buffer occupancy status is divided into 10 levels based on the current storage occupancy rate.
[0056] The diagnostic data hierarchy's state space encompasses fault code status, system health status, diagnostic priority status, and historical fault frequency status. Fault code status directly maps to predefined fault type codes, totaling 50 fault types. System health status uses a percentage-based scoring mechanism, divided into 10 health levels. At a given moment, the diagnostic data shows fault code type 23, a system health score of 65 (corresponding to level 7), a diagnostic priority of level 3, and a historical fault frequency of 5.
[0057] The action space is closely related to the control objectives at each level. The action space at the control data level includes four types of actions: adjusting control commands, modifying execution parameters, activating backup channels, and triggering emergency responses. Adjusting control commands includes three sub-options: increasing the command value, decreasing the command value, and maintaining the current value. The action space at the sensor data level includes four types of actions: increasing the sampling frequency, decreasing the sampling frequency, switching sensor channels, and initiating data filtering. The action space at the diagnostic data level includes four types of actions: initiating deep diagnostics, recording fault logs, triggering alarm notifications, and executing self-healing procedures. The action space and state space at each level together constitute the decision model for that level, supporting reinforcement learning algorithms for policy optimization training.
[0058] In one optional implementation, the remote frames in the priority request sequence are divided into three levels according to data type: control data, sensor data, and diagnostic data; a hierarchical reinforcement learning algorithm is used to construct state-action spaces for each of the three levels, including: The priority request sequence is layered according to the remote frame data type. Remote frames with real-time requirements are assigned to the control data layer, remote frames with periodic characteristics are assigned to the sensor data layer, and remote frames with non-real-time characteristics are assigned to the diagnostic data layer, forming a layered request set. The number of requests, data size, and processing latency of remote frames in each layer are calculated to generate a layered state vector. A hierarchical reinforcement learning algorithm is applied to the hierarchical request set to construct an independent state space and action space for each layer.
[0059] When processing priority request sequences hierarchically based on remote frame data types, a priority request sequence containing multiple remote frames is received. Each remote frame carries an identification field to indicate its data type attribute. The system reads the identification field from the remote frame, which contains a frame type code, a latency requirement parameter, and a periodicity flag. When the identification field shows a frame type code of 01 and a latency requirement parameter of less than 10 milliseconds, the system assigns the remote frame to the control data layer. When the identification field shows a frame type code of 02 and the periodicity flag is true, the system assigns the remote frame to the sensor data layer. When the identification field shows a frame type code of 03 and a latency requirement parameter of greater than 100 milliseconds, the system assigns the remote frame to the diagnostic data layer.
[0060] In implementation, assuming the priority request sequence contains 15 remote frames, the system reads the identifier field of each remote frame sequentially. The first remote frame has a frame type code of 01 and a latency requirement of 8 milliseconds; the system assigns it to the control data layer. The second remote frame has a frame type code of 02, a periodicity flag of true, and a period of 50 milliseconds; the system assigns it to the sensor data layer. The third remote frame has a frame type code of 03 and a latency requirement of 150 milliseconds; the system assigns it to the diagnostic data layer. The system continues to perform the same judgment and assignment operation on the remaining 12 remote frames, ultimately forming three hierarchical request sets: the control data layer contains 5 remote frames, the sensor data layer contains 7 remote frames, and the diagnostic data layer contains 3 remote frames.
[0061] Statistical analysis was performed on five remote frames in the control data layer. The total number of requests for remote frames in this layer was calculated to be 5. The data length field of each remote frame was read, which were 64 bytes, 128 bytes, 96 bytes, 112 bytes, and 80 bytes respectively. The total data size of this layer was calculated to be 480 bytes. The system accessed the processing latency record of each remote frame, which was stored in the latency field of the frame header. The latency values were 6 milliseconds, 7 milliseconds, 8 milliseconds, 5 milliseconds, and 9 milliseconds respectively. The maximum value was taken as the processing latency parameter of this layer, and the processing latency of the control data layer was found to be 9 milliseconds. The system used the number of requests (5), the data size (480 bytes), and the processing latency (9 milliseconds) as three dimensions to construct a vector format, generating a hierarchical state vector representation of the control data layer from 5 to 480 to 9.
[0062] The same statistical calculation process is performed on the sensor data layer, which contains 7 remote frames, for a total of 7 requests. The data length fields of each remote frame are read as 200 bytes, 180 bytes, 220 bytes, 190 bytes, 210 bytes, 195 bytes, and 205 bytes, respectively, and the total data size is 1400 bytes. The processing latency records of each remote frame are accessed, which are 25 milliseconds, 30 milliseconds, 22 milliseconds, 28 milliseconds, 26 milliseconds, 29 milliseconds, and 24 milliseconds, respectively. The maximum value is taken as the processing latency of this layer, which is 30 milliseconds. The hierarchical state vector of the sensor data layer is generated as 7 to 1400 to 30.
[0063] Statistical analysis of the diagnostic data layer reveals that it contains three remote frames, with a total of three requests. The data lengths of each remote frame are 512 bytes, 480 bytes, and 520 bytes, respectively, resulting in a total data size of 1512 bytes. The processing latency for each remote frame is recorded as 160 milliseconds, 180 milliseconds, and 170 milliseconds; the maximum value yields a processing latency of 180 milliseconds for this layer. The hierarchical state vector for the diagnostic data layer is represented as 3 to 1512 to 180.
[0064] A hierarchical reinforcement learning algorithm is applied to the control data layer to construct an independent state space for this layer. The state space contains three dimensions: the current layer's hierarchical state vector, the current processing queue length, and the available bandwidth resources. The system reads the hierarchical state vectors 5 to 480 to 9 of the control data layer, determines the number of remote control data frames to be processed in the current processing queue to be 2, and queries the network communication module to obtain the current available bandwidth resources of 800 kilobits per second. The system combines these three sets of values to form the state space representation of the control data layer, with the state values being the hierarchical state vectors 5 to 480 to 9, the queue length of 2, and the available bandwidth of 800 kilobits per second.
[0065] An independent action space is constructed for the control data layer. This action space defines the types of operations the system can execute, and includes three options: immediate processing actions, delayed processing actions, and discard processing actions. An immediate processing action means the system immediately adds the current remote frame to the processing queue and assigns it the highest priority. A delayed processing action means the system adds the current remote frame to a buffer queue to await subsequent processing. A discard processing action means the system marks the current remote frame as low priority and removes it from the processing flow. Based on the real-time requirements of the control data layer, the system sets the initial weight of the immediate processing action to 0.7, the initial weight of the delayed processing action to 0.2, and the initial weight of the discard processing action to 0.1.
[0066] A state space is constructed for the sensor data layer. The layer's hierarchical state vectors 7 to 1400 to 30, the current processing queue length of 4, and the available bandwidth resource of 600 kilobits per second are read and combined to form the state space representation of the sensor data layer. An action space is then constructed for this layer, including three options: batch processing actions, periodic processing actions, and buffered processing actions. Batch processing actions indicate that the system merges multiple remote sensor data frames and processes them uniformly. Periodic processing actions indicate that the system triggers the processing flow according to a preset periodic time. Buffered processing actions indicate that the system temporarily stores remote frames in a buffer area until resources become available. Based on the periodic characteristics of the sensor data, the initial weights are set to 0.6 for periodic processing actions, 0.3 for batch processing actions, and 0.1 for buffered processing actions.
[0067] A state space is constructed for the diagnostic data layer. The layer's hierarchical state vectors 3 to 1512 to 180, the current processing queue length of 1, and the available bandwidth resource of 400 kilobits per second are read to form a state space representation. An action space is then constructed for this layer, including three options: background processing actions, merged processing actions, and on-demand processing actions. Background processing actions indicate that the system processes remote frames of diagnostic data during low-priority periods. Merged processing actions indicate that the system combines multiple diagnostic requests into a single processing task. On-demand processing actions indicate that the system only executes processing when it receives an explicit instruction. Based on the non-real-time nature of diagnostic data, the initial weights for background processing actions are set to 0.5, merged processing actions to 0.35, and on-demand processing actions to 0.15.
[0068] A second aspect of the present invention provides a CAN2.0 remote frame predictive request optimization system, comprising: The acquisition unit is used to acquire vehicle operating status information and vehicle surrounding environment information. Based on the vehicle operating status information and the vehicle surrounding environment information, a multi-dimensional scene feature vector is established. Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score. The probability distribution of remote frame requests in the current scene is determined based on the scene similarity score. The identification unit is used to identify the highest priority remote frame request sequence according to the probability distribution of the remote frame request; a hierarchical reinforcement learning method is used to establish a prediction control strategy, the remote frame request sequence is divided into hierarchical levels according to data type, an independent state space and reward function are set for each level, and the optimal prediction time window is determined through policy iteration optimization to realize hierarchical prediction control of remote frame requests. The execution unit is used to execute predictive control instructions, pre-allocate communication resources, and complete remote frame data transmission.
[0069] The method further includes: When transmitting string data based on the CAN 2.0 protocol data frame structure, the transmitting device first acquires the instruction frame data to be transmitted. This instruction frame is a complete string instruction used by the serial port screen to interact with external devices. The transmitting end detects the length of the instruction frame, determines the total number of bytes by byte counting, and then calculates the number of frames according to the rule that each CAN data frame carries a 6-byte payload. The number of frames is calculated by rounding up, that is, the total number of bytes is divided by 6 and then rounded up to obtain the total number of data frames required. This value is used as the unified value of the Total field in subsequent frames.
[0070] During string segmentation, the sending end sequentially divides the instruction frame according to 6-byte boundaries, extracting 6 consecutive bytes each time as a fragment, starting from byte 0. When the last fragment is less than 6 bytes, it is padded with 0x00 bytes to a length of 6 bytes, ensuring that the data segment of each CAN data frame is a fixed length of 8 bytes. Frame sequence numbers are generated simultaneously during the segmentation process, starting from 0 and incrementing, with each fragment corresponding to a unique sequence number value.
[0071] When encapsulating CAN data frames, each frame's 8-byte data segment uses a fixed layout. Byte 0 is the Num field, filled with the sequence number of the current fragment, ranging from 0 to 254, supporting a maximum of 255 frames for command transmission. Byte 1 is the Total field, filled with the total number of frames, which remains consistent across all frames of the same command. Bytes 2 to 7 are string data segments, sequentially filled with the 6-byte content of the corresponding fragment, with any insufficient space pre-padded with 0x00.
[0072] The transmitting end sends data frames sequentially according to their frame numbers via the CAN controller, with an inter-frame interval of 1 to 5 milliseconds to avoid bus congestion and ensure transmission efficiency. The CAN identifier uses an 11-bit standard format, and the transmitting and receiving ends pre-agree on a fixed identifier value to ensure the receiver can correctly identify the target frame. During transmission, the CAN controller status is monitored, and a successful transmission confirmation signal is detected. If a transmission failure occurs, a retransmission is performed, limited to a maximum of three times.
[0073] The receiver receives data frames via the CAN interrupt service routine. Upon interrupt triggering, it immediately reads 8 bytes of data and parses the format. The receiver maintains a receive buffer and a frame counter, with the buffer size set to 999 bytes to support the complete reception of the maximum length command. After receiving each frame, the Num and Total fields are extracted for verification, checking whether the sequence number is within a reasonable range and whether the Total value is consistent with the previously received frame.
[0074] During frame reassembly, the receiver determines the position of the current frame within the complete instruction based on the Num field and writes 6 bytes of data (bytes 2 to 7) into the corresponding offset position in the receive buffer. The offset address is calculated as Num multiplied by 6 to ensure that the frame data is assembled in the correct order. The receiver also maintains a bitmap marker for received frames, recording which sequence numbers of frames have been successfully received, for detecting frame loss and duplicate frames.
[0075] Integrity checks are performed by comparing the number of received frames with the Total field value. Command reception is considered complete when the total number of received frames reaches the Total value and all sequence-numbered frames have been received. The receiving end then performs 0x00 padded removal on the reassembled data, removing all consecutive 0x00 bytes by scanning from the end backwards to restore the original command frame content. The padded process has a minimum length limit of 1 byte to prevent the command from being completely cleared.
[0076] The exception handling mechanism includes multiple fault tolerance strategies. The receive timeout detection is set to a 200-millisecond window; if the expected subsequent frame is not received within this time, the timeout processing procedure is triggered. Out-of-order frame handling is implemented through Num field sorting, allowing the receiver to accept frames arriving in any order and correctly reassemble them. Duplicate frame detection is implemented based on bitmap marking; duplicate frames with the same sequence number are directly discarded. When a discrepancy in the Total field is detected, the receiver clears the current receive state and restarts the receive process.
[0077] In a specific implementation example, the serial port screen instruction frame "JY 022 HELLO JY_GUI EF" contains 22 bytes of complete data. This instruction is divided into 4 fragments with 6-byte boundaries. The first fragment is "JY 022" plus a space, totaling 6 bytes; the second fragment is "HELLO", totaling 6 bytes; the third fragment is "JY_GU", totaling 6 bytes; and the fourth fragment is "I EF" plus 4 0x00 padding bytes.
[0078] The first frame of CAN data is 0x00 0x04 0x4A 0x59 0x20 0x30 0x32 0x32, where 0x00 represents sequence number 0, 0x04 indicates a total of 4 frames, and the following 6 bytes are the ASCII code "JY 032". The second frame of data is 0x01 0x04 0x200x48 0x45 0x4C 0x4C 0x4F, with sequence number 1 corresponding to the string "HELLO". The third frame of data is 0x02 0x04 0x200x4A 0x59 0x5F 0x47 0x55, with sequence number 2 corresponding to the content "JY_GU". The fourth frame of data is 0x03 0x04 0x49 0x20 0x45 0x46 0x00 0x00, and sequence number 3 contains "I EF" and 2 bytes of padding.
[0079] The receiving end receives four frames of data sequentially and then reassembles them, concatenating bytes 2 through 7 of each frame at offset positions to obtain a complete 22-byte data set. The tail padding and clearing process removes the last two 0x00 bytes, ultimately restoring the original instruction "JY 022HELLO JY_GUI EF". The entire transmission process takes approximately 20 milliseconds, including the time for four CAN frame transmissions and processing, meeting the response requirements of the real-time control system.
[0080] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.
[0081] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.
[0082] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A CAN2.0 remote frame predictive request optimization method, characterized in that, include: Vehicle operating status information is collected, and information about the vehicle's surrounding environment is obtained. Based on the vehicle operating status information and the information about the vehicle's surrounding environment, a multi-dimensional scene feature vector is established. Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score. The probability distribution of remote frame requests in the current scene is determined based on the scene similarity score. Based on the probability distribution of the remote frame requests, the sequence of remote frame requests with the highest priority is identified; a hierarchical reinforcement learning method is used to establish a predictive control strategy, the remote frame request sequence is divided into hierarchical levels according to data type, an independent state space and reward function are set for each level, and the optimal prediction time window is determined through policy iteration optimization to achieve hierarchical predictive control of remote frame requests; Execute predictive control commands, allocate communication resources in advance, and complete remote frame data transmission.
2. The method according to claim 1, characterized in that, Based on the vehicle operating status information and the surrounding environment information, a multi-dimensional scene feature vector is established, including: The vehicle operating status information is subjected to feature extraction in chronological order to obtain operating status features reflecting the dynamic changes of the vehicle; the surrounding environment information of the vehicle is subjected to spatial feature extraction to obtain environmental features reflecting the distribution of the environment; the correlation degree between the operating status features and the environmental features is calculated, and feature combinations are generated based on the correlation degree. The feature combination is dimensionality reduced to obtain simplified features. The continuous values in the simplified features are converted into discrete values. The information contribution of each discrete value is calculated. Features with information contribution exceeding a preset contribution threshold are selected to construct a multi-dimensional scene feature vector.
3. The method according to claim 1, characterized in that, Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a Long Short-Term Memory (LSTM) network to generate scene similarity scores, including: Set a time window length and a sliding step size, sample historical remote frame request data based on the time window length and the sliding step size to obtain multiple request sample segments, calculate the time interval and request frequency of remote frame requests in each request sample segment, and generate request time sequence features; combine the request time sequence features with scene data within the corresponding time period to form a scene-request association sequence; The scene-request association sequence is input into a long short-term memory network for training. The long short-term memory network constructs a scene-request association model by extracting long-term dependency features of the scene-request association sequence. Based on the scene-request association model, the matching degree between the current scene and historical scenes is calculated, and a scene similarity score is generated.
4. The method according to claim 3, characterized in that, The scene-request association sequence is input into a Long Short-Term Memory (LSTM) network for training. The LSM network constructs a scene-request association model by extracting long-term dependency features from the scene-request association sequence, including: The scenario-request association sequence is preprocessed temporally to calculate the temporal correlation between scenario features and request features, generating a feature association matrix; the scenario-request association sequence is then normalized based on the feature association matrix to obtain a standardized association sequence. A long short-term memory network is constructed. The standardized association sequence is input into the long short-term memory network. Long-term temporal dependency features are extracted through forward propagation, and the network parameters are optimized through backpropagation to obtain the trained scene-request association model.
5. The method according to claim 1, characterized in that, Based on the remote frame request probability distribution, identify the highest priority remote frame request sequence; A hierarchical reinforcement learning method is used to establish a predictive control strategy, which involves hierarchically dividing the remote frame request sequence according to data type, including: Calculate the priority weight of each request in the probability distribution of the remote frame requests. The priority weight is obtained by weighting the request time urgency, priority level and request frequency. The time urgency is calculated based on the request deadline and the request frequency is obtained based on historical statistical data. Sort the requests according to the priority weight and select the requests with the highest weight to form a priority request sequence. The remote frames in the priority request sequence are divided into three levels according to data type: control data, sensor data, and diagnostic data; a hierarchical reinforcement learning algorithm is used to construct state-action spaces for each of the three levels.
6. The method according to claim 5, characterized in that, The remote frames in the priority request sequence are divided into three levels according to data type: control data, sensor data, and diagnostic data. A hierarchical reinforcement learning algorithm is used to construct state-action spaces for three levels, including: The priority request sequence is layered according to the remote frame data type. Remote frames with real-time requirements are assigned to the control data layer, remote frames with periodic characteristics are assigned to the sensor data layer, and remote frames with non-real-time characteristics are assigned to the diagnostic data layer, forming a layered request set. The number of requests, data size, and processing latency of remote frames in each layer are calculated to generate a layered state vector. A hierarchical reinforcement learning algorithm is applied to the hierarchical request set to construct an independent state space and action space for each layer.
7. A CAN2.0 remote frame predictive request optimization system, used to implement the method of any one of claims 1-6, characterized in that, include: The acquisition unit is used to acquire vehicle operating status information and vehicle surrounding environment information. Based on the vehicle operating status information and the vehicle surrounding environment information, a multi-dimensional scene feature vector is established. Historical remote frame request data is sampled using a sliding time window method. A scene-request association model is constructed using a long short-term memory network to generate a scene similarity score. The probability distribution of remote frame requests in the current scene is determined based on the scene similarity score. The identification unit is used to identify the highest priority remote frame request sequence based on the remote frame request probability distribution. A hierarchical reinforcement learning method is used to establish a predictive control strategy. The remote frame request sequence is divided into hierarchical levels according to data type. An independent state space and reward function are set for each level. The optimal prediction time window is determined through policy iteration and optimization to achieve hierarchical predictive control of remote frame requests. The execution unit is used to execute predictive control instructions, pre-allocate communication resources, and complete remote frame data transmission.
8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.