Target case testing method and device
Through a test method of target use cases, the problem of inefficient ADAS SDPU testing in the prior art is solved, and the efficiency and accuracy of automated testing are achieved, and the cost is reduced.
Patent Information
- Application Number
- CN202411715854.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
When testing sensor data processing units (SDPUs) in advanced driving assistance systems (ADAS), the prior art is inefficient, labor and time costs are high, and the testing efficiency in simulation environment is also poor, making it difficult to achieve the test target.
Provide a test method for target use cases. By obtaining the target use case identification, finding and obtaining the data to be tested and expected data in the matching target test set, performing data fusion processing, sending it to the on-board system for testing, receiving and analyzing the test results, and comparing them to determine the use case test results.
It improves the automated testing efficiency of target use cases corresponding to the on-board system, ensures the accuracy and reliability of test results, and reduces labor and time costs.
Smart Images

Figure CN119645853A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of testing advanced driver assistance systems, and in particular to a method and device for testing a target use case. Background Art
[0002] Modern vehicle systems contain a variety of sensors with different functions and models. They collect information about the vehicle's environment and road conditions and transmit it to the Advanced Driver Assistance System (ADAS).
[0003] The Sensor Data Processing Unit is generally placed at the input front end of the ADAS system. Its responsibility is to convert the raw data from the sensor into a format that the system can understand and process, repackage the related parts according to certain rules, and distribute them to downstream systems for high-level autonomous driving algorithm processing.
[0004] Since the ADAS system collects a lot of data types and data formats, the goal of functional testing of the SDPU unit is to ensure the consistency, integrity, and accuracy of data before and after processing. During actual vehicle testing, different types of sensors are used to collect data in the same scenario, and their outputs are compared to verify the correctness of SDPU processing. This has poor reentrancy and high manpower and time costs. Another testing method is to use a simulation environment, build a virtual environment, simulate different driving scenarios and conditions, and observe the output of the sensor. This also requires manual observation and comparison, that is, the simulated data and the data generated by the SDPU module are intercepted, and compared and analyzed field by field. The test efficiency is poor, and it is even difficult to achieve the test goal. Summary of the invention
[0005] The present application provides a test method and device for a target use case, which can improve the efficiency of automated testing of target use cases corresponding to a vehicle-mounted system and ensure the accuracy and reliability of automated testing results.
[0006] On the one hand, the present application provides a method for testing a target use case, the method comprising:
[0007] In response to the target use case test request, obtaining a target use case identifier corresponding to the target use case;
[0008] Searching for a target test set matching the target case identifier in an identifier test set library, and obtaining target test data and target expected data in the target test set; the identifier test set library includes a mapping relationship between preset case identifiers and preset test sets; the preset test set includes preset test data and preset expected data;
[0009] Performing data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and sending the updated data to be tested to the vehicle-mounted system; so that the vehicle-mounted system performs data test processing based on the updated data to be tested, so as to obtain real-time data test results;
[0010] Receiving the real-time data test result sent by the vehicle-mounted system, and parsing and processing the real-time data test result to obtain a real-time test identifier and real-time test data;
[0011] Perform consistency comparison between the target use case identifier and the real-time test identifier to obtain an identifier comparison result;
[0012] If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, a use case test result corresponding to the target use case is determined according to the difference between the real-time test data and the target expected data.
[0013] In an exemplary embodiment, in response to the target use case test request, obtaining a target use case identifier corresponding to the target use case includes:
[0014] In response to the target case test request, sending a request for obtaining the type of data to be tested to the vehicle system;
[0015] Receiving a preset data type file corresponding to a target case test request sent by the vehicle-mounted system, and extracting a preset data type in the preset data type file;
[0016] Acquire a local test data file; the local test data file includes a plurality of local data types and a local test set corresponding to each of the local data types; the local test set includes a plurality of local test data and local expected data corresponding to each of the local test data;
[0017] Searching the local test data file for a local test set that matches the preset data type to obtain an initial test set;
[0018] Performing data screening processing on the initial test data and the initial expected data in the initial test set to obtain the preset test set;
[0019] Obtain the target use case identifier corresponding to the target use case.
[0020] In an exemplary embodiment, the performing data screening processing on the initial test data and the initial expected data in the initial test set to obtain the preset test set includes:
[0021] Acquire an initial data identifier corresponding to initial data; the initial data is any one of the initial test data and the initial expected data;
[0022] Determine an initial use case identifier corresponding to the initial data identifier from the preset use case identifiers;
[0023] According to the correspondence between the initial data identifier and the initial data and the correspondence between the initial use case identifier and the initial data identifier, determine the correspondence between the initial use case identifier and the initial data, and obtain a use case identifier data relationship library;
[0024] Searching for preset data corresponding to the preset use case identifier in the use case identifier data relationship library, and determining that the preset data is the preset test set; the preset data includes the preset data to be tested and the preset expected data;
[0025] Before searching the target test set matching the target case identifier in the identifier test set library and obtaining the target to-be-tested data and the target expected data in the target test set, the method further includes:
[0026] The identified test set library is constructed according to the correspondence between the preset use case identifiers and the preset test sets.
[0027] In an exemplary embodiment, the receiving a preset data type file sent by the vehicle-mounted system and extracting a preset data type from the preset data type file includes:
[0028] Receiving the preset data type file sent by the vehicle-mounted system;
[0029] Extracting static data information and dynamic data information from the preset data type file;
[0030] Serializing the static data information to obtain a first preset data type;
[0031] Flattening the dynamic data information to obtain a second preset data type;
[0032] The preset data type is determined according to the first preset data type and the second preset data type.
[0033] In an exemplary embodiment, the target data to be tested is any data in the target data set to be tested; the target expected data is any data in the target expected data set; the real-time test data is any data in the real-time test data set; if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, determining the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data, includes:
[0034] If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, obtaining the target expected data quantity corresponding to the target expected data set and the real-time test data quantity corresponding to the real-time test data set;
[0035] Comparing the target expected data quantity with the real-time test data quantity to obtain a quantity comparison result;
[0036] If the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity, the use case test result is obtained according to the difference between the real-time test data and the target expected data.
[0037] In an exemplary embodiment, if the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity, obtaining the use case test result according to the difference between the real-time test data and the target expected data includes:
[0038] If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, data conversion processing is performed on each of the target expected data in the target expected data set to obtain an updated expected data set; the updated expected data set includes a plurality of updated expected data;
[0039] Performing data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set; the updated real-time test data set includes a plurality of updated real-time test data;
[0040] Sequentially acquiring difference values between the update expected data at the target position in the update expected data set and the update real-time test data at the target position in the update real-time test data set, and obtaining a data difference value corresponding to each of the update real-time test data;
[0041] If the data difference values corresponding to each of the updated real-time test data are within the preset difference range, it is determined that the use case test of the target use case has passed.
[0042] In an exemplary embodiment, if the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, performing data conversion processing on each of the target expected data in the target expected data set to obtain an updated expected data set includes:
[0043] If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, serializing each of the target expected data in the target expected data set to obtain a serialized expected data set; the serialized expected data set includes a plurality of serialized expected data;
[0044] sorting the data in the serialized expected data set according to the size of each serialized expected data in the serialized expected data set to obtain the updated expected data set;
[0045] The performing data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set includes:
[0046] Performing serialization processing on each of the real-time test data in the real-time test data set to obtain a serialized real-time test data set; the serialized real-time test data set includes a plurality of serialized real-time test data;
[0047] According to the size of each serialized real-time test data in the serialized real-time test data set, the data in the serialized real-time test data set is sorted to obtain the updated real-time test data set.
[0048] In an exemplary embodiment, performing data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and sending the updated data to be tested to the vehicle system includes:
[0049] Performing data fusion processing on the target use case identifier and each of the target data to be tested to obtain updated data to be tested corresponding to each of the target data to be tested;
[0050] Determine, according to a preset strategy, a preset sending time corresponding to each of the updated data to be tested and a preset duration corresponding to the target use case;
[0051] Sending the updated test data to the vehicle system at the preset sending time;
[0052] The receiving the real-time data test result sent by the vehicle-mounted system and parsing the real-time data test result to obtain a real-time test identifier and real-time test data includes:
[0053] Receiving the real-time data test result sent by the vehicle-mounted system, and obtaining the real-time duration corresponding to the real-time data test result;
[0054] If the real-time duration is less than the preset duration, the real-time data test result is parsed and processed to obtain the real-time test identifier and the real-time test data.
[0055] In an exemplary embodiment, before obtaining the target use case identifier corresponding to the target use case in response to the target use case test request, the method further includes:
[0056] In response to the use case construction request, obtaining the target use case name and use case description information stored in the target terminal and carried in the use case construction request;
[0057] Obtaining the target use case identifier corresponding to the target use case stored in the server;
[0058] Constructing the target use case according to the target use case name, the use case description information and the target use case identifier;
[0059] If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, after determining the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data, the method further includes:
[0060] Adding the target test set and the use case test result to the target use case to obtain an updated target use case;
[0061] The updated target use case is sent to the target terminal, so that the target terminal displays the updated target use case.
[0062] Another aspect provides a test device for a target use case, the device comprising:
[0063] A target use case identification determination module, used to obtain a target use case identification corresponding to a target use case in response to a target use case test request;
[0064] A target test set determination module is used to search for a target test set matching the target case identifier in an identification test set library, and obtain target test data and target expected data in the target test set; the identification test set library includes a mapping relationship between a preset case identifier and a preset test set; the preset test set includes preset test data and preset expected data;
[0065] A sending module, used for performing data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and sending the updated data to be tested to the vehicle-mounted system; so that the vehicle-mounted system performs data test processing based on the updated data to be tested to obtain real-time data test results;
[0066] An acquisition module, used for receiving the real-time data test result sent by the vehicle-mounted system, and parsing and processing the real-time data test result to obtain a real-time test identifier and real-time test data;
[0067] An identification comparison result determination module is used to compare the target use case identification with the real-time test identification to obtain an identification comparison result;
[0068] The use case test result determination module is used to determine the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification.
[0069] On the other hand, an electronic device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded by the processor and executes the test method of the target use case as described above.
[0070] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the test method of the target use case as described above.
[0071] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the test method of the target use case as described above.
[0072] A target case testing method and device provided by the present application have the following technical effects: the present application responds to a target case test request, obtains a target case identifier corresponding to a target case; searches for a target test set matching the target case identifier in an identifier test set library, and obtains target test data and target expected data in the target test set; the identifier test set library includes a mapping relationship between a preset case identifier and a preset test set; the preset test set includes preset test data and preset expected data; the target case identifier and the target test data are subjected to data fusion processing to obtain updated test data, and the updated test data is sent to the vehicle-mounted system The updated data to be tested; so that the vehicle-mounted system performs data testing based on the updated data to be tested to obtain real-time data test results; receiving the real-time data test results sent by the vehicle-mounted system, and parsing the real-time data test results to obtain real-time test identifiers and real-time test data; performing consistency comparison between the target use case identifier and the real-time test identifier to obtain an identifier comparison result; if the identifier comparison result indicates that the target use case identifier is consistent with the real-time test identifier, the use case test result corresponding to the target use case is determined according to the difference between the real-time test data and the target expected data. The present application pre-imports a preset test set in the server and stores it in the identifier test set library in the form of a key value, so that when the target use case needs to be tested, the target data to be tested and the target expected data can be directly obtained, and identifiers are set on both the sent and received data to ensure that the compared data are all corresponding to the target use case. Finally, the use case test results are obtained through automated data comparison, thereby improving the efficiency of automated testing of the target use case corresponding to the vehicle-mounted system and the accuracy and reliability of the use case test results. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions and advantages of the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0074] Figure 1 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0075] Figure 2 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0076] Figure 3 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0077] Figure 4 is a schematic diagram for determining a second preset data type provided in an embodiment of this specification;
[0078] Figure 5 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0079] Figure 6 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0080] Figure 7 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0081] Figure 8 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0082] Fig. 9 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0083] Fig.10 is a schematic diagram of an automated testing system provided in an embodiment of this specification;
[0084] Fig.11 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0085] Fig.12 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0086] Fig.13 It is a flowchart of a test method for a target use case provided in an embodiment of this specification;
[0087] Fig.14 It is a schematic diagram of the structure of the test device of the target use case provided in the embodiment of this specification.
[0088] Fig.15 It is a structural diagram of a server of a test method for a target use case provided in an embodiment of this specification. DETAILED DESCRIPTION
[0089] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0090] It should be noted that the terms "first", "second", etc. 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 sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server 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.
[0091] The following describes a test method for a target use case of this application. Figure 1 It is a flowchart of a test method for a target use case provided in an embodiment of this specification. This specification provides method operation steps as described in the embodiment or flowchart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the actual system or server product is executed, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 1 As shown, the method can be applied to a server corresponding to the vehicle-mounted system, and the method includes:
[0092] S101: In response to a target use case test request, obtain a target use case identifier corresponding to a target use case.
[0093] In the embodiment of this specification, the target use case may be a test case corresponding to the sensor data processing unit (SDPU) in the advanced driver assistance system (ADAS), which is used to determine whether the test result of the SDPU unit is accurate. At the same time, the target use case may be one or more. If the target use case test request only needs to execute one target use case, only the target use case identifier corresponding to the target use case is obtained; if the target use case test request needs to execute multiple target use cases, the target use case identifier corresponding to each target use case is obtained.
[0094] In the embodiment of this specification, in response to the target use case test request, the target use case identifier corresponding to the target use case is obtained, such as Figure 2 As shown, Figure 2 A flowchart of a test method for a target use case, including:
[0095] S201: In response to the target case test request, sending a request for obtaining a data type to be tested to the vehicle system;
[0096] In the embodiment of this specification, when the server receives a target case test request input by the user, the server needs to obtain the target test data and target expected data corresponding to the target case, so the server sends a test data type acquisition request to the vehicle system, so that the subsequent server first determines the data type of the test data and the expected data, and then obtains the required test data and expected data. Among them, the vehicle system is a broad concept, which can be specifically referred to as the sensor data processing unit SDPU in the vehicle system ADAS.
[0097] S202: receiving a preset data type file corresponding to a target case test request sent by the vehicle-mounted system, and extracting a preset data type from the preset data type file;
[0098] In the embodiment of the present specification, after the vehicle-mounted system receives the request for obtaining the data type to be tested sent by the server, it will send a preset data type file corresponding to the target case test request to the server, wherein the preset data type file can be a dynamic library and header file provided by the SDPU unit in the vehicle-mounted system, and the dynamic library and header file contain the definition interface, serialization interface and deserialization interface of the data type. By extracting the preset data type in the preset data type file, so as to obtain the data to be tested and the expected data corresponding to the preset data type, the process of automated testing is simplified and the efficiency of automated testing is improved.
[0099] In the embodiment of the present specification, the receiving of the preset data type file sent by the vehicle-mounted system and the extraction of the preset data type in the preset data type file are as follows: Figure 3 As shown, Figure 3 A flowchart of a test method for a target use case, including:
[0100] S301: receiving the preset data type file sent by the vehicle-mounted system;
[0101] In the embodiment of the present specification, the server first receives a preset data type file provided by the SDPU unit in the vehicle system.
[0102] S302: extracting static data information and dynamic data information from the preset data type file;
[0103] In the embodiments of the present specification, two formats of structures are encapsulated in the preset data type file, one is a basic structure containing only some simple fields, that is, static data information, and the basic structure is a statically defined structure with a fixed structure; the other is a complex structure of proto type, that is, dynamic data information, wherein the complex structure of proto type can contain nested messages, enumerations, repeated fields, etc., and is a dynamically defined structure with a flexible structure.
[0104] S303: Serializing the static data information to obtain a first preset data type;
[0105] In the embodiments of the present specification, since the static data information only includes some simple fields, and different fields represent different data types, it is necessary to initialize the static data information into an object, and serialize the object through an external library, such as the nlohmann / json library, so that the object is converted into a text in a lightweight data exchange format (JavaScript Object Notation). The converted text exists in the form of a key value, wherein the key of the text is the field name, and the value of the text is the value corresponding to the field. Here, only the field name part of the text needs to be extracted and combined to obtain a field list, i.e., the first preset data type. Extracting the first data type helps to generate a field list in a data configuration graphical interface view (GUI), which is convenient for users to display data by field or further customize data.
[0106] S304: Flatten the dynamic data information to obtain a second preset data type;
[0107] In the embodiments of this specification, since the structure of dynamic data information is more complex than that of static data information, there will be nested information. Therefore, for dynamic data information, the reflection function provided by the mixed language data standard library (google.protobuf) can be used to extract the nested fields in the dynamic data information, that is, the second preset data type. Specifically, Figure 4 As shown, Figure 4A schematic diagram of determining a second preset data type provided in an embodiment of the present specification, in which 401 is the composition of dynamic data information, wherein the basic message structure may be message Base, field 1 may be a double-precision floating point number (double) type indicating the longitudinal distance (longitudinal_distance) field in the basic message (Base), the identification number of field 1 may be 1, and exemplarily, field 1 and the identification number corresponding to field 1 may be double longitudinal_distance=1; field 2 may be a double-precision floating point number (double) type indicating the lateral distance (lateral_distance) field in the basic message (Base), the identification number of field 2 may be 2, and exemplarily, field 2 and the identification number corresponding to field 2 may be double lateral_distance=2; field 3 may be a double-precision floating point number (double) type indicating the vertical distance (vertical_distance) field in the basic message (Base), the identification number of field 3 may be 3, and exemplarily, field 3 and the identification number corresponding to field 3 may be double vertical_distance=3; the derived message structure may be message Derived, field 4 can be a double-precision floating point number (double) type to represent the timestamp (time_stamp) field in the derived message (Derived), the identification number of field 4 can be 1, exemplary, field 4 and the identification number corresponding to field 4 can be double time_stamp=1; the derived message structure is nested with a basic message, so the nested basic message structure is Base, the identification number corresponding to the nested basic message structure can be 2, exemplary, the nested basic message structure and the identification number corresponding to the nested basic message structure can be Base base=2. In the figure, 402 is a list composed of nested fields in the dynamic data information extracted through the mixed language data standard library, that is, the second preset data type. And the complete field path needs to be extracted during extraction, so both the basic message (Base) and the derived message (Derived) need to be extracted so that the position of each field can be clearly indicated when data configuration or display is required. When extracting, it is necessary to clarify the hierarchical relationship of the fields in the message structure. Therefore, we extract them layer by layer starting from the message structure. The basic message structure is nested in the derived message structure. Therefore, we extract them layer by layer starting from the derived message structure. The fields finally extracted are as follows: Figure 4As shown in 402, illustratively, derived message structure.field name 4 may be Derived.time_stamp; derived message structure.nested base message structure.field name 1 may be Derived.Base.longitudinal_distance; derived message structure.nested base message structure.field name 2 may be Derived.Base.lateral_distance; derived message structure.nested base message structure.field name 3 may be Derived.Base.vertical_distance; the four field names finally obtained are combined to form the second preset type.
[0108] S305: Determine the preset data type according to the first preset data type and the second preset data type.
[0109] In the embodiments of this specification, the first preset data type and the second preset data type cover all preset data types in the preset data type file sent by the SDPU unit in the vehicle system. By serializing the static data information and extracting the first preset data type, it is ensured that the extracted first preset data type is accurate, and by flattening the dynamic data information, it is ensured that all fields including nested fields are correctly extracted, and finally the second preset data type is combined, so that the user can clearly see the hierarchical structure of the data and avoid ambiguity caused by field name conflicts; and these two extraction methods ensure that the data type definitions of the subsequently acquired test data and expected data are consistent with the data type definitions in the SDPU unit, avoiding problems caused by data type mismatch; at the same time, it supports the management of multiple data types, and can select appropriate data types according to actual needs, which improves the flexibility and compatibility of data management.
[0110] S203: Acquire a local test data file; the local test data file includes multiple local data types and a local test set corresponding to each local data type; the local test set includes multiple local test data and local expected data corresponding to each local test data;
[0111] In an embodiment of the present specification, the local test data file is an offline file, which is a real data file collected during the actual vehicle test corresponding to the vehicle-mounted system. After the server obtains the local test data file, it will first parse the local test data file to identify the format of the local test data file and the content in the file. Among them, the file format is defined by the acquisition tool, which usually includes key information such as timestamp and data type. The local test data in the local test data can be various data of the vehicle collected by the data acquisition tool corresponding to the vehicle-mounted system in the actual vehicle test corresponding to the vehicle-mounted system, and the data sent to the vehicle-mounted system. These data are usually prepared before the test starts and are used to initialize the test environment or provide test input; the local expected data can be the data generated by the SDPU unit after test processing according to the received test data during the test process, and the data is recorded in the local test data file as the expected data for subsequent tests, which is used to verify whether the test results of the vehicle-mounted system meet expectations.
[0112] S204: searching the local test data file for a local test set that matches the preset data type to obtain an initial test set;
[0113] In an embodiment of the present specification, the test data in the local test data file can be filtered according to a preset data type to obtain an initial test set, which includes data to be tested and expected data with the same data type as the preset data type; in addition, the data in the local test data file can also be filtered by timestamp or other key information.
[0114] S205: performing data screening processing on the initial test data and the initial expected data in the initial test set to obtain the preset test set;
[0115] In the embodiments of the present specification, the data in the initial test set is only the same as the data type of the data defined in the SDPU unit. However, in actual use, different target use cases require different test data and expected data. Therefore, it is necessary to screen the initial test data and initial expected data in the initial test set for different target use cases to obtain a test set corresponding to each target use case.
[0116] In the embodiment of this specification, the initial test data and the initial expected data in the initial test set are subjected to data screening to obtain the preset test set, such as Figure 5 As shown, Figure 5 A flowchart of a test method for a target use case, including:
[0117] S501: Acquire an initial data identifier corresponding to initial data; the initial data is any one of the initial test data and the initial expected data;
[0118] In the embodiment of this specification, after obtaining the initial test set, the server will import all the data in the initial test set into the server for storage, and in order to better manage the imported data, the server can mark the data. Specifically, the server background will generate a data identification ID corresponding to each data, that is, the initial data identification, and each data identification is unique.
[0119] S502: Determine an initial use case identifier corresponding to the initial data identifier from the preset use case identifiers;
[0120] In the embodiments of the present specification, the target data to be tested and the target expected data corresponding to each target use case are different, each target data to be tested and each target expected data have a data identifier corresponding to it, and each use case requires at least one data to be tested and expected data, so one use case identifier can correspond to at least two data identifiers, and the target data to be tested and the target expected data corresponding to the target use case are obtained through the data identifier.
[0121] S503: Determine the correspondence between the initial use case identifier and the initial data according to the correspondence between the initial data identifier and the initial data and the correspondence between the initial use case identifier and the initial data identifier, and obtain a use case identifier data relationship library;
[0122] In the embodiments of the present specification, since the initial data identifier corresponds to the initial data, and the initial use case identifier corresponds to a different initial data identifier, a use case identifier data relationship library can be constructed, and the target test data and target expected data corresponding to the target use case can be directly obtained through the target use case identifier.
[0123] S504: searching for preset data corresponding to the preset use case identifier in the use case identifier data relationship library, and determining that the preset data is the preset test set; the preset data includes the preset test data and the preset expected data;
[0124] In an embodiment of the present specification, the use case identification data relationship library stores multiple preset use case identifications and preset test data and preset expected data corresponding to each preset use case identification. Therefore, the preset test set corresponding to each preset use case identification can be obtained in the use case identification data relationship library through the preset use case identification.
[0125] Before searching the target test set matching the target case identifier in the identifier test set library and obtaining the target to-be-tested data and the target expected data in the target test set, the method further includes:
[0126] The identified test set library is constructed according to the correspondence between the preset use case identifiers and the preset test sets.
[0127] In the embodiments of the present specification, due to the correspondence between the preset use case identifier and the preset test set, an identification test set library can be constructed so that when the target use case needs to be tested, the target test set corresponding to the target use case can be directly obtained through the target use case identifier. The identification test set library is constructed by the progressive correspondence between the use case identifier, the data identifier and the data, which ensures the accuracy of the use case test results of the target use case and the repeatability of the test. Since the use case identifier of each target use case and the data identifier of the data are unique identifiers, data management and traceability are convenient. If the test result is not as expected, the problem can be quickly located, which improves the efficiency and reliability of the automated testing of the target use case.
[0128] S206: Obtain the target use case identifier corresponding to the target use case.
[0129] In the embodiment of the present specification, the server obtains the target use case identifier in order to obtain the preset test set later. By accurately screening the data in the local test data file, it is ensured that the data matching the preset data type is stored in the server, thereby avoiding the problems caused by the mismatch of the data type later. At the same time, through data annotation, the preset use case identifier is matched with the preset test set, thereby obtaining the test set corresponding to each target use case, simplifying the process of automated testing, and improving the efficiency and reliability of automated testing of target use cases.
[0130] S103: Searching for a target test set that matches the target use case identifier in an identification test set library, and obtaining target test data and target expected data in the target test set; the identification test set library includes a mapping relationship between preset use case identifiers and preset test sets; the preset test set includes preset test data and preset expected data.
[0131] In an embodiment of the present specification, before responding to a target use case test request, the server will first construct a project file, which is saved in the server in the format of a json file. The project file may include a project name, a project description, and a tree structure of use cases, wherein the tree structure of the use case can be understood as the directory hierarchy of the project, and each hierarchy corresponds to a leaf node of the tree structure, where the leaf node is a preset use case identifier. The preset use case identifier is automatically generated by the server backend when the use case is constructed, and each use case corresponds to a use case identifier. Combining all use case identifiers can obtain the preset use case identifier. The preset test set can be data imported by the server from a local test data file or user-defined data. After obtaining these data, the server will annotate the data, that is, the server backend will generate a data identifier corresponding to each data, and different data identifiers can correspond to the same use case identifier. First, all target data identifiers corresponding to the target use case identifier are obtained, and then the data corresponding to each target data identifier is obtained, and the target test set corresponding to different target use cases is obtained by combining.
[0132] S105: Perform data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and send the updated data to be tested to the vehicle-mounted system; so that the vehicle-mounted system performs data testing processing based on the updated data to be tested to obtain real-time data testing results.
[0133] In an embodiment of the present specification, before the server sends data to the vehicle system so that the vehicle system can be tested, the server needs to package the target data to be tested first. Optionally, the target data to be tested can be packaged in the form of a Topic. Among them, Topic is a mechanism for organizing and classifying messages, and is a core concept in the publish / subscribe model. Each Topic has a unique name. Producers can publish messages to a specific Topic, and subscribers can subscribe to these Topics to receive related messages. Here, different Topics identify different data types. Before each target data to be tested is sent, the server will select a suitable Topic according to the data type of the target data to be tested, send the target data to the Topic, and then add additional information to the header of each target data to be tested. For example, it can be a target use case identifier, and the target use case identifier is used as a CRC check value to verify the integrity and correctness of the sent data to prevent errors during data transmission. When the server wants to send data to the SDPU unit in the vehicle system, the server acts as a publisher and the SDPU unit acts as a subscriber. The server merges the target use case identifier with the target data to be tested to obtain the updated data to be tested and sends the updated data to the SDPU unit in the vehicle system. The SDPU unit in the vehicle system receives the updated data to be tested and parses it to obtain the use case identifier and the target data to be tested in the updated data to be tested, and uses the target data to be tested as input to perform data testing to obtain test data results, adds the use case identifier in the updated data to be tested to the header of the test data results, obtains real-time data test results, and sends the real-time data test results to the server.
[0134] S107: receiving the real-time data test result sent by the vehicle-mounted system, and parsing and processing the real-time data test result to obtain a real-time test identifier and real-time test data.
[0135] In an embodiment of the present specification, the server receives the real-time data test results sent by the SDPU unit in the vehicle system, and parses them to obtain the use case identifier in the updated test data, i.e., the real-time test identifier and the test data results, i.e., the real-time test data, so as to perform subsequent data comparison to determine the test results of the SDPU unit in the vehicle system.
[0136] In the embodiment of this specification, the target use case identifier is subjected to data fusion processing with the target data to be tested to obtain updated data to be tested, and the updated data to be tested is sent to the vehicle-mounted system, such as Figure 6 As shown, Figure 6 A flowchart of a test method for a target use case, including:
[0137] S601: performing data fusion processing on the target use case identifier and each of the target data to be tested to obtain updated data to be tested corresponding to each of the target data to be tested;
[0138] In an embodiment of the present specification, a target use case identifier is added to the header of each target data to be tested to obtain updated data to be tested corresponding to each target data to be tested, and the sent data is made unique by adding the target use case identifier to facilitate subsequent data management.
[0139] S602: Determine, according to a preset strategy, a preset sending time corresponding to each of the updated data to be tested and a preset duration corresponding to the target use case;
[0140] In the embodiments of the present specification, during actual sending, for example, due to data characteristics, some data need to be sent at the same time, and some data need to be sent based on the data that has been sent. Therefore, a timer can be set to determine the preset sending time corresponding to each updated test data. Here, the preset sending time corresponding to each updated test data can be not fixed; at the same time, a preset duration can also be set. The preset duration represents the maximum timeout time for the server to receive the data corresponding to the target use case sent back by the SDPU unit in the vehicle system. For example, it can be set to 1 minute.
[0141] S603: Sending the updated test data to the vehicle system at the preset sending time;
[0142] In the embodiment of the present specification, when the preset sending time corresponding to each updated data to be tested arrives, the server can send the updated data to be tested to the SDPU unit in the vehicle system through a variety of communication methods. For example, Data Distribution Service, ZeroMQ, Transmission Control Protocol, User Datagram Protocol, etc. can be used. After the server sends the updated data to be tested to the SDPU unit of the vehicle system, a receiving waiting time will be set for receiving the real-time data test results sent by the SDPU unit of the vehicle system. For example, the receiving waiting time can be set to 2 seconds.
[0143] The receiving the real-time data test result sent by the vehicle-mounted system and parsing the real-time data test result to obtain a real-time test identifier and real-time test data includes:
[0144] Receiving the real-time data test result sent by the vehicle-mounted system, and obtaining the real-time duration corresponding to the real-time data test result;
[0145] In the embodiment of this specification, the server receives the real-time data test result sent by the SDPU unit of the vehicle system, and the SDPU unit in the vehicle system can also send the real-time data test result to the server through a variety of communication methods, wherein the communication methods include but are not limited to data distribution service (Data Distribution Service), zero message queue (ZeroMQ), transmission control protocol (Transmission Control Protocol), user datagram protocol (User Datagram Protocol), etc. When receiving the real-time data test result, the data reception duration corresponding to the real-time data test result, i.e., the real-time duration, is obtained.
[0146] If the real-time duration is less than the preset duration, the real-time data test result is parsed and processed to obtain the real-time test identifier and the real-time test data.
[0147] In an embodiment of the present specification, when the real-time duration is less than the preset duration, the real-time data test result received by the server is valid and does not exceed the set maximum timeout, i.e., the preset duration. At this time, the received real-time data test result is parsed and processed to obtain a real-time test identifier and real-time test data. When the real-time duration is greater than or equal to the preset duration, the real-time data test result received by the server is invalid, and the receiving duration has exceeded the set maximum timeout, i.e., the preset duration. By fusing the target use case identifier with the target data to be tested, the uniqueness and integrity of each updated data to be tested is ensured to prevent data transmission errors; by setting a preset sending time, multiple updated data to be tested are ensured to be sent in sequence to avoid data congestion and loss; by setting the real-time duration, it is ensured that the server receives valid real-time test data in order to obtain accurate use case test results.
[0148] S109: performing consistency comparison between the target use case identifier and the real-time test identifier to obtain an identifier comparison result.
[0149] In the embodiments of the present specification, the target use case identifier and the real-time test identifier are first compared to ensure that the implementation test data in the real-time data test results sent by the SDPU unit in the vehicle system to the server is a data test result corresponding to the target data to be tested, thereby improving the reliability of the automated test.
[0150] S111: If the identifier comparison result indicates that the target use case identifier is consistent with the real-time test identifier, determine a use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data.
[0151] In the embodiment of this specification, when the target use case identifier and the real-time test identifier are consistent, it is determined that the implementation test data in the real-time data test result sent by the SDPU unit in the vehicle system to the server is the data test result corresponding to the target test data, so further data judgment can be performed to determine the use case test result of the target use case. Through the multi-layer judgment strategy, the consistency of the compared data is ensured, and the reliability of the automated test and the accuracy of the use case test results are improved.
[0152] In the embodiment of the present specification, the target data to be tested is any data in the target data set to be tested; the target expected data is any data in the target expected data set; the real-time test data is any data in the real-time test data set; if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, the use case test result corresponding to the target use case is determined according to the difference between the real-time test data and the target expected data, such as Figure 7 As shown, Figure 7 A flowchart of a test method for a target use case, including:
[0153] S701: If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, obtain the target expected data quantity corresponding to the target expected data set and the real-time test data quantity corresponding to the real-time test data set;
[0154] In the embodiments of the present specification, during testing, each target use case requires multiple target data to be tested as input, multiple target expected data as reference for output, and multiple real-time test data as output. Therefore, in fact, multiple target data to be tested can be combined to form a queue, that is, a target data set to be tested; multiple target expected data can be combined to form a queue, that is, a target expected data set; multiple real-time test data can be combined to form a queue, that is, a real-time test data set. When it is determined that the real-time test data in the real-time data test result sent to the server by the SDPU unit in the vehicle system is a data test result corresponding to the target data to be tested, it is necessary to compare the data in the target expected data set and the data in the real-time test data set to determine the use case test result. Before comparing the data, it is necessary to first obtain the number of target expected data corresponding to the target expected data set and the number of real-time test data corresponding to the real-time test data set, and compare these two numbers as the first step of data comparison.
[0155] S702: Compare the target expected data quantity with the real-time test data quantity to obtain a quantity comparison result;
[0156] In an embodiment of the present specification, the target expected data quantity is compared with the real-time test data quantity to determine that the updated test data sent by the server to the SDPU unit in the vehicle system has been successfully tested by the SDPU unit, and the test results are sent to the server.
[0157] S703: If the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity, the use case test result is obtained according to the difference between the real-time test data and the target expected data.
[0158] In an embodiment of the present specification, when the target expected data quantity is the same as the real-time test data quantity, it can be determined that the data transmission process is complete, and then the second step of data comparison is performed, that is, the real-time test data and the target expected data are compared, and the use case test result is determined based on the difference between the two. When the target expected data quantity is different from the real-time test data quantity, it can be considered that the target use case test has failed. By checking whether the target expected data quantity and the real-time test data quantity are the same, data integrity verification is achieved, ensuring that the test results corresponding to each updated data to be tested have been successfully received, ensuring the accuracy of the use case test results, achieving automated testing, and improving the efficiency and reliability of automated testing.
[0159] In the embodiment of the present specification, if the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity, the use case test result is obtained according to the difference between the real-time test data and the target expected data, such as Figure 8 As shown, Figure 8 A flowchart of a test method for a target use case, including:
[0160] S801: If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, data conversion processing is performed on each of the target expected data in the target expected data set to obtain an updated expected data set; the updated expected data set includes a plurality of updated expected data;
[0161] In the embodiment of this specification, before performing data comparison, it is necessary to perform data conversion processing on each target expected data set, convert it into json format, and obtain an updated expected data set containing multiple updated expected data for subsequent data comparison.
[0162] In an embodiment of the present specification, if the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, performing data conversion processing on each of the target expected data in the target expected data set to obtain an updated expected data set includes:
[0163] If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, serializing each of the target expected data in the target expected data set to obtain a serialized expected data set; the serialized expected data set includes a plurality of serialized expected data;
[0164] In the embodiment of the present specification, each target expected data in the target expected data set is serialized, and each target expected data is converted into a json format to obtain multiple serialized expected data, which are combined to form a serialized expected data set.
[0165] sorting the data in the serialized expected data set according to the size of each serialized expected data in the serialized expected data set to obtain the updated expected data set;
[0166] In the embodiment of the present specification, according to the size of each serialized expected data in the serialized expected data set, the data in the serialized expected data set can be sorted in ascending order according to the size of the serialized expected data set to obtain the updated expected data set. In addition, the data can also be sorted from large to small or in other preset sorting methods.
[0167] The performing data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set includes:
[0168] Performing serialization processing on each of the real-time test data in the real-time test data set to obtain a serialized real-time test data set; the serialized real-time test data set includes a plurality of serialized real-time test data;
[0169] In the embodiment of the present specification, each real-time test data in the real-time test data set is serialized, and each real-time test data is converted into a json format to obtain multiple serialized real-time test data, which are combined to form a serialized real-time test data set.
[0170] According to the size of each serialized real-time test data in the serialized real-time test data set, the data in the serialized real-time test data set is sorted to obtain the updated real-time test data set.
[0171] In an embodiment of the present specification, according to the size of each serialized real-time test data in the serialized real-time test data set, illustratively, the data in the serialized real-time test data set can be sorted from small to large according to the size of the serialized real-time test data to obtain an updated real-time test data set. At the same time, it can also be sorted from large to small or sorted according to other preset sorting methods. By serializing both the target expected data and the real-time test data, the format of the data is consistent, which facilitates data exchange and processing between different systems; at the same time, sorting by data size ensures the orderliness of the data, so that subsequent data comparison and verification can be completed automatically, thereby improving the reliability of the use case test results.
[0172] S802: Perform data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set; the updated real-time test data set includes a plurality of updated real-time test data;
[0173] In the embodiment of the present specification, data conversion processing is performed on each real-time data in the real-time test data set, and it is converted into json format to obtain an updated real-time test data set containing multiple updated real-time test data, so as to facilitate subsequent data comparison.
[0174] S803: sequentially acquiring difference values between the update expected data at the target position in the update expected data set and the update real-time test data at the target position in the update real-time test data set, and obtaining a data difference value corresponding to each of the update real-time test data;
[0175] In the embodiment of the present specification, at this time, the data in the updated expected data set and the data in the updated real-time test data set are both sorted data. Therefore, when obtaining the difference value, if the difference value between the first data in the updated expected data set and the first data in the updated real-time test data set is to be obtained, at this time, the target position is at the first data in the updated expected data set or at the first data in the updated real-time test data set. After obtaining the difference value between the first data in the updated expected data set and the first data in the updated real-time test data set, subsequent difference values are obtained in sequence until the difference value between the last data in the updated expected data set and the last data in the updated real-time test data set is obtained, thereby determining the data difference value corresponding to each updated real-time test data.
[0176] S804: If the data difference values corresponding to each of the updated real-time test data are within a preset difference range, it is determined that the use case test of the target use case has passed.
[0177] In the embodiments of the present specification, the user can set a preset difference interval corresponding to each update expected data according to the update expected data; the data difference value corresponding to each update real-time test data can be an absolute value or a difference value directly calculated without any other processing. When the data difference values corresponding to each update real-time test data are within the preset difference interval, the target case test is determined to have passed; if any data difference value exceeds the preset difference interval, the target case test is determined to have failed. By comparing the data in the sorted update expected data set and the data in the update real-time test data set in sequence, the accuracy of each data is ensured, and the entire data conversion and comparison process can be automated, which improves the efficiency and reliability of automated testing and ensures accurate case test results.
[0178] In the embodiment of this specification, before the target use case identification corresponding to the target use case is obtained in response to the target use case test request, as follows Fig. 9 As shown, Fig. 9 A program flow diagram of a test method for a target use case, wherein the method further comprises:
[0179] S901: In response to a use case construction request, obtain a target use case name and use case description information stored in a target terminal and carried in the use case construction request;
[0180] In the embodiment of the present specification, before the target use case is tested, the target use case needs to be built first. In response to the use case building request, the server obtains the target use case name and use case description information stored in the target terminal carried by the use case building request, wherein the target use case name and use case description information may also be stored in the server, and specifically refers to that the target use case name and use case description information will be displayed in the target terminal, so the target terminal also stores the target use case name and use case description information.
[0181] S902: Acquire the target use case identifier corresponding to the target use case stored in the server;
[0182] In the embodiment of the present specification, after obtaining the target use case name and use case description information, the server background will generate a target use case identifier corresponding to the target use case, and one use case identifier corresponds to one use case, which is unique. At the same time, the use case identifier is only stored in the server and is not displayed on the target terminal.
[0183] S903: construct the target use case according to the target use case name, the use case description information and the target use case identifier;
[0184] In the embodiments of this specification, the target use case can be constructed by combining the target use case name, the use case description information and the target use case identifier.
[0185] In the embodiment of the present specification, if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, after determining the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data, the method further includes:
[0186] Adding the target test set and the use case test result to the target use case to obtain an updated target use case;
[0187] In an embodiment of the present specification, the target test set and the use case test results are added to the target use case, and the target test set is split into the form of preset data and expected data, respectively, wherein the preset data is the target data set to be tested, the expected data is the target expected data set, and the use case test results exist in the form of execution records, thereby constituting an updated target use case.
[0188] The updated target use case is sent to the target terminal, so that the target terminal displays the updated target use case.
[0189] In the embodiment of this specification, after the target case test is completed and the case test result is obtained, the server will send the target case to the target terminal so that the target terminal displays the target case name, case description information, preset data, expected data and execution record. Fig.10 As shown, Fig.10 A schematic diagram of an automated testing system provided in an embodiment of this specification. Fig.10As can be seen in the figure, the target terminal display page displays the project files and target use cases corresponding to the target use case. Specifically, the project name can be TestCase Explorer, test scene 1 can be scene1, test case 1 can be the first test case tc1-1 corresponding to test scene 1, test case 2 can be the second test case tc1-2 corresponding to test scene 1, test scene 2 can be scene2, test case 3 can be the first test case tc2-1 corresponding to test scene 2, and test case 4 can be the second test case tc2-2 corresponding to test scene 2; As can be seen in the figure, test case 1 is executed at this time, and the use case description can be Test Sensor for scene1, that is, the sensor test case for test scene 1; the user can customize the preset data and the expected data according to the add or delete keys near the preset data and the expected data; the content of preset data 1 can be 00:00data-sensor1-input-1, the content of preset data 2 can be 00:00data-sensor1-input-2, and the content of preset data 3 can be 00:02data-sensor1-input-3, indicating that preset data 1 and preset data 2 are sent when the server starts to send updated test data to the SDPU unit in the vehicle system, and preset data 3 is sent when the server starts to send data to the SDPU unit in the vehicle system. 2 seconds after the expected data is received, the server sends preset data 3 to the SDPU unit in the vehicle system. At the same time, preset data 1 is the first input data of sensor 1, preset data 2 is the second input data of sensor 1, and preset data 3 is the third input data of sensor 1; the content of expected data 1 can be 1.data-sensor1-output1, the content of expected data 2 can be 2.data-sensor1-output2, and the content of expected data 3 can be 3.data-sensor1-output3, which respectively represent the data identifier and data description corresponding to each expected data. For example, the data id of expected data 1 is 1, and the data description is the first output data of sensor 1.In addition, the display form of preset data and expected data is not limited to this. When the user needs to change additional information, the user can include the data information modified by the user. The user can start executing the test case by running the run case button. Of course, the test cases that are started can be multiple and executed simultaneously. The result description of test case 1 is recorded in the execution record. For example, it can be "test case 1 failed to execute, and the expected data displayed is a, but the actual tested data is b". Of course, if multiple test cases are executed simultaneously, the server will eventually generate a test case engineering report. Each test case in the report includes the test case name, the test case result and the test case log. Finally, it is combined with a tabular file, such as Excel, to save and process, which reduces the time of manual testing and data processing, saves the testing cost, and simplifies the collation and analysis process of the test case test results. By clearly displaying the detailed information of each test case on the target terminal, including the target case name, the case description information, the preset data, the expected data and the execution record, the tester can understand the content of the test case at a glance. At the same time, the graphical interface is provided through the target terminal, so that the tester can easily browse and manage the test case, which improves the efficiency of the target case automation test and the consistency of the test.
[0190] In an exemplary embodiment, a server provides an automated testing framework, which includes a test case management component, a data management component, a data transceiver component, and a data comparison and verification component. Through modular design and case management, the functions of data management, data transceiver, and case management are separated, which reduces manual intervention and reduces the workload of testers. In the test case management component, the server maintains a project file, which is saved in json format; the project file includes a tree structure of the project name, project description, and use cases, that is, the directory hierarchy of the project, and the leaf node of the tree structure is the use case id. Different use case ids represent different use cases, and the use case id is automatically generated by the server background when the use case is built. When the use case is built, each use case includes the key information of the use case, that is, the use case name, use case description, preset data, expected data, and execution record, and whenever a use case is built, the server background will automatically generate a unique use case id corresponding to each use case. Among them, the preset data and expected data are both in the form of a combination of data id and additional data information. Specifically, the data id includes id and data description, and the additional data information includes the field name and value of the supplementary modification field. The execution record contains the historical execution information of the use case, which includes but is not limited to the execution time, execution success information or execution failure information of the use case. When the use case is successfully created, the server stores each use case in the database in the form of a key value. Optionally, it may include but is not limited to open source document database management systems Mysql or MongoDb, and the primary key is the use case id. Whenever the use case is edited, the key information of the use case is modified and saved, and the server updates the key information of the use case to the database. Whenever a use case needs to be deleted, the server deletes the use case id corresponding to the use case in the project file, and simultaneously deletes the use case in the database with the use case id corresponding to the use case as the primary key. The following introduces the specific workflow of the data management component, such as Fig.11 As shown, Fig.11 A flow chart of a data management component provided in an embodiment of this specification includes:
[0191] S1101: The server pre-imports the data type definition library.
[0192] In the embodiment of this specification, the data type definition library is provided by the SDPU unit in the vehicle system, and the server obtains and imports the data type definition library so as to extract the data type from the data type definition library later, so that the data type definition in the server is compatible with the original data type and abstracted data of the sensor defined in the SDPU unit. Among them, the original data type of the sensor defined in the SDPU unit refers to the data type directly collected by the sensor, which is usually the unprocessed raw data; the abstracted data refers to the data after the raw data is processed and converted, usually to better meet the needs of the application and improve the readability and operability of the data.
[0193] S1102: The server determines a method for extracting a field name.
[0194] In the embodiments of this specification, the data type definition library includes basic structures and complex structures. For basic structures, the server needs to convert the basic structures into json format and then extract the field names in the basic structures; for complex structures, the server needs to flatten them and extract all the fields in the structure.
[0195] S1103: The server extracts fields in the basic structure.
[0196] In the embodiment of the present specification, the server initializes the basic structure as an object and converts it into json format text through an external library. In the text, the basic structure exists in the form of key value, where the key is the field name and the value is the identification number of each field. The server only extracts all the keys, that is, the field names.
[0197] S1104: The server extracts fields from the complex structure.
[0198] In the embodiment of the present specification, the server flattens the complex structure and extracts the nested field names in the complex structure layer by layer.
[0199] S1105: The server imports data from an external file.
[0200] In the embodiment of this specification, the external file is a file recorded and saved after the actual vehicle test corresponding to the vehicle-mounted system, which includes multiple preset data and expected data corresponding to each preset data. Since the real data file collected during the actual vehicle test, that is, the external file, is relatively large, the server can filter the data in the external file according to some key information, wherein the data can be filtered according to the execution time, data type or other key information, and some data can be selected and imported into the server.
[0201] S1106: User-defined data.
[0202] In the embodiments of this specification, the user may also customize the data corresponding to these data types according to the acquired data types, that is, the field names extracted from the basic structure and the field names extracted from the complex structure.
[0203] S1107: The server annotates the data and stores it in the database.
[0204] In the embodiment of this specification, when the data construction is completed, that is, the server has imported the data from the external file or the user-defined data is completed, each data must be marked. Specifically, the annotation information corresponding to each data needs to include data id, label name, data type, first data content and second data content. Among them, the server background will generate a unique data id corresponding to each data; when the data is user-defined data, the user needs to manually enter the label name corresponding to each data, and its uniqueness needs to be guaranteed. When the data is imported from an external file, the default label name of the data is in the form of file name_import time_serial number, and the user can also modify it on this basis, but it is necessary to ensure the uniqueness of each label name; the data type is the type of each data; the first data content is the text in json format obtained by serializing each data, which is convenient for users to view; the second data content is the original data content in binary (bin) format, which is used for server transmission. When the data annotation is completed, the server will store the annotation information of each data in the database in the form of key value, where the primary key is data id. And the data id is the same value as the data id of the preset data and expected data in the test management component, but the data id in the test management component also carries a data description.
[0205] In this embodiment, the data management component supports the management of two data type structures and can extract fields from different structures, so that the data type definition of the data in the server is adapted to the original data type of the sensor and the abstracted data defined in the SDPU unit, ensuring the consistency and compatibility of the data type; by supporting the import of data from external files and filtering the data by key information, as well as allowing users to manually enter custom data, a flexible data construction method is provided; through data labeling, the server background generates a unique data id corresponding to each data, ensuring the uniqueness of each data; by storing data in the database in the form of key values, the persistence and management of the data is ensured, the uniqueness and traceability of the data are ensured, and the selectivity of the data required for use case testing is improved.
[0206] In an exemplary embodiment, Fig.12 As shown, Fig.12 A flow chart of a data transceiver component provided in an embodiment of this specification includes:
[0207] S1201: The server selects a data sending and receiving method.
[0208] In the embodiments of this specification, the server interacts with the SDPU unit in the vehicle system, and the server needs to send preset data to the SDPU unit, or receive response data from the SDPU unit. The server can choose to use a variety of communication methods to send and receive data with the SDPU unit in the vehicle system, where the communication methods include but are not limited to Data Distribution Service, Zero Message Queue (ZeroMQ), Transmission Control Protocol (Transmission Control Protocol), and User Datagram Protocol (User Datagram Protocol).
[0209] S1202: The server adds additional information to the message header.
[0210] In the embodiments of this specification, taking the data distribution service as an example, the preset data will be packaged in the form of a Topic and then distributed or subscribed. When the preset data needs to be sent from the server to the SDPU unit in the vehicle system, the server acts as a publisher and the SDPU unit acts as a subscriber. The server adds an additional information to the message header of each message, which can be, for example, a use case identifier corresponding to each preset data, and uses it as a CRC check value to verify the accuracy of data transmission.
[0211] S1203: The server adds the data content to the message body.
[0212] In the embodiment of the present specification, the server uses the preset data as the message body, adds it to the message body, and combines it with the additional information to form a complete message.
[0213] S1204: The server sends the first message to the vehicle system.
[0214] In the embodiment of this specification, the test of a use case requires multiple preset data, so there are multiple messages. After the message encapsulation is completed, the server sends the first message to the SDPU unit of the vehicle system.
[0215] S1205: The server starts a sending timer.
[0216] In the embodiments of this specification, when there are multiple messages to be sent, a sending time interval can be set so that each message is sent according to the set sending time interval. Exemplarily, when the first message is sent, the server starts a timer and sets the timing duration of the timer to the time interval between the second message and the first message.
[0217] S1206: The server sends the next message to the vehicle system.
[0218] In the embodiments of this specification, the timer is essentially a counter. For example, when the count value of the timer is reduced to 0, it is determined that the time to send the second message has arrived, and the server sends the next message to the SDPU unit of the vehicle system. When the second message is sent, the same process is repeated until the server sends the last message to the SDPU unit of the vehicle system.
[0219] S1207: The server starts a receiving timer.
[0220] In an embodiment of the present specification, after the server sends the first message to the SDPU unit of the vehicle system, the server starts a receiving timer, which can be set to 2s for example, during which the server waits to receive response data containing specific additional information sent by the SDPU unit in the vehicle system.
[0221] S1208: The server places the received message into the received message queue.
[0222] In the embodiment of the present specification, the server places the received message, ie, the response data, into a received message queue for subsequent data comparison.
[0223] In this embodiment, the data transceiver component has an efficient communication mechanism, supports multiple communication protocols such as DDS, ZMQ, TCP, UDP, etc., provides a flexible communication method, and enhances the communication flexibility and compatibility between the server and the vehicle-mounted system; and the data transceiver component helps to ensure the integrity of the data and prevent the loss or duplication of data packets by adding additional information to the message header of each message to uniquely identify the message. At the same time, after the SDPU unit receives the message, it adds the additional information to the message header of the response message to ensure the correspondence between the response message and the request message, which is convenient for subsequent data processing and verification; the data transceiver component helps to ensure the stability of data transmission and ensure the orderly sending and receiving of data by setting the sending time interval and starting the timer; the data transceiver component starts a timer after sending the data to wait for the response data containing specific additional information, ensuring that the server has enough waiting time to receive the response, avoiding data loss due to premature termination of reception, and saving the received response data to the receiving message queue, which is convenient for subsequent data processing and analysis, ensuring the order and integrity of the data, and improving the reliability and accuracy of the automated test.
[0224] In an exemplary embodiment, Fig.13 As shown, Fig.13 A flow chart of a data comparison and verification component provided in an embodiment of this specification includes:
[0225] S1301: The server compares whether the expected number of data items is the same as the received number of data items.
[0226] In an embodiment of the present specification, the server first parses the received message to obtain additional information in the received message, and compares the additional information with the additional information in the message sent by the server to ensure the accuracy of data transmission. When it is confirmed that the two additional information are consistent, the message bodies of all received messages in the received message queue are extracted and combined to form a received data queue. The expected data queue and the received data queue are traversed to check whether the number of data in the expected data queue is the same as the number of data in the received data queue. If the number of data in the expected data queue is different from the number of data in the received data queue, it can be determined that the use case test has failed, a test report is generated, and the test process ends.
[0227] S1302: The server sorts the data in the expected data queue according to the size of the expected data.
[0228] In the embodiment of the present specification, for the expected data, the server sorts the data in the expected data queue according to the size of the expected data.
[0229] S1303: The server sorts the data in the received data queue according to the size of the received data.
[0230] In the embodiment of the present specification, for receiving data, the server sorts the data in the received data queue according to the size of the received data, and the sorting method of the received data needs to be the same as the sorting method of the expected data to facilitate data comparison.
[0231] S1304: The server compares each expected data and received data in sequence.
[0232] In an embodiment of the present specification, the server compares the data in the expected data queue and the data in the received data queue in sequence. During the comparison process, if the difference between the first data in the expected data queue and the first data in the received data queue is within a preset difference interval, the first data in the received data queue passes the test and subsequent data comparison is performed. If all the data in the received data queue pass the test, the data comparison is considered successful and the use case test passes; if the comparison result of the existing data in the received data queue fails, the use case test is considered to have failed. At the same time, regardless of whether the use case test succeeds or fails, the server will generate a result report, which will be recorded in the form of an execution record in the execution record corresponding to each use case in the test case management component.
[0233] The data comparison and verification component in this embodiment first compares whether the expected number of data items is the same as the received number of data items, ensuring the integrity of the data and avoiding misjudgment caused by data loss or excess data; for the expected data queue and the received data queue, the size of the data in each queue is calculated and sorted according to the size of the data, ensuring that the data has the same order when compared, facilitating comparison one by one, and improving the efficiency and accuracy of the comparison; at the same time, after the comparison is completed, the difference results are returned and a result report is provided, which helps to quickly locate and solve problems and improves the readability of the test results; and when all the received data match their corresponding expected data, the comparison is considered successful, ensuring comprehensive verification of the data and improving the accuracy of the test results.
[0234] This specification also provides test setups for target use cases, such as Fig.14 As shown, the device comprises:
[0235] The target use case identification determination module 1401 is used to obtain the target use case identification corresponding to the target use case in response to the target use case test request;
[0236] The target test set determination module 1402 is used to search for a target test set matching the target case identifier in the identification test set library, and obtain the target test data and target expected data in the target test set; the identification test set library includes a mapping relationship between a preset case identifier and a preset test set; the preset test set includes preset test data and preset expected data;
[0237] The sending module 1403 is used to perform data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and send the updated data to be tested to the vehicle-mounted system; so that the vehicle-mounted system performs data test processing based on the updated data to be tested to obtain real-time data test results;
[0238] The acquisition module 1404 is used to receive the real-time data test result sent by the vehicle-mounted system, and parse and process the real-time data test result to obtain a real-time test identifier and real-time test data;
[0239] The identification comparison result determination module 1405 is used to compare the target use case identification with the real-time test identification to obtain an identification comparison result;
[0240] The use case test result determination module 1406 is used to determine the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification.
[0241] In some embodiments, the target use case identification determination module further includes:
[0242] An acquisition request sending submodule, used for sending a request for acquiring the data type to be tested to the vehicle system in response to the target case test request;
[0243] A preset data type extraction submodule, used for receiving a preset data type file corresponding to a target case test request sent by the vehicle-mounted system, and extracting a preset data type in the preset data type file;
[0244] A local test data file acquisition submodule is used to acquire a local test data file; the local test data file includes a plurality of local data types and a local test set corresponding to each of the local data types; the local test set includes a plurality of local test data and local expected data corresponding to each of the local test data;
[0245] An initial test set determination submodule is used to search the local test data file for a local test set that matches the preset data type to obtain an initial test set;
[0246] A preset test set determination submodule is used to perform data screening processing on the initial test data and the initial expected data in the initial test set to obtain the preset test set;
[0247] The target use case identifier acquisition submodule is used to acquire the target use case identifier corresponding to the target use case.
[0248] In some embodiments, the preset test set determination submodule further includes:
[0249] An initial data identification acquisition unit, used to acquire an initial data identification corresponding to initial data; the initial data is any one of the initial test data and the initial expected data;
[0250] An initial use case identifier determining unit, configured to determine an initial use case identifier corresponding to the initial data identifier from the preset use case identifiers;
[0251] A use case identifier data relationship library determining unit, configured to determine the correspondence between the initial use case identifier and the initial data according to the correspondence between the initial data identifier and the initial data and the correspondence between the initial use case identifier and the initial data identifier, and obtain a use case identifier data relationship library;
[0252] A preset test set determination unit, configured to search the preset data corresponding to the preset use case identifier in the use case identifier data relationship library, and determine that the preset data is the preset test set; the preset data includes the preset data to be tested and the preset expected data;
[0253] In some embodiments, the apparatus further comprises:
[0254] The identification test set library construction module is used to construct the identification test set library according to the corresponding relationship between the preset use case identification and the preset test set.
[0255] In some embodiments, the preset data type extraction submodule further includes:
[0256] A preset data type file receiving unit, used for receiving the preset data type file sent by the vehicle-mounted system;
[0257] A data information extraction unit, used to extract static data information and dynamic data information from the preset data type file;
[0258] A first preset data type obtaining unit, configured to perform serialization processing on the static data information to obtain a first preset data type;
[0259] A second preset data type obtaining unit, configured to perform flattening processing on the dynamic data information to obtain a second preset data type;
[0260] A preset data type determining unit is used to determine the preset data type according to the first preset data type and the second preset data type.
[0261] In some embodiments, the test case result determination module further includes:
[0262] A quantity acquisition submodule, configured to acquire the target expected data quantity corresponding to the target expected data set and the real-time test data quantity corresponding to the real-time test data set if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification;
[0263] A quantity comparison result acquisition submodule is used to compare the target expected data quantity with the real-time test data quantity to obtain a quantity comparison result;
[0264] The case test result determination submodule is used to obtain the case test result according to the difference between the real-time test data and the target expected data if the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity.
[0265] In some embodiments, the use case test result determination submodule further includes:
[0266] an updated expected data set determining unit, configured to, if the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, perform data conversion processing on each of the target expected data in the target expected data set to obtain an updated expected data set; the updated expected data set includes a plurality of updated expected data;
[0267] An updated real-time test data set determining unit is used to perform data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set; the updated real-time test data set includes a plurality of updated real-time test data;
[0268] A data difference value determining unit, used to sequentially obtain difference values between the update expected data at the target position in the update expected data set and the update real-time test data at the target position in the update real-time test data set, and obtain a data difference value corresponding to each of the update real-time test data;
[0269] The test pass determination unit is used to determine that the test case test of the target test case has passed if the data difference values corresponding to each of the updated real-time test data are within a preset difference range.
[0270] In some embodiments, the update expected data set determination unit further includes:
[0271] A serialized expected data set determination subunit is used to serialize each of the target expected data in the target expected data set to obtain a serialized expected data set if the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity; the serialized expected data set includes a plurality of serialized expected data;
[0272] an update expected data set determining subunit, configured to sort the data in the serialized expected data set according to the size of each of the serialized expected data in the serialized expected data set to obtain the update expected data set;
[0273] In some embodiments, the updating real-time test data set determination unit further comprises:
[0274] A serialized real-time test data set determination subunit is used to perform serialization processing on each of the real-time test data in the real-time test data set to obtain a serialized real-time test data set; the serialized real-time test data set includes a plurality of serialized real-time test data;
[0275] The updated real-time test data set determining subunit is used to sort the data in the serialized real-time test data set according to the size of each serialized real-time test data in the serialized real-time test data set to obtain the updated real-time test data set.
[0276] In some embodiments, the sending module further includes:
[0277] An updated test data determination submodule is used to perform data fusion processing on the target use case identifier and each of the target test data to obtain updated test data corresponding to each of the target test data;
[0278] A time determination submodule, used to determine a preset sending time corresponding to each of the updated test data and a preset duration corresponding to the target use case according to a preset strategy;
[0279] A sending submodule, used for sending the updated test data to the vehicle system at the preset sending time;
[0280] In some embodiments, the acquisition module further includes:
[0281] A real-time duration acquisition submodule, used to receive the real-time data test result sent by the vehicle-mounted system, and acquire the real-time duration corresponding to the real-time data test result;
[0282] The parsing submodule is used to parse the real-time data test result if the real-time duration is less than the preset duration to obtain the real-time test identifier and the real-time test data.
[0283] In some embodiments, the apparatus further comprises:
[0284] An information acquisition module, configured to respond to a use case construction request and acquire a target use case name and use case description information stored in a target terminal and carried in the use case construction request;
[0285] A target use case identifier acquisition module, used to acquire the target use case identifier corresponding to the target use case stored in the server;
[0286] A target use case construction module, used to construct the target use case according to the target use case name, the use case description information and the target use case identifier;
[0287] In some embodiments, the apparatus further comprises:
[0288] An updated target use case determination module is used to add the target test set and the use case test result to the target use case to obtain an updated target use case;
[0289] A display module is used to send the updated target use case to the target terminal so that the target terminal displays the updated target use case.
[0290] The device and method embodiments in the described device embodiments are based on the same inventive concept.
[0291] An embodiment of the present specification provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement a test method for a target use case provided in the above method embodiment.
[0292] An embodiment of the present application also provides a computer storage medium, which can be set in a terminal to store at least one instruction or at least one program related to a test method for implementing a target use case in a method embodiment, and the at least one instruction or at least one program is loaded and executed by the processor to implement the test method for the target use case provided by the above method embodiment.
[0293] The embodiment of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the test method for the target use case provided by the above method embodiment.
[0294] The memory described in the embodiments of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0295] The test method embodiment of the target use case provided in the embodiments of this specification can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig.15 1 is a hardware structure diagram of a server of a test method for a target use case provided in an embodiment of this specification. Fig.15As shown, the server 1500 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1510 (the central processing unit 1510 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1530 for storing data, and one or more storage media 1520 (such as one or more mass storage devices) for storing application programs 1523 or data 1522. Among them, the memory 1530 and the storage medium 1520 can be short-term storage or permanent storage. The program stored in the storage medium 1520 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1510 can be configured to communicate with the storage medium 1520 and execute a series of instruction operations in the storage medium 1520 on the server 1500. The server 1500 may also include one or more power supplies 1560, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1540, and / or one or more operating systems 1521, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0296] The input / output interface 1540 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 1500. In one example, the input / output interface 1540 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 1540 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0297] It can be understood by those skilled in the art that Fig.15 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.15 More or fewer components as shown, or with Fig.15 Different configurations are shown.
[0298] It can be seen from the embodiments of the test method and device for the target use case provided by the present application that the present application responds to a target use case test request, obtains a target use case identifier corresponding to the target use case; searches for a target test set matching the target use case identifier in an identifier test set library, and obtains target test data and target expected data in the target test set; the identifier test set library includes a mapping relationship between a preset use case identifier and a preset test set; the preset test set includes preset test data and preset expected data; performs data fusion processing on the target use case identifier and the target test data to obtain updated test data, and sends the updated test data to the vehicle-mounted system; so that the vehicle-mounted system performs data test processing based on the updated test data to obtain a real-time data test result; receives the real-time data test result sent by the vehicle-mounted system, and parses the real-time data test result to obtain a real-time test identifier and real-time test data; performs consistency comparison between the target use case identifier and the real-time test identifier to obtain an identifier comparison result; if the identifier comparison result indicates that the target use case identifier is consistent with the real-time test identifier, the use case test result corresponding to the target use case is determined according to the difference between the real-time test data and the target expected data. This application obtains data that can be used for use case testing by combining preset data type files and local test data files, thereby improving the flexibility and compatibility of data management; by combining use case identifiers, data identifiers, and the correspondence between data to build an identification test set library, the data source can be flexibly selected when the target use case needs to be tested; at the same time, the data transmission between the server and the vehicle system can support multiple communication methods, thereby enhancing the communication flexibility and compatibility between the server and the vehicle system; by introducing data conversion and data comparison, the consistency and correctness of the data are ensured, and the accuracy of the automated test results is improved; by supporting batch execution of use cases and generating reports, the test result collation and analysis process is simplified, automated execution is facilitated, and the efficiency of automated testing is improved.
[0299] It should be noted that the above sequence of the embodiments of this specification is for description only and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0300] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0301] A person skilled in the art will appreciate that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0302] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A test method for a target use case, characterized in that: The method comprises: In response to the target use case test request, obtaining a target use case identifier corresponding to the target use case; Searching for a target test set matching the target case identifier in an identifier test set library, and obtaining target test data and target expected data in the target test set; the identifier test set library includes a mapping relationship between preset case identifiers and preset test sets; the preset test set includes preset test data and preset expected data; Performing data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and sending the updated data to be tested to the vehicle-mounted system; so that the vehicle-mounted system performs data test processing based on the updated data to be tested, so as to obtain real-time data test results; Receiving the real-time data test result sent by the vehicle-mounted system, and parsing and processing the real-time data test result to obtain a real-time test identifier and real-time test data; Perform consistency comparison between the target use case identifier and the real-time test identifier to obtain an identifier comparison result; If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, a use case test result corresponding to the target use case is determined according to the difference between the real-time test data and the target expected data.
2. The method according to claim 1, characterized in that The step of obtaining, in response to the target use case test request, a target use case identifier corresponding to the target use case includes: In response to the target case test request, sending a request for obtaining the type of data to be tested to the vehicle system; Receiving a preset data type file corresponding to a target case test request sent by the vehicle-mounted system, and extracting a preset data type in the preset data type file; Acquire a local test data file; the local test data file includes a plurality of local data types and a local test set corresponding to each of the local data types; the local test set includes a plurality of local test data and local expected data corresponding to each of the local test data; Searching the local test data file for a local test set that matches the preset data type to obtain an initial test set; Performing data screening processing on the initial test data and the initial expected data in the initial test set to obtain the preset test set; Obtain the target use case identifier corresponding to the target use case.
3. The method according to claim 2, characterized in that The performing data screening processing on the initial test data and the initial expected data in the initial test set to obtain the preset test set includes: Acquire an initial data identifier corresponding to initial data; the initial data is any one of the initial test data and the initial expected data; Determine an initial use case identifier corresponding to the initial data identifier from the preset use case identifiers; According to the correspondence between the initial data identifier and the initial data and the correspondence between the initial use case identifier and the initial data identifier, determine the correspondence between the initial use case identifier and the initial data, and obtain a use case identifier data relationship library; Searching for preset data corresponding to the preset use case identifier in the use case identifier data relationship library, and determining that the preset data is the preset test set; the preset data includes the preset data to be tested and the preset expected data; Before searching the target test set matching the target case identifier in the identifier test set library and obtaining the target to-be-tested data and the target expected data in the target test set, the method further includes: The identified test set library is constructed according to the correspondence between the preset use case identifiers and the preset test sets.
4. The method according to claim 2, characterized in that: The receiving the preset data type file sent by the vehicle-mounted system and extracting the preset data type in the preset data type file includes: Receiving the preset data type file sent by the vehicle-mounted system; Extracting static data information and dynamic data information from the preset data type file; Serializing the static data information to obtain a first preset data type; Flattening the dynamic data information to obtain a second preset data type; The preset data type is determined according to the first preset data type and the second preset data type.
5. The method according to claim 1, characterized in that The target data to be tested is any data in the target data set to be tested; the target expected data is any data in the target expected data set; the real-time test data is any data in the real-time test data set; if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, determining the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data, includes: If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, obtaining the target expected data quantity corresponding to the target expected data set and the real-time test data quantity corresponding to the real-time test data set; Comparing the target expected data quantity with the real-time test data quantity to obtain a quantity comparison result; If the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity, the use case test result is obtained according to the difference between the real-time test data and the target expected data.
6. The method according to claim 5, characterized in that If the quantity comparison result indicates that the target expected data quantity is the same as the real-time test data quantity, obtaining the use case test result according to the difference between the real-time test data and the target expected data includes: If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, data conversion processing is performed on each of the target expected data in the target expected data set to obtain an updated expected data set; the updated expected data set includes a plurality of updated expected data; Performing data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set; the updated real-time test data set includes a plurality of updated real-time test data; Sequentially acquiring difference values between the update expected data at the target position in the update expected data set and the update real-time test data at the target position in the update real-time test data set, and obtaining a data difference value corresponding to each of the update real-time test data; If the data difference values corresponding to each of the updated real-time test data are within the preset difference range, it is determined that the use case test of the target use case has passed.
7. The method according to claim 6, characterized in that If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, performing data conversion processing on each of the target expected data in the target expected data set to obtain an updated expected data set, including: If the quantity comparison result indicates that the quantity of the target expected data is the same as the quantity of the real-time test data, serializing each of the target expected data in the target expected data set to obtain a serialized expected data set; the serialized expected data set includes a plurality of serialized expected data; sorting the data in the serialized expected data set according to the size of each serialized expected data in the serialized expected data set to obtain the updated expected data set; The performing data conversion processing on each of the real-time test data in the real-time test data set to obtain an updated real-time test data set includes: Performing serialization processing on each of the real-time test data in the real-time test data set to obtain a serialized real-time test data set; the serialized real-time test data set includes a plurality of serialized real-time test data; According to the size of each serialized real-time test data in the serialized real-time test data set, the data in the serialized real-time test data set is sorted to obtain the updated real-time test data set.
8. The method according to claim 1, characterized in that The step of performing data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and sending the updated data to be tested to the vehicle-mounted system includes: Performing data fusion processing on the target use case identifier and each of the target data to be tested to obtain updated data to be tested corresponding to each of the target data to be tested; Determine, according to a preset strategy, a preset sending time corresponding to each of the updated data to be tested and a preset duration corresponding to the target use case; Sending the updated test data to the vehicle system at the preset sending time; The receiving the real-time data test result sent by the vehicle-mounted system and parsing the real-time data test result to obtain a real-time test identifier and real-time test data includes: Receiving the real-time data test result sent by the vehicle-mounted system, and obtaining the real-time duration corresponding to the real-time data test result; If the real-time duration is less than the preset duration, the real-time data test result is parsed and processed to obtain the real-time test identifier and the real-time test data.
9. The method according to claim 1, characterized in that: Before obtaining the target use case identifier corresponding to the target use case in response to the target use case test request, the method further includes: In response to the use case construction request, obtaining the target use case name and use case description information stored in the target terminal and carried in the use case construction request; Obtaining the target use case identifier corresponding to the target use case stored in the server; Constructing the target use case according to the target use case name, the use case description information and the target use case identifier; If the identification comparison result indicates that the target use case identification is consistent with the real-time test identification, after determining the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data, the method further includes: Adding the target test set and the use case test result to the target use case to obtain an updated target use case; The updated target use case is sent to the target terminal, so that the target terminal displays the updated target use case.
10. A test device for a target use case, characterized in that: The device comprises: A target use case identification determination module, used to obtain a target use case identification corresponding to a target use case in response to a target use case test request; A target test set determination module is used to search for a target test set matching the target case identifier in an identification test set library, and obtain target test data and target expected data in the target test set; the identification test set library includes a mapping relationship between a preset case identifier and a preset test set; the preset test set includes preset test data and preset expected data; A sending module, used for performing data fusion processing on the target use case identifier and the target data to be tested to obtain updated data to be tested, and sending the updated data to be tested to the vehicle-mounted system; so that the vehicle-mounted system performs data test processing based on the updated data to be tested to obtain real-time data test results; An acquisition module, used for receiving the real-time data test result sent by the vehicle-mounted system, and parsing and processing the real-time data test result to obtain a real-time test identifier and real-time test data; An identification comparison result determination module is used to compare the target use case identification with the real-time test identification to obtain an identification comparison result; The use case test result determination module is used to determine the use case test result corresponding to the target use case according to the difference between the real-time test data and the target expected data if the identification comparison result indicates that the target use case identification is consistent with the real-time test identification.