Big data verification method and device, equipment and storage medium
By introducing terminal equipment, bus simulation equipment, vehicle communication equipment and big data cloud into the big data testing system, the test data collection is generated and verified, and the problems of inaccurate data, low testing efficiency and high cost in traditional big data testing methods are solved, and the effect of automated verification of big data is achieved.
Patent Information
- Application Number
- CN202510070449.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-30
AI Technical Summary
Traditional big data testing methods rely on manual construction conditions, resulting in inaccurate data, low testing efficiency and high cost.
Through a big data verification method, test data collections are generated and verified to achieve automated verification using terminal equipment, bus simulation equipment, vehicle communication equipment and big data cloud.
It improves the accuracy and efficiency of big data testing, reduces the testing cost, and realizes automated verification of big data.
Smart Images

Figure CN120075096A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data testing, and particularly to a big data verification method, device, equipment, and storage medium. Background Art
[0002] With the development and competition in the automotive industry, cutting-edge technologies such as big data, cloud computing, and AI are increasingly applied to the automotive industry. As the vehicle's data is an important factor in product iteration and improvement, it has become crucial for the vehicle manufacturers. To ensure the accuracy and integrity of data reporting and meet the transmission requirements in different scenarios, the testing methods and efficiency need to be continuously updated and improved.
[0003] Traditional big data testing mainly relies on manual construction of various working conditions based on real vehicles to construct and report data values. The data reported by the vehicle is collected by recording through simulation devices, viewed by logging in to the cloud big data platform, and finally the data to be verified is selected through information such as timestamps and signal names for one-by-one comparison to complete the test verification process. In the data test verification process, due to the inability to construct some working conditions and the inability to accurately construct some data, there are many data items, and the workload of data construction, search, and comparison is large, the test takes a long time, resulting in inaccurate reported data, low test efficiency, and high test costs. Summary of the Invention
[0004] Based on this, this application provides a big data verification method, device, equipment, and storage medium to solve the technical problems of inaccurate reported data, low test efficiency, and high test costs.
[0005] In a first aspect, a big data verification method is provided. This method is applied to a big data verification system, which includes a terminal device, a bus simulation device, a vehicle-mounted communication device, and a big data cloud. The terminal device is respectively connected to the bus simulation device and the big data cloud, the bus simulation device is connected to the vehicle-mounted communication device, and the vehicle-mounted communication device is connected to the big data cloud. The method includes:
[0006] In response to receiving the operation information input by the user pressing the data update button through the terminal device, the bus simulation device obtains the preset test files stored in the terminal device, where the preset test files include ASN.1 definition files and Excel configuration files;
[0007] Generate a test data set according to the ASN.1 definition file, Excel configuration file, and preset interface information, and send the test data set to the vehicle-mounted communication device;
[0008] The vehicle-mounted communication device forwards the test data set to the big data cloud;
[0009] The terminal device obtains a test data set from the big data cloud, and verifies whether the test data set forwarded by the vehicle-mounted communication device is correct according to the test data set and the preset test file.
[0010] According to an implementable manner in the embodiment of the present application, before the bus simulation device obtains the preset test file, the method further includes:
[0011] Define the variables to be tested according to the ASN.1 standard format to obtain an ASN.1 definition file;
[0012] Integrate the variables to be tested and the data corresponding to the variables to be tested to obtain an Excel configuration file;
[0013] According to the ASN.1 definition file, perform equivalence class partitioning on the variables to be tested to obtain equivalence class variables;
[0014] Based on the value range of the equivalence class variables, determine the test values of the variables to be tested;
[0015] Update the Excel configuration file according to the test values of the variables to be tested.
[0016] According to an implementable manner in the embodiment of the present application, the equivalence class variables include valid equivalence class enumerated variables, invalid equivalence class enumerated variables, valid equivalence class positive integer variables, and invalid equivalence class positive integer variables; based on the value range of the equivalence class variables, determining the test values of the variables to be tested includes:
[0017] Use each value within the value range of the valid equivalence class enumerated variables as the test value of the valid equivalence class enumerated variables;
[0018] Use any value within the value range of the invalid equivalence class enumerated variables as the test value of the invalid equivalence class enumerated variables;
[0019] According to the boundary values of the value range of the valid equivalence class positive integer variables, determine the test values of the valid equivalence class positive integer variables;
[0020] Use any integer value and decimal value within the value range of the invalid equivalence class positive integer variables as the test values of the invalid equivalence class positive integer variables;
[0021] Perform the simplest orthogonal combination on the test values of the valid equivalence class enumerated variables, the test values of the invalid equivalence class enumerated variables, the test values of the valid equivalence class positive integer variables, and the test values of the invalid equivalence class positive integer variables to obtain the test values of the variables to be tested.
[0022] According to an implementable manner in the embodiment of the present application, generate a test data set according to the ASN.1 definition file, the Excel configuration file, and the preset interface information, including:
[0023] Compile the ASN.1 definition file and return a specification mode object, where the specification mode object contains the structure defined by ASN.1;
[0024] Parse the Excel configuration file and convert the parsed Excel configuration file into a preset format configuration file based on the structure defined by ASN.1;
[0025] Generate a test data set according to the preset format configuration file and the preset interface information.
[0026] According to an implementable manner in the embodiments of the present application, parsing the Excel configuration file includes:
[0027] Read the data in the Excel configuration file and load it into a data structure object;
[0028] Obtain the page name of each preset independent page in the Excel configuration file, as well as the integer number of rows, the integer number of columns, and the Excel data list of each preset independent page;
[0029] According to the page type of the preset independent page, perform data type conversion on the Excel data list based on the integer number of rows and the integer number of columns of each preset independent page to obtain the parsed Excel configuration file.
[0030] According to an implementable manner in the embodiments of the present application, performing data type conversion on the Excel data list based on the integer number of rows and the integer number of columns of each preset independent page includes:
[0031] Judge the value variable type of the cell data in the Excel data list;
[0032] If the value variable type is integer type, convert the cell data from the original base data to integer type;
[0033] If the value variable type is byte sequence, convert the cell data from string type to byte string object;
[0034] If the value variable type is boolean type, convert the cell data into true value or false value;
[0035] If the value variable type is null value, fill the cell data with no value;
[0036] If the value variable type is floating point number, convert the cell data into floating point type;
[0037] If the value variable type is string type, according to the field type of the cell data, convert the data type of the cell data, and judge whether the actual value length of the cell data meets the preset field length. If it meets, retain the cell data after converting the data type.
[0038] According to an implementable manner in an embodiment of the present application, converting the parsed Excel configuration file into a preset format configuration file based on the structure defined by ASN.1 includes:
[0039] Obtain the operation identifier and service identifier in the parsed Excel configuration file;
[0040] Concatenate the independent page name according to the operation identifier and service identifier;
[0041] Obtain the data of the target independent page corresponding to the independent page name;
[0042] Obtain the target data in the data of the target independent page according to the preset operation type;
[0043] Based on the target data and the structure defined by ASN.1, perform uper encoding on the target data, and convert the encoded target data into preset format data to obtain a preset format configuration file.
[0044] In a second aspect, a big data verification device is provided. The device is set in a big data verification system, and the system includes a terminal device, a bus emulation device, a vehicle-mounted communication device, and a big data cloud. The terminal device is respectively connected to the bus emulation device and the big data cloud. The bus emulation device is connected to the vehicle-mounted communication device, and the vehicle-mounted communication device is connected to the big data cloud. The device includes:
[0045] An acquisition module, configured to, in response to receiving operation information input by a user through the terminal device, the bus emulation device acquires a preset test file stored in the terminal device, where the preset test file includes an ASN.1 definition file and an Excel configuration file;
[0046] A generation module, configured to generate a test data set according to the ASN.1 definition file, the Excel configuration file, and preset interface information, and send the test data set to the vehicle-mounted communication device;
[0047] A forwarding module, configured to forward the test data set from the vehicle-mounted communication device to the big data cloud;
[0048] A verification module, configured to the terminal device acquires the test data set from the big data cloud, and verifies whether the test data set forwarded by the vehicle-mounted communication device is correct according to the test data set and the preset test file.
[0049] In a third aspect, a computer device is provided, including:
[0050] At least one processor; and
[0051] A memory communicatively connected to the at least one processor; wherein,
[0052] The memory stores computer instructions executable by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to execute the method involved in the first aspect above.
[0053] In a fourth aspect, a computer-readable storage medium is provided, on which computer instructions are stored, characterized in that the computer instructions are used to cause a computer to execute the method involved in the first aspect above.
[0054] According to the technical content provided by the embodiments of the present application, by responding to the operation information input by the user through the terminal device, the bus emulation device obtains the preset test files stored in the terminal device, where the preset test files include ASN.1 definition files and Excel configuration files. According to the ASN.1 definition files, Excel configuration files, and preset interface information, a test data set is generated and sent to the vehicle-mounted communication device. The vehicle-mounted communication device forwards the test data set to the big data cloud. The terminal device obtains the test data set from the big data cloud and verifies whether the test data set forwarded by the vehicle-mounted communication device is correct according to the test data set and the preset test files. The present application can achieve automated big data verification, and the preset test files can ensure the accuracy of the test data, thereby improving the test efficiency and test accuracy and reducing the test cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a schematic structural diagram of a big data verification system in an embodiment;
[0056] Figure 2 It is a schematic flowchart of a big data verification method in an embodiment;
[0057] Figure 3 It is a block diagram of the structure of a big data verification device in an embodiment;
[0058] Figure 4 It is a schematic structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0059] The following further details the present application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0060] For ease of understanding, the system applicable to the present application is first described. The big data verification method provided by the present application can be applied to a big data verification system as Figure 1 shown. As Figure 1As shown in the figure, the big data verification system 100 includes a terminal device 110, a bus simulation device 120, a vehicle-mounted communication device 130, and a big data cloud 140. Among them, the terminal device 110 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, etc. The bus simulation device 120 is an Ethernet bus simulation device, and the vehicle-mounted communication device 130 can be a vehicle-mounted communication box TBOX. The terminal device 110 is respectively connected to the bus simulation device 120 and the big data cloud 140, the bus simulation device 120 is connected to the vehicle-mounted communication device 130, and the vehicle-mounted communication device 130 is connected to the big data cloud 140. Specifically, the terminal device 110 is connected to the big data cloud 140 through an Ethernet interface. The terminal device 110 can be connected to the bus simulation device 120 through a Universal Serial Bus (USB) interface. The bus simulation device 120 is connected to the vehicle-mounted communication device 130 through an Ethernet interface, and the vehicle-mounted communication device 130 is connected to the big data cloud 140 through a cellular network.
[0061] The terminal device 110 can run Python and CAPL codes to control the bus simulation device 120 to simulate electronic control units (ECUs) such as gateways, driving information, and digital cockpit head units (DHUs) in a real vehicle, and send preset data values to the vehicle-mounted communication device 130. After receiving the message sent by the bus simulation device 120 through the Ethernet, the vehicle-mounted communication device 130 reports it to the big data cloud 140 through the cellular network. The terminal device 110 runs Python code to retrieve the reported data from the database of the big data cloud 140, and compares the preset test data with the reported data one by one according to the reporting time and data name to determine whether the data forwarded by the vehicle-mounted communication device 130 is correct.
[0062] Figure 2 It is a flowchart of a big data verification method provided by an embodiment of the present application. As Figure 2 shown, the method may include the following steps:
[0063] S210, in response to receiving operation information input by a user through a terminal device, the bus simulation device obtains a preset test file stored in the terminal device.
[0064] Among them, the operation information is information input by the user through the terminal device to update data, which can be input through the keys, keyboard, mouse, voice device, etc. of the terminal device, or can be input by handwriting on the touch display screen of the terminal device, or other convenient input forms, which are not limited here. The operation information may include operation instructions, operators, operation time, operation methods, and other information.
[0065] The pre-set test file is a file formed by pre-set test data in the terminal device, which may include an ASN.1 definition file and an Excel configuration file. The ASN.1 definition file is a file written in ASN.1 syntax and is used to define data structures, types, and encoding rules. The Excel configuration file is an Excel file obtained by combining the variables to be tested and their data.
[0066] After pre-setting the test data in the terminal device, start the programming language project. The programming language code initializes system variables, mainly to complete the creation of socket connections for broadcast and multicast, namely socketConnection, for receiving broadcast and multicast messages. Before calling the interface of the dynamic link library dll, initialize the environment, set the python path and the key file path, wake up the verified gross mass (VGM) of the simulated DHU and the simulated vehicle, and send an Ethernet network wake-up message. Wait for the Ethernet of the in-vehicle communication device to be woken up. Determine whether the Ethernet of the in-vehicle communication device has been woken up through the Ethernet response message of the in-vehicle communication device. Establish a network control protocol IPCP link between the simulated DHU, the simulated VGM, and the in-vehicle communication device, and wait for the user to input control information. If the user does not input, continue to wait.
[0067] After the operation information input by the user through the terminal device, when the bus simulation device receives the operation information, the bus simulation device obtains the pre-set test file stored in the terminal device to encode the pre-set test file and forwards the encoded test file to the in-vehicle communication device.
[0068] S220, generate a test data set according to the ASN.1 definition file, the Excel configuration file, and the pre-set interface information, and send the test data set to the in-vehicle communication device.
[0069] The pre-set interface information is the interface information for communication between pre-defined system modules, which may include Internet Protocol (IP) addresses, port numbers, Virtual Local Area Network Identifiers (VlanIDs), etc.
[0070] Obtain information such as service identifiers, operation identifiers, operation names, and operation types according to the ASN.1 definition file and the Excel configuration file. Parse the Excel configuration file into data in a data structure format, process the data in each cell of the Excel configuration file one by one in terms of format and length, perform uper format encoding on the ASN.1 definition file, and perform uper encoding on the values set in the Excel configuration file. Assemble the encoded Excel configuration file and the preset interface information together into a frame to obtain a test data set, and send the test data set to the vehicle-mounted communication device via Ethernet.
[0071] S230, the vehicle-mounted communication device forwards the test data set to the big data cloud.
[0072] S240, the terminal device obtains the test data set from the big data cloud, and verifies whether the test data set forwarded by the vehicle-mounted communication device is correct according to the test data set and the preset test file.
[0073] After the vehicle-mounted communication device forwards the test data set to the big data cloud via the cellular network, the terminal device accesses the big data cloud, queries the test data set forwarded by the vehicle-mounted communication device through SQL statements in the standard query language, compares the test data set with the preset test file, and verifies whether the two are consistent, so as to judge whether the test data set forwarded by the vehicle-mounted communication device is correct.
[0074] It can be seen that in the embodiment of the present application, in response to receiving the operation information input by the user through the terminal device, the bus simulation device obtains the preset test file stored in the terminal device, where the preset test file includes the ASN.1 definition file and the Excel configuration file. According to the ASN.1 definition file, the Excel configuration file, and the preset interface information, a test data set is generated and the test data set is sent to the vehicle-mounted communication device. The vehicle-mounted communication device forwards the test data set to the big data cloud, and the terminal device obtains the test data set from the big data cloud, and verifies whether the test data set forwarded by the vehicle-mounted communication device is correct according to the test data set and the preset test file, realizing automatic big data verification, and the preset test file can ensure the accuracy of the test data, thereby improving the test efficiency and test accuracy and reducing the test cost.
[0075] As an implementable manner, before the bus simulation device obtains the preset test file, the method further includes:
[0076] Define the variables to be tested according to the ASN.1 standard format to obtain the ASN.1 definition file;
[0077] Integrate the variables to be tested and the data corresponding to the variables to be tested to obtain the Excel configuration file;
[0078] According to the ASN.1 definition file, perform equivalence class partitioning on the variables to be tested to obtain equivalent class variables;
[0079] Based on the value ranges of the equivalent class variables, determine the test values of the variables to be tested;
[0080] Update the Excel configuration file according to the test values of the variables to be tested.
[0081] Among them, the variables to be tested are various parameters and performance indicators that need to be evaluated in various test scenarios of the vehicle, which may include state variables, vehicle performance variables, safety performance variables, etc.
[0082] Paste the ASN.1 definition from the IPCP definition document into a plain text txt document, and save the data structure and type of the variables to be tested according to the ASN.1 standard format to obtain the ASN.1 definition file. Different electronic control units of the vehicle use the data format defined in the ASN.1 definition file to transmit information during communication.
[0083] Organize the variables to be tested and their corresponding data combinations into an Excel table to obtain the Excel configuration file. According to the data structure and type in the ASN.1 definition file, perform equivalence class partitioning on the variables to be tested. The ASN.1 definition file can define data types as enumeration type and positive integer type. The variables to be tested include enumeration type variables and positive integer variables. Using equivalence class partitioning, each type of variable can be divided into valid equivalence classes and invalid equivalence classes to obtain equivalent class variables. Among them, the equivalent class variables include valid equivalence class enumeration type variables, invalid equivalence class enumeration type variables, valid equivalence class positive integer variables, and invalid equivalence class positive integer variables.
[0084] The value range of the valid equivalence class enumeration type variable is the value range of the data corresponding to one of the independent variables among all the sub-variables of the enumeration type variable. The value range of the invalid equivalence class enumeration type variable is any value outside the valid equivalence class enumeration type variable.
[0085] The value range of the valid equivalence class positive integer variable is complementary to the value range of the invalid equivalence class positive integer variable. That is to say, the data set of the valid equivalence class positive integer variable is the complement of the data set of the invalid equivalence class positive integer variable. The value of the valid equivalence class positive integer variable is an integer, and the value of the invalid equivalence class positive integer variable is an integer or a decimal.
[0086] Based on the value ranges of the equivalent class variables, determine the test values of the variables to be tested, specifically including: taking each value within the value range of the valid equivalence class enumeration type variable as the test value of the valid equivalence class enumeration type variable;
[0087] Take any value within the value range of the invalid equivalence class enumerated variable as the test value of the invalid equivalence class enumerated variable;
[0088] Determine the test value of the valid equivalence class positive integer variable according to the boundary values of the value range of the valid equivalence class positive integer variable;
[0089] Take any integer value and decimal value within the value range of the invalid equivalence class positive integer variable as the test value of the invalid equivalence class positive integer variable;
[0090] Perform the simplest orthogonal combination of the test values of the valid equivalence class enumerated variable, the test values of the invalid equivalence class enumerated variable, the test values of the valid equivalence class positive integer variable, and the test values of the invalid equivalence class positive integer variable to obtain the test values of the variables to be tested.
[0091] Take the variables to be tested including the charging status ChargeStatus and the vehicle speed vehspeed as an example. Among them, ChargeStatus is an enumerated variable, vehspeed is a positive integer variable, and the sub-variables of ChargeStatus include the default charging status Default(0), the charging status Charging(1), the not charging status NotCharging(2), the charging completed status ChargingCompleted(3), and the invalid charging status Invalid(4).
[0092] The value range of the valid equivalence class enumerated variable of ChargeStatus is the data set of 1 sub-variable among the default charging status Default(0), the charging status Charging(1), the not charging status NotCharging(2), the charging completed status ChargingCompleted(3), and the invalid charging status Invalid(4); the value range of the invalid equivalence class enumerated variable of ChargeStatus is any value outside the value range of the valid equivalence class enumerated variable.
[0093] The value range of the valid equivalence class positive integer variable of vehspeed is an integer greater than or equal to 0 and less than or equal to 31790, and the value range of the invalid equivalence class positive integer variable of vehspeed is an integer less than 0 or an integer greater than 31970 or any decimal.
[0094] Each value within the value range of the valid equivalence class enumerated variable of ChargeStatus needs to be verified, so take each value within the value range of the valid equivalence class enumerated variable as the test value of the valid equivalence class enumerated variable.
[0095] To prevent the test scale from expanding infinitely, a value is randomly selected from the value range of the enumeration type variable of the invalid equivalence class of ChargeStatus for verification. Therefore, any value within the value range of the enumeration type variable of the invalid equivalence class is used as the test value of the enumeration type variable of the invalid equivalence class.
[0096] The vehspeed variable is a numerical variable, and the value range of the valid class variable is very large. To minimize the test cost while ensuring the test effect, the boundary value method is used to obtain values for the valid equivalence class variable. Specifically, for the valid equivalence class positive integer variable of vehspeed, the boundary values 0 and 31970 are taken. The value one more than the left boundary value is taken as 1, and the value one less than the right boundary value is taken as 31969. Finally, a value is randomly selected between 0 and 31970, and here 100000 is taken to obtain the test value of the valid equivalence class positive integer variable. Several values are randomly selected from integers less than 0, integers greater than 31970, or any decimal numbers as the test values of the invalid equivalence class positive integer variable. For example, -1, 91971, 100.5. The test values of the valid equivalence class enumeration type variable, the test values of the invalid equivalence class enumeration type variable, the test values of the valid equivalence class positive integer variable, and the test values of the invalid equivalence class positive integer variable are shown in Table 1:
[0097] Table 1
[0098]
[0099] To further reduce the number of test executions and lower the test cost, orthogonal design is used to generate test data combinations. Here, the simplest orthogonal combination is adopted, that is, each value of each variable is tested at least once, and the test value combinations shown in Table 2 are obtained as the test values of the variables to be tested:
[0100] Table 2
[0101] Data combination Variable ChargeStatus Variable vehspeed Combination 1 Default(0) 0 Combination 2 Charging(1) 1 Combination 3 NotCharging(2) 10000 Combination 4 ChargingCompleted(3) 31969 Combination 5 Invalid(4) 31970 Combination 6 BattaryMiss(5) -1 Combination 7 Default(0) 91971 Combination 8 Default(0) 100.5
[0102] After completing the design of the data combination, it is organized and saved in the Excel configuration file to update the Excel configuration file.
[0103] As an implementable method, according to the ASN.1 definition file, Excel configuration file, and preset interface information, a test data set is generated, including:
[0104] Compile the ASN.1 definition file and return a specification mode object, and the specification mode object contains the structure defined by ASN.1;
[0105] Parse the Excel configuration file and convert the parsed Excel configuration file into a preset format configuration file based on the structure defined by ASN.1;
[0106] Generate a test data set based on the preset format configuration file and preset interface information.
[0107] Use the ASN.1 compiler to compile the ASN.1 definition file into code, and you can create and operate the Specification object in ASN.1. The Specification object contains the structure defined by ASN.1.
[0108] The Excel configuration file is parsed into data structure format data, and the data structure format data is converted into a preset format configuration file based on the structure defined by ASN.1, and the preset format is a preset base format, for example, hexadecimal. The preset format configuration file and the preset interface information are assembled into a frame to obtain a test data set.
[0109] As a feasible method, parsing the Excel configuration file specifically includes: reading the data in the Excel configuration file and loading it into a data structure object;
[0110] Get the page name of each preset independent page in the Excel configuration file, as well as the integer number of rows, integer number of columns, and Excel data list of each preset independent page;
[0111] According to the page type of the preset independent page, the data type of the Excel data list is converted based on the integer number of rows and the integer number of columns of each preset independent page to obtain a parsed Excel configuration file.
[0112] Read the data in the Excel configuration file and load it into a dataframe object. A dataframe is a two-dimensional, resizable, heterogeneous tabular data structure with labeled axes, i.e. rows and columns, making the data more intuitive and easy to understand.
[0113] The preset independent page is a sheet page pre-set for the user to configure test data. The page type can include overview page and non-overview page. If the page type of the preset sheet page is Overview page, the data type of the Excel data list is converted based on the integer number of rows and integer number of columns of each preset sheet page. If the page type of the preset sheet page is non-Overview page, the data type of the Excel data list is converted based on the integer number of rows and integer number of columns of each preset sheet page one by one.
[0114] Convert the data type of the Excel data list based on the integer number of rows and integer number of columns of each preset independent page, including:
[0115] Determine the value variable type of the cell data in the Excel data list;
[0116] If the value variable type is integer, convert the cell data from the original base data to an integer type;
[0117] If the value variable type is a byte sequence, convert the cell data from a string type to a byte string object;
[0118] If the value variable type is boolean, convert the cell data to a true value or a false value;
[0119] If the value variable type is null, fill the cell data with no value;
[0120] If the value variable type is floating point, convert the cell data to a floating point type;
[0121] If the value variable type is string, convert the data type of the cell data according to the field type of the cell data, and judge whether the actual value length of the cell data meets the preset field length. If it meets, retain the cell data after converting the data type.
[0122] Determine the position of each cell data in the Excel data list based on the number of integer rows and integer columns of each preset independent page, and judge the value variable type of each cell data. The value variable types include string, integer, byte sequence, boolean, null, and floating point, etc.
[0123] If the value variable type is integer, convert the cell data from the original base data to an integer type. The original base is the base format in which the data was originally stored. For example, for hexadecimal, convert the cell data from hexadecimal to int type.
[0124] If the value variable type is a byte sequence, convert the cell data from a string type to a byte string object, that is, a bytes object.
[0125] If the value variable type is boolean, convert the cell data to a true value True or a false value False.
[0126] If the value variable type is null, fill the cell data with no value None;
[0127] If the value variable type is floating point, convert the cell data to a floating point type.
[0128] If the value variable type is string, convert the data type of the cell data according to the field type of the cell data, and judge whether the actual value length of the cell data meets the preset field length. If it meets, retain the cell data after converting the data type.
[0129] The field types of cell data include the bes field, the type field, and the value field. If the field type of the cell data is the bes field, set it to the bitstr type, set the variable type of the value column to a tuple, set the value of the value cell to the str type. If the number of bits is not an integer multiple of 8, pad it with 0s, convert the padded string to a hexadecimal string, convert the hexadecimal string to the bytes type, and save it together with the original value length to config_data. Determine whether the length of the actual value value meets the preset field length length. If it meets, retain the cell data after converting the data type; if it does not meet, report an error.
[0130] Alternatively, if the field type of the cell data is the type field or the value field, set the type field to the str type, set the value field to int, and change the actual value of the value field to the str type. Pad with 0s if it is less than the specified length. Determine whether the length of the actual value value meets the preset field length length. If it meets, retain the cell data after converting the data type; if it does not meet, report an error.
[0131] As an implementable method, convert the parsed Excel configuration file into a preset format configuration file based on the structure defined by ASN.1, including:
[0132] Obtain the operation identifier and service identifier in the parsed Excel configuration file;
[0133] Concatenate the independent page name according to the operation identifier and service identifier;
[0134] Obtain the data of the target independent page corresponding to the independent page name;
[0135] Obtain the target data in the data of the target independent page according to the preset operation type;
[0136] Based on the target data and the structure defined by ASN.1, perform uper encoding on the target data, and convert the encoded target data into preset radix data to obtain a preset format configuration file.
[0137] Obtain the operation identifier operationID value and service identifier servicelID value in the parsed Excel configuration file, use the string concatenation rule to generate the sheet name of the sheet page, find the sheet page that matches the sheet name in the Excel configuration file as the target independent page, and obtain the data of this page.
[0138] The preset operation type is the specified operation type, that is, specify optype. Find the start and end indexes of the specified optype in the target independent page. You can use the conditional indexing function of Pandas to find all matching rows and obtain their indexes. Calculate the minimum and maximum values among these indexes, which are used as the start index and end index respectively. Obtain the target data based on the start index and end index, and handle the case where the parent node is empty.
[0139] The target data conforms to the structure defined by ASN.1. Use the ASN.1 compiler to perform uper encoding on the target data encoding, convert the data after uper encoding into preset base data, and write the preset base data into a preset format configuration file. Among them, the preset format is usually binary or hexadecimal.
[0140] It should be understood that although Figure 2 each step in the flowchart of Figure 2 is displayed in sequence according to the indication of the arrow, these steps are not necessarily executed in sequence according to the indication of the arrow. Unless there is a clear description in this application, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,
[0141] Figure 3 This is a schematic structural diagram of a big data verification device provided by an embodiment of this application, used to execute the method flow as shown in Figure 2 As shown in Figure 3 the big data verification device 300 may include: an acquisition module 310, a generation module 320, a forwarding module 330, and a verification module 340, and may further include: a setting module. The main functions of each component module are as follows:
[0142] The acquisition module 310 is used to, in response to receiving operation information input by the user through the terminal device, the bus emulation device acquires the preset test file stored in the terminal device, where the preset test file includes an ASN.1 definition file and an Excel configuration file;
[0143] The generation module 320 is used to generate a test data set according to the ASN.1 definition file, the Excel configuration file, and the preset interface information, and send the test data set to the vehicle-mounted communication device;
[0144] A forwarding module 330, configured to forward a test data set from a vehicle-mounted communication device to a big data cloud;
[0145] A verification module 340, configured to obtain a test data set from a big data cloud by a terminal device, and verify whether the test data set forwarded by the vehicle-mounted communication device is correct according to the test data set and a preset test file.
[0146] As an implementable manner, the device further includes a setting module, configured to: define variables to be tested according to the ASN.1 standard format to obtain an ASN.1 definition file;
[0147] integrate the variables to be tested and the data corresponding to the variables to be tested to obtain an Excel configuration file;
[0148] perform equivalence class partitioning on the variables to be tested according to the ASN.1 definition file to obtain equivalent class variables;
[0149] determine test values of the variables to be tested based on the value ranges of the equivalent class variables;
[0150] update the Excel configuration file according to the test values of the variables to be tested.
[0151] As an implementable manner, the equivalent class variables include valid equivalent class enumerated variables, invalid equivalent class enumerated variables, valid equivalent class positive integer variables, and invalid equivalent class positive integer variables; the setting module is specifically configured to:
[0152] take each value within the value range of the valid equivalent class enumerated variable as the test value of the valid equivalent class enumerated variable;
[0153] take any value within the value range of the invalid equivalent class enumerated variable as the test value of the invalid equivalent class enumerated variable;
[0154] determine the test values of the valid equivalent class positive integer variables according to the boundary values of the value range of the valid equivalent class positive integer variables;
[0155] take any integer value and decimal value within the value range of the invalid equivalent class positive integer variable as the test value of the invalid equivalent class positive integer variable;
[0156] perform the simplest orthogonal combination on the test values of the valid equivalent class enumerated variables, the test values of the invalid equivalent class enumerated variables, the test values of the valid equivalent class positive integer variables, and the test values of the invalid equivalent class positive integer variables to obtain the test values of the variables to be tested.
[0157] As an implementable manner, a generation module 320 is specifically configured to: compile the ASN.1 definition file and return a specification mode object, where the specification mode object includes a structure defined by ASN.1;
[0158] Parse the Excel configuration file and convert the parsed Excel configuration file into a preset format configuration file based on the structure defined by ASN.1;
[0159] Generate a test data set according to the preset format configuration file and the preset interface information.
[0160] As an implementable way, the generation module 320 is specifically used for: reading the data in the Excel configuration file and loading it into the data structure object;
[0161] Obtain the page name of each preset independent page in the Excel configuration file, as well as the integer number of rows, integer number of columns, and Excel data list of each preset independent page;
[0162] According to the page type of the preset independent page, perform data type conversion on the Excel data list based on the integer number of rows and integer number of columns of each preset independent page to obtain the parsed Excel configuration file.
[0163] As an implementable way, the generation module 320 is specifically used for: judging the value variable type of the cell data in the Excel data list;
[0164] If the value variable type is integer type, convert the cell data from the original base data to integer type;
[0165] If the value variable type is byte sequence, convert the cell data from string type to byte string object;
[0166] If the value variable type is boolean type, convert the cell data to true value or false value;
[0167] If the value variable type is null value, fill the cell data with no value;
[0168] If the value variable type is floating point type, convert the cell data to floating point type;
[0169] If the value variable type is string type, according to the field type of the cell data, convert the data type of the cell data, and judge whether the actual value length of the cell data meets the preset field length. If it meets, retain the cell data after converting the data type.
[0170] As an implementable way, the generation module 320 is specifically used for: obtaining the operation identifier and service identifier in the parsed Excel configuration file;
[0171] Concatenate the independent page names according to the operation identifier and service identifier;
[0172] Obtain data of the target independent page corresponding to the independent page name;
[0173] Obtain target data from the data of the target independent page according to the preset operation type;
[0174] Based on the target data and the structure defined by ASN.1, perform uper encoding on the target data, and convert the encoded target data into data in a preset format to obtain a preset format configuration file.
[0175] For the same or similar parts among the above embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment.
[0176] According to the embodiments of the present application, the present application also provides a computer device and a computer-readable storage medium.
[0177] As Figure 4 shown, it is a block diagram of a computer device according to an embodiment of the present application. The computer device is intended to represent various forms of digital computers or mobile devices. Among them, the digital computer may include a desktop computer, a portable computer, a workbench, a personal digital assistant, a server, a mainframe computer, and other suitable computers. The mobile device may include a tablet computer, a smart phone, a wearable device, etc.
[0178] As Figure 4 shown, the computer device 400 includes a computing unit 401, a ROM 402, a RAM 403, a bus 404, and an input / output (I / O) interface 405. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other through the bus 404. The input / output (I / O) interface 405 is also connected to the bus 404.
[0179] The computing unit 401 can execute various processes in the method embodiments of the present application according to the computer instructions stored in the read-only memory (ROM) 402 or the computer instructions loaded from the storage unit 408 into the random access memory (RAM) 403. The computing unit 401 can be various general and / or special processing components with processing and computing capabilities. The computing unit 401 may include, but is not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. In some embodiments, the method provided by the embodiments of the present application can be implemented as a computer software program, which is tangibly included in a computer-readable storage medium, such as the storage unit 408.
[0180] The RAM 403 can also store various programs and data required for the operation of the computer device 400. Part or all of the computer programs can be loaded and / or installed onto the computer device 400 via the ROM 402 and / or the communication unit 409.
[0181] The input unit 406, output unit 407, storage unit 408, and communication unit 409 in the computer device 400 can be connected to the I / O interface 405. Among them, the input unit 406 can be, for example, a keyboard, mouse, touch screen, microphone, etc.; the output unit 407 can be, for example, a display, speaker, indicator light, etc. The computer device 400 can exchange information, data, etc. with other devices through the communication unit 409.
[0182] It should be noted that the device may also include other components necessary for normal operation. It may also only include the components necessary to implement the solution of this application, and does not necessarily include all the components shown in the figure.
[0183] The various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof.
[0184] The computer instructions for implementing the methods of this application can be written in any combination of one or more programming languages. These computer instructions can be provided to the computing unit 401, such that when the computer instructions are executed by a computing unit 401 such as a processor, the steps involved in the method embodiments of this application are executed.
[0185] The computer-readable storage medium provided by this application can be a tangible medium that can contain or store computer instructions for executing the steps involved in the method embodiments of this application. The computer-readable storage medium can include, but is not limited to, storage media in the forms of electronic, magnetic, optical, electromagnetic, etc.
[0186] The above specific embodiments do not constitute a limitation on the protection scope of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims
1. A big data verification method, characterized in that: The method is applied to a big data verification system, the system comprising a terminal device, a bus simulation device, a vehicle-mounted communication device and a big data cloud, the terminal device is connected to the bus simulation device and the big data cloud respectively, the bus simulation device is connected to the vehicle-mounted communication device, the vehicle-mounted communication device is connected to the big data cloud, and the method comprises: In response to receiving operation information input by the user through the terminal device, the bus simulation device obtains a preset test file stored in the terminal device, wherein the preset test file includes an ASN.1 definition file and an Excel configuration file; Generate a test data set according to the ASN.1 definition file, the Excel configuration file and the preset interface information and send the test data set to the vehicle-mounted communication device; The vehicle-mounted communication device forwards the test data set to the big data cloud; The terminal device obtains the test data set from the big data cloud, and verifies whether the test data set forwarded by the in-vehicle communication device is correct based on the test data set and the preset test file.
2. The method according to claim 1, characterized in that Before the bus simulation device obtains the preset test file, the method further includes: Define the variables to be tested according to the ASN.1 standard format and obtain the ASN.1 definition file; Integrate the variables to be tested and the data corresponding to the variables to be tested to obtain an Excel configuration file; According to the ASN.1 definition file, the variables to be tested are divided into equivalence classes to obtain equivalence class variables; Determining a test value of the variable to be tested based on the value range of the equivalence class variable; The Excel configuration file is updated according to the test value of the variable to be tested.
3. The method according to claim 2, characterized in that The equivalence class variables include valid equivalence class enumeration type variables, invalid equivalence class enumeration type variables, valid equivalence class positive integer variables and invalid equivalence class positive integer variables; The step of determining the test value of the variable to be tested based on the value range of the equivalence class variable includes: Taking each value within the value range of the valid equivalence class enumeration type variable as a test value of the valid equivalence class enumeration type variable; Taking any value within the value range of the invalid equivalence class enumeration type variable as the test value of the invalid equivalence class enumeration type variable; Determining a test value of the valid equivalence class positive integer variable according to a boundary value of a value range of the valid equivalence class positive integer variable; Taking any integer value and decimal value within the value range of the invalid equivalence class positive integer variable as the test value of the invalid equivalence class positive integer variable; The test value of the valid equivalence class enumeration type variable, the test value of the invalid equivalence class enumeration type variable, the test value of the valid equivalence class positive integer variable and the test value of the invalid equivalence class positive integer variable are subjected to the simplest orthogonal combination to obtain the test value of the variable to be tested.
4. The method according to claim 1, characterized in that The generating of the test data set according to the ASN.1 definition file, the Excel configuration file and the preset interface information comprises: Compile the ASN.1 definition file and return a specification schema object, wherein the specification schema object contains a structure defined by ASN.1; Parsing the Excel configuration file, and converting the parsed Excel configuration file into a preset format configuration file based on the structure defined by ASN.1; A test data set is generated according to the preset format configuration file and the preset interface information.
5. The method according to claim 4, characterized in that The parsing of the Excel configuration file includes: Read the data in the Excel configuration file and load it into the data structure object; Get the page name of each preset independent page in the Excel configuration file, as well as the integer number of rows, integer number of columns, and Excel data list of each preset independent page; According to the page type of the preset independent page, data type conversion is performed on the Excel data list based on the integer number of rows and the integer number of columns of each preset independent page to obtain a parsed Excel configuration file.
6. The method according to claim 5, characterized in that The data type conversion is performed on the Excel data list based on the integer number of rows and the integer number of columns of each preset independent page, including: Determine the value variable type of the cell data in the Excel data list; If the value variable type is an integer type, convert the cell data from the original base data to an integer type; If the value variable type is a byte sequence, convert the cell data from a string type to a byte string object; If the value variable type is Boolean, convert the cell data into a true value or a false value; If the value variable type is null, the cell data is filled with no value; If the value variable type is a floating point number, convert the cell data into a floating point type; If the value variable type is a string type, the data type of the cell data is converted according to the field type of the cell data, and it is determined whether the actual value length of the cell data meets the preset field length. If so, the cell data after the converted data type is retained.
7. The method according to claim 4, characterized in that The structure defined in ASN.1 is used to convert the parsed Excel configuration file into a configuration file in a preset format, including: Obtaining the operation identifier and the service identifier in the parsed Excel configuration file; Concatenate an independent page name according to the operation identifier and the service identifier; Acquire data of a target independent page corresponding to the independent page name; Acquire target data from the data of the target independent page according to a preset operation type; Based on the target data and the structure defined by ASN.1, the target data is uper-encoded, and the encoded target data is converted into preset format data to obtain a preset format configuration file.
8. A big data verification device, characterized in that: The device is arranged in a big data verification system, the system comprising a terminal device, a bus simulation device, a vehicle-mounted communication device and a big data cloud, the terminal device is connected to the bus simulation device and the big data cloud respectively, the bus simulation device is connected to the vehicle-mounted communication device, the vehicle-mounted communication device is connected to the big data cloud, and the device comprises: an acquisition module, configured to, in response to receiving operation information input by a user through the terminal device, cause the bus simulation device to acquire a preset test file stored in the terminal device, wherein the preset test file includes an ASN.1 definition file and an Excel configuration file; A generating module, configured to generate a test data set according to the ASN.1 definition file, the Excel configuration file and the preset interface information, and send the test data set to the vehicle-mounted communication device; A forwarding module, used for the vehicle-mounted communication device to forward the test data set to the big data cloud; A verification module is used for the terminal device to obtain the test data set from the big data cloud, and to verify whether the test data set forwarded by the in-vehicle communication device is correct based on the test data set and the preset test file.
9. A computer device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores computer instructions that can be executed by the at least one processor, and the computer instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: The computer instructions are used to make a computer execute the method according to any one of claims 1 to 7.