Vehicle gateway controller testing method, testing device and vehicle testing system
Patent Information
- Application Number
- CN202611096042.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2046-07-22
AI Technical Summary
The existing automated testing of automotive gateway controllers relies on manual selection of test cases, which leads to low efficiency, insufficient coverage, difficulty in controlling complexity, and inability to test entirely new gateway controllers that do not exist in the database. The testing costs are high and the cycle is long.
By acquiring the text content of the gateway controller of the vehicle under test, generating initial feature representations using a pre-trained language model, constructing a controller information association network, calculating edge weights, using a neural network model to recommend the order of test cases, and performing self-checking operations, automated testing is achieved.
It improves the testing accuracy and efficiency of the new vehicle gateway controller, solves the problems of low efficiency and insufficient coverage of traditional testing methods, and can complete targeted automated testing with high accuracy.
Smart Images

Figure CN122613953B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of controller testing technology, and in particular to a vehicle gateway controller testing method, testing device, and vehicle testing system. Background Technology
[0002] The automotive gateway controller is the core hub of the automotive electronic and electrical architecture. It integrates and converts signals from different protocols such as CAN and LIN to enable data communication between various electronic control units (ECUs) such as the body, chassis, powertrain, and intelligent driving systems, solving the "information silo" problem in the traditional distributed architecture. At the same time, it undertakes key tasks such as information security protection (e.g., data encryption, intrusion detection), OTA remote upgrade (pushing ECU firmware updates), and domain control (centralized management of a functional domain such as the chassis domain).
[0003] Currently, automated testing of automotive gateway controllers mainly relies on manual selection of test cases. This method heavily depends on the experience of the personnel and suffers from problems such as low efficiency, insufficient coverage, difficulty in controlling complexity, and low execution efficiency, resulting in high testing costs and long testing cycles for gateway controllers. Furthermore, existing automated testing methods struggle with testing gateway controllers not present in the test database, and may also result in insufficient test case coverage. Summary of the Invention
[0004] This disclosure provides a vehicle gateway controller testing method, testing device, and vehicle testing system, which can improve the testing accuracy of brand-new vehicle gateway controllers under test.
[0005] The first aspect of this disclosure provides a method for testing a vehicle gateway controller, including: Obtain the text content of the gateway controller of the vehicle under test. The text content includes at least one of the following: manufacturer, interface definition, test requirements, functional requirements, hardware parameters and network communication requirements. Perform natural language pre-training on the text content through a pre-trained language model to obtain the initial feature representation of the gateway controller of the vehicle under test. The similarity between different vehicle gateway controllers is calculated based on the initial feature representation and the feature representation of vehicle gateway controllers in the database. Based on the similarity, a controller information association network is constructed with the vehicle gateway controller under test as nodes and information association relationships as edges. Based on the relationship between the vehicle under test gateway controller and the test cases, the relevant factors between the two are obtained. The relevant factors include at least one of failure probability, failure impact and development change impact. The edge weight between the vehicle under test gateway controller and the test cases is calculated using the time count decay method based on the relevant factors. The recommended order of test cases is obtained by using a neural network model to associate the network and edge weights based on the controller information, and the test cases are executed sequentially according to the recommended order.
[0006] In some embodiments, the pre-trained language model includes the BERT model.
[0007] In some embodiments, the initial feature representation includes a first controller vector, and the feature representation of the vehicle gateway controller in the database includes a second controller vector. Calculating the similarity between different vehicle gateway controllers based on the initial feature representation and the feature representation of the vehicle gateway controller in the database includes: The cosine similarity between the vehicle gateway controller under test and all vehicle gateway controllers in the database is calculated based on the first controller vector and the second controller vector. If the cosine similarity is greater than a preset threshold, it is determined that there is an information association between the vehicle gateway controller under test and the vehicle gateway controllers in the database.
[0008] In some embodiments, the controller information association network is constructed as Y=(A, E), where Y represents the controller information association network, A represents the set of all vehicle gateway controllers input to the system, and E represents the information association between the vehicle gateway controller under test and the vehicle gateway controllers in the database, with a value of 1 or 0.
[0009] In some embodiments, The likelihood of failure is determined based on historical failure probability and scenario coverage. Historical failure probability is the ratio of the number of test case failures to the total number of executions within a preset time period. Scenario coverage is the score obtained by the test case based on the test case scenario coverage table; and / or The impact of a failure is determined based on the failure risk level and functional priority. The failure risk level is set according to the level of failure caused by the test case function, and the functional priority is set according to the priority of the test case function in the product requirements document; and / or The impact of development changes is determined by the number of modules associated with the test cases.
[0010] In some embodiments, calculating the edge weights between the vehicle under test gateway controller and test cases using a time-decay method based on relevant factors includes: The test case weights are calculated based on the number of times the test cases are used and then normalized. The edge weights are calculated based on the normalized test case weights and related factors.
[0011] In some embodiments, the initial feature representation includes a first controller vector, and the recommended order of test cases is obtained by a neural network model based on the controller information, network association, and edge weights, including: The domain relationships of the controller information association network are aggregated by a graph neural network based on the controller information association network. The information between the gateway controller of the vehicle under test and the test cases is obtained by a variational graph autoencoder based on the edge weights, and the test case vector is obtained. The recommended order of test cases is obtained by performing a dot product operation on the first controller vector and the test case vector.
[0012] In some embodiments, the method further includes, before obtaining the recommended order of test cases by calculating the dot product of the first controller vector and the test case vector: The training structure of the graph neural network and variational graph autoencoder is optimized by a joint loss function, which includes network structure loss and ranking structure loss.
[0013] In some embodiments, the test cases are executed sequentially according to the recommended order, and the following steps are included before: Perform a self-test operation on the gateway controller of the vehicle under test. The self-test of the gateway controller of the vehicle under test includes at least one of the following: message sending status detection, sleep status detection, implicit voltage value rationality detection, and terminal resistance consistency detection. Perform a self-test on the test equipment. The self-test of the test equipment includes at least one of the following: digital multimeter status test, oscilloscope status test, power supply status test, and bipolar power supply status test.
[0014] In some embodiments, obtaining the text content of the gateway controller of the vehicle under test includes: Obtain the test-related documents of the gateway controller of the vehicle under test. The test-related documents include at least one of the following: technical specifications, communication protocol, functional requirements, and test requirements. Extract the text content of the gateway controller of the vehicle under test using a programming language.
[0015] A second aspect of this disclosure provides a vehicle gateway controller testing apparatus, comprising: Memory; and A processor coupled to a memory, configured to execute instructions stored in the memory, in some embodiments, includes the vehicle gateway controller test apparatus of the above embodiments.
[0016] This disclosure provides a third aspect of a vehicle testing system, including the vehicle gateway controller testing device described in the above embodiments.
[0017] The vehicle gateway controller testing method disclosed in this embodiment can solve the problems of low efficiency, insufficient coverage, difficulty in controlling complexity, and low execution efficiency caused by the reliance on manual selection of test cases in traditional vehicle gateway controller testing. It also addresses the issues of being unable to test entirely new gateway controllers not present in the test database and insufficient test case coverage. The testing method captures the connections between controllers by constructing a controller information association network, which enriches feature representation and provides recommended test cases quickly and accurately for entirely new vehicle gateway controllers, improving the accuracy and efficiency of new controller testing recommendations. Furthermore, the testing method adjusts the order of test cases according to different vehicle gateway controllers, enabling targeted and efficient automated testing. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this disclosure and form part of this application, illustrate exemplary embodiments of this disclosure and are used to explain this disclosure, but do not constitute an undue limitation of this disclosure.
[0019] Figure 1 This is a flowchart illustrating some embodiments of the vehicle gateway controller testing method disclosed herein.
[0020] Figure 2 The present invention provides a logic block diagram of some embodiments of the vehicle gateway controller testing method.
[0021] Figure 3 This is a schematic diagram illustrating the composition of some embodiments of the vehicle gateway controller test apparatus disclosed herein. Detailed Implementation
[0022] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. The descriptions of the exemplary embodiments are merely illustrative and are in no way intended to limit the present disclosure or its application or use. The present disclosure may be implemented in many different forms and is not limited to the embodiments described herein. These embodiments are provided so that the present disclosure will be thorough and complete, and will fully express the scope of the disclosure to those skilled in the art. It should be noted that, unless specifically stated otherwise, the relative arrangement of components and steps, the composition of materials, numerical expressions, and values set forth in these embodiments should be interpreted as exemplary only and not as limiting.
[0023] The terms "first," "second," and similar words used in this disclosure do not indicate any order, quantity, or importance, but are merely used to distinguish different parts. Words such as "including" or "contains" mean that the element preceding the word encompasses the element listed after it, and do not exclude the possibility of encompassing other elements as well. Terms such as "above," "below," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, this relative positional relationship may also change accordingly.
[0024] In this disclosure, when a specific device is described as being located between a first device and a second device, an intermediary device may or may not be present between the specific device and the first or second device. When a specific device is described as being connected to other devices, the specific device may be directly connected to the other devices without an intermediary device, or it may be not directly connected to the other devices but have an intermediary device.
[0025] All terms used in this disclosure (including technical or scientific terms) have the same meaning as understood by one of ordinary skill in the art to which this disclosure pertains, unless otherwise specifically defined. It should also be understood that terms defined in a general dictionary, such as a dictionary, should be interpreted as having a meaning consistent with their meaning in the context of the relevant art, and not as having an idealized or highly formalized meaning, unless expressly defined herein.
[0026] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.
[0027] Based on the embodiments disclosed above, in the absence of explicit denial or conflict, the technical features of one embodiment may be advantageously combined with one or more other embodiments.
[0028] First, this disclosure proposes a test method for a vehicle gateway controller, such as... Figure 1 As shown, it includes: S1. Obtain the text content of the gateway controller of the vehicle under test. The text content includes at least one of the following: manufacturer, interface definition, test requirements, functional requirements, hardware parameters and network communication requirements. Perform natural language pre-training on the text content through a pre-trained language model to obtain the initial feature representation of the gateway controller of the vehicle under test. S2. Calculate the similarity between different vehicle gateway controllers based on the initial feature representation and the feature representation of the vehicle gateway controller in the database. Construct a controller information association network with the vehicle gateway controller under test as nodes and information association relationships as edges based on the similarity. S3. Based on the relationship between the gateway controller of the vehicle under test and the test cases, obtain the relevant factors between them. The relevant factors include at least one of failure probability, failure impact and development change impact. Calculate the edge weight between the gateway controller of the vehicle under test and the test cases using the time decay method based on the relevant factors. S4 (S41) Obtain the recommended order of test cases by associating the network and edge weights based on the controller information through a neural network model; S4 (S43) Execute the test cases in the recommended order.
[0029] Steps S1-S4 are executed sequentially to automate the testing of vehicle gateway controllers for various types of vehicles. This testing method is particularly suitable for situations where the gateway controller under test is not in the database and has not been tested before, i.e., the gateway controller under test is a brand new gateway controller, and it can address the issue of low testing accuracy for brand new gateway controllers under test. Step S1 can be referred to as the feature preprocessing step, step S2 as the controller information association network construction step, step S3 as the time-frequency decay network edge generation step, and step S4 as the test case recommendation and test execution step. Step S4 may also include a controller and test equipment self-test step S42, i.e., performing a self-test operation on the vehicle gateway controller and test equipment.
[0030] Interface definitions can be external physical connection ports such as serial ports; testing requirements can be stability requirements and other testing standards that the product must meet before leaving the factory and being used in the field; functional requirements represent the functions of the vehicle gateway controller, for example, some gateways only forward packets, while others also reassemble packets; hardware parameters can be its own hardware configuration, size, power supply, temperature resistance and other physical hardware indicators; network communication requirements can be networking rules, transmission standards, security requirements, etc., such as a packet loss rate of less than 0.1%.
[0031] The edge weights between the vehicle under test gateway controller and the test cases are calculated using the time-decay method based on relevant factors. The purpose is to make the vehicle under test gateway controller closer to more suitable test cases and further away from test cases that are not closely related.
[0032] The vehicle gateway controller testing method obtains the text content of the vehicle gateway controller under test and uses a pre-trained language model for natural language pre-training to obtain initial feature representations. Based on the initial feature representations and the feature representations of vehicle gateway controllers in the database, the similarity between different vehicle gateway controllers is calculated, and a controller information association network is constructed with controllers as nodes and information association relationships as edges. At the same time, relevant factors such as failure probability, failure impact, and development modification impact are obtained, and the edge weights are calculated using the time decay method. Finally, the recommended order of test cases is obtained through a neural network model, and the tests are automatically executed sequentially.
[0033] The testing method described in this embodiment addresses the problems of inefficiency, insufficient coverage, difficulty in controlling complexity, and low execution efficiency caused by the reliance on manual test case selection in traditional vehicle gateway controller testing. It also solves the problems of being unable to test entirely new gateway controllers not present in the test database and insufficient test case coverage. By constructing a controller information association network to capture the connections between controllers, the method enriches feature representation and provides recommended test cases quickly and accurately for entirely new vehicle gateway controllers, improving the accuracy and efficiency of new controller testing recommendations. Furthermore, by adjusting the test case order according to different vehicle gateway controllers, the method can efficiently and effectively complete automated testing in a targeted manner.
[0034] Optionally, the text content may also include the communication protocol version number or diagnostic service identifier, etc.
[0035] In some embodiments, the pre-trained language model includes the BERT model.
[0036] BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model based on the Transformer encoder, capable of bidirectional contextual understanding. Optionally, the pre-trained language model can be an optimized model based on the BERT architecture, such as the RoBERTa or ALBERT model, for example, the albbert-base-v2 model. Pre-training a BERT model can output a fixed-length first controller vector.
[0037] This embodiment uses the BERT model as a pre-trained language model to process natural language. By pre-training, it captures the text information of the gateway controller and generates a fixed-length vector as the initial feature representation of the controller. Compared with traditional text representation methods such as the bag-of-words model, the BERT model can understand the contextual semantics, has stronger representation capabilities, and has a unified output format that facilitates subsequent cosine similarity calculation and graph neural network processing, thereby improving the testing efficiency and accuracy of the vehicle gateway controller.
[0038] In some embodiments, the initial feature representation includes a first controller vector, and the feature representation of the vehicle gateway controller in the database includes a second controller vector. Calculating the similarity between different vehicle gateway controllers based on the initial feature representation and the feature representation of the vehicle gateway controller in the database includes: The cosine similarity between the vehicle gateway controller under test and all vehicle gateway controllers in the database is calculated based on the first controller vector and the second controller vector. If the cosine similarity is greater than a preset threshold, it is determined that there is an information association between the vehicle gateway controller under test and the vehicle gateway controllers in the database.
[0039] The lengths of the first and second controller vectors can be 128 dimensions, etc. The preset threshold can be set as needed; for example, a value greater than 0.8 represents a highly similar filtering condition, while a value between 0.6 and 0.8 represents a fairly similar filtering condition.
[0040] The testing method of this embodiment is simple and quick to calculate similarity, can quickly process a large number of controller samples, and can accurately construct a controller information association network by setting a preset threshold, thereby improving the testing accuracy of the gateway controller of the vehicle under test.
[0041] In some embodiments, the controller information association network is constructed as Y = (A, E), where Y represents the controller information association network, A represents the set of all vehicle gateway controllers input to the system, A includes vehicle gateway controllers in the database and new vehicle gateway controllers under test, and E represents the information association between the vehicle gateway controller under test and the vehicle gateway controllers in the database, with a value of 1 or 0.
[0042] The controller information association network in this embodiment is stored as a binary network in the form of an adjacency matrix. The representation structure is clear, which is convenient for computer storage and operation. It can be directly used as the input of the graph neural network. The binary network can reduce the model complexity and make training more stable and efficient.
[0043] In some embodiments, The likelihood of failure is determined based on historical failure probability and scenario coverage. Historical failure probability is the ratio of the number of test case failures to the total number of executions within a preset time period. Scenario coverage is the score obtained by the test case based on the test case scenario coverage table; and / or The impact of a failure is determined based on the failure risk level and functional priority. The failure risk level is set according to the level of failure caused by the test case function, and the functional priority is set according to the priority of the test case function in the product requirements document; and / or The impact of development changes is determined by the number of modules associated with the test cases.
[0044] The preset time period for historical failure probability can be set to the past 3 months, the past 5 months, or the past 12 months, etc. Scenario coverage refers to the coverage of the function tested by this test case in the actual communication process of this model of controller. It is calculated based on the test case scenario coverage table: Scenario coverage = Number of scenarios covered by the test case / Total number of scenarios of this function in the actual communication of the controller.
[0045] A test case scenario coverage table can be written based on experience. The score for each test case is fixed according to the scenario. For example, the actual communication scenarios for the Unified Diagnostic Services (UDS) read function may include normal reading of valid Data Identifiers (DIDs), requesting to read DIDs not supported by the system, read attempts in a secure access state where the device is not unlocked, abnormal request message length, response timeout, and long response requiring multiple frame transmissions. The total number of scenarios is six. If the test cases cover the first, second, third, and sixth scenarios, then the scenario coverage = 4 / 6. Historical failure probability and scenario coverage can each account for 50% of the failure probability.
[0046] The failure risk level is primarily set based on the level of failure caused by the test case's functionality. For example, a level 3 to level 1 failure level can be used, with higher levels indicating higher risk. If a test case fails, the highest possible failure level is used. For instance, a failure to detect gateway message transmission and reception consistency in a test case might lead to a level 3 failure, causing the gateway to malfunction and the vehicle to stall. A failure to detect LIN bus slave node communication failure in a test case might cause communication timeouts in LIN slave modules (such as rearview mirrors and light sensors), but it wouldn't affect the powertrain, resulting in a level 2 failure. A failure to forward fan switch messages in a test case might lead to a level 1 failure, causing the fan to stop operating.
[0047] Functional priorities are primarily determined based on the priority of test case functions in the product requirements document. For example, functional priorities can be divided into five levels, from highest to lowest: P0 (mandatory), P1 (important), P2 (moderate), P3 (low), and P4 (optional), with corresponding numerical values of 5, 4, 3, 2, and 1.
[0048] For example, the test case controller self-test corresponds to the self-test function, marked as P0 in the product requirements document, with a corresponding function priority of 5; the test case UDS diagnostic service corresponds to the diagnostic function of supporting the reading of fault codes, DID data, ECU information, etc., marked as P1 in the product requirements document, with a corresponding function priority of 4. This means it must be available in the production and after-sales stages, but does not affect the basic operation of the controller; the test case fault log recording corresponds to recording the occurrence of fault events to the internal Flash, marked as P2 in the requirements document, with a corresponding function priority of 3. This means it helps in problem tracing, but does not affect the basic functions of the controller; the test case sunlight and rainfall sensor LIN communication corresponds to the function related to sunlight and rainfall data acquisition, marked as P3 in the requirements document, with a corresponding function priority of 2. This means it belongs to the display-type auxiliary function and has a low priority; the test case extended debugging interface corresponds to the reserved additional debugging commands or special modes, marked as P4 in the requirements document, with a corresponding function priority of 1. This means it is only used in specific development or testing stages and can be implemented later.
[0049] The testing method in this embodiment further defines the determination methods for failure probability, failure impact, and development modification impact. Each relevant factor is given a clear quantitative basis, which facilitates operation and execution. It can comprehensively evaluate the correlation between test cases and controllers from three dimensions: failure probability, failure consequences, and modification costs, thereby improving the practicality of recommended test cases.
[0050] In some embodiments, calculating the edge weights between the vehicle under test gateway controller and test cases using a time-decay method based on relevant factors includes: The test case weights are calculated based on the number of times the test cases are used and then normalized. The edge weights are calculated based on the normalized test case weights and related factors.
[0051] Edge weights allow the gateway controller of the vehicle under test to be closer to the most suitable test cases and further away from edges that are less relevant.
[0052] The testing method in this embodiment makes more recent test records have a greater impact on the current association strength, while older records have a smaller impact. This avoids inaccurate recommendations due to outdated historical data. At the same time, normalization processing can prevent the weight of repeatedly used test cases from being excessively amplified, thereby making the recommendation order of test cases more balanced and reasonable.
[0053] In some embodiments, the recommended order for obtaining test cases by using a neural network model to associate the network and edge weights based on controller information includes: The domain relationships of the controller information association network are aggregated by a graph neural network based on the controller information association network. The information between the gateway controller of the vehicle under test and the test cases is obtained by a variational graph autoencoder based on the edge weights, and the test case vector is obtained. The recommended order of test cases is obtained by performing a dot product operation on the first controller vector and the test case vector.
[0054] The domain relationships of the controller information association network are aggregated by a graph neural network based on the controller information association network. The network is trained by inputting network information through a graph convolutional network.
[0055] The testing method in this embodiment is trained using graph learning, which enables the controller's representation to integrate information from other controllers in the associated network to enrich the feature representation. The variational graph autoencoder can make inferences through probabilistic modeling when the controller-test case association is insufficient, and can also give reasonable recommendations for new controllers, thereby improving the accuracy of testing.
[0056] In some embodiments, the method further includes, before obtaining the recommended order of test cases by calculating the dot product of the first controller vector and the test case vector: The training structure of the graph neural network and variational graph autoencoder is optimized by a joint loss function, which includes network structure loss and ranking structure loss.
[0057] The joint optimization of network structure loss and ranking structure loss in this embodiment enables the testing method to simultaneously possess high-precision association representation capabilities and high-quality recommendation ranking capabilities. It can avoid training bias caused by a single loss function, shorten the convergence time, and enable the most important test cases to be recommended and executed first, thereby improving the effectiveness of recommended test cases.
[0058] In some embodiments, the test cases are executed sequentially according to the recommended order, and the following steps are included before: S42. Perform a self-test on the gateway controller of the vehicle under test. The self-test of the gateway controller includes at least one of the following: message transmission status detection, sleep state detection, implicit voltage value rationality detection, and terminal resistance consistency detection. Specifically, depending on the gateway model, the self-test of the gateway controller of the vehicle under test may, for example, monitor whether there are messages, whether the gateway is in sleep state during power-down, whether the implicit output voltages (typically CANH and CANL) fall within the reasonable value range of 2.0~3.0V, and whether the resistance value is 60Ω, etc.
[0059] Perform a self-test on the test equipment. The self-test of the test equipment includes at least one of the following: digital multimeter status test, oscilloscope status test, power supply status test, and bipolar power supply status test.
[0060] The testing method in this embodiment performs a self-test operation on the gateway controller and test equipment of the vehicle under test before the test is executed. This can confirm that the controller and test equipment are in normal working condition, avoid test failure due to abnormal controller status or equipment failure, improve test success rate and test efficiency, and save time and labor costs.
[0061] Optionally, the self-test of the test equipment and the self-test of the gateway controller of the vehicle under test are not limited in order. Optionally, the self-test operations can be performed in all preset orders, or selectively performed based on historical fault records.
[0062] In some embodiments, obtaining the text content of the gateway controller of the vehicle under test includes: Obtain the test-related documents of the gateway controller of the vehicle under test. The test-related documents include at least one of the following: technical specifications, communication protocol, functional requirements, and test requirements. Extract the text content of the gateway controller of the vehicle under test using a programming language.
[0063] The testing method in this embodiment extracts text content from the test-related files of the gateway controller of the vehicle under test using a programming language. It is highly operable and easy to deploy in a real test environment. Automating the extraction of text content through a programming language can avoid the inefficiency and human error of manual input and improve the accuracy of text content extraction.
[0064] Alternatively, the programming language can be Python, Java, or C++, etc.
[0065] In some specific embodiments, such as Figure 2 As shown, the vehicle gateway controller test method includes: S1. Feature Preprocessing: Based on the required files of the gateway to be tested, use Python to extract the text content of the key information of the gateway, sort them in the order of extraction, and perform natural language pre-training on the text content to obtain feature representations.
[0066] 1. The documents required for testing the gateway include the technical specifications, communication protocol, functional requirements, and test requirements.
[0067] 2. Key gateway information includes manufacturer, interface definition, testing requirements, functional requirements, hardware parameters, and network communication requirements.
[0068] 3. Natural language pre-training is represented as follows: The text content {P1, P2, P3, P4, P5, P6} is concatenated and fed into the BERT model to generate the initial feature representation of the gateway. The specific formula is C = BERT{P1, P2, P3, P4, P5, P6}, where the BERT model can be a similar model such as Albert-Base-V2. Finally, the pre-trained output is a fixed-length vector, for example, a 128-dimensional vector.
[0069] S2. Construction of Controller Information Association Network: Based on the relevant vectors generated by the BERT model in S1, the cosine similarity between the vector of the vehicle gateway controller under test and the vectors of all vehicle gateway controllers in the database is calculated. The information association between each pair of controllers is summarized. If the similarity is higher than the set threshold, it proves that there is information association between the controllers. Therefore, a controller association network is constructed with the controller as the vertex and the information association relationship as the edge. The threshold is set to 0.8.
[0070] The controller information association network is: Y=(A,E), where Y represents the controller information association network, A represents the set of all controllers input to the system, and E represents the information association between controllers, with a value of 1 or 0.
[0071] S3. Generation of Time Decay Network Edges: By using the correlation factors between the controller and test cases, the edges of the controller and test case network are calculated using the time decay method.
[0072] 1. The relevant factors between the controller and test cases are: failure probability, failure impact, and impact of development changes.
[0073] Failure probability includes historical failure probability and scenario coverage. Historical failure probability is calculated as: number of failures for this test case in the past 5 months ÷ total number of executions. Scenario coverage is the extent to which the tested functionality of this test case is utilized in actual communication processes, and is scored based on the test case scenario coverage table. Historical failure probability and scenario coverage each account for 50% of the failure probability.
[0074] The impact of failure primarily includes the failure risk level and the functional priority. The failure risk level is mainly set based on the level of failure caused by the test case functionality. The functional priority is mainly determined based on the priority of the test case functionality in the product requirements document.
[0075] The impact of development changes is mainly determined by the number of modules associated with the test cases. The value is set to 1.0 if the number of modules associated with the test cases is greater than 5, 0.6 if the number of modules associated with the test cases is between 2 and 5, and 0.2 if the number of modules associated with the test cases is 1.
[0076] 2. The method for calculating the network edges between the controller and test cases is represented as the time decay method. Specifically, it is divided into decay weight calculation and time decay edge weight. The following example uses the edge representation between controller C1 and test case T1.
[0077] Weight decay for each test case: Calculate the weight W_count(p) = β^(kp) for each test case, where k is the total number of test cases T1 used by controller C1, β is the weight factor (set to 0.8), and p is the number of times controller C1 uses test cases (1, 2, 3, ..., k). Calculate the total weight: W_total = Σ[β^(kq)] (q = 1 to k), and the normalized weight W_norm(p) = W_count(p) / W_total.
[0078] Time-related impact weights: Calculate the mean of the influencing factors: R_avg=Σ[W_norm(p)×R], B_avg=Σ[W_norm(p)×B], D_avg=Σ[W_norm(p)×D], where R, B, and D are the calculated values for failure probability, failure impact, and development change impact, respectively. Calculate the impact correlation strength: S_base=(R_avg×B_avg×D_avg)×(1 / 3). Calculate the time impact: F_count=1 / (1+δ×n_current), where δ is the weighting factor, set to 0.1, and n_current represents the current time count, which is the number of interactions between this test case and the controller arranged by time. The final edge weight is: W(C1, T1)=S_base×F_count.
[0079] S4 (S41), Test Case Recommendation: A graph convolutional network is used to aggregate the neighborhood relationships of the controller information association network, and a variational graph autoencoder is used to capture the information between the controller and test cases. Furthermore, a joint loss function is used to optimize the training results. Finally, the recommended order of test cases is derived based on the dot product of the controller vector and the test case vector.
[0080] The joint loss function includes network structure loss and ranking structure loss. The network structure loss is calculated using Ci and Cj, which are used to associate network vectors with controller information. T The product of these factors is used to approximate the controller information association network matrix. The ranking structure loss employs Bayesian personalized ranking.
[0081] S4 (S42): Controller and test equipment self-test: Check the necessary functions of the controller and the condition of the test equipment.
[0082] 1. The controller self-test includes: whether it sends messages, whether it goes into sleep mode after power-down, whether the implicit voltage is reasonable, and whether the terminating resistor is consistent with the topology.
[0083] 2. The self-test contents of the test equipment include: digital multimeter status, oscilloscope status, power supply status, and bipolar power supply status.
[0084] S4 (S43): Test execution: Based on the given calibration value file, input it into the Canoe testing tool, and then call and run the test script.
[0085] The testing method in this embodiment involves data cleaning and preprocessing of information such as the manufacturer, interface definition, test requirements, functional requirements, hardware parameters, and network communication requirements of the gateway controller under test. Natural language preprocessing is used to derive the controller's representation, and then a controller information association network is constructed to capture the information relationships between controllers. An association network is built between the controller and test cases, and information representation is added using this network to obtain new feature representations. Through the association between the controller and test case networks, factors such as failure probability, failure impact, and development modification impact are used, and the edges between the controller and test case networks are obtained using a time decay method, which is then trained using a graph neural network. Finally, the entity representation is obtained, and test cases that meet the controller requirements are derived through dot product operations, generating a test case sequence and thus completing the test case recommendation. Afterwards, the controller's communication status, sleep status, implicit voltage rationality, and terminal resistance consistency are tested. The device performs self-tests using an oscilloscope, digital multimeter, programmable power supply, and bipolar power supply. After the testing is completed, a test program is executed on the controller sample, following the generated test case sequence, to complete the test.
[0086] By constructing a controller information association network using controller information and employing a joint structure loss function, the connections between controllers can be captured, feature representations enriched, and the accuracy of test case recommendations improved, as well as the efficiency and precision of introducing new controllers into the test. A time-decay generation method for network edges is designed, considering the impact of time count, failure probability, failure impact, and development modification impact on the test case order. This improves model training efficiency and enhances the effectiveness of model-recommended test cases. Adjusting the test case order according to different gateway controllers prevents resource waste and ensures efficient testing.
[0087] The vehicle gateway controller testing method of this embodiment can be executed automatically, which can solve the problem of low efficiency in personalized recommendation for testing new vehicle gateway controllers under test, and improve testing efficiency and accuracy.
[0088] Secondly, this disclosure proposes a vehicle gateway controller testing device, such as... Figure 3 As shown, it includes: Memory 101; and A processor 102 coupled to memory 101 is configured to execute a vehicle gateway controller test method as described above based on instructions stored in memory 101.
[0089] The vehicle gateway controller testing device of this embodiment can be integrated into a vehicle test bench, solving the problems of low efficiency, insufficient coverage, difficulty in controlling complexity, and low execution efficiency caused by the reliance on manual selection of test cases in traditional vehicle gateway controller testing. It also addresses the issues of being unable to test entirely new gateway controllers not present in the test database and insufficient test case coverage. Furthermore, it can quickly and accurately provide recommended test cases for new vehicle gateway controllers, improving the accuracy and efficiency of new controller testing recommendations. The testing device can adjust the order of test cases according to different vehicle gateway controllers, enabling targeted and efficient automated testing.
[0090] In some embodiments, the test apparatus described above may be implemented as a general-purpose processor, a programmable logic controller (PLC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or any suitable combination thereof for performing the functions described herein.
[0091] Furthermore, this disclosure also proposes a vehicle testing system, including the vehicle gateway controller testing device of the above embodiments.
[0092] The vehicle testing system of this embodiment has the same technical effects as the vehicle gateway controller testing method and vehicle gateway controller testing device of the above embodiments.
[0093] Optionally, the vehicle testing system can also integrate auxiliary equipment such as CANoe hardware, CAN bus simulator, LIN bus simulator, or programmable power supply. Optionally, the vehicle testing system can be configured as a fixed or mobile test bench, test fixture vehicle, etc. Optionally, the vehicle testing system architecture can be designed as a standalone version or a distributed version based on a cloud platform, supporting multi-station parallel testing.
[0094] The foregoing has provided a detailed description of a vehicle gateway controller testing method, testing apparatus, and vehicle testing system provided in this disclosure. Specific embodiments have been used to illustrate the principles and implementation methods of this disclosure. The descriptions of these embodiments are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this disclosure without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this disclosure.
Claims
1. A test method for a vehicle gateway controller, characterized in that, include: The text content of the gateway controller of the vehicle under test is obtained. The text content includes at least one of the following: manufacturer, interface definition, test requirements, functional requirements, hardware parameters and network communication requirements. The text content is then pre-trained with a pre-trained language model to obtain the initial feature representation of the gateway controller of the vehicle under test. The similarity between different vehicle gateway controllers is calculated based on the initial feature representation and the feature representation of vehicle gateway controllers in the database. Based on the similarity, a controller information association network is constructed with the vehicle gateway controller under test as nodes and information association relationships as edges. Based on the relationship between the vehicle under test gateway controller and the test cases, the relevant factors between the two are obtained. The relevant factors include at least one of failure probability, failure impact and development change impact. The edge weight between the vehicle under test gateway controller and the test cases is calculated based on the relevant factors using the time count decay method. The recommended order of the test cases is obtained by using a neural network model based on the controller information, the network association, and the edge weights. The test cases are then executed sequentially according to the recommended order.
2. The vehicle gateway controller testing method according to claim 1, characterized in that, The pre-trained language model includes the BERT model.
3. The vehicle gateway controller testing method according to claim 1, characterized in that, The initial feature representation includes a first controller vector, and the feature representation of the vehicle gateway controller in the database includes a second controller vector. Calculating the similarity between different vehicle gateway controllers based on the initial feature representation and the feature representation of the vehicle gateway controller in the database includes: The cosine similarity between the vehicle gateway controller under test and all vehicle gateway controllers in the database is calculated based on the first controller vector and the second controller vector. If the cosine similarity is greater than a preset threshold, it is determined that there is an information association between the vehicle gateway controller under test and the vehicle gateway controllers in the database.
4. The vehicle gateway controller testing method according to claim 3, characterized in that, The controller information association network is constructed as Y=(A,E), where Y represents the controller information association network, A represents the set of all vehicle gateway controllers input to the system, and E represents the information association between the vehicle gateway controller under test and the vehicle gateway controllers in the database, with a value of 1 or 0.
5. The vehicle gateway controller testing method according to claim 1, characterized in that, The failure probability is determined based on the historical failure probability and scenario coverage. The historical failure probability is the ratio of the number of failures of the test case to the total number of executions within a preset time period. The scenario coverage is the score obtained by the test case based on the test case scenario coverage table. and / or The impact of the failure is determined based on the failure risk level and functional priority, wherein the failure risk level is set according to the fault level caused by the test case function, and the functional priority is set according to the priority of the test case function in the product requirements document; and / or The impact of the development changes is determined based on the number of modules associated with the test cases.
6. The vehicle gateway controller testing method according to claim 5, characterized in that, Based on the aforementioned relevant factors, the edge weights between the gateway controller of the vehicle under test and the test cases are calculated using the time-decay method, including: The test case weights are calculated based on the number of times the test cases are used and then normalized. The edge weights are calculated based on the normalized test case weights and the relevant factors.
7. The vehicle gateway controller testing method according to claim 1, characterized in that, The initial feature representation includes a first controller vector. The recommended order of the test cases is obtained through a neural network model based on the controller information, the associated network, and the edge weights, including: The domain relationships of the controller information association network are aggregated by a graph neural network based on the controller information association network. The information between the gateway controller of the vehicle under test and the test cases is obtained by a variational graph autoencoder based on the edge weights, and the test case vector is obtained. The recommended order of test cases is obtained by performing a dot product operation on the first controller vector and the test case vector.
8. The vehicle gateway controller testing method according to claim 7, characterized in that, Before obtaining the recommended order of test cases based on the dot product of the first controller vector and the test case vector, the following steps are also included: The training structure of the graph neural network and the variational graph autoencoder is optimized by a joint loss function, which includes network structure loss and ranking structure loss.
9. The vehicle gateway controller testing method according to any one of claims 1 to 8, characterized in that, Before executing the test cases in the recommended order, the process also includes: Perform a self-test operation on the vehicle gateway controller under test. The self-test of the vehicle gateway controller under test includes at least one of the following: message sending status detection, sleep status detection, implicit voltage value rationality detection, and terminal resistance consistency detection. Perform a self-test on the test equipment, which includes at least one of the following: digital multimeter status detection, oscilloscope status detection, power supply status detection, and bipolar power supply status detection.
10. The vehicle gateway controller testing method according to any one of claims 1 to 8, characterized in that, The text content obtained from the gateway controller of the vehicle under test includes: Obtain the test-related documents of the gateway controller of the vehicle under test, including at least one of the following: technical specifications, communication protocol, functional requirements, and test requirements. The text content of the gateway controller of the vehicle under test is extracted using a programming language.
11. A vehicle gateway controller testing device, characterized in that, include: Memory (101); and A processor (102) coupled to the memory (101) is configured to execute the vehicle gateway controller test method as claimed in any one of claims 1 to 10 based on instructions stored in the memory (101).
12. A vehicle testing system, characterized in that, Includes the vehicle gateway controller test apparatus as described in claim 11.
Citation Information
Patent Citations
Test case recommendation system and method based on pre-training language model
CN114579430A
Automobile hybrid gateway automatic test system and method based on AI case generation
CN121792408A
