Vehicle collision event detection method and device and storage medium

By performing multi-dimensional analysis of vehicle data in the cloud and using deep learning models for identification, the problem of vehicle collision recognition flexibility and insufficient recognition ability of minor collision events in the prior art is solved, and higher accuracy of collision event recognition is achieved.

CN120123739APending Publication Date: 2025-06-10CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510216257.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

The prior art relies on predefined thresholds and conditions in vehicle collision recognition, lacks flexibility, is difficult to deal with complex situations and diverse collision patterns, and is difficult to identify minor but important collision events.

Method used

By analyzing multi-dimensional vehicle data in the cloud, using preset sliding windows and step-length partitioning data, a vector to be detected is formed, and input it into the target collision event detection model composed of a long and short-term memory network layer, layer normalization layer, self-attention layer, full connection layer and mapped output layer for identification.

Benefits of technology

It improves the accuracy of identification of collision events, avoids the threshold definition based on the rule model and the misidentification of minor collision events, can judge collision events more accurately, and improves the detection ability of minor collision events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123739A_ABST
    Figure CN120123739A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle collision event detection method and device and a storage medium. The method comprises the steps of obtaining to-be-detected vehicle data; determining a plurality of to-be-detected vectors according to the to-be-detected vehicle data, a preset sliding window and a preset step length; inputting each to-be-detected vector into a target collision event detection model to obtain a collision state corresponding to each to-be-detected vector; the target collision event detection model comprises a long short-term memory network layer, a layer normalization layer, a self-attention layer, a full connection layer and a mapping output layer; and if at least one to-be-detected vector of which the collision state is collision exists, taking the to-be-detected vector of which the collision state is collision as a collision vector, determining a target timestamp corresponding to each collision vector, and sending each collision vector and the target timestamp corresponding to each collision vector to a target platform. According to the technical scheme of the invention, the method achieves the analysis of the multi-dimensional vehicle data at the cloud end, and improves the recognition accuracy of the collision event.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and particularly relates to a method, device, and storage medium for detecting vehicle collision events. Background Art

[0002] Vehicle collision recognition has always been an important research direction for all automobile manufacturers and suppliers. Automobile manufacturers hope to quickly care about the vehicle owners, provide rescue for the vehicle owners, and ensure the safety of the vehicle owners after a vehicle accident.

[0003] Currently, for remote vehicle collision recognition, it is mostly carried out through a rule-based model, which heavily relies on predefined thresholds and conditions to judge collision events, lacks flexibility, is difficult to handle complex situations and diverse collision patterns, and usually sets a relatively high threshold in the model, resulting in the omission of some minor but still important minor collision events. Moreover, the rule-based model judges the data at a single time point and is difficult to consider the time series characteristics of the data. Summary of the Invention

[0004] In view of the above defects or deficiencies in the prior art, this application aims to provide a method, device, and storage medium for detecting vehicle collision events, so as to effectively improve the recognition accuracy of collision events by analyzing multi-dimensional vehicle data in the cloud.

[0005] An embodiment of this application provides a method for detecting vehicle collision events, and the method includes: Obtain the vehicle data to be detected; wherein, the vehicle data to be detected includes vehicle motion data, vehicle system activation status, vehicle driving operation data, and vehicle component status data; Determine a plurality of vectors to be detected according to the vehicle data to be detected, a preset sliding window, and a preset step size; Input each vector to be detected into a target collision event detection model respectively to obtain a collision state corresponding to each vector to be detected; wherein, the target collision event detection model includes a long short-term memory network layer, a layer normalization layer, a self-attention layer, a fully connected layer, and a mapping output layer; If there is at least one vector to be detected with a collision state of collision, then use the vector to be detected with a collision state of collision as a collision vector, determine the target time stamp corresponding to each collision vector, and send each collision vector and the target time stamp corresponding to each collision vector to a target platform.

[0006] According to the technical solution provided by the embodiment of this application, optionally, the determining a plurality of vectors to be detected according to the vehicle data to be detected, a preset sliding window, and a preset step size includes: Divide the vehicle data to be detected according to a preset sliding window and a preset step size to obtain a matrix to be detected corresponding to each timestamp; For each matrix to be detected, determine a time series to be detected corresponding to each signal dimension, and splice the time series to be detected to obtain a vector to be detected corresponding to the matrix to be detected.

[0007] According to the technical solution provided in the embodiment of the present application, optionally, the step of inputting each vector to be detected into a target collision event detection model to obtain a collision state corresponding to each vector to be detected includes: For each vector to be detected, input the vector to be detected into a long short-term memory network layer to obtain a feature vector corresponding to each preset time step; Input the feature vectors into a layer normalization layer for normalization processing to obtain a normalized vector corresponding to each feature vector; Input the normalized vectors into a self-attention layer to obtain an attention output matrix corresponding to the vector to be detected; Convert the attention output matrix into an attention output vector, and process the attention output vector based on a fully connected layer and a first activation function to obtain a process feature; Input the process feature into a mapping output layer to obtain a collision state corresponding to the vector to be detected.

[0008] According to the technical solution provided in the embodiment of the present application, optionally, the step of inputting the feature vectors into a layer normalization layer for normalization processing to obtain a normalized vector corresponding to each feature vector includes: For each feature vector, determine the mean and variance corresponding to the feature vector; According to the mean, the variance, and a preset constant, determine a normalized vector corresponding to the feature vector; Process the normalized vector according to a preset scaling parameter and a preset translation parameter to obtain a normalized vector corresponding to the feature vector.

[0009] According to the technical solution provided in the embodiment of the present application, optionally, the step of inputting the normalized vectors into a self-attention layer to obtain an attention output matrix corresponding to the vector to be detected includes: Input the normalized vectors into a first linear sub-layer, a second linear sub-layer, and a third linear sub-layer respectively to obtain a query vector, a key vector, and a value vector corresponding to each normalized vector; For each current vector, determine the attention score corresponding to the current vector according to the query vector corresponding to the current vector, the key vectors corresponding to each other vector, and the dimension of the feature vector corresponding to the current vector; wherein, the current vector is one of the normalized vectors, and the other vectors are the vectors in the normalized vectors except the current vector. According to each attention score, determine a score matrix, and perform normalization processing on the score matrix to obtain a weight matrix. According to the value vectors corresponding to each normalized vector and the weight matrix, determine the attention output matrix corresponding to the vector to be detected.

[0010] According to the technical solution provided by the embodiment of the present application, optionally, the fully connected layer includes at least two fully connected sub-layers; the process of processing the attention output vector based on the fully connected layer and the first activation function to obtain the process feature includes: Take the fully connected sub-layer with the first connection order as the current sub-layer, and take the attention output vector as the vector to be processed. Perform a fully connected process on the vector to be processed based on the current sub-layer to obtain a first vector, and perform a process on the first vector based on the first activation function to obtain a second vector, and determine whether the connection order of the current sub-layer is the last one. If so, take the second vector as the process feature. If not, take the fully connected sub-layer with the connection order next to the current sub-layer as the new current sub-layer, take the second vector as the new vector to be processed, and return to execute the step of performing a fully connected process on the vector to be processed based on the current sub-layer to obtain a first vector, and performing a process on the first vector based on the first activation function to obtain a second vector.

[0011] According to the technical solution provided by the embodiment of the present application, optionally, the mapping output layer includes a fully connected mapping layer and an activation mapping layer; the step of inputting the process feature into the mapping output layer to obtain the collision state corresponding to the vector to be detected includes: Input the process feature into the fully connected mapping layer to obtain the feature to be activated. Perform an activation process on the feature to be activated based on the second activation function in the activation mapping layer to obtain the collision probability. According to the collision probability and the preset probability threshold, determine the collision state corresponding to the vector to be detected.

[0012] According to the technical solution provided by the embodiment of the present application, optionally, the target collision event detection model is trained based on the following method: Obtain historical vehicle data and the collision timestamp in the historical vehicle data; Determine a plurality of historical vectors according to the vehicle data to be detected, a preset sliding window, and a preset step size; For each historical vector, determine whether the historical vector corresponds to the collision timestamp. If so, determine that the collision state of the historical vector is a collision. If not, determine that the collision state of the historical vector is non-collision; Determine the positive sample vectors in the sample vectors according to the historical vectors with the collision state being a collision, and determine the negative sample vectors in the sample vectors according to the historical vectors with the collision state being non-collision; wherein, the number of the positive sample vectors is equal to the number of the negative sample vectors; Input the sample vectors into the initial collision event detection model to be trained, and obtain the predicted state corresponding to each sample vector; Determine the target loss of the initial collision event detection model according to the predicted state corresponding to each sample vector, the collision state corresponding to each sample vector, and a preset loss function; Adjust each model parameter of the initial collision event detection model based on the target loss to obtain a target collision event detection model.

[0013] An embodiment of the present application further provides an electronic device, and the electronic device includes: A processor and a memory; The processor is configured to execute the steps of the vehicle collision event detection method according to any one of the embodiments by calling a program or an instruction stored in the memory.

[0014] An embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores a program or an instruction, and the program or the instruction causes a computer to execute the steps of the vehicle collision event detection method according to any one of the embodiments.

[0015] In summary, the present application proposes a method for detecting vehicle collision events. By obtaining the data of the vehicle to be detected, multiple vectors to be detected are determined according to the data of the vehicle to be detected, a preset sliding window, and a preset step size, so as to obtain data in time series, which is convenient for subsequent time series analysis. Each vector to be detected is respectively input into the target collision event detection model to obtain the collision state corresponding to each vector to be detected. If there is at least one vector to be detected with a collision state of collision, the vector to be detected with a collision state of collision is used as a collision vector, the target timestamps corresponding to the collision vectors are determined, and each collision vector and the target timestamp corresponding to each collision vector are sent to the target platform. It realizes the analysis of multi-dimensional vehicle data in the cloud, effectively improves the recognition accuracy of collision events. Compared with the prior art, the present application avoids the limitation of various thresholds in the rule-based model and the misrecognition of minor collision events. By processing time series data through a long short-term memory network layer, it can capture the patterns or dependencies of data changing over time, so as to more accurately judge collision events. Combining with the self-attention mechanism, it automatically focuses on the important parts in the time series, thereby improving the detection ability of minor collision events and the classification accuracy. Moreover, without manual adjustment of rules, the model can adaptively learn the changes of data and process collision events under different types of vehicles and driving environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flowchart of a method for detecting vehicle collision events provided by an embodiment of the present application; Figure 2 is a flowchart of another method for detecting vehicle collision events provided by an embodiment of the present application; Figure 3 is a schematic structural diagram corresponding to a method for detecting vehicle collision events provided by an embodiment of the present application; Figure 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0017] The present application will be further described in detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. In addition, it should be noted that only the parts related to the invention are shown in the drawings for the convenience of description.

[0018] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and embodiments.

[0019] Figure 1It is a flowchart of a vehicle collision event detection method provided by an embodiment of the present application. This vehicle collision event detection method is applied to the cloud, used to remotely obtain data and analyze and determine whether a collision event has occurred. If a collision event occurs, information notification is carried out. Refer to Figure 1 , the vehicle collision event detection method specifically includes: S110. Obtain the data of the vehicle to be detected.

[0020] Among them, the data of the vehicle to be detected is the data related to vehicle driving collected and obtained by the vehicle through in-vehicle sensors and in-vehicle systems. The data of the vehicle to be detected includes vehicle motion data, vehicle system activation status, vehicle driving operation data, and vehicle component status data. Vehicle motion data is the data used to describe the motion of the vehicle, the vehicle system activation status is the activation status of various driving systems and assisted driving systems in the vehicle, the vehicle driving operation data is the operation data of the driver on the vehicle, and the vehicle component status data is the situation of each component in the vehicle, such as the tire pressure of the tires.

[0021] Exemplarily, the data of the vehicle to be detected may include longitudinal acceleration, lateral acceleration, yaw angle signal, driver's request for braking, whether the brake pedal is operated, the target deceleration value of emergency brake assist, vehicle deceleration control, emergency brake on / off status, adaptive cruise control reaching the limit, the target longitudinal distance of the current lane, the effective target lateral distance, the throttle pedal position, the brake pedal status, vehicle speed, the angular velocity of the steering wheel, the activation status of the anti-lock braking system, the activation status of the vehicle dynamic control system, the activation status of the electronic stability program, the activation status of the traction control system, the activation status of the electronic brake force distribution, the master cylinder pressure, the auxiliary deceleration status, the hydraulic brake assist status, the automatic emergency braking status, whether the automatic emergency braking is available, the left front tire pressure, the left rear tire pressure, the right front tire pressure, and the right rear tire pressure.

[0022] Specifically, obtain the data of the vehicle to be detected collected and uploaded by the cloud for subsequent analysis and identification of the collision status corresponding to each time point.

[0023] S120. Determine a plurality of vectors to be detected according to the data of the vehicle to be detected, a preset sliding window, and a preset step size.

[0024] Among them, the preset sliding window can be a window with a certain time length set in advance. The preset step size is the step size set in advance for moving the preset sliding window. The vector to be detected is a vector formed by a part of the data of the vehicle to be detected within the preset sliding window each time the preset sliding window is moved.

[0025] Specifically, move a preset sliding window according to a preset step size, segmentally collect the data of the vehicle to be detected, and expand the partial data of the vehicle to be detected collected by each preset sliding window, so as to obtain a vector to be detected corresponding to each movement of the preset sliding window, that is, multiple vectors to be detected can be obtained.

[0026] Based on the above example, the following method can be used to determine multiple vectors to be detected according to the data of the vehicle to be detected, the preset sliding window, and the preset step size: Divide the data of the vehicle to be detected according to the preset sliding window and the preset step size to obtain a matrix to be detected corresponding to each time stamp; For each matrix to be detected, determine the time series to be detected corresponding to each signal dimension, and splice the time series to be detected to obtain a vector to be detected corresponding to the matrix to be detected.

[0027] Among them, the time stamp is the starting time corresponding to each movement of the preset sliding window. The matrix to be detected is the partial data of the vehicle to be detected within the preset sliding window. The signal dimension is the dimension of the signal types in the data of the vehicle to be detected. The time series to be detected is the time series formed by the data corresponding to each signal type within the preset sliding window.

[0028] Specifically, move the preset sliding window according to the preset step size, segmentally collect the data of the vehicle to be detected, and take the part collected by each preset sliding window as the matrix to be detected corresponding to the time stamp of the preset sliding window at this time. For each matrix to be detected, the time series to be detected corresponding to each signal type in the signal dimension can be determined, and the time series to be detected are spliced in sequence to obtain the vector to be detected corresponding to the matrix to be detected.

[0029] Exemplarily, set a preset sliding window of 50 seconds, and the preset step size of the preset sliding window is 1 second, that is, the preset sliding window moves a distance of 1 second each time. The signal dimension of the data of the vehicle to be detected is 30 dimensions, that is, it includes 30 signal types. Move the preset sliding window on the data of the vehicle to be detected, and 50 seconds of data can be extracted from each preset sliding window, that is, the matrix to be detected. For each signal (signal type in the signal dimension), flatten the 50-second time series to obtain the time series to be detected. Splice the time series to be detected after flattening all signals together to form a 1500-dimensional long vector (30 signals × 50 seconds), that is, the vector to be detected.

[0030] The method of using a preset sliding window to extract fixed-length data from continuous time series data generates data segments for model input. Each preset sliding window contains time series of multiple signals, and these series are spliced to form a high-dimensional input vector to ensure that the model can process the time series data of multiple signals simultaneously.

[0031] S130. Input each vector to be detected into the target collision event detection model to obtain the collision status corresponding to each vector to be detected.

[0032] Among them, the target collision event detection model is a collision event detection model pre-trained to identify collision events, that is, a model for identifying the collision status of vectors to be detected. The target collision event detection model includes a long short-term memory network layer, a layer normalization layer, a self-attention layer, a fully connected layer, and a mapping output layer. The long short-term memory network layer is used to extract temporal dependencies; the layer normalization layer is used to standardize the feature vectors corresponding to each preset time step in the long short-term memory network layer to improve the training speed and stability of the model; the self-attention layer is used to enhance features, and by calculating the attention scores between preset time steps, capture the relationships between preset time steps; the fully connected layer is used to reduce the dimension of the vector; the mapping output layer is used to map to obtain the collision status.

[0033] Specifically, input each vector to be detected into the target collision event detection model. For each vector to be detected, it successively passes through the long short-term memory network layer, the layer normalization layer, the self-attention layer, the fully connected layer, and the mapping output layer for model calculation and processing, and outputs the collision status corresponding to the vector to be detected. Thus, the collision status corresponding to each vector to be detected can be obtained.

[0034] S140. If there is at least one vector to be detected with a collision status of collision, then use the vector to be detected with a collision status of collision as a collision vector, determine the target time stamps corresponding to each collision vector, and send each collision vector and the target time stamps corresponding to each collision vector to the target platform.

[0035] Among them, the collision status is status data used to describe whether a vector to be detected is involved in a collision event, and the collision status can include collision and non-collision. A collision vector is a vector to be detected with a collision status of collision. The target time stamp is the starting time in the collision vector. The target platform is a platform for analyzing the collision data of a vehicle or for instructing a safety inspection of a vehicle.

[0036] Specifically, if there is at least one vector to be detected with a collision status of collision, it means that a collision event has occurred within the time period covered by the vehicle data to be detected. Therefore, the vector to be detected with a collision status of collision can be used as a collision vector, and the starting time points of each collision vector can be used as the corresponding target time stamps. Furthermore, it is convenient for each target platform to effectively analyze and utilize the collision event for analysis and decision-making, and each collision vector and the target time stamps corresponding to each collision vector can be sent to the target platform.

[0037] Based on the above example, the target collision event detection model can be trained in the following way: Obtain historical vehicle data and the collision timestamp in the historical vehicle data; Determine multiple historical vectors according to the vehicle data to be detected, a preset sliding window, and a preset step size; For each historical vector, determine whether the historical vector corresponds to the collision timestamp. If so, determine the collision state of the historical vector as a collision; if not, determine the collision state of the historical vector as non-collision; Determine the positive sample vectors in the sample vectors according to the historical vectors with the collision state being a collision, and determine the negative sample vectors in the sample vectors according to the historical vectors with the collision state being non-collision; Input the sample vectors into the initial collision event detection model to be trained, and obtain the predicted state corresponding to each sample vector; Determine the target loss of the initial collision event detection model according to the predicted state corresponding to each sample vector, the collision state corresponding to each sample vector, and a preset loss function; Adjust the model parameters of the initial collision event detection model based on the target loss to obtain the target collision event detection model.

[0038] Among them, the historical vehicle data is the vehicle data uploaded by the vehicle within the historical time. The collision timestamp is the time corresponding to the real collision event. The historical vector is the vector formed by part of the historical vehicle data within the preset sliding window each time the preset sliding window is moved. The positive sample vector is the historical vector with the collision state being a collision, and the negative sample vector is the historical vector with the collision state being non-collision. The number of positive sample vectors is equal to the number of negative sample vectors. The sample vector is the sum of the positive sample vectors and the negative sample vectors, and is used to train and obtain the target collision event detection model. The initial collision event detection model is a collision event detection model whose model parameters have not been adjusted. The predicted state is the output result after the model parameters of the initial collision event detection model process the sample vector. The preset loss function is a preset loss function, which is used to measure the difference between the predicted state of the model and the real collision state. The target loss is the loss calculated based on the preset loss function, and is used to judge whether the model is successfully trained.

[0039] Specifically, obtain the historical vehicle data uploaded by the vehicle, and determine the collision timestamp therein by annotating the historical vehicle data. Move a preset sliding window according to a preset step size, segment and collect the historical vehicle data, and expand the partial historical vehicle data collected by the preset sliding window each time, so as to obtain a historical vector corresponding to each movement of the preset sliding window, that is, multiple historical vectors can be obtained. For each historical vector, determine whether the historical vector corresponds to the collision timestamp, that is, whether each timestamp included in the historical vector includes the collision timestamp. If so, determine that the collision state of the historical vector is a collision; if not, determine that the collision state of the historical vector is a non-collision. Determine positive sample vectors from the historical vectors with a collision state of collision, and determine negative sample vectors from the historical vectors with a collision state of non-collision, and ensure that the number of positive sample vectors is the same as the number of negative sample vectors. Furthermore, integrate the positive sample vectors and the negative sample vectors as sample vectors. Input the sample vectors into the initial collision event detection model to be trained, and the output result can be used as the prediction state corresponding to each sample vector. Further, input the prediction state corresponding to each sample vector and the collision state corresponding to each sample vector into a preset loss function to calculate the loss, and obtain the target loss. If the target loss meets the preset requirements, it means that the initial collision event detection model can already be put into use, so the initial collision event detection model can be used as the target collision event detection model. If the target loss does not meet the preset requirements, it means that the initial collision event detection model still needs to adjust the model parameters. Therefore, based on the target loss, adjust the various model parameters of the initial collision event detection model, and return to execute the step of inputting the sample vectors into the initial collision event detection model to be trained to obtain the prediction state corresponding to each sample vector, until the target loss meets the preset requirements, and obtain the target collision event detection model.

[0040] The vehicle collision event detection method provided by the embodiments of the present application determines multiple vectors to be detected by obtaining the data of the vehicle to be detected, according to the data of the vehicle to be detected, a preset sliding window, and a preset step size, so as to obtain data in time series, which is convenient for subsequent time series analysis. Each vector to be detected is input into the target collision event detection model to obtain the collision state corresponding to each vector to be detected. If there is at least one vector to be detected with a collision state of collision, the vector to be detected with a collision state of collision is used as a collision vector, and the target timestamps corresponding to the collision vectors are determined, and each collision vector and the target timestamp corresponding to each collision vector are sent to the target platform. By analyzing multi-dimensional vehicle data in the cloud, the recognition accuracy of collision events is effectively improved. Compared with the prior art, the present application avoids the limitation of various thresholds in the rule-based model and the misrecognition of minor collision events. By processing time series data through a long short-term memory network layer, the model can capture the patterns or dependencies of data changing over time, so as to more accurately judge collision events. Combining with the self-attention mechanism, it automatically focuses on the important parts in the time series, thereby improving the detection ability of minor collision events and the classification accuracy. Moreover, without manual adjustment of rules, the model can adaptively learn the changes of data and process collision events under different types of vehicles and driving environments.

[0041] Figure 2 It is a flowchart of another vehicle collision event detection method provided by the embodiments of the present application. On the basis of the above embodiments, an exemplary description is made of the specific process of processing the vectors to be detected using each model layer in the target collision event detection model. Refer to Figure 2 and the vehicle collision event detection method specifically includes: S210. Obtain the data of the vehicle to be detected.

[0042] S220. Determine multiple vectors to be detected according to the data of the vehicle to be detected, a preset sliding window, and a preset step size.

[0043] S230. For each vector to be detected, input the vector to be detected into the long short-term memory network layer to obtain the feature vector corresponding to each preset time step.

[0044] Among them, the long short-term memory network (LSTM, Long Short-Term Memory) is a special RNN (Recurrent Neural Network), mainly to solve the problems of gradient disappearance and gradient explosion in the process of long sequence training, that is, the LSTM can perform better in longer sequences. The preset time step is the length of the time dimension of each sample preset when processing the vector to be detected in the long short-term memory network. The feature vector is the implicit feature when processing the partial vector corresponding to each preset time step.

[0045] Specifically, for each vector to be detected, the vector to be detected is input into the long short-term memory network layer for processing, and the implicit features corresponding to each preset time step can be extracted as feature vectors. By processing the spliced high-dimensional time series data (vector to be detected) through the LSTM network, the time-dependent relationships in the data can be captured, and the learning process can be dynamically adjusted through the gating mechanism, improving the accuracy and robustness of feature extraction.

[0046] S240. Input each feature vector into the layer normalization layer for standardization processing to obtain the standardized vector corresponding to each feature vector.

[0047] Among them, the standardized vector is a vector that has undergone standardization processing, and the standardization processing can include normalization processing, scaling, and translation processing, etc.

[0048] Specifically, for the feature vector corresponding to each preset time step, it can be standardized through the layer normalization layer to obtain the corresponding standardized vector, so as to improve the subsequent processing speed and stability.

[0049] Based on the above example, the following method can be used to input each feature vector into the layer normalization layer for standardization processing to obtain the standardized vector corresponding to each feature vector: For each feature vector, determine the mean and variance corresponding to the feature vector; According to the mean, variance, and a preset constant, determine the normalized vector corresponding to the feature vector; According to the preset scaling parameter and the preset translation parameter, process the normalized vector to obtain the standardized vector corresponding to the feature vector.

[0050] Among them, the preset constant is a small constant set in advance to prevent division by zero errors. The normalized vector is the result of the normalization processing of the feature vector. The preset scaling parameter and the preset translation parameter are parameters in the target collision event detection model and are parameters obtained through model training. The preset scaling parameter is a parameter used to scale the normalized vector, and the preset translation parameter is a parameter used to translate the normalized vector.

[0051] Specifically, for each feature vector, calculate the mean and variance through each element of the feature vector. Substitute the mean, variance, and the preset constant into the normalization calculation formula to obtain the normalized vector corresponding to the feature vector. Further, perform scaling and translation processing on the normalized vector through the preset scaling parameter and the preset translation parameter to obtain the standardized vector corresponding to the feature vector.

[0052] Exemplarily, the mean and variance are calculated through the following formula:

[0053]

[0054] Among them, is the mean of the feature vector corresponding to the preset time step t of, is the feature vector the i-th element of, d is the dimension of the feature vector of, is the feature vector corresponding to the preset time step t of variance.

[0055] The elements in the normalized vector are calculated through the following formula:

[0056] Among them, is the result after normalizing the i-th element of the feature vector i.e., the i-th element in the normalized vector of, is a preset constant.

[0057] The standardized vector is calculated through the following formula:

[0058] Among them, is the standardized vector corresponding to the feature vector of, is the normalized vector corresponding to the feature vector of, is a preset scaling parameter, is a preset translation parameter.

[0059] S250. Input each standardized vector into the self-attention layer to obtain the attention output matrix corresponding to the vector to be detected.

[0060] Among them, the attention output matrix is the matrix information that combines the importance of each preset time step calculated through the self-attention mechanism.

[0061] Specifically, input each standardized vector into the self-attention layer, perform self-attention mechanism processing, enhance features, extract the relationships between each preset time step, and then obtain the attention output matrix corresponding to the vector to be detected.

[0062] Based on the above example, each standardized vector can be input into the self-attention layer in the following manner to obtain the attention output matrix corresponding to the vector to be detected: Input each normalized vector into the first linear sub-layer, the second linear sub-layer, and the third linear sub-layer respectively to obtain the query vector, key vector, and value vector corresponding to each normalized vector; For each current vector, determine the attention score corresponding to the current vector according to the query vector corresponding to the current vector, the key vectors corresponding to each other vector, and the dimension of the feature vector corresponding to the current vector; Determine a score matrix according to each attention score, and perform normalization processing on the score matrix to obtain a weight matrix; Determine the attention output matrix corresponding to the vector to be detected according to the value vectors corresponding to each normalized vector and the weight matrix.

[0063] Among them, the first linear sub-layer, the second linear sub-layer, and the third linear sub-layer are linear layers used to extract the query vector, key vector, and value vector. The parameters in the first linear sub-layer, the second linear sub-layer, and the third linear sub-layer are determined through model training. The current vector is one of the normalized vectors, and the other vectors are the vectors in the normalized vectors except the current vector. The attention score is used to represent the correlation between the current vector and other vectors. The score matrix is a matrix composed of each attention score. The weight matrix is used to represent the importance of each preset time step.

[0064] Specifically, input each normalized vector into the first linear sub-layer to obtain the query vector corresponding to each normalized vector, input each normalized vector into the second linear sub-layer to obtain the key vector corresponding to each normalized vector, and input each normalized vector into the third linear sub-layer to obtain the value vector corresponding to each normalized vector. For each current vector, according to the calculation method of the attention score, substitute the query vector corresponding to the current vector, the key vectors corresponding to each other vector, and the dimension of the feature vector corresponding to the current vector, and the attention score corresponding to the current vector can be obtained. Furthermore, integrate each attention score to obtain a score matrix, and perform normalization processing on the score matrix to obtain a weight matrix. Multiply the matrix composed of the value vectors corresponding to each normalized vector by the weight matrix to obtain the attention output matrix corresponding to the vector to be detected.

[0065] Exemplarily, the process of processing through the first linear sub-layer, the second linear sub-layer, and the third linear sub-layer is as follows:

[0066] Among them, Q is the query vector, K is the key vector, V is the value vector, and X is the normalized vector. is the first linear sub-layer. is the second linear sub-layer. is the third linear sub-layer.

[0067] Calculate the query vector Q corresponding to the current vector1 The key vector K corresponding to other vectors 2 The dot product between them, and then divided by the scaling factor to obtain the attention score.

[0068]

[0069] where dk is the dimension of the feature vector output at the corresponding preset time step is the attention score between the current vector and other vectors. It can be known that an attention score can be calculated between the current vector and each other vector.

[0070] Use the Softmax function to normalize the score matrix formed by the attention scores to obtain the weight matrix, and the weight matrix represents the importance of each preset time step of the LSTM:

[0071] where is the weight matrix.

[0072] Finally, multiply the weight matrix by the value matrix formed by the value vectors corresponding to each normalized vector to obtain the attention output matrix, and the attention output matrix contains the information of the important preset time steps:

[0073] where is the attention output matrix, is the value matrix formed by the value vectors corresponding to each normalized vector.

[0074] Introducing the self-attention mechanism, by calculating the attention scores between preset time steps, it identifies and focuses on the most important parts in the time series, significantly enhancing the model's feature extraction and classification accuracy.

[0075] S260. Convert the attention output matrix into an attention output vector, and process the attention output vector based on the fully connected layer and the first activation function to obtain the process features.

[0076] where the attention output vector is the result after unfolding the attention output matrix. The fully connected layer is a model layer used for feature dimensionality reduction processing. The first activation function is a pre-set activation function used in conjunction with the fully connected layer. The process features are the output results after being processed by the fully connected layer and the first activation function.

[0077] Specifically, the attention output matrix consists of a time dimension and a feature dimension. Unfolding the attention output matrix along the feature dimension results in an attention output vector. Exemplarily, the size of the attention output matrix is (sequence_length, feature_dim), and the size of the unfolded attention output vector is sequence_length × feature_dim, where sequence_length is the sequence length of the time dimension and feature_dim is the number of feature dimensions. The attention output vector is processed sequentially through a fully connected layer and a first activation function to obtain a process feature.

[0078] Based on the above example, the fully connected layer includes at least two fully connected sub-layers. The attention output vector can be processed based on the fully connected layer and the first activation function in the following manner to obtain a process feature: Take the fully connected sub-layer with the first connection order as the current sub-layer, and take the attention output vector as the vector to be processed; Perform a fully connected process on the vector to be processed based on the current sub-layer to obtain a first vector, and process the first vector based on the first activation function to obtain a second vector. Determine whether the connection order of the current sub-layer is the last one; If so, take the second vector as the process feature; If not, take the fully connected sub-layer with the connection order next to the current sub-layer as the new current sub-layer, take the second vector as the new vector to be processed, and return to execute the step of performing a fully connected process on the vector to be processed based on the current sub-layer to obtain a first vector, and processing the first vector based on the first activation function to obtain a second vector.

[0079] Among them, a fully connected sub-layer is a layer in the fully connected layer, and the connection order is the order in which the vector passes through each fully connected sub-layer in the fully connected layer. The current sub-layer is the fully connected sub-layer currently processing the vector to be processed. The vector to be processed is the vector that currently needs to be fully connected and activated. The first vector is the output result of the current sub-layer, and the second vector is the output result of the first activation function corresponding to the current sub-layer.

[0080] Specifically, determine the connection order of each fully connected sub-layer in the fully connected layer. Take the fully connected sub-layer with the first connection order as the current sub-layer, and use the attention output vector as the vector to be processed. Perform a fully connected process on the vector to be processed based on the current sub-layer, and the result is the first vector. Then input the first vector into the first activation function for activation processing to obtain the second vector. Further, it is necessary to determine whether to end the processing of the fully connected layer, that is, to determine whether the connection order of the current sub-layer is the last one. If so, it means that there are no other fully connected sub-layers after the current sub-layer, that is, all the fully connected sub-layers and the corresponding first activation functions in the fully connected layer have been processed. Therefore, the second vector can be used as the process feature. If not, it means that there are still other fully connected sub-layers after the current sub-layer and further processing is required. Therefore, take the fully connected sub-layer with the connection order next to the current sub-layer as the new current sub-layer, use the second vector as the new vector to be processed, and return to execute the steps of performing a fully connected process on the vector to be processed based on the current sub-layer to obtain the first vector, and then processing the first vector based on the first activation function to obtain the second vector. Then, determine whether the connection order of the current sub-layer is the last one until the connection order of the current sub-layer is the last one, and use the second vector as the process feature.

[0081] S270. Input the process feature into the mapping output layer to obtain the collision state corresponding to the vector to be detected.

[0082] Specifically, inputting the process feature into the mapping output layer can map to obtain probability values, which are used to represent the probabilities of the collision state of the vector to be detected being collision and non-collision. The collision state corresponding to the vector to be detected can be determined through the probability values. For example, if the probability value of the collision state being collision is greater than the probability value of the collision state being non-collision, it is determined that the collision state corresponding to the vector to be detected is collision; otherwise, the collision state is non-collision. Or, if the probability value of the collision state being collision is greater than a preset value, it is determined that the collision state corresponding to the vector to be detected is collision; otherwise, the collision state is non-collision.

[0083] Based on the above example, the mapping output layer includes a fully connected mapping layer and an activation mapping layer. The process feature can be input into the mapping output layer in the following way to obtain the collision state corresponding to the vector to be detected: Input the process feature into the fully connected mapping layer to obtain the feature to be activated; Perform activation processing on the feature to be activated based on the second activation function in the activation mapping layer to obtain the collision probability; Determine the collision state corresponding to the vector to be detected according to the collision probability and the preset probability threshold.

[0084] Among them, the fully connected mapping layer is a fully connected structure used to further map the process features. The feature to be activated is the output result of the fully connected mapping layer. The activation mapping layer is a layer structure used to activate the feature to be activated output by the fully connected mapping layer. The second activation function is the activation function in the activation mapping layer. The collision probability is the output result of the second activation function. The preset probability threshold is a preset probability value used to distinguish whether the collision state is a collision or non-collision.

[0085] Specifically, the process features are input into the fully connected mapping layer for fully connected mapping processing, and the output is the feature to be activated. The feature to be activated is input into the second activation function in the activation mapping layer for activation processing to obtain a collision probability. The collision probability is compared with the preset probability threshold. If the collision probability is greater than or equal to the preset probability threshold, it is determined that the collision state corresponding to the vector to be detected is a collision; if the collision probability is less than the preset probability threshold, it is determined that the collision state corresponding to the vector to be detected is non-collision.

[0086] S280. If there is at least one vector to be detected with a collision state of collision, then the vector to be detected with a collision state of collision is used as a collision vector, the target timestamps corresponding to the respective collision vectors are determined, and the respective collision vectors and the target timestamps corresponding to the respective collision vectors are sent to the target platform.

[0087] Figure 3 is a schematic structural diagram corresponding to a vehicle collision event detection method provided by an embodiment of the present application. Refer to Figure 3 , specifically including: 1. Data acquisition Historical vehicle data is obtained from the cloud, including 30 signals such as collision state, longitudinal acceleration, lateral acceleration, yaw angle signal, driver's request for braking, whether the brake pedal is operated, emergency brake assist target deceleration value, vehicle deceleration control, emergency brake on / off state, adaptive cruise control reaching the limit, longitudinal distance to the target in the current lane, effective target lateral distance, throttle pedal position, brake pedal state, vehicle speed, steering wheel angular velocity, anti-lock braking system activation state, vehicle dynamic control system activation state, electronic stability program activation state, traction control system activation state, electronic brake force distribution activation state, master cylinder pressure, auxiliary deceleration state, hydraulic brake assist state, automatic emergency braking state, availability of automatic emergency braking, left front tire pressure, left rear tire pressure, right front tire pressure, and right rear tire pressure, denoted as signal 1, signal 2,..., signal 30 in Figure 3 respectively.

[0088] 2. Data processing Set a preset sliding window of 50 seconds with a preset step size of 1 second for the preset sliding window, that is, the preset sliding window moves 1 second each time. Identify the timestamp of vehicle collision (collision timestamp) from historical vehicle data. Initialize the preset sliding window so that the end of the preset sliding window is located at the collision timestamp, and gradually move the preset sliding window forward until the start of the preset window is located at the collision timestamp. And a preset sliding window that does not contain the collision timestamp can be obtained by sliding. Extract 50 seconds of data from each preset sliding window. For each signal, flatten the 50-second time series into a vector, and concatenate the flattened vectors of all signals together to form a 1500-dimensional long vector (30 signals × 50 seconds), which is the vector U.

[0089] 3. Label processing Positive sample generation: Find all collision timestamps. For each collision timestamp, label the vector corresponding to the preset sliding window containing the collision timestamp as "collision", and the corresponding vector is the positive sample vector.

[0090] Negative sample generation: Randomly select time periods that do not contain collision timestamps, apply the same preset sliding window movement to these time periods to generate windows with a length of 50 seconds, label them as "non-collision", and the corresponding vectors are negative sample vectors.

[0091] It should be noted that the number of positive sample vectors is equal to the number of negative sample vectors.

[0092] 4. Construction of collision event detection model Long short-term memory network layer (LSTM layer): Used to process time series data and capture the temporal dependencies in the sequence.

[0093] Layer Normalization layer: After the LSTM layer, by normalizing the feature vectors of each preset time step, the training speed and stability of the model are improved, and h is output 1 、h 2 、…、h n , where n is the number of preset time steps.

[0094] Self-attention layer: The self-attention mechanism is used to extract features. By calculating the attention scores between each preset time step, the relationships between important time steps in the sequence are captured, and the obtained h 1 ’、h 2 ’、…、h n ’ form a matrix (attention output matrix).

[0095] Flatten the matrix output by the self-attention layer into a vector V (attention output vector).

[0096] Fully connected layer: The flattened vector V is processed through the first fully connected sub-layer, and the first activation function uses ReLU. Further, features are extracted through the second fully connected sub-layer, and the first activation function ReLU is applied again to obtain the process features.

[0097] Mapping output layer: The result (process features) is input into a fully connected layer (fully connected mapping layer), and the Softmax activation function (the second activation function in the activation mapping layer) is used for classification. The Softmax activation function converts the output features to be activated into a probability distribution (collision probability), representing the probabilities that the input sample vector belongs to "collision" and "non-collision", and then determines the collision state. By comparing the classification probabilities, it is determined whether it is classified as a "collision" event.

[0098] 5. Model Deployment and Inference Deploy the trained target collision event detection model, and obtain real-time vehicle data to be detected by subscribing to the message queue. The message queue continuously receives and stores the vehicle data to be detected. Similar to the construction of the model training dataset (positive and negative samples), a preset sliding window is set, and the preset sliding window slides once per second to extract the data within 50 seconds in the preset sliding window. The 50-second time series of each signal is flattened to form a vector. The flattened vectors of all 30 signals are concatenated together to form a 1500-dimensional long vector, which is used as an input to the target collision event detection model once. The concatenated 1500-dimensional long vector is packed into a batch to meet the input requirements of the model. The prepared input data (vector to be detected) is passed to the deployed target collision event detection model, and finally a classification result, that is, the collision state at the current moment, is generated.

[0099] If the model determines that a collision event occurs at the current moment, that is, the collision state is collision, it will immediately trigger the corresponding response mechanism and send each collision vector and the target timestamp corresponding to each collision vector to the target platform. For example: The response mechanism includes notifying the vehicle driver, activating the emergency safety system, sending a collision event report to the remote server, etc.

[0100] The vehicle collision event detection method provided by the embodiments of the present application inputs each vector to be detected into a long short-term memory network layer for each vector to be detected, obtains feature vectors corresponding to each preset time step, inputs the feature vectors into a layer normalization layer for normalization processing to obtain normalized vectors corresponding to each feature vector, inputs the normalized vectors into a self-attention layer to obtain an attention output matrix corresponding to the vector to be detected, converts the attention output matrix into an attention output vector, processes the attention output vector based on a fully connected layer and a first activation function to obtain a process feature, and inputs the process feature into a mapping output layer to obtain a collision state corresponding to the vector to be detected, achieving the effect of improving the recognition accuracy of collision events by analyzing multi-dimensional vehicle data in the cloud.

[0101] Figure 4 is a schematic structural diagram of an electronic device provided by the embodiments of the present application. As Figure 4 shown, the electronic device 400 includes one or more processors 401 and a memory 402.

[0102] The processor 401 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.

[0103] The memory 402 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may run the program instructions to implement the vehicle collision event detection method of any embodiment of the present application described above and / or other desired functions. Various contents such as initial external parameters and thresholds may also be stored in the computer-readable storage medium.

[0104] In one example, the electronic device 400 may further include: an input device 403 and an output device 404, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown). The input device 403 may include, for example, a keyboard, a mouse, etc. The output device 404 may output various information to the outside, including warning prompt information, braking force, etc. The output device 404 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0105] Of course, for simplicity,Figure 4 Only some of the components related to the present application in the electronic device 400 are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device 400 may further include any other appropriate components.

[0106] In addition to the above methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions that, when run on a processor, cause the processor to execute the steps of the vehicle collision event detection method provided in any embodiment of the present application.

[0107] The computer program product may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present application. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0108] In addition, an embodiment of the present application may also be a computer-readable storage medium having computer program instructions stored thereon that, when run on a processor, cause the processor to execute the steps of the vehicle collision event detection method provided in any embodiment of the present application.

[0109] The computer-readable storage medium may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0110] It should be noted that the terms used in this application are only for describing specific embodiments and do not limit the scope of this application. As shown in the specification and claims of this application, unless the context clearly indicates otherwise, words such as "a", "an", "one", and / or "the" do not specifically refer to the singular and may also include the plural. The term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method or device comprising the said element.

[0111] It should also be noted that the orientation or positional relationship indicated by terms such as "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to this application. Unless otherwise clearly specified and defined, terms such as "installed", "connected", "coupled" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection; it can be directly connected, or indirectly connected through an intermediate medium, and can be the communication inside two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0112] In this article, specific examples are used to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. The above is only the preferred implementation manner of this application. It should be noted that due to the limitation of literal expression and objectively infinite specific structures, for those of ordinary skill in the art of this technology, without departing from the principle of this invention, several improvements, refinements or changes can be made, or the above technical features can be combined in an appropriate manner; these improvements, refinements, changes or combinations, or directly applying the concept and technical solution of the invention to other occasions without improvement, should all be regarded as the protection scope of this application.

Claims

1. A vehicle collision event detection method, characterized in that: include: Acquire the vehicle data to be detected; wherein the vehicle data to be detected includes vehicle motion data, vehicle system activation status, vehicle driving operation data and vehicle component status data; Determining a plurality of vectors to be detected according to the vehicle data to be detected, a preset sliding window and a preset step size; Input each vector to be detected into the target collision event detection model to obtain a collision state corresponding to each vector to be detected; wherein the target collision event detection model includes a long short-term memory network layer, a layer normalization layer, a self-attention layer, a fully connected layer and a mapping output layer; If there is at least one vector to be detected whose collision state is collision, the vector to be detected whose collision state is collision is used as the collision vector, the target timestamp corresponding to each collision vector is determined, and each collision vector and the target timestamp corresponding to each collision vector are sent to the target platform.

2. The method according to claim 1, characterized in that The step of determining a plurality of vectors to be detected according to the vehicle data to be detected, a preset sliding window, and a preset step size includes: Dividing the vehicle data to be detected according to a preset sliding window and a preset step size to obtain a matrix to be detected corresponding to each timestamp; For each matrix to be detected, a time series to be detected corresponding to each signal dimension is determined, and each time series to be detected is concatenated to obtain a vector to be detected corresponding to the matrix to be detected.

3. The method according to claim 1, characterized in that The step of inputting each vector to be detected into the target collision event detection model to obtain a collision state corresponding to each vector to be detected includes: For each vector to be detected, the vector to be detected is input into the long short-term memory network layer to obtain a feature vector corresponding to each preset time step; Each feature vector is input into the layer normalization layer for normalization processing to obtain the normalized vector corresponding to each feature vector; Input each standardized vector into the self-attention layer to obtain the attention output matrix corresponding to the vector to be detected; Converting the attention output matrix into an attention output vector, and processing the attention output vector based on a fully connected layer and a first activation function to obtain a process feature; The process feature is input into the mapping output layer to obtain the collision state corresponding to the vector to be detected.

4. The method according to claim 3, characterized in that The step of inputting each feature vector into a layer normalization layer for normalization to obtain a normalized vector corresponding to each feature vector includes: For each eigenvector, determining the mean and variance corresponding to the eigenvector; Determine a normalized vector corresponding to the feature vector according to the mean, the variance and a preset constant; The normalized vector is processed according to a preset scaling parameter and a preset translation parameter to obtain a standardized vector corresponding to the feature vector.

5. The method according to claim 3, characterized in that: The step of inputting each standardized vector into the self-attention layer to obtain the attention output matrix corresponding to the vector to be detected includes: Input each standardized vector into the first linear sublayer, the second linear sublayer, and the third linear sublayer respectively to obtain a query vector, a key vector, and a value vector corresponding to each standardized vector; For each current vector, determine the attention score corresponding to the current vector according to the query vector corresponding to the current vector, the key vectors corresponding to each other vector, and the dimension of the feature vector corresponding to the current vector; wherein the current vector is a vector in the standardized vector, and the other vectors are vectors in the standardized vector other than the current vector; Determine a score matrix according to each attention score, and normalize the score matrix to obtain a weight matrix; According to the value vectors corresponding to each standardized vector and the weight matrix, the attention output matrix corresponding to the vector to be detected is determined.

6. The method according to claim 3, characterized in that The fully connected layer includes at least two fully connected sublayers; the processing of the attention output vector based on the fully connected layer and the first activation function to obtain a process feature includes: The fully connected sublayer that is first in the connection order is used as the current sublayer, and the attention output vector is used as the vector to be processed; Performing full connection processing on the vector to be processed based on the current sub-layer to obtain a first vector, and processing the first vector based on a first activation function to obtain a second vector, and determining whether the connection order of the current sub-layer is in the last position; If yes, then the second vector is used as a process feature; If not, the fully connected sublayer that is next to the current sublayer in the connection order is used as the new current sublayer, the second vector is used as the new vector to be processed, and the process returns to execute the step of performing full connection processing on the vector to be processed based on the current sublayer to obtain the first vector, and processing the first vector based on the first activation function to obtain the second vector.

7. The method according to claim 3, characterized in that The mapping output layer includes a fully connected mapping layer and an activated mapping layer; the step of inputting the process feature into the mapping output layer to obtain the collision state corresponding to the vector to be detected includes: Inputting the process features into a fully connected mapping layer to obtain features to be activated; Activate the feature to be activated based on the second activation function in the activation mapping layer to obtain a collision probability; The collision state corresponding to the vector to be detected is determined according to the collision probability and a preset probability threshold.

8. The method according to claim 1, characterized in that The target collision event detection model is trained based on the following method: Obtaining historical vehicle data and collision timestamps in the historical vehicle data; Determining a plurality of history vectors according to the vehicle data to be detected, a preset sliding window, and a preset step size; For each history vector, determine whether the history vector corresponds to a collision timestamp, if so, determine the collision state of the history vector is collision, if not, determine the collision state of the history vector is non-collision; Determine a positive sample vector in a sample vector according to each historical vector in which the collision state is a collision, and determine a negative sample vector in a sample vector according to each historical vector in which the collision state is a non-collision; wherein the number of the positive sample vectors is equal to the number of the negative sample vectors; Inputting the sample vectors into the initial collision event detection model to be trained to obtain a predicted state corresponding to each sample vector; Determining a target loss of the initial collision event detection model according to a predicted state corresponding to each sample vector, a collision state corresponding to each sample vector, and a preset loss function; The model parameters of the initial collision event detection model are adjusted based on the target loss to obtain a target collision event detection model.

9. An electronic device, characterized in that: The electronic device comprises: Processor and memory; The processor is used to execute the steps of the vehicle collision event detection method according to any one of claims 1 to 8 by calling the program or instruction stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute the steps of the vehicle collision event detection method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Vehicle collision detection method, medium and vehicle

    CN120673592A