Simulated Data Generation Method, Apparatus, Computer Device, and Storage Medium
Generate and send data packets that meet the sensor type through simulated data generation method, solving the problems of high cost and low flexibility in traditional testing methods, and realizing low-cost and efficient data fusion system testing.
Patent Information
- Application Number
- CN202211124995.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-15
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-09-15
AI Technical Summary
Traditional data fusion system testing methods require the use of multiple expensive sensor devices, and the data playback rate and diversity are limited, resulting in high testing costs and insufficient flexibility.
Through the simulation data generation method, a pre-stored data template file is used to generate data packets that meet the sensor type and user input parameters, and is sent to the data fusion system interface at a specified time to simulate the generation of sensor data and failure scenarios.
It effectively reduces the testing cost, improves the flexibility and availability of test data, and can customize parameters such as the quantity, value and occurrence time of sensor data according to user needs, simulates various fault scenarios, and improves testing efficiency.
Smart Images

Figure CN115509901B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data testing, and particularly to a method and device for simulating data generation, a computer device, and a storage medium. Background Art
[0002] In the realization from manual driving to autonomous driving, sensors are the eyes of autonomous vehicles, used to obtain information about the surrounding environment; while the data fusion system is the brain of autonomous vehicles, used to calculate and analyze the data received from the eyes, providing a basis for the next step of outputting instructions to control the movement of the vehicle (such as accelerating, braking, steering, etc.). The data fusion ability of the data fusion system directly affects the accuracy, reliability, and timeliness of the system's target recognition.
[0003] In the field of autonomous driving, common sensors include cameras, lidar, ultrasonic radars, millimeter-wave radars, etc. During the design and R & D stage of autonomous vehicles, it is necessary to test the data fusion ability of the data fusion system. During the test process, various types of sensor data need to be input into the data fusion system under test for testing.
[0004] In traditional testing methods, multiple types of real sensors can be connected to the data fusion system to use the data generated by these sensors to test the data fusion system. For example, as shown in Figure 1 shown, an example of testing a data fusion system under test by connecting lidar, millimeter-wave radar, ultrasonic radar, and camera is given. However, this method requires the use of multiple data sensors, such as lidar, millimeter-wave radar, ultrasonic radar, etc., and there may be different differences in the data formats of different sensor manufacturers. To achieve compatibility testing, a large number of sensor devices are required, and the cost of these sensor devices is high.
[0005] In traditional testing methods, sensor data is generally obtained through data playback, and the playback rate of data is limited by the recording rate, and the data diversity is limited by the recording time, as well as the diversity of recording sites and spatial objects; due to the large amount of data of some sensors, it is difficult for existing storage devices to store data for a long time, resulting in limitations in test data.
[0006] Therefore, there is room for improvement in the above traditional testing methods for data fusion systems. Summary of the Invention
[0007] Based on this, in view of the above technical problems, it is necessary to provide a method and device for simulating data, a computer device, and a storage medium that can save the testing cost of the data fusion system and improve the testing flexibility.
[0008] A method for generating analog data, the method comprising:
[0009] Receiving user input through a user interface, the user input including a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be generated;
[0010] Searching for a pre-stored data template file corresponding to the data type parameter;
[0011] Using the data template file, generating a data packet queue based on the numerical parameter;
[0012] Sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter.
[0013] In one embodiment, the searching for a pre-stored data template file corresponding to the data type parameter includes:
[0014] Searching for a data template file corresponding to the data type parameter from a set of data template files;
[0015] Wherein, the set of data template files pre-stores data template files corresponding to various data type parameters, and each data template file is used to generate a data packet having the value and simulating the data format of the data detected by the sensor represented by the data type parameter according to the value determined by the numerical parameter.
[0016] In one embodiment, the using the data template file to generate a data packet queue based on the numerical parameter includes:
[0017] Using the data template file to generate a template data packet with a default value;
[0018] Based on the numerical parameter, repeating the step of modifying the value of the previous generated data packet by a corresponding numerical offset to determine the current data packet, so as to generate the multiple data packets that meet the numerical parameter;
[0019] Feeding the multiple data packets into the data packet queue in sequence.
[0020] In one embodiment, the based on the numerical parameter, repeating the step of modifying the value of the previous generated data packet by a corresponding numerical offset to determine the current data packet, so as to generate the multiple data packets that meet the numerical parameter, includes:
[0021] When the information indicating that the random value in the numerical parameter is not selected is included and the user-specified value is not included in the numerical parameter, repeat the step of modifying the numerical value of the previous generated data packet by a zero numerical offset to determine the current data packet, so as to generate the multiple data packets with the default value;
[0022] When the information indicating that the random value in the numerical parameter is not selected is included and the user-specified value is included in the numerical parameter, modify the default value of the template data packet by a numerical offset which is the difference between the user-specified value and the default value to determine the current data packet, and then repeat the step of modifying the numerical value of the previous generated data packet by a zero numerical offset to determine the current data packet, so as to generate the multiple data packets with the user-specified value;
[0023] When the information indicating that the random value in the numerical parameter is selected is included, obtain the random value range in the numerical parameter, and repeat the step of modifying the numerical value of the previous generated data packet by a random numerical offset on the premise of ensuring that the current data packet is within the random value range to determine the current data packet, so as to generate multiple data packets with random values within the random value range.
[0024] In one embodiment, sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter includes:
[0025] Based on the occurrence time parameter, determine the initial sending moment and the sending time interval;
[0026] Take out the first data packet from the data packet queue and send the first data packet to the target interface corresponding to the target interface parameter at the initial sending moment;
[0027] Repeat the step of sending the current data packet to the target interface at the sending moment determined by adding the sending time interval to the sending moment of the previous sent data packet until all the data packets in the data packet queue are sent.
[0028] In one embodiment, the user input further includes fault simulation information; when generating and / or sending data packets, further adjust the value of the data packet and / or the sending moment of the data packet according to the fault simulation information to simulate the influence of the fault corresponding to the fault simulation information on the value of the data packet and / or the sending moment of the data packet.
[0029] In one embodiment, when the fault simulation information includes numerical fault simulation information, generating a data packet queue based on the numerical parameters by using the data template file includes: generating a data packet queue based on the numerical parameters and the numerical fault simulation information by using the data template file, so that the value of the data packets in the data packet queue takes into account the influence difference of the numerical fault corresponding to the numerical fault simulation information on the value.
[0030] In one embodiment, when the fault simulation information includes occurrence time fault simulation information, sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the moment specified by the occurrence time parameter includes: sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter and the occurrence time fault simulation information, so that the sending moment of the data packet takes into account the influence difference of the occurrence time fault corresponding to the occurrence time fault simulation information on the sending moment.
[0031] A simulation data generation device, the device includes:
[0032] An input receiving module, configured to receive user input through a user interface, where the user input includes a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be generated;
[0033] A template searching module, configured to search for a pre-stored data template file corresponding to the data type parameter;
[0034] A data packet generation module, configured to generate a data packet queue based on the numerical parameters by using the data template file;
[0035] A data packet sending module, configured to send each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter.
[0036] A computer device includes a memory and a processor, the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the method described in any of the above embodiments are implemented.
[0037] A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.
[0038] The above-mentioned simulated data generation method, device, computer device, and storage medium generate data packets with corresponding sensor data formats according to user input through a pre-stored data template file, and send these data packets to the corresponding interfaces of the data fusion system at specified times according to user input. Therefore, parameters such as the quantity, value, and generation time of the sensor data used for testing input into the data fusion system can be customized according to user needs, effectively improving the flexibility of the available test data. Brief Description of the Drawings
[0039] Figure 1 Schematic diagram of an existing test system as an example;
[0040] Figure 2 Application environment diagram of the simulated data generation method in an embodiment;
[0041] Figure 3 Flow schematic diagram of the simulated data generation method in an embodiment;
[0042] Figure 4 Schematic diagram of a user interface in an embodiment;
[0043] Figure 5 Flow schematic diagram of executing steps on the first thread and the second thread in an embodiment;
[0044] Figure 6 Internal structure diagram of the simulated data generation device in an embodiment;
[0045] Figure 7 Structural block diagram of the simulated data generation device in an embodiment;
[0046] Figure 8 Internal structure diagram of a computer device in an embodiment. Detailed Description of the Specific Embodiment
[0047] In order to make the objectives, technical solutions, and advantages of this application clearer, the following further elaborates on this application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.
[0048] The simulated data generation method provided by this application can be applied to an application environment as shown in Figure 2 Among them, the simulated data generation device 202 is connected to the data fusion system 204 to be tested through a corresponding interface. The data fusion system 204 can be provided with various types of interfaces. For example, in Figure 1 or Figure 6In the example, it may include an ETH interface, a CAN interface, a LIN interface, and a MIPI / HDMI interface. The analog data generation device 202 is respectively connected to the data fusion system 204 through these interfaces. The analog data generation device 202 executes the analog data generation method of the embodiment of the present application to generate data packets according to user input, and sends the data packets into the data fusion system 204 through the corresponding interfaces for testing. The analog data generation device 202 can be implemented by, for example, a personal computer, a laptop computer, etc., so that there is no need to rely on expensive sensors or dedicated devices, etc. Only a conventional computer is needed to simulate and generate the required data packets and send them into the data fusion system 204 to implement the test of the data fusion system 204, effectively reducing the test cost.
[0049] In one embodiment, as Figure 3 shown, a method for generating analog data is provided. Taking the analog data generation device 202 in Figure 2 as an example, the following steps S310 - S340 are included:
[0050] Step S310, receive user input through a user interface. The user input includes a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be generated.
[0051] The user interface (User Interface, UI) is an interface for the analog data generation device 202 to interact with the user. The analog data generation device 202 can display the user interface on its display screen for the user to provide user input to the analog data generation device 202 through the input device of the analog data generation device 202. For example, referring to Figure 4 shown, a specific example of the user interface displayed on the display screen is given.
[0052] Among them, there can be a one-to-one correspondence between the data type parameters and the sensor data formats that can be correspondingly generated. That is, when it is necessary to simulate and generate M data formats, M data type parameters can be correspondingly defined, where M is a positive integer. Exemplarily, the data type parameters can be determined according to the sensor type, sensor signal, and / or sensor manufacturer, etc. For example, the sensor type can include cameras, lidars, ultrasonic radars, millimeter-wave radars, etc. Generally, the data generated by sensors of different sensor types have different data formats, and thus need to be correspondingly defined as corresponding to different data type parameters. In addition, sensors of the same sensor type from different manufacturers or different sensor models may also have different data formats, and thus the manufacturers or sensor models with these different data formats also need to be respectively defined as corresponding to different data type parameters. For example, when the data generated by the 16-line lidar of Company A, the 64-line lidar of Company B, and the 1080P camera of Company C have three different data formats, they respectively correspond to three different data type parameters. Exemplarily, in Figure 4 , device names such as lidar 001, lidar 002, lidar 003, millimeter-wave radar 001, millimeter-wave radar 002, millimeter-wave radar 003, ultrasonic radar 001, ultrasonic radar 002, ultrasonic radar 002, camera 001, etc. can respectively refer to different data type parameters, and the user can make the user input contain the corresponding data type parameters by checking the required device names in the drop-down list.
[0053] Among them, the numerical parameter is a related parameter used to define the value size of the generated data packet, and the numerical parameter can have different forms. For example, the numerical parameter can include information on whether to check the random value. When the information that the random value is not checked is included in the numerical parameter, the value of the generated data packet can be the default value or the value specified by the user, and the value specified by the user can also be included in the numerical parameter. When the information that the random value parameter is checked is included in the numerical parameter, the numerical parameter can further include a random value range defined by the upper limit and the lower limit of the value. Correspondingly, the value of the generated data packet can be a value randomly generated within the defined random value range. The random values of several continuously generated data packets within the random value range can simulate the volatility of the data collected by the sensor during the actual operation process, making the value of the generated data packet closer to the data collected during the actual operation process. Exemplarily, as shown in Figure 4 , for the selected lidar 002, an example of the random value is the random reflection intensity. When the random reflection intensity is checked, the minimum reflection intensity 100 - the maximum reflection intensity 2000 defines the random value range.
[0054] Among them, the occurrence time parameter may include a transmission time parameter, which is a relevant parameter used to define the actual time when each data packet in the data packet queue is expected to be output to the data fusion system. The transmission time parameter may include, for example, an initial transmission time and a transmission time interval. Further, the occurrence time parameter may also include a simulated occurrence time parameter, which is a simulated occurrence timestamp used to define when each data packet in the data packet queue will be written. For example, for a certain data packet, assuming that the transmission time parameter specifies the transmission time as time A, and the simulated occurrence time parameter specifies the simulated occurrence timestamp as time B, then the data packet will be sent to the data fusion system at time A, but the occurrence timestamp of the data packet will be written as time B. When the data fusion system reads the data packet, it will consider that the acquisition data in the data packet was acquired at time B. Thus, by using the simulated occurrence time parameter, data occurring at any time can be simulated. By way of example, referring to Figure 4 As shown in Figure 4 , for the selected lidar 002, the start timestamp 666595623 μs defines the initial transmission time, and the rotation rate of 20 revolutions per second defines the transmission time interval.
[0055] Among them, the target interface parameter is a relevant parameter used to define through which interface the data is sent to the data fusion system. The target interface parameter can be determined according to the sensor type. For example, the lidar corresponds to using the ETH interface, the millimeter-wave radar corresponds to using the CAN interface, the ultrasonic radar corresponds to using the LIN interface, and the camera corresponds to using the MIPI / HDMI interface. In some embodiments, when there are multiple available interfaces for a sensor type, the user input can also be used to specify which available interface to select.
[0056] Step S320, search for the pre-stored data template file corresponding to the data type parameter.
[0057] Before performing this step, the user or the R & D personnel can pre-store the data template files corresponding to various data type parameters in the simulated data generation device 202. The data template file can be defined according to the data format defined in the product manual of the sensor to be simulated. For example, it is defined which data fields are included in the data format, and the types of each data field, such as string, bool, int, etc., so that each data template file can be used to simulate and generate a data packet in the data format corresponding to a data type parameter to replace the data packet output by the real sensor.
[0058] In one embodiment, step S320 includes: searching in the data template file set for the data template file corresponding to the data type parameter; wherein, various data template files corresponding to data type parameters are prestored in the data template file set, and each data template file is used to generate a data packet with the value determined by the numerical parameter and simulating the data in the data format detected by the sensor represented by the data type parameter according to the value determined by the numerical parameter.
[0059] Step S330, using the data template file, generate a data packet queue based on the numerical parameter.
[0060] In one embodiment, step S330 includes: using the data template file to generate a template data packet with a default value; repeating the step of modifying the previous generated data packet's numerical value by a corresponding numerical offset to determine the current data packet based on the numerical parameter, so as to generate multiple data packets that conform to the numerical parameter; and sequentially sending the multiple data packets into the data packet queue.
[0061] Further, in one embodiment, repeating the step of modifying the previous generated data packet's numerical value by a corresponding numerical offset to determine the current data packet based on the numerical parameter includes: when the information that the random numerical value in the numerical parameter is not selected and the numerical parameter does not contain the user-specified numerical value, repeating the step of modifying the previous generated data packet's numerical value by a zero numerical offset (i.e., keeping the numerical value of the previous generated data packet unchanged) to determine the current data packet, so as to generate the multiple data packets with the default value;
[0062] When the information that the random numerical value in the numerical parameter is not selected and the numerical parameter contains the user-specified numerical value, modifying the default value of the template data packet by a numerical offset equal to the difference between the user-specified numerical value and the default value to determine the current data packet, and then repeating the step of modifying the previous generated data packet's numerical value by a zero numerical offset to determine the current data packet, so as to generate the multiple data packets with the user-specified value;
[0063] When the information that the random numerical value in the numerical parameter is selected, obtain the random numerical value range in the numerical parameter, and repeat the step of modifying the previous generated data packet's numerical value by a random numerical offset on the premise of ensuring that the current data packet is within the random numerical value range to determine the current data packet, so as to generate multiple data packets with random values within the random numerical value range.
[0064] In the above embodiments, on the basis of generating a previous generated data packet, the current data packet can be generated without starting from scratch using the data template file. Instead, the values of the previous generated data packet can be directly modified by the required numerical offset to obtain the current data packet more quickly. In alternative embodiments, each current data packet with the required values can also be regenerated using the data template file.
[0065] Exemplarily, referring to Figure 5 as shown, Figure 5 shows a specific example of implementing step S330 and step S340. In Figure 5 it, step S330 and step S340 can be executed on two threads, namely the first thread and the second thread. Among them, on the first thread, step S330 can include:
[0066] S331, read the template data packet;
[0067] Among them, the template data packet will not be sent to the data packet queue;
[0068] S332, dynamically modify the data packet according to the numerical parameters input by the user;
[0069] S333, generate a data packet with a specified data format;
[0070] S334, write the generated data packet into the data packet queue;
[0071] In this step, each data packet generated according to the numerical parameters input by the user except the template data packet is sequentially written into the data packet queue for sending.
[0072] S335, determine whether the data packet queue has reached its capacity? If so, proceed to step S336; if not, return to step S332.
[0073] S336, wait for X CPU time slices;
[0074] S337, determine whether there is a stop flag? If so, stop the current process; if not, return to step S335.
[0075] Among them, the stop flag bit is a software global variable, and there are two sources for triggering its generation. The first is that all the data packets specified to be written into the queue have been written, and the second is triggered by the stop button on the user interface.
[0076] Step S340, send each data packet in the data packet queue to the target interface corresponding to the target interface parameter according to the sending time specified by the occurrence time parameter.
[0077] In one embodiment, step S340 includes: determining an initial transmission time and a transmission time interval based on the occurrence time parameter; taking out the first data packet from the data packet queue and transmitting the first data packet to the target interface corresponding to the target interface parameter according to the initial transmission time; repeating the step of transmitting the current data packet to the target interface at the transmission time determined by adding the transmission time interval to the transmission time of the previous transmitted data packet until all the data packets in the data packet queue are transmitted.
[0078] Exemplarily, referring to Figure 5 as shown, on the second thread, step S340 may include:
[0079] S341, taking out a data packet from the data packet queue;
[0080] S342, obtaining the time stamp of the current simulation data generating device;
[0081] S343, determining whether the current time stamp meets the specified transmission time of the data packet? If so, proceed to step S344; if not, execute step S345, wait for N CPU time slices, and then return to step S342;
[0082] Among them, for the first data packet in the data packet queue, determining whether the current system time stamp meets the specified transmission time means determining whether the current system time stamp meets the initial time; and for other data packets after the first data packet, determining whether the current system time stamp meets the specified transmission time may be directly determining whether the current system time stamp meets the specified transmission time, or it may also be determining whether the time difference between the time stamp of the transmission time of the previous data packet and the current system time stamp meets the transmission time interval.
[0083] S344, recording the time stamp of the current data packet;
[0084] In this step, write the time stamp into the current data packet. Among them, when the simulation occurrence time parameter is not specified in the occurrence time parameter, the time stamp written in the current data packet may be the actual transmission time when the current data packet is transmitted, and when the simulation occurrence time parameter is specified in the occurrence time parameter, the time stamp written in the current data packet may be the simulation occurrence time stamp of the current data packet specified by the simulation occurrence time parameter.
[0085] S346, writing the current data packet into the target interface specified by the transmission engine;
[0086] S347, determining whether the data packet queue is empty? If so, proceed to step S348; if not, return to step S341;
[0087] S348, waiting for X CPU time slices;
[0088] S349, Determine whether there is a stop flag? If so, stop the current process; if not, return to step S347.
[0089] Among them, the stop flag bit is a software global variable, and there are two sources for triggering its generation. The first is that all the specified packets have been sent, and the second is triggered by the stop button on the user interface.
[0090] Among them, the values of X and N can be determined according to the occurrence time interval. For example, for a 1MHz CPU, an interval of 1ms is equal to waiting for 1000 CPU time slices.
[0091] In the above method for generating simulation data, through the pre-stored data template file, packets with the corresponding sensor data format are simulated and generated according to the user input, and these packets are sent to the corresponding interface of the data fusion system 204 at the specified moment according to the user input, so that the parameters such as the quantity, value, and occurrence time of the sensor data used for testing input into the data fusion system 204 can be customized according to the user's needs, effectively improving the flexibility of the available test data.
[0092] In one embodiment, the user input may further include fault simulation information in addition to the data type parameter, numerical parameter, occurrence time parameter, and target interface parameter. When generating and / or sending packets, that is, when performing the above steps S330 and / or S340, the method also adjusts the value of the packet and / or the sending moment of the packet according to the fault simulation information to simulate the influence of the fault corresponding to the fault simulation information on the value of the packet and / or the sending moment of the packet.
[0093] In one embodiment, the fault simulation information may include numerical fault simulation information and / or occurrence time fault simulation information.
[0094] Exemplarily, as shown in Figure 4 By inputting parameters in the signal loss simulation column (such as a loss duration of 5ms and a signal interval time of 500000ms for the lost signal), the user can simulate the fault situation of signal loss. The user can, for example, select whether to perform fault simulation by checking the enable signal loss item. When the user checks the enable signal loss item, the user input will include fault simulation information. Conversely, when the user does not check the enable signal loss item, the user input may not include fault simulation information. It can be understood that signal loss is only an exemplary fault type, and simulations of different fault types can also be designed according to requirements.
[0095] In one embodiment, when the fault simulation information includes numerical fault simulation information, step S330 above may include: using a data template file, generating a data packet queue based on numerical parameters and the numerical fault simulation information, such that the values of the data packets in the data packet queue take into account the difference in values of the numerical faults corresponding to the numerical fault simulation information.
[0096] In one embodiment, when the fault simulation information includes occurrence time fault simulation information, step S340 above may include: sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter and the occurrence time fault simulation information, such that the sending moment of the data packet takes into account the difference in the occurrence time faults corresponding to the occurrence time fault simulation information.
[0097] In the above embodiments, by further including fault simulation information in the user input and correspondingly adjusting the values or sending moments of the generated data packets according to the fault simulation information, it is possible to further simulate the output of the sensor's analog data in the case of various faults occurring in the sensor, further enhancing the flexibility of providing data to the data fusion system and improving the test flexibility and efficiency.
[0098] It should be understood that although Figure 3 the steps in the flowchart are shown sequentially in the direction of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, the execution of these steps has no strict order restriction, and these steps can be executed in other orders. Moreover, Figure 3 at least a part of the steps in
[0099] may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.
[0099] Refer to Figure 6 as shown, Figure 6 is the internal structure diagram of an example analog data generation device 202. Among them, the analog data generation device 202 may include a data packet generation module and a data packet sending module.
[0100] The data packet generation module, through the data format parser, calls the pre-stored data template file (the data template file defines the data formats of sensors of different sensor types, or the data formats of sensors of the same sensor type but from different manufacturers or models) to generate the template data packets of sensors based on the default numerical parameters in the data packet generation system, such as generating the data packets of the 16-line lidar of Company A, generating the data packets of the 64-line lidar of Company B, generating the data packets of the 1080P camera of Company C, etc.
[0101] The data packet sending module loads the template data packets into the memory, and uses the parameter modifier to dynamically modify the values of the corresponding numerical offsets in the data packets to be sent according to the numerical parameters specified by the user in the data packet sending system, so as to continuously generate data packets, and send the generated data packets into the data packet queue of the data sending engine in sequence; the data sending engine cyclically sends the data packets in the data packet queue to the specified physical interface (such as Ethernet port, LIN port, CAN port, etc.) according to the specified sending time (determined according to the time interval and time stamp). The data packet sending module can write the data packets into the specified target interface for sending in sequence through the first thread for dynamically modifying the data packets and the second thread for timing the sending of data packets, so as to generate analog data close to the real sensor detection data. In the case where the user inputs the fault simulation information, it is also possible to intermittently implant simulated signal interference or signal loss and other real scenarios at the same time, for testing and verifying the robustness of the data fusion system and whether the downgrade / upgrade fusion strategy of data fusion is correct.
[0102] When using Figure 6 the analog data generation device 202 shown in Figure 4 the user can perform operations in the
[0103] 1) Define the data template file according to the product manual to be simulated;
[0104] 2) The user uses the data packet generation module of this system, selects the data template file and related parameters on the user interface, and clicks Start Generation to generate the template data packets;
[0105] 3) The data module of this system loads the template data packets;
[0106] 4) The user configures the dynamic modification parameters and selects the sending port or target address;
[0107] 5) The user adds multiple data nodes to be sent by looping through steps 2 to 4;
[0108] 6) The user clicks Start Sending.
[0109] In Figure 1In the existing data generation system shown in the figure, real sensor devices are used to test the data fusion ability of the data fusion system. Taking lidar as an example: a 16-line lidar costs tens of thousands of yuan, while a 64-line lidar costs hundreds of thousands; and different manufacturers have different sensor data formats, and the data fusion system has differences in the parsing ability of different data formats. Therefore, when it is necessary to be compatible with the sensor data of multiple manufacturers, multiple sensor devices need to be purchased; coupled with multiple ultrasonic radars, millimeter-wave radars, and multiple cameras, the cost of building a set of test systems is high.
[0110] However, by using the analog data generation device provided in this application, sensor data of various different data formats can be defined and simulated through different data template files. Taking lidar, which has the largest amount of data, as an example, the current data volume of a 16-line lidar is about 100 Mbit / s, and by analogy, the data volume of a 64-line lidar is no more than 500 Mbit / s; and currently, common personal computers have integrated 1000M network cards. With this system, a large amount of analog data of multiple sensors can be generated on an ordinary personal computer, thus effectively saving the test cost.
[0111] In addition, as discussed in the above embodiments, this system can also freely simulate and customize various fault data required to be processed by the data fusion system to be tested, thereby improving the flexibility and efficiency of the test.
[0112] In one embodiment, as Figure 7 shown, an analog data generation device 700 is provided, which can be included in the aforementioned analog data generation device 202. It includes: an input receiving module 710, a template searching module 720, a data packet generating module 730, and a data packet sending module 740, where:
[0113] The input receiving module 710 is used to receive user input through the user interface. The user input includes the data type parameter, numerical parameter, occurrence time parameter, and target interface parameter of the data to be generated;
[0114] The template searching module 720 is used to search for the pre-stored data template file corresponding to the data type parameter;
[0115] The data packet generating module 730 is used to generate a data packet queue based on the numerical parameter by using the data template file;
[0116] The data packet sending module 740 is used to send each data packet in the data packet queue to the target interface corresponding to the target interface parameter according to the sending moment specified by the occurrence time parameter.
[0117] For the specific limitations of the analog data generation device 700, reference can be made to the limitations of the analog data generation method in the foregoing text, which will not be elaborated herein. Each module in the above-mentioned analog data generation device 700 can be implemented in whole or in part by software, hardware, and their combination. The above-mentioned modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above-mentioned modules.
[0118] In one embodiment, a computer device is provided. This computer device can be used to implement the analog data generation device of the present application, and its internal structure diagram can be as Figure 8 shown. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an analog data generation method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad provided on the shell of the computer device, or an external keyboard, a touchpad, or a mouse, etc.
[0119] Those skilled in the art can understand that Figure 8 the structure shown in
[0120] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0121] Receive user input through a user interface. The user input includes a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be generated;
[0122] Search for a pre-stored data template file corresponding to the data type parameter;
[0123] Use the data template file to generate a data packet queue based on the numerical parameter;
[0124] Send each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending time specified by the occurrence time parameter.
[0125] In other embodiments, when the processor executes the computer program, it also implements the steps of the analog data generation method in any of the above embodiments.
[0126] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0127] Receive user input through a user interface, where the user input includes a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be generated;
[0128] Search for a pre-stored data template file corresponding to the data type parameter;
[0129] Use the data template file to generate a data packet queue based on the numerical parameter;
[0130] Send each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending time specified by the occurrence time parameter.
[0131] In other embodiments, when the computer program is executed by a processor, it also implements the steps of the analog data generation method in any of the above embodiments.
[0132] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.
[0133] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0134] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A method for generating analog data, the method comprising: Receiving user input through a user interface, the user input including a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be generated; wherein, the occurrence time parameter includes a sending time parameter, and the sending time parameter is a relevant parameter for defining the actual time when each data packet in the data packet queue is expected to be output to the data fusion system; Searching in a data template file set for a data template file corresponding to the data type parameter; wherein, the data template file set pre-stores data template files corresponding to various data type parameters, and each data template file is used to generate a data packet with the value determined by the numerical parameter and simulating the data format of the sensor detection represented by the data type parameter; using the data template file, generating a data packet queue based on the numerical parameter; Sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter according to the sending time specified by the occurrence time parameter.
2. The method according to claim 1, wherein The occurrence time parameter further includes a simulated occurrence time parameter, and the simulated occurrence time parameter is a simulated occurrence timestamp for defining when each data packet in the data packet queue will be written; wherein, when the data fusion system reads a data packet, it will be considered that the acquisition data in the data packet is acquired at the moment of the simulated occurrence timestamp written in the data packet.
3. The method according to claim 1, wherein The generating a data packet queue based on the numerical parameter by using the data template file includes: Generating a template data packet with a default value by using the data template file; Based on the numerical parameter, repeating the step of modifying the numerical value of the previous generated data packet by a corresponding numerical offset to determine the current data packet, so as to generate multiple data packets that conform to the numerical parameter; Sequentially sending the multiple data packets into the data packet queue.
4. The method according to claim 3, wherein The repeating the step of modifying the numerical value of the previous generated data packet by a corresponding numerical offset to determine the current data packet based on the numerical parameter, so as to generate multiple data packets that conform to the numerical parameter, includes: When the information that the random numerical value in the numerical parameter is not selected and the numerical parameter does not contain user-specified numerical values, repeating the step of modifying the numerical value of the previous generated data packet by a zero numerical offset to determine the current data packet, so as to generate the multiple data packets with the default value; When the information that the random numerical value in the numerical parameter is not selected and the numerical parameter contains user-specified numerical values, modifying the default value of the template data packet by a numerical offset of the difference between the user-specified numerical value and the default value to determine the current data packet, and then repeating the step of modifying the numerical value of the previous generated data packet by a zero numerical offset to determine the current data packet, so as to generate the multiple data packets with the user-specified value; When the information indicating that the random value is included in the numerical parameter is checked, obtain the random value range in the numerical parameter, and repeat the step of modifying the random value offset on the basis of the value of the previous generated data packet to ensure that the current data packet is within the random value range, so as to generate multiple data packets with random values within the random value range.
5. The method according to claim 1, wherein Sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter includes: Based on the occurrence time parameter, determine the initial sending moment and the sending time interval; Take out the first data packet from the data packet queue and send the first data packet to the target interface corresponding to the target interface parameter at the initial sending moment; Repeat the step of sending the current data packet to the target interface at the sending moment determined by adding the sending time interval to the sending moment of the previous sent data packet until all the data packets in the data packet queue are sent.
6. The method according to any one of claims 1 to 5, characterized in that, The user input further includes fault simulation information; when generating and / or sending data packets, the values of the data packets and / or the sending moments of the data packets are further adjusted according to the fault simulation information to simulate the influence of the fault corresponding to the fault simulation information on the values of the data packets and / or the sending moments of the data packets.
7. The method according to claim 6, wherein When the fault simulation information includes numerical fault simulation information, the generating of the data packet queue by using the data template file based on the numerical parameter includes: generating the data packet queue by using the data template file based on the numerical parameter and the numerical fault simulation information, so that the values of the data packets in the data packet queue take into account the influence difference of the numerical fault corresponding to the numerical fault simulation information on the values.
8. The method according to claim 6, wherein When the fault simulation information includes occurrence time fault simulation information, sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the moment specified by the occurrence time parameter includes: sending each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending moment specified by the occurrence time parameter and the occurrence time fault simulation information, so that the sending moment of the data packet takes into account the influence difference of the occurrence time fault corresponding to the occurrence time fault simulation information on the sending moment.
9. An analog data generating device, characterized in that, The device includes: An input receiving module, configured to receive user input through a user interface, where the user input includes a data type parameter, a numerical parameter, an occurrence time parameter, and a target interface parameter of the data to be sent; wherein, the occurrence time parameter includes a sending time parameter, and the sending time parameter is a relevant parameter for defining the actual moment when each data packet in the data packet queue is expected to be output to the data fusion system. A template search module, configured to search, from a set of data template files, for a data template file corresponding to the data type parameter; wherein, various data template files corresponding to data type parameters are prestored in the set of data template files, and each data template file is used to generate a data packet having the value and simulating the data in the data format detected by the sensor represented by the data type parameter according to the value determined by the numerical parameter. A data packet generation module, configured to generate a data packet queue based on the numerical parameter by using the data template file. A data packet sending module, configured to send each data packet in the data packet queue to the target interface corresponding to the target interface parameter at the sending time specified by the occurrence time parameter.
10. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Data transmission method, intelligent gateway, computer device and storage medium
CN110912810A
System fault simulation method and device, computer equipment and medium
CN114185758A