Resource scheduling method and device of vehicle gateway
Patent Information
- Application Number
- CN202610544453.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-23
- Publication Date
- 2026-09-01
AI Technical Summary
[0003]本发明提供一种车载网关的资源调度方法以及装置,用于解决相关技术中由于运行复杂算法导致延迟高危及行车安全的技术问题
[0016]This invention provides a resource scheduling method for a vehicle-mounted gateway. The method involves obtaining a traffic feature vector of a target vehicle-mounted gateway within a historical time window; inputting the traffic feature vector into a pre-constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle-mounted gateway in the current time window; obtaining multi-dimensional target index values of the target vehicle-mounted gateway in the current time window; weighting and summing the traffic anomaly probability value and the multi-dimensional target index values according to a target weighting strategy to obtain a security pressure index of the target vehicle-mounted gateway in the current time window; determining a target scheduling strategy for the target vehicle-mounted gateway based on the security pressure index; and performing resource scheduling within the current time window according to the target scheduling strategy. By combining the traffic anomaly probability value determined from the traffic feature vector of the target vehicle-mounted gateway in a historical time window with the multi-dimensional target index values of the target vehicle-mounted gateway in the current time window, historical traffic characteristics can be combined with the current network status. The security pressure index allows for a more accurate quantitative assessment of the current pressure on the target vehicle-mounted gateway, thereby making the target scheduling strategy more accurate and ensuring more rational use of the target vehicle-mounted gateway's resources.
Smart Images

Figure CN122679113A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle control technology, and in particular to a resource scheduling method and apparatus for an on-board gateway. Background Technology
[0002] As automotive electrical / electronic architecture (E / E architecture) evolves towards domain controllers and central computing architectures, the in-vehicle gateway has become a core hub connecting traditional Controller Area Network (CAN) / CAN with Flexible Data-rate (CAN-FD) bus networks with high-speed automotive Ethernet. Because the gateway handles data exchange between external networks (such as 4G / 5G / Wi-Fi) and internal control networks, it is highly vulnerable to hacker attacks (such as Denial of Service (DoS) attacks, fuzzing, and malicious control command injection). Therefore, deploying an Intrusion Detection System (IDS) and defensive scheduling mechanisms on the gateway is crucial. Existing technologies typically employ statistical or traditional deep learning methods for traffic detection. However, due to the limited computing resources of in-vehicle gateways, running complex algorithms can lead to high inference latency (>20ms), causing congestion in the forwarding of normal CAN bus control messages (such as braking and steering), jeopardizing driving safety. Summary of the Invention
[0003] This invention provides a resource scheduling method and apparatus for vehicle gateways, which solves the technical problem of high latency and driving safety caused by running complex algorithms in related technologies.
[0004] In a first aspect, embodiments of the present invention provide a resource scheduling method for an in-vehicle gateway, the method comprising: Obtain the traffic feature vector of the target vehicle gateway within a historical time window; The traffic feature vector is input into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window; Obtain the multi-dimensional index values of the target vehicle gateway in the current time window; The traffic anomaly probability value and the multi-dimensional target index value are weighted and summed according to the target weight strategy to obtain the security pressure index of the target vehicle gateway in the current time window. Based on the security pressure index, a target scheduling strategy is determined for the target vehicle gateway, and resource scheduling is performed within the current time window according to the target scheduling strategy.
[0005] Optionally, obtaining the traffic feature vector of the target vehicle gateway within a historical time window includes: generating a fused feature vector based on the traffic characteristics of different traffic channels of the target vehicle gateway within the historical time window; generating a vehicle state vector based on the vehicle state within the historical time window; processing the vehicle state vector and the fused feature vector according to an attention mechanism to obtain an attention weight vector corresponding to the historical time window; and obtaining the traffic feature vector by multiplying the attention weight vector and the fused feature vector.
[0006] Optionally, the target analysis model is a model of a Long Short-Term Memory (LSTM) network after sparsification, including multiple processing units and fully connected layers. Each processing unit includes a sparse weight matrix that has undergone structured pruning and quantization compression. The multiple processing units include a forget gate, an input gate, an output gate, and a cell state update unit. The step of inputting the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window includes: concatenating the traffic feature vector with the hidden vector in the target analysis model to obtain a concatenated vector; and concatenating the concatenated vector with the forget gate, input gate, output gate, and cell state update unit, respectively. The input gate, the output gate, and the sparse weight matrix within the cell state update unit are multiplied to sequentially obtain the output vector of the forget gate, the output vector of the input gate, the output vector of the output gate, and the candidate memory vector output by the cell state update unit. The memory vector within the target model is updated based on the output vector of the forget gate, the output vector of the input gate, and the candidate memory vector. The hidden vector is updated based on the updated memory vector and the output vector of the output gate to obtain the updated hidden vector. The updated hidden vector is input into the fully connected layer to obtain the traffic anomaly probability value.
[0007] Optionally, obtaining the multi-dimensional index values of the target vehicle gateway in the current time window includes: obtaining the CPU load rate, network interruption frequency, and buffer packet loss rate of the target vehicle gateway in the current time window; and normalizing the CPU load rate, network interruption frequency, and buffer packet loss rate to obtain the target CPU load rate, target network interruption frequency, and target buffer packet loss rate.
[0008] Optionally, before the step of weighting and summing the traffic anomaly probability value and the multi-dimensional target index value according to the target weight strategy to obtain the security pressure index of the target vehicle gateway in the current time window, the method further includes: obtaining a basic weight strategy, the basic weight strategy including a first weight corresponding to the target CPU load rate, a second weight corresponding to the target network interruption frequency, a third weight corresponding to the target buffer packet loss rate, and a fourth weight corresponding to the traffic anomaly probability value; if the traffic anomaly probability value is detected to be greater than a first traffic threshold, then the first weight and the second weight in the basic weight strategy are increased to obtain the target weight strategy; if the target buffer packet loss rate is detected to be greater than a packet loss rate threshold and the traffic anomaly probability value is less than a second traffic threshold, then the third weight in the basic weight strategy is increased to obtain the target weight strategy; if the chip temperature of the target vehicle gateway is detected to be greater than a temperature threshold or the voltage is abnormal, then the first weight in the basic weight strategy is increased to obtain the target weight strategy; if the vehicle is detected to be performing a remote upgrade while parked, then the first weight and the second weight in the basic weight strategy are decreased and the fourth weight is increased to obtain the target weight strategy.
[0009] Optionally, determining the target scheduling strategy for the target vehicle gateway based on the security pressure index includes: if the security pressure index is in a first pressure range, indicating that the target vehicle gateway is in a safe state, and using a preset first scheduling strategy as the target scheduling strategy; if the security pressure index is in a second pressure range, indicating that the target vehicle gateway is in a defensive state, and using a preset second scheduling strategy as the target scheduling strategy; if the security pressure index is in a third pressure range, indicating that the target vehicle gateway is in a critical state, and using a preset third scheduling strategy as the target scheduling strategy.
[0010] Optionally, before determining the target scheduling strategy for the target vehicle gateway based on the safety pressure index, the method further includes: obtaining a preset first pressure resistance threshold and a second pressure resistance threshold, wherein the first pressure resistance threshold is less than the second pressure resistance threshold; constructing a first pressure interval, a second pressure interval, and a third pressure interval based on the first pressure resistance threshold and the second pressure resistance threshold, wherein the values of the first pressure intervals are all less than the first pressure resistance threshold, the values of the second pressure intervals are not less than the first pressure resistance threshold and are less than the second pressure resistance threshold, and the values of the third pressure intervals are not less than the second pressure resistance threshold.
[0011] Optionally, the step of scheduling resources within the current time window according to the target scheduling strategy includes: if the target scheduling strategy is the first scheduling strategy, maintaining the default operating parameters of the target vehicle gateway; if the target scheduling strategy is the second scheduling strategy, reducing the bandwidth limit of the target vehicle gateway for transmitting entertainment content; if the target scheduling strategy is the third scheduling strategy, binding driving safety content to the first processor core of the target vehicle gateway's processor, binding intrusion detection content to the second processor core of the target vehicle gateway's processor, and reducing the polling quota of the target vehicle gateway's network card.
[0012] Secondly, embodiments of the present invention provide a resource scheduling device for an in-vehicle gateway, the device comprising: The acquisition module is used to acquire the traffic feature vector of the target vehicle gateway within a historical time window; The input module is used to input the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window; The acquisition module is also used to acquire the multi-dimensional index values of the target vehicle gateway in the current time window; The weighting module is used to perform a weighted summation of the traffic anomaly probability value and the multi-dimensional target index value according to the target weighting strategy, so as to obtain the security pressure index of the target vehicle gateway in the current time window; The determination module is used to determine the target scheduling strategy for the target vehicle gateway based on the security pressure index, and to perform resource scheduling within the current time window according to the target scheduling strategy.
[0013] Thirdly, embodiments of the present invention provide a vehicle, including: processor; A memory for storing instructions to be executed by the processor, wherein the processor is configured to execute the instructions to implement the method as described in the first aspect.
[0014] Fourthly, embodiments of the present invention provide a storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the vehicle to perform the method as described in the first aspect.
[0015] Fifthly, embodiments of the present invention provide a computer program product, the program product comprising a computer program, the computer program being executed by a processor as described in the first aspect.
[0016] This invention provides a resource scheduling method for a vehicle-mounted gateway. The method involves obtaining a traffic feature vector of a target vehicle-mounted gateway within a historical time window; inputting the traffic feature vector into a pre-constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle-mounted gateway in the current time window; obtaining multi-dimensional target index values of the target vehicle-mounted gateway in the current time window; weighting and summing the traffic anomaly probability value and the multi-dimensional target index values according to a target weighting strategy to obtain a security pressure index of the target vehicle-mounted gateway in the current time window; determining a target scheduling strategy for the target vehicle-mounted gateway based on the security pressure index; and performing resource scheduling within the current time window according to the target scheduling strategy. By combining the traffic anomaly probability value determined from the traffic feature vector of the target vehicle-mounted gateway in a historical time window with the multi-dimensional target index values of the target vehicle-mounted gateway in the current time window, historical traffic characteristics can be combined with the current network status. The security pressure index allows for a more accurate quantitative assessment of the current pressure on the target vehicle-mounted gateway, thereby making the target scheduling strategy more accurate and ensuring more rational use of the target vehicle-mounted gateway's resources. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 The flowchart of a resource scheduling method for an in-vehicle gateway provided in some embodiments of the present invention is shown; Figure 2 The structure of a resource scheduling device for an in-vehicle gateway provided in some embodiments of the present invention is shown; Figure 3 The diagram shows a structural block diagram of a vehicle provided in some embodiments of this application. Detailed Implementation
[0019] As described in the background section, with the evolution of automotive electronic and electrical architecture (E / E architecture) towards domain controllers and central computing architectures, the in-vehicle gateway has become a core hub connecting traditional CAN / CAN-FD bus networks with high-speed automotive Ethernet. Because the gateway carries data exchange between external networks (such as 4G / 5G / Wi-Fi) and internal control networks, it is highly vulnerable to hacker attacks (such as DoS attacks, fuzzing, and malicious control command injection). Therefore, deploying intrusion detection systems (IDS) and defense scheduling mechanisms on the gateway is crucial. Existing technologies typically employ statistical or traditional deep learning methods for traffic detection. However, due to the limited computing resources of in-vehicle gateways, running complex algorithms can lead to high inference latency (>20ms), which can cause blocking of normal CAN bus control messages (such as braking and steering), endangering driving safety.
[0020] According to an embodiment of the present invention, a resource scheduling method for an in-vehicle gateway is provided. Based on the traffic anomaly probability value determined by the traffic feature vector of the target in-vehicle gateway in a historical time window, and combined with the multi-dimensional index value of the target in-vehicle gateway in the current time window, the historical traffic characteristics can be combined with the current network status. The current pressure of the target in-vehicle gateway can be accurately judged by quantifying the security pressure index, thereby making the target scheduling strategy more accurate and the resources of the target in-vehicle gateway more rationally used.
[0021] The technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems will be described in detail below with 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. The embodiments of the present invention will now be described with reference to the accompanying drawings.
[0022] Figure 1 The flowchart illustrates a resource scheduling method for an in-vehicle gateway provided by an embodiment of the present invention. For example... Figure 1 As shown, the resource scheduling method for an in-vehicle gateway provided in this embodiment of the invention can be executed by the target in-vehicle gateway on the vehicle, or by a server or cloud connected to the target in-vehicle gateway. Specifically, the resource scheduling method for an in-vehicle gateway provided in this embodiment of the invention includes steps 110 to 150.
[0023] Step 110: Obtain the traffic feature vector of the target vehicle gateway within the historical time window.
[0024] In this invention, if a vehicle is equipped with multiple vehicle gateways, the target vehicle gateway can be the main gateway among the multiple vehicle gateways that manages all vehicle traffic; if the vehicle includes only one vehicle gateway, that vehicle gateway is the target vehicle gateway. A vehicle gateway (Vehicle Security Gateway) is used to connect devices in different vehicle network domains (such as CAN / FlexRay / Ethernet) to achieve data filtering and protocol conversion.
[0025] In this invention, a unified time window (e.g., 20ms) is first set, and all subsequent operations are based on this unified time window. A single time window can be of any length, such as 20ms or 50ms. After the vehicle starts, each preset interval is considered to have elapsed through a time window (time step). The historical time window can be the t-th time window elapsed since the vehicle started; correspondingly, the current time window corresponding to the current moment can be the (t+1)-th time window, where t is a natural number.
[0026] In this embodiment of the invention, after the vehicle's travel time has passed through a historical time window, a traffic feature vector can be determined based on the characteristics of the traffic passing through the target vehicle gateway within that historical time window. To make the traffic feature vector more accurately describe the traffic characteristics within the target vehicle gateway, the traffic feature vector can include the traffic characteristics of multiple traffic channels within the target vehicle gateway. The traffic characteristics of multiple traffic channels are concatenated to obtain the traffic feature vector. After obtaining the traffic feature vector, step 120 can be executed.
[0027] Step 120: Input the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window.
[0028] In this embodiment of the invention, the target analysis model can be a model capable of analyzing contextual features over time, i.e., a model with temporal dependency modeling capabilities, such as a Gated Recurrent Unit (GRU), a Temporal Convolutional Network (TCN), or a Long Short-Term Memory (LSTM). The traffic feature vector within a historical time window is input into the target analysis model. By analyzing the features included in the traffic feature vector through the target analysis model, a traffic anomaly probability value can be obtained. The traffic anomaly probability value is derived from the traffic features within the historical time window and reflects the probability score of the likelihood of traffic anomalies within the current time window.
[0029] In this embodiment of the invention, in order to more accurately determine the operating pressure of the target vehicle gateway, step 130 can be executed after obtaining the traffic anomaly probability value in step 120 within the current time window.
[0030] Step 130: Obtain the multi-dimensional index values of the target vehicle gateway in the current time window.
[0031] In this embodiment of the invention, the multidimensional index values may include index values that characterize the network characteristics of the target vehicle gateway, and may also include index values that characterize the utilization rate of the computing resources of the target vehicle gateway.
[0032] Step 140: The traffic anomaly probability value and the multi-dimensional target index value are weighted and summed according to the target weight strategy to obtain the security pressure index of the target vehicle gateway in the current time window.
[0033] In this embodiment of the invention, after obtaining multiple values through steps 120 and 130, the multiple values can be weighted and summed according to the target weight strategy to obtain the Security Pressure Index (SPI). The Security Pressure Index is an evaluation value that comprehensively quantifies the security threats and system load of the target vehicle gateway within the current time window. The higher the value, the greater the security pressure faced by the target vehicle gateway, and it is used to trigger different levels of collaborative scheduling strategies. The target weight strategy can be dynamically determined based on factors such as the vehicle's current network load, driving status, and gateway hardware temperature. After determining the Security Pressure Index, step 150 can be executed.
[0034] Step 150: Determine the target scheduling strategy for the target vehicle gateway based on the security pressure index, and perform resource scheduling within the current time window according to the target scheduling strategy.
[0035] In this embodiment of the invention, the target scheduling strategy is a resource scheduling scheme selected from a plurality of preset scheduling strategies based on the threshold range of the Security Stress Index (SPI). Different levels of scheduling strategies correspond to different resource control actions, such as rate limiting, CPU core binding, and interrupt suppression, to achieve a hierarchical and adaptive security response.
[0036] In this embodiment of the invention, step 150 employs an "event-driven immediate execution" mechanism. Once the calculated SPI exceeds the threshold within the current time window (t+1), the underlying operating system will immediately (at the microsecond level) call the system application programming interface (API), for example, by calling the sched_setaffinity interface to perform resource isolation and traffic shaping, schedule the resources of the target vehicle gateway, and adjust the operating state of the target vehicle gateway. This allows the instantly adjusted target vehicle gateway to act on the current and subsequent continuous network data flow, thereby eliminating the risk of system crashes caused by waiting within the time window.
[0037] In this embodiment of the invention, the traffic anomaly probability value determined by the traffic feature vector of the target vehicle gateway in the historical time window, combined with the multi-dimensional index value of the target vehicle gateway in the current time window, can combine the historical traffic characteristics with the current network status. The current pressure of the target vehicle gateway can be accurately judged by the security pressure index, thereby making the target scheduling strategy more accurate and the resources of the target vehicle gateway more rationally used.
[0038] In this embodiment of the invention, in the analysis process of the prior art, the CAN bus or Ethernet in the vehicle gateway is usually detected in isolation. However, modern attacks often inject forged packets through Ethernet (infotainment domain) to affect the control domain (CAN bus transmission content). Analyzing only a single protocol feature cannot capture this cross-domain attack feature of "high-frequency Ethernet traffic causing CAN bus logic abnormalities". Therefore, in step 110 of this embodiment of the invention, which obtains the traffic feature vector of the target vehicle gateway within a historical time window, the following steps can be specifically included: generating a fused feature vector based on the traffic characteristics of different traffic channels of the target vehicle gateway within the historical time window; generating a vehicle state vector based on the vehicle state within the historical time window; processing the vehicle state vector and the fused feature vector according to an attention mechanism to obtain the attention weight vector corresponding to the historical time window; and obtaining the traffic feature vector by multiplying the attention weight vector and the fused feature vector.
[0039] In this embodiment of the invention, the target vehicle gateway may include dual traffic channels, such as an Ethernet channel carrying content-related traffic (e.g., entertainment and navigation content) and a Controller Area Network and its Flexible Data Rate Extension Protocol (CAN / CAN-FD) channel carrying vehicle control and / or driving safety traffic.
[0040] In this embodiment of the invention, during the process of generating a fused feature vector based on the traffic characteristics of different traffic channels of the target vehicle gateway within the historical time window, for the Ethernet channel, flow-level and packet-level statistical features of the traffic flowing through the Ethernet channel within the historical time window can be extracted, such as the average packet length within the historical time window and the inter-arrival time (IAT) difference between two adjacent Ethernet packets. The dimension of the Ethernet channel features can be denoted as De. Correspondingly, for the CAN / CAN-FD channel, the first-order difference corresponding to each physical quantity signal flowing through the CAN / CAN-FD channel within the historical time window can be extracted. The dimension of the CAN / CAN-FD channel can be denoted as Dc. Here, physical quantity signals refer to vehicle status or control parameters with actual physical meaning obtained by parsing CAN messages. Common physical quantity signals include, but are not limited to, parameters such as engine speed, accelerator pedal opening, steering wheel angle, and turn signal status.
[0041] In this embodiment of the invention, the dual-channel features can be processed by category before fusion. Specifically, for bursty Ethernet data, a "time-based previous value preservation and attenuation mechanism" can be adopted. If there are no Ethernet packets in the historical time window, the features of the previous window are used and multiplied by an attenuation coefficient λ (e.g., 0.9) to avoid LSTM state breaks caused by "zero padding". For high-frequency CAN data, a max pooling strategy can be used to perform dimensionality reduction and aggregation on all CAN messages in the window, usually taking the maximum value of the signal change amplitude in the historical time window. This means that within this entire time window (e.g., 20ms), no matter how many frames of CAN data are received, only the maximum value of the first-order difference of each physical quantity signal in the window is extracted as a representative feature. This maximum value is used as the overall feature input of the CAN channel in the historical time window. Its purpose is to accurately capture "signal mutations" that may be caused by attacks or anomalies while performing dimensionality reduction and alignment, so as to preserve mutation features.
[0042] In this embodiment of the invention, the processed features are concatenated and fused to form a fused feature vector Xt∈R(De+Dc) corresponding to the historical time window t. Here, R represents the set of real numbers, and R(De+Dc) represents a real number vector space of dimension (De+Dc). Xt is an array / sequence formed by concatenating Ethernet features of dimension De and CAN features of dimension Dc.
[0043] In this embodiment of the invention, the vehicle state vector can be represented as C. In order to facilitate the calculation based on the vehicle state vector C and the fused feature vector Xt, the vehicle state vector C and the fused feature vector Xt should be aligned in the time window. In the process of generating the vehicle state vector Ct based on the vehicle state in the historical time window, the vehicle state can include the vehicle speed range, gear and driving mode in the historical time window.
[0044] In this embodiment of the invention, during the process of processing the vehicle state vector and the fused feature vector according to the attention mechanism to obtain the attention weight vector corresponding to the historical time window, the weight corresponding to each feature in the fused feature vector, i.e., the attention weight vector, can be dynamically adjusted using the aligned vehicle state vector Ct. In the attention weight vector In this context, there may be (De+Dc) real numbers, which are the weights corresponding to each parameter in the fused feature vector. These are the weights of the "Attention" mechanism within the neural network, used to measure the importance of different "fused feature vectors (Xt)" at the current time step. Specifically, The calculation formula is as follows:
[0045] in, is the attention weight vector corresponding to the historical time window t (output values are between 0 and 1); Wa, Wx, and Wc are all learnable weight matrices in the neural network, used to perform linear transformations on the attention output, the fused feature vector Xt, and the vehicle state vector Ct, respectively; Xt is the fused feature vector corresponding to the historical time window t; Ct is the vehicle state context vector corresponding to the historical time window t (such as an encoded vector containing information like vehicle speed and gear); ba is the bias term vector of the neural network; tanh is the hyperbolic tangent activation function, used to introduce nonlinearity and map the values to [ 1,1][ [1,1]; softmax is a normalization exponential function used to convert the calculation result into a probability distribution of weights (making the sum of the weights equal to 1).
[0046] Subsequently, the traffic feature vector can be obtained by multiplying the attention weight vector and the fused feature vector using the following formula:
[0047] in, This represents the traffic feature vector after weighting and adjustment using the attention mechanism; This represents the Hadamard product (element-wise product). This is the attention weight vector. This formula ensures that when the vehicle is in different state vectors C (such as high speed), low-priority entertainment traffic features can be automatically ignored.
[0048] In this embodiment of the invention, the model first perceives and fuses the current physical operating condition of the vehicle (i.e., the vehicle state vector C), then dynamically evaluates the safety importance of the fused traffic features of the currently collected heterogeneous networks under specific operating conditions, and calculates the corresponding feature attention weights (i.e., αt); finally, through the Hadamard product ( The operation suppresses or filters irrelevant or low-risk traffic data under the current operating conditions, allowing only important and high-risk features (i.e., traffic feature vectors) to pass through and input into the subsequent target analysis model for in-depth anomaly analysis, effectively eliminating the interference of redundant data on model inference.
[0049] After obtaining the fused feature vector, existing technologies typically employ statistical or traditional deep learning models, such as standard Long Short-Term Memory (LSTM) networks or Convolutional Neural Networks (CNNs), for traffic detection. The fused feature vector is input into a trained LSTM model, utilizing LSTM's ability to remember time series data to predict traffic characteristics at the next time step. If the actual traffic deviates significantly from the prediction, it is considered an anomaly. When an anomaly is detected, the bandwidth priority of the queue containing the abnormal traffic is reduced according to the Quality of Service (QoS) policy. However, existing deep learning models have a large number of parameters and high computational complexity. In contrast, vehicle gateways typically use embedded chips (such as ARM Cortex-R / A series), with very limited computing resources. Running a standard LSTM results in high inference latency (>20ms), which can cause blocking of normal CAN bus control messages (such as braking and steering), endangering driving safety.
[0050] In this embodiment of the invention, the target analysis model is a model after sparsification of the Long Short-Term Memory Network, including multiple processing units and fully connected layers. Each processing unit includes a sparse weight matrix that has undergone structured pruning and quantization compression. The multiple processing units include a forget gate, an input gate, an output gate, and a cell state update unit.
[0051] In this embodiment of the invention, the process of sparsifying the Long Short-Term Memory (LSTM) network to obtain the target analysis model may include the following steps: Structured pruning of the weight matrix, which involves pruning the weight matrices of the four gate units (forget gate, input gate, output gate, and cell state update) within the LSTM during the offline training phase. , , , Sparsity processing is performed. By evaluating the sensitivity of the weights, redundant weights with absolute values below a set threshold are forced to zero, generating a sparse weight matrix. Low-precision quantization, combined with quantization-aware training, compresses and maps the LSTM activation values and sparse weights from 32-bit floating-point numbers (FP32) to 8-bit integers (INT8), so that each processing unit includes a sparse weight matrix that has undergone structured pruning and quantization compression.
[0052] Before introducing the embodiments of this invention, it is necessary to understand the hidden vector and memory vector in Long Short-Term Memory (LSTM) networks. The hidden vector and memory vector are two core state variables in LSM networks, working together to model long-term dependencies on temporal information. The memory vector (usually denoted as c) determines how much old information is retained and how much new information is added, responsible for preserving key historical information over longer time series, thereby avoiding gradient vanishing or exploding problems. The hidden vector (usually denoted as h) is generated based on the current memory vector and the output gate, used both as the output at the current time step and as the input at the next time step.
[0053] In this embodiment of the invention, when performing analysis using a sparsed target analysis model, and executing step 120 to input the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway within the historical time window, the process may include: concatenating the traffic feature vector with the hidden vector in the target analysis model to obtain a concatenated vector; multiplying the concatenated vector with the sparse weight matrix in the forget gate, the input gate, the output gate, and the cell state update unit respectively to obtain the output vector of the forget gate, the output vector of the input gate, the output vector of the output gate, and the candidate memory vector output by the cell state update unit; updating the memory vector in the target model according to the output vector of the forget gate, the output vector of the input gate, and the candidate memory vector; updating the hidden vector according to the updated memory vector and the output vector of the output gate to obtain the updated hidden vector; and inputting the updated hidden vector into the fully connected layer to obtain the traffic anomaly probability value.
[0054] In this embodiment of the invention, after inputting the traffic feature vector into the target analysis model, the hidden vector (i.e., the one output from the previous analysis) in the target analysis model can be used. The concatenation vector is obtained by concatenating the values of the forget gate, the input gate, the output gate, and the sparse weight matrix within the cell state update unit. Then, the concatenated vector is multiplied by these weights to obtain the output vector of the forget gate. The output vector of the input gate The output vector of the output gate and the candidate memory vector output by the cell state update unit In the process of multiplying the flow feature vector with the sparsified weight matrix, sparse matrix multiplication can be used to directly skip the calculation of weights with values of zero, thereby significantly reducing the number of multiply-add (MAC) operations. After each processing unit has finished outputting, the memory vector in the target model can be updated using the following formula based on the output vector of the forget gate, the output vector of the input gate, and the candidate memory vector:
[0055] in, This is the updated memory vector; This is the memory vector output from the previous analysis in the target analysis model.
[0056] The hidden vector is then updated using the following formula based on the updated memory vector and the output vector of the output gate, resulting in the updated hidden vector:
[0057] In this embodiment of the invention, after updating the hidden vector through the above-described sparse LSTM unit, the hidden vector ( The updated hidden vector is used as the prediction error for the next time window (i.e., the current time window). This updated hidden vector is then input into a fully connected layer, normalized by Softmax, and output as the traffic anomaly probability value corresponding to the current time window, denoted as... , This improvement retains the ability of LSTM to capture long sequence time dependencies while strictly controlling the single inference latency within a safe threshold (e.g., ≤5ms), thus avoiding the blocking of normal CAN control messages.
[0058] In this embodiment of the invention, the multidimensional indicator values in step 130 may include the target CPU load rate, target network interruption frequency, and target buffer packet loss rate of the target vehicle gateway at the current moment. Specifically, step 130 obtains the multidimensional indicator values of the target vehicle gateway in the current time window, including: obtaining the CPU load rate, network interruption frequency, and buffer packet loss rate of the target vehicle gateway within the current time window; and normalizing the CPU load rate, network interruption frequency, and buffer packet loss rate to obtain the target CPU load rate, target network interruption frequency, and target buffer packet loss rate.
[0059] In this embodiment of the invention, since the CPU load rate is expressed as a percentage, the CPU load rate is the target CPU load rate, which can be denoted as: (Take a value of 0.0~1.0). The target CPU load rate can be obtained in real time by reading the system API or kernel status file (such as / proc / stat and / proc / interrupts under Linux) of the underlying operating system (such as Linux / QNX) of the target vehicle gateway.
[0060] In embodiments of the present invention, the unit of network interruption frequency is typically (times / second), usually denoted as . Network interruption frequency can be obtained in real time through the system API or kernel status files (such as / proc / stat and / proc / interrupts in Linux) of the target vehicle gateway's underlying operating system (such as Linux / QNX). To map thousands of interrupts per second to the [0,1] interval, and to be more sensitive to high frequencies, an exponential normalization formula can be used:
[0061] Where K is the maximum interruption reference constant that the system can withstand (e.g., K=10000). This is the target network interrupt frequency after normalization.
[0062] In this embodiment of the invention, since the buffer packet loss rate is also expressed as a percentage, the buffer packet loss rate is the same as the target buffer packet loss rate, which can be denoted as: (Values range from 0.0 to 1.0). The target buffer packet loss rate can be obtained from the target vehicle gateway's network protocol stack or the statistics registers of the NIC driver (such as the dropped field of ifconfig or the NIC queue status). In this embodiment of the invention, when determining the probability score of traffic anomalies... Target CPU load rate Target network outage frequency and target buffer packet loss rate Then, step 140 can be executed to perform a weighted summation of the traffic anomaly probability value and the multi-dimensional target index value according to the target weight strategy, to obtain the security pressure index of the target vehicle gateway in the current time window. Specifically, the security pressure index of the target vehicle gateway in the current time window can be obtained by weighted summation of each data according to the following formula:
[0063] in, Here, w1 represents the security stress index of the target vehicle gateway within the current time window; w2, w3, and w4 are the physical weights assigned to "system resource indicators" such as CPU, interrupts, traffic, and packet loss rate, respectively, when calculating the system security stress index, satisfying the following conditions: wi =1.
[0064] In this embodiment of the invention, the weights for calculating the safety pressure index are based on a dynamic weighting mechanism, including baseline allocation for normal states and adaptive adjustment for sudden operating conditions in multiple scenarios. Therefore, before step 140, the method further includes: obtaining a basic weighting strategy, wherein the basic weighting strategy includes a first weight corresponding to the target CPU load rate, a second weight corresponding to the target network interruption frequency, a third weight corresponding to the target buffer packet loss rate, and a fourth weight corresponding to the traffic anomaly probability value. Under normal conditions (i.e. (≤0.8 and no other sudden anomalies occurred), focusing on "early warning and network service quality monitoring". At this time, the CPU load and interrupt frequency of the target vehicle gateway are stable, so it is given a low base weight, and to maintain high sensitivity to potential attack precursors, it is given a higher weight for anomaly scores and packet loss rates. For example, the base weight strategy at this time can be w1 =0.15, w2=0.15, w3=0.30, w4=0.40. If no anomaly is detected, the base weight strategy is the target weight strategy. If an anomaly is detected, renormalization is required after each adjustment to ensure... wi=1.
[0065] In this embodiment of the invention, if the detected traffic anomaly probability value is greater than a first traffic threshold, the first weight and the second weight in the basic weighting strategy are increased to obtain the target weighting strategy. The first traffic threshold can be 0.8. A value >0.8 indicates that the target vehicle gateway is under attack. In this case, the target CPU load rate can be dynamically increased. The weight w1 and the target network outage frequency The weight w2 is used to deal with the risk of resource depletion under attack.
[0066] In this embodiment of the invention, if the target buffer packet loss rate is detected to be greater than a packet loss rate threshold, and the traffic anomaly probability value is less than a second traffic threshold, the third weight in the basic weight strategy is increased to obtain the target weight strategy. The packet loss rate threshold can be 0.5, the second traffic threshold can be 0.5, and when a sharp increase in the buffer packet loss rate is detected (e.g., ... >0.5), but the model output anomaly score is low ( When the packet loss rate is less than 0.4%, it indicates a sudden, non-malicious network congestion at the target vehicle gateway, resulting in a broadcast storm. Therefore, the packet loss rate of the target buffer can be dynamically and significantly increased. The weight w3 causes the currently calculated SPI value to be rapidly amplified and exceed the warning threshold T1, thereby triggering subsequent scheduling strategies in advance to perform queue-based traffic shaping and smooth out congestion without triggering the highest level of CPU core binding.
[0067] In this embodiment of the invention, if the chip temperature of the target vehicle gateway is detected to be greater than a temperature threshold or the voltage is abnormal, the first weight in the basic weighting strategy is increased to obtain the target weighting strategy. When the underlying sensor detects chip overheating (e.g., chip temperature > 105°C) or abnormal voltage triggers CPU hardware frequency reduction protection, it indicates that the physical hardware of the target vehicle gateway is degraded or in a harsh environment (high temperature / low voltage). At this time, the target CPU load rate can be forcibly increased. weight w1 (If increased to 0.5 or higher). At this point, the computing power is fragile. Even moderate traffic can cause the SPI to spike and quickly reach the critical threshold T2, thereby rapidly triggering subsequent scheduling strategies, interrupt suppression protection, and preventing hot crashes.
[0068] In this embodiment of the invention, if the vehicle state vector C detects that a remote over-the-air (OTA) upgrade is being performed while the vehicle is parked, the CPU load rate and network interruption frequency will naturally increase. Therefore, the first and second weights in the basic weight strategy can be reduced, and the fourth weight can be increased to obtain the target weight strategy. This can lower the overall SPI value, prevent legitimate high load from accidentally triggering the threshold and causing upgrade interruption, and prevent hackers from maliciously injecting data during OTA.
[0069] In this embodiment of the invention, after determining the security pressure index of the target vehicle gateway in the current time window, step 140, which involves determining a target scheduling strategy for the target vehicle gateway based on the security pressure index, can be executed. Specifically, the steps may include: if the security pressure index is in a first pressure range, indicating that the target vehicle gateway is in a safe state, a preset first scheduling strategy is used as the target scheduling strategy; if the security pressure index is in a second pressure range, indicating that the target vehicle gateway is in a defensive state, a preset second scheduling strategy is used as the target scheduling strategy; if the security pressure index is in a third pressure range, indicating that the target vehicle gateway is in a critical state, a preset third scheduling strategy is used as the target scheduling strategy.
[0070] In this embodiment of the invention, when the security pressure index is in the first pressure range, the target vehicle gateway is in a safe state, and there are currently no obvious threats or resource bottlenecks. Therefore, the first scheduling strategy focuses on maintaining transparency and does not actively intervene in traffic processing to avoid introducing additional delays or complexity due to excessive detection or restrictions. Furthermore, the intrusion detection system runs only in the background with extremely low priority, ensuring that the real-time performance of regular communication is not affected in any way.
[0071] In this embodiment of the invention, when the security pressure index is in the second pressure range, it indicates that the target vehicle gateway is in a defensive state. At this time, abnormal traffic or load increases, but the overall system is not yet overloaded. Therefore, the second scheduling strategy focuses on adjusting the priority of services without affecting the scheduling of underlying computing resources. For example, bandwidth limits are imposed on non-critical services (such as entertainment and infotainment) to protect the forwarding queue of control class messages (CAN).
[0072] In this embodiment of the invention, when the safety pressure index is in the third pressure range, it indicates that the target vehicle gateway is in a critical state, facing the risk of resource exhaustion due to system crashes or attacks. Therefore, the third scheduling strategy focuses on ensuring the survival of the minimum core functions to avoid affecting driving safety.
[0073] In this embodiment of the invention, the first pressure interval, the second pressure interval, and the third pressure interval are associated with the warning threshold T1 and the critical threshold T2 mentioned above. Before determining the target scheduling strategy for the target vehicle gateway based on the safety pressure index in step 140, the method further includes: obtaining a preset first resistance threshold (i.e., warning threshold T1) and a second resistance threshold (i.e., critical threshold T2), wherein the first resistance threshold is less than the second resistance threshold. The first pressure interval, the second pressure interval, and the third pressure interval are constructed based on the first resistance threshold and the second resistance threshold, wherein the values of the first pressure intervals are all less than the first resistance threshold, the values of the second pressure intervals are not less than the first resistance threshold and are less than the second resistance threshold, and the values of the third pressure intervals are not less than the second resistance threshold.
[0074] In this embodiment of the invention, the first stress threshold (i.e., the warning threshold T1) can be 0.5, representing abnormal traffic but not overload. The second stress threshold (i.e., the critical threshold T2) can be 0.85, representing that the target vehicle gateway faces the risk of crashing. The first and second stress thresholds can be preset based on hardware limit testing and vehicle model calibration. For example, during the bench testing phase of gateway development, the limits of the gateway chip (such as an ARM Cortex processor) are tested by injecting DDoS attacks. When the combined CPU load and interrupt index reaches 0.85, the forwarding delay of the CAN bus will exceed the safety threshold (e.g., 5ms) and frame drops will begin. Therefore, the critical threshold T2 is set to 0.85 to ensure that "core binding and interrupt suppression" are triggered before the system crashes. Alternatively, it can be based on vehicle model configuration (EOL calibration). Different configurations of vehicles (high-end models have strong computing power, low-end models have weak computing power) have different stress resistance capabilities. Thresholds T1 and T2 will be used as configuration files and written and calibrated according to the specific gateway hardware model during the vehicle off-line detection (EOL) phase. Gateways with weaker computing power will have their T2 threshold preset to be lower so that protection is triggered earlier.
[0075] In this embodiment of the invention, during the process of constructing the first pressure range, the second pressure range, and the third pressure range based on the first and second pressure resistance thresholds, the setting logic of the upper boundary value being greater than or equal to the lower boundary value should be followed to ensure that protection is triggered at the critical point, which complies with the "fail-safe" principle of the safety system.
[0076] In the embodiment of the present invention, step 150 of performing resource scheduling within the current time window according to the target scheduling policy comprises the following steps: if SPI < T1, the target scheduling policy is the first scheduling policy, keeping the default working parameters of the target vehicle-mounted gateway, enabling the target vehicle-mounted gateway to perform conventional forwarding, and running IDS in the low-priority background. If T1 ≤ SPI < T2, the target scheduling policy is the second scheduling policy, at this time, the network layer QoS intervenes and queue-based traffic shaping is started. An upper bandwidth limit of the target vehicle-mounted gateway for transmitting entertainment content is restricted and reduced (for example, restricted to 10 Mbps), and the CAN control message queue is preferentially guaranteed. If SPI ≥ T2, the target scheduling policy is the third scheduling policy, which triggers a kernel-level core binding instruction, binds the driving safety content to a first processor core (CPU Core 0) of the processor of the target vehicle-mounted gateway, and binds the intrusion detection content to a second processor core (CPU Core 1) of the processor of the target vehicle-mounted gateway, wherein the driving safety content is key service processes of the gateway (such as CAN route forwarding and security monitoring), and the intrusion detection content may be high-energy-consumption IDS detection processes and Ethernet software interrupt processing. It ensures that even if Core 1 is fully occupied by attack traffic (100% usage), Core 0 still has idle time slices to process brake commands. In addition, the third scheduling policy further comprises interrupt suppression (NAPI Budget Tuning), which dynamically modifies and reduces the NAPI polling quota (Budget) of the network card driver, forces the network card to process fewer packets in one interrupt, actively discards overload traffic, and prevents the CPU from falling into an "interrupt livelock" (Livelock) state, thereby avoiding system crash.
[0077] In the embodiment of the present invention, when the security pressure index fluctuates between the third pressure interval and the second pressure interval, a hysteresis threshold (for example, the release threshold is the entry threshold minus 0.1) can be adopted and a shortest holding time (1 to 3 s) can be set, so as to avoid frequent switching which wastes computing resources and may also cause network oscillation. Specifically, the threshold for entering the critical state is T2=0.85, correspondingly, the threshold for releasing the critical state is set as 0.85 minus 0.1 equals 0.75, the critical state is only entered when SPI rises to the third pressure interval and is greater than or equal to 0.85; once entered, SPI must drop to below 0.75 to exit. The intermediate interval of 0.75 to 0.85 forms a buffer zone, which avoids frequent entry and exit when SPI fluctuates slightly around 0.85. The shortest holding time forces the current state to stay for at least 1 to 3 seconds even if SPI has dropped below the release threshold. This further avoids switching caused by instantaneous fluctuations, thereby ensuring system stability and reducing unnecessary scheduling actions.
[0078] In this embodiment of the invention, a fail-safe and backup forwarding mechanism is also proposed. When the target analysis model is unavailable, the SPI remains excessively high, or the system temperature / voltage is abnormal, a backup mode can be entered. After entering backup mode, the target vehicle gateway only allows preset critical CAN IDs (such as CAN messages crucial to driving safety, such as braking, steering, throttle, and vehicle speed) and necessary diagnostic frames (such as a small number of diagnostic messages used for fault reporting or remote assistance), restricting external Ethernet access to prevent further penetration by external attacks and ensuring basic vehicle controllability. This ensures the vehicle still possesses basic controllability (can drive, stop, and steer), avoiding complete loss of control.
[0079] In this embodiment of the invention, by adjusting the scheduling strategy of the target vehicle gateway in a hierarchical manner through multiple scheduling strategies, the resource scheduling of the target vehicle gateway can be accurately performed. Compared with the prior art that only adjusts network bandwidth (QoS), simply limiting bandwidth is ineffective, and the gateway itself will crash or restart due to resource exhaustion, causing the vehicle to completely lose control. This embodiment of the invention provides a richer dimension of scheduling strategies, which can prevent gateway crashes.
[0080] To better understand the resource scheduling of the vehicle gateway provided in this embodiment of the invention, an example is given. Assume the vehicle is in a high-speed driving scenario, with vehicle state C including [speed > 100km / h, gear = D, driving mode = Sport]. Safety requirements are extremely high in this situation. Through attention mechanism calculation, control features such as "steering angle" and "brake pedal" in the CAN bus are automatically assigned extremely high weights αt, while the weights of features such as "vehicle video stream" and "entertainment download" in the Ethernet are significantly reduced. If a minor anomaly occurs in the CAN control signal, the model will immediately detect it. Assume the vehicle is in a parking / charging scenario, with vehicle state C including [speed = 0, gear = P, vehicle in charging or OTA upgrade state]. Chassis control signals are typically stationary in this situation. In this case, attention mechanism calculation can increase the feature weights of external Ethernet interfaces (such as Wi-Fi, 4G download traffic, and diagnostic messages). This is because hackers are most likely to launch penetration or injection attacks through external network interfaces in this situation. Assuming the vehicle is in a reversing scenario, when the vehicle state C includes [vehicle speed < 20km / h, gear = R], the attention mechanism can assign high weights to the "surround view camera video stream characteristics" in the Ethernet channel and the "radar ranging and braking characteristics" in the CAN channel, while ignoring other irrelevant cabin entertainment traffic.
[0081] The resource scheduling method for vehicle gateways provided in this invention solves the problem of more accurate detection through a "spatiotemporal attention mechanism" (αt). It dynamically filters irrelevant and redundant interference through scene perception, reducing the cognitive load on the model. Simultaneously, the target analysis model, after sparsification, addresses the issue of slow processing speed due to excessive model computation. The combination of these two methods ensures that the single inference latency is strictly controlled within a safe threshold of 5ms, perfectly adapting to the hardware environment of vehicle gateways with limited computing power (such as ARM Cortex chips), meeting the real-time requirements of vehicles, reducing false alarms caused by changes in operating conditions, and improving detection sensitivity in critical scenarios (high speed, braking). Furthermore, through SPI-driven two-dimensional scheduling, it prioritizes control domain forwarding under high-pressure attacks, significantly reducing the risk of gateway overload and restart, providing evidence preservation and fault safety capabilities, and enhancing systematic protection and traceability.
[0082] In an embodiment of the present invention, Figure 2 The structure of a resource scheduling device for an in-vehicle gateway provided in some embodiments of the present invention is shown. For example... Figure 2 As shown, the resource scheduling device 200 for an in-vehicle gateway provided in this embodiment of the invention includes: The acquisition module 210 is used to acquire the traffic feature vector of the target vehicle gateway within a historical time window; Input module 220 is used to input the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway within the historical time window; The acquisition module 210 is also used to acquire the multi-dimensional index values of the target vehicle gateway in the current time window; Weighting module 230 is used to perform weighted summation of the traffic anomaly probability value and the multi-dimensional target index value according to the target weight strategy to obtain the security pressure index of the target vehicle gateway in the current time window; The determination module 240 is used to determine the target scheduling strategy for the target vehicle gateway based on the security pressure index, and to perform resource scheduling within the current time window according to the target scheduling strategy.
[0083] It should be noted that the embodiments of the resource scheduling device for the vehicle gateway in this specification and the embodiments of the resource scheduling method for the vehicle gateway in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the corresponding embodiments of the resource scheduling method for the vehicle gateway mentioned above, and the repeated parts will not be described again.
[0084] Figure 3 This is a structural block diagram of a vehicle provided as an embodiment of this application. Figure 3As shown, the vehicle provided in this embodiment includes a processor 310 and a memory 320, wherein the memory is used to store instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the above method.
[0085] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0086] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions that can be executed by a processor of a device to perform the described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc. When the instructions in this non-transitory computer-readable storage medium are executed by a processor of an electronic device, the vehicle is able to perform the described method.
[0087] This application also provides a computer program product, including a computer program that is executed by a processor using the methods described above.
[0088] The above description does not provide detailed technical specifications regarding the structure of each layer. However, those skilled in the art should understand that layers and regions of desired shapes can be formed using various technical means. Furthermore, to form the same structure, those skilled in the art can also design methods that are not entirely identical to those described above. Additionally, although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be advantageously combined.
[0089] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other modifications and adjustments to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all modifications and adjustments falling within the scope of the invention.
[0090] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims and their equivalents, this invention is also intended to include these modifications and variations.
Claims
1. A resource scheduling method for an on-board gateway, characterized in that, The method includes: Obtain the traffic feature vector of the target vehicle gateway within a historical time window; The traffic feature vector is input into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window; Obtain the multi-dimensional index values of the target vehicle gateway in the current time window; The traffic anomaly probability value and the multi-dimensional target index value are weighted and summed according to the target weight strategy to obtain the security pressure index of the target vehicle gateway in the current time window. Based on the security pressure index, a target scheduling strategy is determined for the target vehicle gateway, and resource scheduling is performed within the current time window according to the target scheduling strategy.
2. The method according to claim 1, characterized in that, The step of obtaining the traffic feature vector of the target vehicle gateway within a historical time window includes: Based on the traffic characteristics of different traffic channels of the target vehicle gateway within the historical time window, a fusion feature vector is generated. Generate a vehicle state vector based on the vehicle state within the historical time window; The vehicle state vector and the fused feature vector are processed according to the attention mechanism to obtain the attention weight vector corresponding to the historical time window; The traffic feature vector is obtained by multiplying the attention weight vector and the fused feature vector.
3. The method according to claim 1, characterized in that, The target analysis model is a model after sparsification of the Long Short-Term Memory Network, which includes multiple processing units and fully connected layers. Each processing unit includes a sparse weight matrix that has undergone structured pruning and quantization compression. The multiple processing units include a forget gate, an input gate, an output gate, and a cell state update unit. The step of inputting the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window includes: The traffic feature vector is concatenated with the hidden vector in the target analysis model to obtain the concatenated vector; The concatenated vector is multiplied by the sparse weight matrix in the forget gate, the input gate, the output gate, and the cell state update unit, respectively, to obtain the output vector of the forget gate, the output vector of the input gate, the output vector of the output gate, and the candidate memory vector output by the cell state update unit in sequence. The memory vector within the target model is updated based on the output vector of the forget gate, the output vector of the input gate, and the candidate memory vector. The hidden vector is updated based on the updated memory vector and the output vector of the output gate to obtain the updated hidden vector; The updated hidden vector is input into the fully connected layer to obtain the traffic anomaly probability value.
4. The method according to claim 1, characterized in that, The step of obtaining the multi-dimensional indicator values of the target vehicle gateway in the current time window includes: Obtain the CPU load rate, network interruption frequency, and buffer packet loss rate of the target vehicle gateway within the current time window; The CPU load rate, the network interrupt frequency, and the buffer packet loss rate are normalized to obtain the target CPU load rate, the target network interrupt frequency, and the target buffer packet loss rate.
5. The method according to claim 4, characterized in that, Before the step of weighting and summing the traffic anomaly probability value and the multi-dimensional target index value according to the target weight strategy to obtain the security pressure index of the target vehicle gateway in the current time window, the method further includes: Obtain a basic weighting strategy, which includes a first weight corresponding to the target CPU load rate, a second weight corresponding to the target network interruption frequency, a third weight corresponding to the target buffer packet loss rate, and a fourth weight corresponding to the traffic anomaly probability value. If the detected abnormal traffic probability value is greater than the first traffic threshold, then the first weight and the second weight in the basic weight strategy are increased to obtain the target weight strategy; If the packet loss rate of the target buffer is detected to be greater than the packet loss rate threshold, and the traffic anomaly probability value is less than the second traffic threshold, the third weight in the basic weight strategy is increased to obtain the target weight strategy. If the chip temperature of the target vehicle gateway is detected to be greater than the temperature threshold or the voltage is abnormal, the first weight in the basic weight strategy is increased to obtain the target weight strategy. If a remote upgrade is detected while the vehicle is parked, the first and second weights in the basic weight strategy are reduced, and the fourth weight is increased to obtain the target weight strategy.
6. The method according to claim 1, characterized in that, The step of determining the target scheduling strategy for the target vehicle gateway based on the security pressure index includes: If the safety pressure index is in the first pressure range, it indicates that the target vehicle gateway is in a safe state, and the preset first scheduling strategy is used as the target scheduling strategy. If the security pressure index is in the second pressure range, it indicates that the target vehicle gateway is in a defensive state, and the preset second scheduling strategy is used as the target scheduling strategy. If the safety pressure index is in the third pressure range, it indicates that the target vehicle gateway is in a critical state, and the preset third scheduling strategy will be used as the target scheduling strategy.
7. The method according to claim 6, characterized in that, Before determining the target scheduling strategy for the target vehicle gateway based on the security pressure index, the method further includes: Obtain a preset first compressive strength threshold and a second compressive strength threshold, wherein the first compressive strength threshold is less than the second compressive strength threshold; The first pressure range, the second pressure range, and the third pressure range are constructed based on the first pressure resistance threshold and the second pressure resistance threshold, wherein the values of the first pressure range are all less than the first pressure resistance threshold, the values of the second pressure range are not less than the first pressure resistance threshold and are less than the second pressure resistance threshold, and the values of the third pressure range are not less than the second pressure resistance threshold.
8. The method according to claim 7, characterized in that, The step of scheduling resources within the current time window according to the target scheduling strategy includes: If the target scheduling strategy is the first scheduling strategy, the default operating parameters of the target vehicle gateway are maintained; If the target scheduling strategy is the second scheduling strategy, the bandwidth limit of the target vehicle gateway used for transmitting entertainment content is reduced; If the target scheduling strategy is the third scheduling strategy, the driving safety content is bound to the first processor core of the processor of the target vehicle gateway, the intrusion detection content is bound to the second processor core of the processor of the target vehicle gateway, and the polling quota of the network card of the target vehicle gateway is reduced.
9. A resource scheduling device for a vehicle-mounted gateway, characterized in that, The device includes: The acquisition module is used to acquire the traffic feature vector of the target vehicle gateway within a historical time window; The input module is used to input the traffic feature vector into the constructed target analysis model to obtain the traffic anomaly probability value of the target vehicle gateway in the current time window; The acquisition module is also used to acquire the multi-dimensional index values of the target vehicle gateway in the current time window; The weighting module is used to perform a weighted summation of the traffic anomaly probability value and the multi-dimensional target index value according to the target weighting strategy, so as to obtain the security pressure index of the target vehicle gateway in the current time window; The determination module is used to determine the target scheduling strategy for the target vehicle gateway based on the security pressure index, and to perform resource scheduling within the current time window according to the target scheduling strategy.
10. A vehicle, characterized in that, include: processor; A memory for storing instructions to be executed by the processor, wherein the processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 8.
