Model training method, data processing method and related equipment
By comprehensively analyzing the dynamic association features and protocol rule association features, the model is used to automatically identify the paired relationships of vehicle network identifiers, which solves the problems of low accuracy and efficiency caused by manual recording in the existing technology, and realizes efficient and accurate CAN ID paired relationship recognition.
Patent Information
- Application Number
- CN202510788860.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-26
AI Technical Summary
Existing pairwise relationship recognition methods rely on manual recording of CAN IDs, resulting in low accuracy and efficiency, difficulty in adapting to new models or equipment, and prone to errors and high labor costs.
By comprehensively analyzing dynamic association features, protocol rule association features, and numerical association features, the model is used to automatically identify the paired relationships of vehicle network identifiers, avoiding manual labeling and errors, and improving recognition accuracy and efficiency.
It realizes the automatic judgment of CAN ID pair relationships in remote diagnosis, reduces labor costs, improves diagnostic efficiency, ensures data accuracy, and can accurately judge complex spatiotemporal correlations and nonlinear relationships.
Smart Images

Figure CN120705700A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of automotive electronic communication technology, and more specifically, to a model training method, a data processing method, a model training device, a data processing device, a computer device, a computer-readable storage medium, and a computer program product containing instructions. Background Art
[0002] As the number of automotive electronic devices and vehicle models increases, in-vehicle network communications become complex, requiring a pairwise relationship identification method.
[0003] Existing pairing recognition methods rely on engineers manually recording the CAN ID (Controller Area Network Identifier) pairings for different vehicle models. Based on their experience, engineers record known diagnostic request CAN IDs and corresponding ECU response CAN ID pairs in a database.
[0004] However, the existing technology requires engineers to manually record the CAN ID pairing relationship at a high cost, and the manual recording process is prone to errors. Therefore, the accuracy and efficiency of the paired relationship recognition of the vehicle network identifier are low. Summary of the Invention
[0005] The embodiments of the present application provide a model training method, a data processing method, a model training device, a data processing device, a computer device, a computer-readable storage medium, and a computer program product containing instructions, which can perform pairwise relationship recognition model training for vehicle network identifiers while improving the accuracy and efficiency of pairwise relationship recognition of vehicle network identifiers.
[0006] In a first aspect, an embodiment of the present application provides a method for training a pairwise relationship recognition model of an in-vehicle network identifier, comprising:
[0007] Acquire multiple target identification samples from the vehicle network, the multiple target identification samples including a first target identification sample of the diagnostic instrument, a second target identification sample of the response electronic control unit, and a protocol rule association relationship feature and a numerical association relationship feature of byte sequences between the first target identification sample and the second target identification sample, the first target identification sample and the second target identification sample being annotated with corresponding paired identification recognition results;
[0008] Inputting the multiple target identification samples into a pairwise relationship recognition model, obtaining a dynamic association feature between the first target identification sample and the second target identification sample by the pairwise relationship recognition model, and obtaining predicted pairwise relationship recognition results corresponding to the multiple target identification samples output by the pairwise relationship recognition model based on a determination result of whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern;
[0009] When the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets the convergence condition, a trained pairwise relationship recognition model is obtained.
[0010] In a second aspect, an embodiment of the present application provides a method for identifying paired relationships of vehicle network identifiers, including:
[0011] Acquire multiple target identifiers of the vehicle network, the multiple target identifiers including a first target identifier of the diagnostic instrument, a second target identifier of the response electronic control unit, a protocol rule association relationship feature of a byte sequence and a numerical association relationship feature between the first target identifier and the second target identifier, the first target identifier and the second target identifier being annotated with corresponding paired identifier recognition results;
[0012] The multiple target identifiers are input into the paired relationship recognition model as described in the first aspect, and the paired relationship recognition model obtains the dynamic association characteristics between the first target identifier and the second target identifier, and based on the determination result of whether the dynamic association characteristics, the protocol rule association relationship characteristics and the numerical association relationship characteristics meet the preset feature pattern, the predicted paired relationship recognition results corresponding to the multiple target identifiers output by the paired relationship recognition model are obtained.
[0013] In a third aspect, an embodiment of the present application provides a device for training a paired relationship recognition model of an in-vehicle network identifier, comprising:
[0014] an acquisition unit configured to acquire a plurality of target identification samples from an in-vehicle network, the plurality of target identification samples comprising a first target identification sample of a diagnostic instrument, a second target identification sample of a response electronic control unit, and a protocol rule association relationship feature and a numerical association relationship feature of a byte sequence between the first target identification sample and the second target identification sample, the first target identification sample and the second target identification sample being annotated with corresponding paired identification recognition results;
[0015] a determination unit, configured to input the plurality of target identification samples into a pairwise relationship recognition model, obtain a dynamic association feature between the first target identification sample and the second target identification sample by the pairwise relationship recognition model, and obtain predicted pairwise relationship recognition results corresponding to the plurality of target identification samples output by the pairwise relationship recognition model based on a determination result of whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern;
[0016] The acquisition unit is further configured to obtain a trained pairwise relationship recognition model when the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets a convergence condition.
[0017] In a fourth aspect, an embodiment of the present application provides a device for identifying paired relationships of vehicle network identifiers, including:
[0018] an acquisition unit configured to acquire a plurality of target identifiers of the vehicle network, the plurality of target identifiers including a first target identifier of the diagnostic instrument, a second target identifier of the response electronic control unit, a protocol rule association relationship feature and a numerical association relationship feature of a byte sequence between the first target identifier and the second target identifier, the first target identifier and the second target identifier being annotated with corresponding paired identifier recognition results;
[0019] A determination unit is used to input the multiple target identifiers into the paired relationship recognition model as described in any one of claims 1 to 8, obtain the dynamic association characteristics between the first target identifier and the second target identifier by the paired relationship recognition model, and obtain the predicted paired relationship recognition results corresponding to the multiple target identifiers output by the paired relationship recognition model based on the determination result of whether the dynamic association characteristics, the protocol rule association relationship characteristics and the numerical association relationship characteristics meet the preset feature pattern.
[0020] In a fifth aspect, an embodiment of the present application provides a computer device, including:
[0021] CPU, memory, input and output interfaces, wired or wireless network interfaces, and power supply;
[0022] The memory is a transient storage memory or a persistent storage memory;
[0023] The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the methods described in the first and second aspects.
[0024] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on a computer, the computer executes the methods described in the first and second aspects above.
[0025] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the methods described in the first and second aspects above.
[0026] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages: by comprehensively analyzing whether the dynamic association characteristics, the protocol rule association characteristics, and the numerical association characteristics meet the preset feature pattern, the paired relationships of the vehicle network identifiers are identified. This method utilizes comprehensive multimodal features for automated model discrimination, avoiding the errors and high labor costs caused by manual pre-recording, thereby improving the accuracy and efficiency of the paired relationship identification of the vehicle network identifiers. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a schematic diagram of the architecture of a paired relationship recognition model training system for vehicle network identifiers disclosed in an embodiment of the present application;
[0028] Figure 2 A flowchart of a method for training a pairwise relationship recognition model for vehicle network identifiers disclosed in an embodiment of the present application;
[0029] Figure 2-1 A schematic diagram of a neural network architecture of a pairwise relationship recognition model disclosed in an embodiment of the present application;
[0030] Figure 2-2 A flowchart of an entire pairwise relationship recognition model development method disclosed in an embodiment of the present application;
[0031] Figure 3 A flowchart of a method for identifying paired relationships of vehicle network identifiers disclosed in an embodiment of the present application;
[0032] Figure 4 A schematic structural diagram of a model training device disclosed in an embodiment of the present application;
[0033] Figure 5 A schematic structural diagram of a data processing device disclosed in an embodiment of the present application;
[0034] Figure 6 This is a schematic diagram of the structure of a computer device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The embodiments of the present application provide a model training method, a data processing method, a model training device, a data processing device, a computer device, a computer-readable storage medium, and a computer program product containing instructions, which can perform pairwise relationship recognition model training for vehicle network identifiers while improving the accuracy and efficiency of pairwise relationship recognition of vehicle network identifiers.
[0036] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the numbers used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "corresponding to" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Pairwise relationship identification is crucial in scenarios such as vehicle diagnostics in the automotive electronics communications sector, and highly accurate methods are urgently needed. Determining the pairwise relationships of CAN IDs is crucial in vehicle diagnostics. For example, in remote diagnostics, due to the extremely high latency requirements for vehicle diagnostics, responses exceeding 55 milliseconds typically time out. However, network communication often struggles to consistently maintain latency within 55 milliseconds, leading to diagnostic failures. To address this issue, a strategy of proxy flow control or proxy negative responses is typically employed, which requires identifying the pairwise relationships of CAN IDs. For example, when receiving a diagnostic request from a diagnostic instrument, if proxy flow control or proxy negative responses are required, the CAN ID of the corresponding responding ECU must be known in order to take appropriate action. Commonly used pairwise relationship identification methods (both those relying on manual experience and machine learning) have several shortcomings. For those relying on manual experience, this method relies on engineers to manually record the CAN ID pairwise relationships of different vehicle models and store them on the platform for remote diagnostic access. However, engineers can only record familiar CAN ID configurations based on their own experience. When faced with new vehicle models or onboard devices, unfamiliarity with their pairing relationships makes it difficult to accurately record these relationships in advance. This directly results in an inability to perform CAN ID substitution for new devices during remote diagnosis, ultimately leading to diagnostic timeouts and failures. Similarly, when analyzing diagnostic failures, engineers' lack of familiarity with pairing relationships also makes it difficult to accurately pinpoint the root cause. Secondly, manual annotation is prone to errors. Engineers may make typographical errors during manual entry, resulting in incorrect configuration information being uploaded to the platform. This results in inaccurate pairing relationships obtained during remote diagnosis based on the incorrect configuration, further leading to diagnostic failures. Finally, manual annotation is costly and inefficient, requiring engineers to expend considerable time and effort recording and maintaining CAN ID pairing relationships. This not only increases labor costs but also reduces overall diagnostic efficiency. Regarding machine learning methods, traditional machine learning algorithms (such as decision trees) are used to process vehicle diagnostic data. However, these methods rely on manual feature extraction and struggle to capture the complex spatiotemporal correlations and nonlinear relationships of CAN IDs. For example, decision trees struggle to effectively learn the byte-level variations in CAN IDs, making it difficult to accurately determine whether CAN IDs are paired.
[0038] Based on this, in an embodiment of the present application, a model training method (a model training method for identifying paired relationships of vehicle network identifiers) and a data processing method (a method for identifying paired relationships of vehicle network identifiers) are provided. By comprehensively analyzing whether dynamic association features, protocol rule association features, and numerical association features meet preset feature patterns, paired relationships of vehicle network identifiers can be identified. It can be seen that the embodiment of the present application can achieve the following effects: First, the model is trained by known data, and the trained model is used to automatically identify paired relationships in the later stage without manual labeling. It is particularly suitable for new models or equipment and can identify the CAN ID paired relationships of new models or equipment. The model automatically determines the relationship, reducing labor costs and improving efficiency. Second, in remote diagnosis, there is no need to manually label and upload the CAN ID to the platform. Only the CAN ID within a period of time needs to be input into the model for judgment to find the paired ID for command substitution, thereby improving diagnostic efficiency. Third, the data manually marked by the engineer can be judged by the model. If it is lower than the threshold, an alarm will be issued to prompt a review, ensuring data accuracy and realizing automatic error correction. Fourth, by comprehensively analyzing whether dynamic association features, protocol rule association features, and numerical association features meet preset feature patterns, we can capture the complex spatiotemporal and nonlinear relationships of CAN IDs and accurately determine whether CAN IDs are paired. The paired relationship recognition model training method for in-vehicle network identifiers of this application can be applied in at least one of the following scenarios.
[0039] Applicable scenario 1: Remote diagnosis:
[0040] During the remote diagnosis process, the paired relationship recognition model trained in this application can be used to determine the CAN ID paired relationship in real time, reducing diagnostic failures caused by network delays.
[0041] Applicable scenario 2, problem analysis:
[0042] After the diagnosis fails, when analyzing the log, the method of this application can be used to automatically find the paired CAN IDs, extract the communication data for analysis, and improve the efficiency of problem location.
[0043] Applicable scenario three: data error correction:
[0044] During the data processing process, the paired relationship recognition model trained in this application can be used to identify the data manually marked by engineers, detect and correct errors in a timely manner, and ensure the accuracy of the data.
[0045] It should be noted that the above application scenarios are only examples. The paired relationship recognition model training method and paired relationship recognition method of vehicle network identifiers provided in this embodiment can also be applied to other scenarios and are not limited here.
[0046] The method provided in this application can be applied to Figure 1 The architecture of the pairwise relationship recognition model training system shown in the figure is as follows. Figure 1 The architecture of the paired relationship recognition model training system for vehicle network identifiers in the embodiment of the present application includes:
[0047] Computer device 101 and client 102. When training a pairwise relationship recognition model for vehicle network identification, computer device 101 can be connected to client 102. Computer device 101 can obtain multiple initial identification samples of the vehicle network sent by client 102, and the multiple initial identification samples include a first initial identification sample of the diagnostic instrument and a second initial identification sample of the response electronic control unit generated during the communication process between the diagnostic instrument and the response electronic control unit. The multiple initial identification samples can be preprocessed to obtain multiple target identification samples, and then the multiple target identification samples are input into the pairwise relationship recognition model. The pairwise relationship recognition model obtains the dynamic association features between the first target identification sample and the second target identification sample, and based on the determination result of whether the dynamic association features, the protocol rule association relationship features and the numerical association relationship features meet the preset feature pattern, the predicted pairwise relationship recognition results corresponding to the multiple target identification samples output by the pairwise relationship recognition model are obtained. When the loss between the predicted pairwise relationship recognition results and the labeled pairwise relationship recognition results meets the convergence condition, the trained pairwise relationship recognition model is obtained.
[0048] Based on the above introduction, the following introduces the training method of the paired relationship recognition model of the vehicle network identifier in this application. Figure 2 The method for training a paired relationship recognition model for vehicle network identifiers in an embodiment of the present application includes:
[0049] 201. Obtain multiple target identification samples of the vehicle network, the multiple target identification samples including a first target identification sample of the diagnostic instrument, a second target identification sample of the response electronic control unit, protocol rule association relationship characteristics and numerical association relationship characteristics of the byte sequence between the first target identification sample and the second target identification sample, and the first target identification sample and the second target identification sample are marked with corresponding paired identification recognition results.
[0050] In one or more embodiments, the identifier of the vehicle network refers to a mark used to uniquely identify different devices or nodes in the vehicle network. Depending on different communication protocols, these identifiers may include but are not limited to the CAN message identifier (CAN ID) of the CAN bus protocol, the vehicle Ethernet identifier of the vehicle Ethernet communication protocol, and the DOIP identifier of the diagnostic communication over IP (DOIP) protocol. The protocol rule association relationship feature is used to characterize whether two identifiers (the first target identifier sample and the second target identifier sample) comply with specific protocol rules, such as whether the first 4 bytes are the same, whether the last two bytes are in reverse order, etc. The numerical association relationship feature is used to characterize the numerical similarity or difference between two identifiers, such as the difference, the XOR value, the Hamming distance, etc.
[0051] 202. Input multiple target identification samples into the paired relationship recognition model, and the paired relationship recognition model obtains the dynamic association characteristics between the first target identification sample and the second target identification sample, and based on the determination result of whether the dynamic association characteristics, the protocol rule association relationship characteristics and the numerical association relationship characteristics meet the preset feature pattern, obtains the predicted paired relationship recognition results corresponding to the multiple target identification samples output by the paired relationship recognition model.
[0052] In one or more embodiments, dynamic correlation features are used to characterize the key features that are dynamically focused on between two identifiers (a first target identifier sample and a second target identifier sample) during model execution. These features can be generated by an attention mechanism and can enhance the ability to recognize complex patterns.
[0053] 203. When the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets the convergence condition, a trained pairwise relationship recognition model is obtained.
[0054] In one or more embodiments, the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result is first calculated based on the loss function. When the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets the convergence condition, a trained pairwise relationship recognition model is obtained.
[0055] In an embodiment of the present application, a method for training a model for identifying paired relationships of vehicle network identifiers is provided. By comprehensively analyzing dynamic association features, protocol rule association features, and numerical association features to determine whether they meet a preset feature pattern, paired relationships of vehicle network identifiers are identified. This method utilizes comprehensive multimodal features for automated model identification, avoiding the errors and significant labor costs associated with manual pre-recording. Consequently, it improves the accuracy and efficiency of identifying paired relationships of vehicle network identifiers.
[0056] Optionally, in the above Figure 2On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, multiple target identification samples of the vehicle network are obtained, and the multiple target identification samples include a first target identification sample, a second target identification sample, a protocol rule association relationship feature, and a numerical association relationship feature, which may specifically include:
[0057] Acquire multiple initial identification samples of the vehicle network, the multiple initial identification samples including a first initial identification sample of the diagnostic instrument and a second initial identification sample of the response electronic control unit;
[0058] Performing byte padding and normalization on the numerical value and byte length value of the first initial identification sample to obtain a first target identification sample, and performing byte padding and normalization on the numerical value and byte length value of the second initial identification sample to obtain a second target identification sample;
[0059] Based on the byte sequence feature between the first initial identification sample and the second initial identification sample, a numerical value association relationship feature and a protocol rule association relationship feature are determined.
[0060] In one or more embodiments, a method for obtaining multiple target identification samples of a vehicle network is introduced. As can be seen from the above embodiments, multiple initial identification samples of the vehicle network can be obtained first, and then the multiple initial identification samples are preprocessed to obtain multiple target identification samples.
[0061] Specifically, for ease of understanding, the multiple initial identification samples of the vehicle network can be divided into three parts: the initial identification sample (s_id) of the diagnostic instrument, which is the CAN ID of the diagnostic request issued by the diagnostic instrument; the initial identification sample (r_id) of the ECU, which is the CAN ID returned by the responding ECU; and the pairing flag (label), which indicates whether the s_id and r_id are paired, with 1 indicating a pair and 0 indicating an unpaired pair. The preprocessing steps include byte padding, normalization, and concatenation. Specifically, all CAN IDs (generally 2, 3, 4, or 5 bytes) are first padded to 5 bytes. If the original CAN ID length is less than 5 bytes, 0 is added to the front to make up the length. The CAN ID and its length are then normalized to the range of 0-1. The specific formula is to divide the CAN ID by 255 and the length by 5, that is, s_byte = s_id / 255; r_byte = r_id / 255; s_len = s_len / 5; r_len = r_len / 5. Finally, the normalized CAN ID and length are concatenated into a 6-dimensional vector. For the identification sample of the diagnostic instrument, the concatenated vector is s_input; for the identification sample of the ECU end, the concatenated vector is r_input, that is, s_input (data input to the model) = concatenate(s_byte, s_len); r_input = concatenate(r_byte, r_len).
[0062] Again, in an embodiment of the present application, a method for obtaining multiple target identification samples from an in-vehicle network is provided. Byte padding unifies CAN IDs of varying lengths into 5 bytes, ensuring consistency in input data and facilitating subsequent processing. Normalization scales CAN ID and length values to a range of 0-1, enhancing the model's compatibility with diverse data. The consistent range of normalized data helps accelerate the convergence of model training. Consequently, the accuracy of pairwise relationship recognition model training is further improved, thereby further improving the accuracy of pairwise relationship recognition.
[0063] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, determining the numerical association relationship feature and the protocol rule association relationship feature based on the byte sequence feature between the first initial identification sample and the second initial identification sample may specifically include:
[0064] Calculating the difference, XOR value, and / or Hamming distance between the first initial identification sample and the second initial identification sample byte by byte to obtain a numerical correlation relationship feature;
[0065] Based on the first N bytes of the first initial identification sample and the second initial identification sample being identical and / or the last M bytes being in reverse order, a protocol rule association relationship feature is obtained.
[0066] In one or more embodiments, a method for determining a numerical association feature and a protocol rule association feature based on byte sequence characteristics between a first initial identification sample and a second initial identification sample is described. As can be seen from the aforementioned embodiments, the numerical association feature and the protocol rule association feature are determined by byte-by-byte calculation and analysis of the first N bytes being identical and / or the last M bytes being in reverse order.
[0067] Specifically, for example: First, the difference, XOR value, and Hamming distance between two CAN IDs can be calculated. These are numerical association features: sub = ((s_id - r_id) / 255.0) * 0.5 + 0.5 / / byte-by-byte difference calculation; xor = (s_id ^ r_id) / 255.0 / / byte-by-byte XOR calculation; hamming = hamming_distance (s_id, r_id) / 40.0 / / Hamming distance calculation. Second, the first N bytes of the two CAN IDs can be checked to see if they are identical and if the last M bytes are in reverse order. These are protocol rule association features: features1 = (s_id[:4] == r_id[:4]) / / The first n bytes are identical; features2 = (s_id[-1] s_id[-2] == r_id[-2][-1]) / / The last two bytes are in reverse order. Next, we can concatenate the XOR, difference, Hamming distance, identity, and reverse order features into a 13-dimensional vector: interact_input (interaction feature input, i.e., numerical correlation features) = concatenate(sub, xor, hamming, features1, features2). Finally, the preprocessing process can return s_input, r_input, interact_input, and label (the label in the training data).
[0068] Again, in an embodiment of the present application, a method is provided for determining numerical association relationship features and protocol rule association relationship features based on the byte sequence features between the first initial identification sample and the second initial identification sample. By calculating the difference, XOR value and Hamming distance, the numerical similarities and differences between the two CAN IDs can be fully captured. Secondly, by checking whether the first N bytes are the same and the last M bytes are in reverse order, etc., it can be ensured that the extracted features comply with the rules of the automobile diagnostic protocol. Furthermore, these features provide rich information for the model, which helps to improve the accuracy of CAN ID pairwise relationship recognition. Therefore, the accuracy of determining numerical association relationship features and protocol rule association relationship features can be improved, thereby further improving the accuracy of paired relationship recognition model training, thereby further improving the accuracy of paired relationship recognition.
[0069] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the pairwise relationship recognition model includes a target feature extraction model based on an attention mechanism, and a target feature analysis model;
[0070] The pairwise relationship recognition model obtains dynamic association features between the first target identification sample and the second target identification sample, and obtains a predicted pairwise relationship recognition result based on the determination result of whether the dynamic association features, the protocol rule association features, and the numerical association features meet the preset feature pattern. Specifically, the predicted pairwise relationship recognition result may include:
[0071] Generate dynamic correlation features based on the first target identification sample and the second target identification sample by a target feature extraction model based on the attention mechanism;
[0072] The target feature analysis model determines whether the dynamic association features, protocol rule association features and numerical association features meet the preset feature patterns to obtain the predicted pairwise relationship recognition results.
[0073] In one or more embodiments, a method for training a pairwise relationship recognition model based on a target feature analysis model and an attention-based target feature extraction model is described. As can be seen from the aforementioned embodiments, the pairwise relationship recognition model includes two models: an attention-based target feature extraction model and a target feature analysis model. These two models divide the work of training the pairwise relationship recognition model.
[0074] Specifically, the model's attention mechanism generates dynamic association features, focusing on key features to enhance the ability to recognize complex patterns. The model's feature analysis component integrates dynamic association features, protocol rule association features, and numerical association features to determine whether they conform to pre-defined feature patterns, thereby outputting predicted pairwise relationship recognition results.
[0075] Secondly, in an embodiment of the present application, a method for training a pairwise relationship recognition model based on a target feature analysis model and a target feature extraction model based on an attention mechanism is provided. By introducing the attention mechanism in the above manner, the model's ability to capture key features is enhanced, and the accuracy of recognition is improved. Combining multimodal features with the attention mechanism can significantly improve the accuracy of complex pattern recognition. Therefore, the accuracy of pairwise relationship recognition model training is further improved, thereby further improving the accuracy of pairwise relationship recognition.
[0076] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, a target feature extraction model based on an attention mechanism generates dynamic association features based on the first target identification sample and the second target identification sample, which may specifically include:
[0077] Generate a dynamic correlation feature by using a target feature extraction model based on an attention mechanism based on a first concatenated feature between local features of the first target identification sample and the second target identification sample;
[0078] The target feature analysis model determines whether the dynamic association feature, the protocol rule association feature, and the numerical association feature meet the preset feature pattern, and obtains the predicted pairwise relationship recognition result, which may specifically include:
[0079] The target feature analysis model obtains a predicted pairwise relationship recognition result based on a determination result of whether the second splicing feature between the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature meets the preset feature pattern.
[0080] In one or more embodiments, a pairwise relationship recognition model training method based on two splicing dimensions is introduced. As can be seen from the above embodiments, the generation of dynamic association features involves one splicing dimension, and the generation of predicted pairwise relationship recognition results involves another splicing dimension.
[0081] Specifically, for the first splicing feature: the local features of the diagnostic instrument identification sample and the response ECU identification sample are spliced together to generate dynamic correlation features. This splicing allows the model to consider the features of the two identification samples at the same time, which helps to capture the correlation between them. Combined with the CNN-attention hybrid architecture, CNN can capture local patterns, and the attention mechanism can enhance dynamic correlation, allowing the model to focus on key features. For the second splicing feature: the dynamic correlation features, protocol rule association relationship features, and numerical association relationship features are spliced together to determine whether the preset feature pattern is met. This splicing method can integrate multiple features for judgment, thereby improving the accuracy and comprehensiveness of recognition.
[0082] Again, in an embodiment of the present application, a pairwise relationship recognition model training method based on two splicing dimensions to implement logic is provided. The CNN based on the CNN-attention hybrid architecture captures local patterns and can effectively extract local features of CANID, such as the pattern of consecutive bytes. The attention mechanism based on the CNN-attention hybrid architecture can dynamically focus on key features, enhance the recognition ability of complex patterns, and enable the model to better understand and process dynamically changing association relationships. Therefore, the accuracy of the pairwise relationship recognition model training is further improved, thereby further improving the accuracy of pairwise relationship recognition.
[0083] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, a feature extraction model based on an attention mechanism includes a first feature extraction module for a diagnostic instrument identifier, a second feature extraction module for a response ECU end identifier, a first splicing submodule, and an attention mechanism;
[0084] The target feature extraction model based on the attention mechanism generates a dynamic correlation feature based on the first splicing feature between the local features of the first target identification sample and the second target identification sample, which may specifically include:
[0085] Using a first feature extraction module to obtain a first local feature of a first target identification sample, and using a second feature extraction module to obtain a second local feature of a second target identification sample;
[0086] Using the first splicing submodule to splice the first local feature and the second local feature to obtain a first splicing feature;
[0087] The attention mechanism is used to generate dynamic correlation features based on the first splicing features.
[0088] In one or more embodiments, a method is described for generating dynamic correlation features by extracting and concatenating features from both the diagnostic instrument and ECU identifiers using specialized modules. As can be seen from the aforementioned embodiments, the dual-tower system for generating dynamic correlation features includes a separate tower for a first feature extraction module for the diagnostic instrument identifier, a separate tower for a second feature extraction module for the response ECU identifier, a first concatenation submodule, and an attention mechanism. These models are divided into two parts to generate dynamic correlation features for training a pairwise relationship recognition model.
[0089] Specifically, the first feature extraction module is used to process the diagnostic instrument identification sample and extract its local features. The second feature extraction module is used to process the response ECU identification sample and extract its local features. The first splicing submodule is used to splice the local features extracted from the diagnostic instrument and ECU identification samples together to form a comprehensive feature vector (the first spliced feature). The attention mechanism is used to generate dynamic correlation features (which can highlight the important correlations between the two identification samples) based on the first spliced feature.
[0090] Again, in an embodiment of the present application, a method is provided for extracting the features of the diagnostic instrument and the ECU identification respectively and splicing them together to generate dynamic correlation features. By extracting the features of the diagnostic instrument and the ECU identification respectively through a special module, the key information of each can be captured more accurately (i.e., the dual-tower structure can better capture the features of s_id and r_id). Therefore, the accuracy of the paired relationship recognition model training is further improved, thereby further improving the accuracy of paired relationship recognition.
[0091] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiment of the present application, the target feature analysis model includes a second feature splicing module and a feature analysis module;
[0092] The target feature analysis model determines whether the second concatenation feature between the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfies the preset feature pattern, thereby obtaining a predicted pairwise relationship recognition result, which may specifically include:
[0093] Using the second feature splicing module to splice the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature to obtain a second splicing feature;
[0094] The feature analysis module is used to obtain a predicted pairwise relationship recognition result based on a determination result of whether the second splicing feature satisfies a preset feature pattern.
[0095] In one or more embodiments, a method is described for combining and integrating dynamic association features, protocol rule association features, and numerical association features to generate predicted pairwise relationship recognition results. As can be seen from the aforementioned embodiments, the target feature analysis model includes a second feature concatenation module and a feature analysis module, which are responsible for generating predicted pairwise relationship recognition results to train the pairwise relationship recognition model.
[0096] Specifically, the second feature concatenation module is used to concatenate and integrate the dynamic association features, the protocol rule association features, and the numerical association features to form a comprehensive feature vector, namely the second concatenated feature. The feature analysis module is used to determine whether this comprehensive feature vector conforms to a preset feature pattern, thereby deriving a predicted pairwise relationship recognition result.
[0097] Again, in an embodiment of the present application, a method is provided for splicing and integrating dynamic association features, protocol rule association relationship features and numerical association relationship features to obtain predicted paired relationship recognition results. By splicing and integrating dynamic association features, protocol rule association relationship features and numerical association relationship features, different types of feature information can be comprehensively considered. This fusion method helps to capture richer feature patterns and improve the model's ability to recognize complex patterns. Secondly, comprehensive analysis of multiple features can enable the model to more accurately judge paired relationships. Finally, by fusing multi-dimensional features, the model can better adapt to data patterns of different types and complexities, so that it can still maintain a high recognition accuracy when facing new models or equipment. Therefore, the accuracy of recognition can be improved, and the accuracy of paired relationship recognition model training can be further improved, thereby further improving the accuracy of paired relationship recognition.
[0098] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, a second feature splicing module is used to splice the dynamic association feature, the protocol rule association feature, and the numerical association feature to obtain a second splicing feature, which may specifically include:
[0099] The second feature splicing module is used to splice the first target identification sample, the second target identification sample, the local feature of the first target identification sample, the local feature of the second target identification sample, the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature to obtain a second splicing feature.
[0100] In one or more embodiments, a method is described for obtaining a second concatenated feature (comprehensive feature) by concatenating multiple types of features (e.g., raw bytes, local features, dynamic association features, protocol rule features, and numerical association features). As can be seen from the aforementioned embodiments, the first target identification sample, the second target identification sample, the local features of the first target identification sample, the local features of the second target identification sample, the dynamic association features, the protocol rule association features, and the numerical association features can all be concatenated to generate the second concatenated feature.
[0101] Specifically, the concatenation operation combines all of the aforementioned features (the first target identification sample, the second target identification sample, local features of the first target identification sample, local features of the second target identification sample, dynamic association features, protocol rule association features, and numerical association features) into a comprehensive feature vector. This vector incorporates feature information extracted from different perspectives. This comprehensive feature vector serves as the model input for subsequent analysis and judgment.
[0102] For easier understanding, see Figure 2-1 , Figure 2-1 This is a schematic diagram of a neural network architecture of a pairwise relationship recognition model disclosed in an embodiment of the present application, which consists of Figure 2-1 It can be seen that the neural network architecture mainly consists of the following parts:
[0103] 1. Input layer:
[0104] s_input: used to receive the input of the diagnostic instrument identification sample.
[0105] r_input: used to receive the input of the response ECU end identification sample.
[0106] interact_input: used to receive input of interaction features.
[0107] 2. Twin tower structure:
[0108] s_input and r_input are processed separately: s_input and r_input are input into two identical sub-networks for independent processing to extract their respective features.
[0109] 3. Convolutional layer (Conv1D): Used to extract local features using a one-dimensional convolutional layer in each tower to capture local patterns in the input sequence.
[0110] 4. Global Max Pooling 1D: It is used to perform global max pooling on the output of the convolutional layer to extract the most important features and reduce the data dimension.
[0111] 5. Fully connected layer: used to further process features after the pooling layer and learn the nonlinear relationship between features.
[0112] 6. Stitching layer: used to stitch the features output by the dual-tower structure and integrate the features from the diagnostic instrument and ECU identification.
[0113] 7. Attention Mechanism (MultiHeadAttention): Used to capture the dynamic correlation between splicing features using the multi-head attention mechanism and enhance attention to key features.
[0114] 8. Global Average Pooling: It is used to perform global average pooling on the output of the attention mechanism to further reduce the dimension and integrate features.
[0115] 9. Second splicing layer: used to splice the processed features with interact_input to integrate multimodal features.
[0116] 10. Subsequent fully connected layers, batch normalization layers, and dropout layers: used to further process features through the fully connected layers. The batch normalization layer is used to accelerate training and stabilize the model. The dropout layer is used to prevent overfitting.
[0117] 11. Output layer: used to output the prediction results through the fully connected layer. An activation function (such as the sigmoid activation function) is used to limit the output value to between 0 and 1, indicating the probability of the pairwise relationship.
[0118] It is important to understand that Figure 2-2 The fully connected layers and Conv1D convolutional layers that do not have activation functions marked in the figure all use relu as the activation function.
[0119] Again, in an embodiment of the present application, a method is provided for obtaining a second spliced feature (comprehensive feature) by splicing multiple types of features (such as raw bytes, local features, dynamic association features, protocol rule features, and numerical association features). By splicing multiple types of features (such as raw bytes, local features, dynamic association features, protocol rule features, and numerical association features), a comprehensive feature space is formed. This fusion method helps to capture the complex association relationships between CAN IDs and improve the model's ability to recognize paired relationships. Secondly, combining features of different levels and types can more accurately describe the relationship between CAN IDs, thereby improving the recognition accuracy of the model. Furthermore, multimodal feature fusion enables the model to adapt to different types of vehicle network communication data, improving the generalization ability and adaptability of the model. Therefore, the accuracy of paired relationship recognition model training is further improved, thereby further improving the accuracy of paired relationship recognition.
[0120] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, the loss function for calculating the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result may be a hybrid loss function.
[0121] Specifically, during model training, the loss function is used to measure the difference between the model's predictions and the true labeled results. The hybrid loss function combines two different loss functions: cross-entropy loss and contrastive loss. Cross-entropy loss (ce_loss) is used to measure the difference between the model's predicted probability distribution and the true label distribution in classification problems. Contrast loss (contrast_loss) is used to measure the model's ability to distinguish between similar and dissimilar samples. The loss function uses a hybrid loss function: cross-entropy + contrastive loss, calculated as: alpha*ce_loss+(1-alpha)*contrast_loss, where ce_loss is the cross-entropy loss; contrast_loss is the contrastive loss; alpha is a hyperparameter used to control the weights of cross-entropy loss and contrastive loss. Alpha is recommended but not limited to 0.7. Using a hybrid loss function to comprehensively consider classification accuracy and sample discrimination can more comprehensively evaluate the performance of the model. During model training, the optimizer can use stochastic gradient descent (SDG) or its derivatives, such as momentum, adaptive learning rate optimization (AdaGrad or RMSProp), or the Adam algorithm. There are no restrictions here, but the Adam algorithm is recommended because it generally provides better convergence speed and performance.
[0122] Optionally, in the above Figure 2 On the basis of one or more corresponding embodiments, in another optional embodiment provided by the embodiments of the present application, after obtaining the trained pairwise relationship recognition model, further processing based on the validation set and the test set is required to obtain the developed pairwise relationship recognition model.
[0123] For details, please refer to Figure 2-2 , Figure 2-2 This is a flow chart of a method for developing a pairwise relationship recognition model disclosed in an embodiment of the present application, which consists of Figure 2-2 As you can see, the entire model development process includes data preprocessing and the use of training, validation, and test sets to train, validate, and evaluate the model. The validation set is used to detect overfitting and adjust hyperparameters, while the test set is used to ultimately evaluate model performance. This process more comprehensively describes how to go from data preprocessing to ultimately producing a practical model.
[0124] based on Figure 1 The paired relationship recognition model training system of the vehicle network identifier shown in the following will introduce the paired relationship recognition model training method of the vehicle network identifier in this application. Figure 3 The method for identifying paired relationships of vehicle network identifiers in an embodiment of the present application includes:
[0125] 301. Acquire multiple target identifiers of the vehicle network, the multiple target identifiers including a first target identifier of the diagnostic instrument, a second target identifier of the response electronic control unit, protocol rule association relationship characteristics and numerical association relationship characteristics of the byte sequence between the first target identifier and the second target identifier, and the first target identifier and the second target identifier are marked with corresponding paired identifier recognition results.
[0126] In one or more embodiments, the protocol rule association feature is used to characterize whether two identifiers (a first target identifier sample and a second target identifier sample) comply with specific protocol rules, such as whether the first four bytes are identical, whether the last two bytes are in reverse order, etc. The numerical value association feature is used to characterize the similarity or difference between the two identifiers in terms of numerical value, such as difference, XOR value, Hamming distance, etc.
[0127] 302. Input multiple target identifiers into the paired relationship recognition model as claimed in any one of claims 1 to 8, obtain the dynamic association characteristics between the first target identifier and the second target identifier by the paired relationship recognition model, and obtain the predicted paired relationship recognition results corresponding to the multiple target identifiers output by the paired relationship recognition model based on the determination result of whether the dynamic association characteristics, the protocol rule association relationship characteristics and the numerical association relationship characteristics meet the preset feature pattern.
[0128] In one or more embodiments, dynamic correlation features are used to characterize the key features that are dynamically focused on between two identifiers (a first target identifier sample and a second target identifier sample) during model execution. These features can be generated by an attention mechanism and can enhance the ability to recognize complex patterns.
[0129] In an embodiment of the present application, a method for identifying paired relationships of vehicle network identifiers is provided. This method identifies paired relationships of vehicle network identifiers by comprehensively analyzing dynamic association features, protocol rule association features, and numerical association features to determine whether they meet a preset feature pattern. This method utilizes comprehensive multimodal features for automated model discrimination, avoiding the errors and significant labor costs associated with manual pre-recording. Consequently, it improves the accuracy and efficiency of identifying paired relationships of vehicle network identifiers.
[0130] The following is a detailed description of the paired relationship recognition model training device for vehicle network identifiers in this application. Figure 4 , Figure 4 This is a schematic diagram of an embodiment of a model training device (paired relationship recognition model training device for vehicle network identifiers) disclosed in an embodiment of the present application. The paired relationship recognition model training device for vehicle network identifiers includes:
[0131] an acquisition unit configured to acquire a plurality of target identification samples from an in-vehicle network, the plurality of target identification samples including a first target identification sample of a diagnostic instrument, a second target identification sample of a response electronic control unit, and a protocol rule association relationship feature and a numerical association relationship feature of a byte sequence between the first target identification sample and the second target identification sample, the first target identification sample and the second target identification sample being annotated with corresponding paired identification recognition results;
[0132] a determination unit, configured to input a plurality of target identification samples into a pairwise relationship recognition model, obtain a dynamic association feature between a first target identification sample and a second target identification sample by the pairwise relationship recognition model, and obtain predicted pairwise relationship recognition results corresponding to the plurality of target identification samples output by the pairwise relationship recognition model based on a determination result of whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern;
[0133] The acquisition unit is also used to obtain a trained pairwise relationship recognition model when the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets the convergence condition.
[0134] Optionally, in the above Figure 4 On the basis of the corresponding embodiment, in another embodiment of the training device for the paired relationship recognition model of the vehicle network identifier provided by the embodiment of the present application, the paired relationship recognition model includes a target feature extraction model based on the attention mechanism, and a target feature analysis model;
[0135] The determination unit is specifically used to generate dynamic association features based on the first target identification sample and the second target identification sample by the target feature extraction model based on the attention mechanism, and obtain the predicted pairwise relationship recognition result based on the determination result of whether the dynamic association features, protocol rule association relationship features and numerical association relationship features meet the preset feature pattern by the target feature analysis model.
[0136] Optionally, in the above Figure 4 On the basis of the corresponding embodiment, in another embodiment of the vehicle network identifier pairwise relationship recognition model training device provided by the embodiment of the present application,
[0137] The determination unit is specifically used to generate dynamic association features based on the first splicing features between the local features of the first target identification sample and the second target identification sample by the target feature extraction model based on the attention mechanism, and obtain the predicted pairwise relationship recognition result based on the determination result of whether the second splicing features between the dynamic association features, the protocol rule association relationship features and the numerical association relationship features meet the preset feature pattern by the target feature analysis model.
[0138] Optionally, in the above Figure 4On the basis of the corresponding embodiment, in another embodiment of the training device for the paired relationship recognition model of the vehicle network identifier provided by the embodiment of the present application, the feature extraction model based on the attention mechanism includes a first feature extraction module for the diagnostic instrument identifier, a second feature extraction module for the response ECU end identifier, a first splicing submodule and an attention mechanism;
[0139] The determination unit is specifically used to use the first feature extraction module to obtain the first local feature of the first target identification sample, and use the second feature extraction module to obtain the second local feature of the second target identification sample, use the first splicing submodule to splice the first local feature and the second local feature to obtain a first splicing feature, and use the attention mechanism to generate a dynamic correlation feature based on the first splicing feature.
[0140] Optionally, in the above Figure 4 On the basis of the corresponding embodiment, in another embodiment of the training device for the paired relationship recognition model of the vehicle network identifier provided by the embodiment of the present application, the target feature analysis model includes a second feature splicing module and a feature analysis module;
[0141] The determination unit is specifically used to use the second feature splicing module to splice the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature to obtain a second splicing feature, and use the feature analysis module to determine whether the second splicing feature meets the preset feature pattern to obtain a predicted pairwise relationship recognition result.
[0142] Optionally, in the above Figure 4 On the basis of the corresponding embodiment, in another embodiment of the vehicle network identifier pairwise relationship recognition model training device provided by the embodiment of the present application,
[0143] The determination unit is specifically used to use the second feature splicing module to splice the first target identification sample, the second target identification sample, the local features of the first target identification sample, the local features of the second target identification sample, the dynamic association features, the protocol rule association relationship features and the numerical association relationship features to obtain the second splicing feature.
[0144] Optionally, in the above Figure 4 On the basis of the corresponding embodiment, in another embodiment of the vehicle network identifier pairwise relationship recognition model training device provided by the embodiment of the present application,
[0145] An acquisition unit is specifically used to acquire multiple initial identification samples of the vehicle network, the multiple initial identification samples including a first initial identification sample of the diagnostic instrument and a second initial identification sample of the response electronic control unit, byte padding and normalization of the numerical value and byte length value of the first initial identification sample to obtain a first target identification sample, and byte padding and normalization of the numerical value and byte length value of the second initial identification sample to obtain a second target identification sample, and based on the byte sequence characteristics between the first initial identification sample and the second initial identification sample, determine the numerical association relationship characteristics and the protocol rule association relationship characteristics.
[0146] Optionally, in the above Figure 4 On the basis of the corresponding embodiment, in another embodiment of the vehicle network identifier pairwise relationship recognition model training device provided by the embodiment of the present application,
[0147] The acquisition unit is specifically used to calculate the difference, XOR value and / or Hamming distance between the first initial identification sample and the second initial identification sample byte by byte to obtain a numerical association relationship feature, and based on the first N bytes between the first initial identification sample and the second initial identification sample being identical and / or the last M bytes being in reverse order, obtain a protocol rule association relationship feature.
[0148] The following is a detailed description of the paired relationship recognition model training device for vehicle network identifiers in this application. Figure 5 , Figure 5 This is a schematic diagram of an embodiment of a data processing device (vehicle network identifier pairing relationship identification device) disclosed in an embodiment of the present application. The vehicle network identifier pairing relationship identification device includes:
[0149] an acquisition unit, configured to acquire a plurality of target identifiers of the vehicle network, the plurality of target identifiers including a first target identifier of the diagnostic instrument, a second target identifier of the response electronic control unit, a protocol rule association relationship feature and a numerical association relationship feature of a byte sequence between the first target identifier and the second target identifier, the first target identifier and the second target identifier being annotated with corresponding paired identifier recognition results;
[0150] A determination unit is used to input multiple target identifiers into a paired relationship recognition model as claimed in any one of claims 1 to 8, obtain dynamic association features between the first target identifier and the second target identifier from the paired relationship recognition model, and obtain predicted paired relationship recognition results corresponding to the multiple target identifiers output by the paired relationship recognition model based on the determination results of whether the dynamic association features, protocol rule association relationship features and numerical association relationship features meet the preset feature patterns.
[0151] See below Figure 6 In one embodiment of the present application, a computer device 600 includes:
[0152] CPU 601, memory 605, input / output interface 604, wired or wireless network interface 603 and power supply 602;
[0153] The memory 605 is a temporary storage memory or a permanent storage memory;
[0154] The CPU 601 is configured to communicate with the memory 605 and execute the instructions in the memory 605 to perform the aforementioned Figure 2 、 Figure 3 The method in the embodiment shown.
[0155] The embodiment of the present application also provides a computer-readable storage medium, which includes instructions. When the instructions are executed on a computer, the computer executes the aforementioned Figure 2 、 Figure 3 The method in the embodiment shown.
[0156] The present application also provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the aforementioned Figure 2 、 Figure 3 The method in the embodiment shown.
[0157] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0158] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0159] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0160] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0161] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A model training method, characterized in that: include: Acquire multiple target identification samples from the vehicle network, the multiple target identification samples including a first target identification sample of the diagnostic instrument, a second target identification sample of the response electronic control unit, and a protocol rule association relationship feature and a numerical association relationship feature of byte sequences between the first target identification sample and the second target identification sample, the first target identification sample and the second target identification sample being annotated with corresponding paired identification recognition results; Inputting the multiple target identification samples into a pairwise relationship recognition model, obtaining a dynamic association feature between the first target identification sample and the second target identification sample by the pairwise relationship recognition model, and obtaining predicted pairwise relationship recognition results corresponding to the multiple target identification samples output by the pairwise relationship recognition model based on a determination result of whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern; When the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets the convergence condition, a trained pairwise relationship recognition model is obtained.
2. The method according to claim 1, characterized in that The pairwise relationship recognition model includes a target feature extraction model based on an attention mechanism and a target feature analysis model; The step of acquiring the dynamic association feature between the first target identification sample and the second target identification sample by the pairwise relationship recognition model, and obtaining the predicted pairwise relationship recognition result based on a determination result of whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern, includes: The target feature extraction model based on the attention mechanism generates the dynamic association feature based on the first target identification sample and the second target identification sample; The predicted paired relationship recognition result is obtained by the target feature analysis model based on the determination result of whether the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature meet the preset feature pattern.
3. The method according to claim 2, characterized in that The generating of the dynamic association feature by the target feature extraction model based on the attention mechanism based on the first target identification sample and the second target identification sample includes: The target feature extraction model based on the attention mechanism generates the dynamic association feature based on a first splicing feature between the local features of the first target identification sample and the second target identification sample; The target feature analysis model determines whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern to obtain the predicted pairwise relationship recognition result, including: The predicted pairwise relationship recognition result is obtained by the target feature analysis model based on a determination result of whether a second splicing feature between the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature meets a preset feature pattern.
4. The method according to claim 3, characterized in that The feature extraction model based on the attention mechanism includes a first feature extraction module for the diagnostic instrument identification, a second feature extraction module for the response ECU end identification, a first splicing submodule and an attention mechanism; The generating of the dynamic association feature by the target feature extraction model based on the attention mechanism based on the first splicing feature between the local features of the first target identification sample and the second target identification sample includes: Using the first feature extraction module to obtain a first local feature of the first target identification sample, and using the second feature extraction module to obtain a second local feature of the second target identification sample; Using the first splicing submodule to splice the first local feature and the second local feature to obtain the first splicing feature; The dynamic association feature is generated based on the first splicing feature using the attention mechanism.
5. The method according to claim 3, characterized in that The target feature analysis model includes a second feature splicing module and a feature analysis module; The predicted pairwise relationship recognition result is obtained by the target feature analysis model based on a determination result of whether a second splicing feature between the dynamic association feature, the protocol rule association relationship feature, and the numerical association relationship feature satisfies a preset feature pattern, including: Using the second feature splicing module to splice the dynamic association feature, the protocol rule association relationship feature, and the numerical association relationship feature to obtain the second splicing feature; The predicted pairwise relationship recognition result is obtained by utilizing the feature analysis module based on a determination result of whether the second splicing feature satisfies a preset feature pattern.
6. The method according to claim 5, characterized in that The step of using the second feature splicing module to splice the dynamic association feature, the protocol rule association relationship feature, and the numerical association relationship feature to obtain the second splicing feature includes: The second feature splicing module is used to splice the first target identification sample, the second target identification sample, the local feature of the first target identification sample, the local feature of the second target identification sample, the dynamic association feature, the protocol rule association relationship feature and the numerical association relationship feature to obtain the second splicing feature.
7. A data processing method, characterized in that: include: Acquire multiple target identifiers of the vehicle network, the multiple target identifiers including a first target identifier of the diagnostic instrument, a second target identifier of the response electronic control unit, a protocol rule association relationship feature of a byte sequence and a numerical association relationship feature between the first target identifier and the second target identifier, the first target identifier and the second target identifier being annotated with corresponding paired identifier recognition results; The multiple target identifiers are input into the paired relationship recognition model as described in any one of claims 1 to 6, and the paired relationship recognition model obtains the dynamic association characteristics between the first target identifier and the second target identifier, and based on the determination result of whether the dynamic association characteristics, the protocol rule association relationship characteristics and the numerical association relationship characteristics meet the preset feature pattern, the predicted paired relationship recognition results corresponding to the multiple target identifiers output by the paired relationship recognition model are obtained.
8. A model training device, characterized in that: include: an acquisition unit configured to acquire a plurality of target identification samples from an in-vehicle network, the plurality of target identification samples comprising a first target identification sample of a diagnostic instrument, a second target identification sample of a response electronic control unit, and a protocol rule association relationship feature and a numerical association relationship feature of a byte sequence between the first target identification sample and the second target identification sample, the first target identification sample and the second target identification sample being annotated with corresponding paired identification recognition results; a determination unit, configured to input the plurality of target identification samples into a pairwise relationship recognition model, obtain a dynamic association feature between the first target identification sample and the second target identification sample by the pairwise relationship recognition model, and obtain predicted pairwise relationship recognition results corresponding to the plurality of target identification samples output by the pairwise relationship recognition model based on a determination result of whether the dynamic association feature, the protocol rule association feature, and the numerical association feature satisfy a preset feature pattern; The acquisition unit is further configured to obtain a trained pairwise relationship recognition model when the loss between the predicted pairwise relationship recognition result and the labeled pairwise relationship recognition result meets a convergence condition.
9. A computer device, characterized in that: include: central processing unit and memory; The memory is a transient storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method according to any one of claims 1 to 6 or claim 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium includes instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 6 or claim 7.