Simulation test method and device based on DDS, storage medium and electronic device
Through the DDS-based simulation test method, the DDS message orchestration is used to orchestrate the response to DDS messages, which solves the problem that the test data cannot be flexibly provided in automotive simulation tests, and achieves a more efficient and accurate test process.
Patent Information
- Application Number
- CN202510040237.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-01-10
AI Technical Summary
During the simulation test of a car, it is impossible to provide test data for the module to be tested flexibly, resulting in limited testing efficiency and accuracy.
Through the DDS-based simulation test method, the DDS message sent by the service module to be tested is monitored, the preconfigured relationship configuration table is read, the response DDS message is simulated based on the table, and the response message is sent to the service module.
It realizes flexible customization of test processes and data during the testing process, improves the efficiency and accuracy of the test, and solves the problem of not being able to flexibly provide test data.
Smart Images

Figure CN119854191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of simulation testing technology, and in particular to a DDS-based simulation testing method and device, a storage medium, and an electronic device. Background Art
[0002] In related technologies, with the continuous development of Internet of Vehicles technology, the number of sensor devices used in automobiles has increased, and the amount of communication data between vehicle ad hoc networks and various heterogeneous networks is much greater than that of traditional vehicles. DDS (Data Distribution Service) is a data-centric middleware protocol. DDS middleware is responsible for receiving data sent by publishers and distributing it to subscribers. DDS has low-latency data connection, high reliability and high scalability, and is applied on the vehicle side.
[0003] In the related art, when testing a module to be tested of a car, it is often necessary to create some test data according to different situations. The most common method is to use scripts to promote the test steps. During the test process, there is a problem that test data cannot be flexibly provided for the module to be tested.
[0004] With respect to the above-mentioned problems existing in the related technologies, no efficient and accurate solutions have been found yet. Summary of the invention
[0005] The present invention provides a DDS-based simulation test method and device, a storage medium, and an electronic device to solve technical problems in related technologies.
[0006] According to one embodiment of the present invention, a DDS-based simulation test method is provided, comprising: monitoring a source data distribution service DDS message sent by a business module to be tested; reading a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of a response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated; simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table; and sending the response DDS message to the business module.
[0007] Optionally, simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table includes: searching the relationship configuration table for a message structure that matches the source DDS message, and generating test data that matches the message structure according to the relationship configuration table; filling the test data into the message structure, and arranging the response DDS message.
[0008] Optionally, before reading the preconfigured relationship configuration table, the method also includes: configuring message response rules between the business module and the simulation module; configuring message transmission rules between the business module and the simulation module based on the message response rules, wherein the message transmission rules are used to characterize the first mapping relationship and the second mapping relationship; and generating the relationship configuration table using the message response rules and the message transmission rules.
[0009] Optionally, configuring the message transmission rules between the business module and the simulation module includes: determining the DDS interface to be tested of the business module based on the message response rules, wherein the DDS interface is used to transmit the source DDS message; configuring the message structure of a response DDS message to the source DDS message; and configuring test data for the message structure.
[0010] Optionally, the test data for configuring the message structure includes one of the following: using fixed configuration data to configure the first test data of the message structure; determining a number of message fields of the message structure, constructing a number of static parameter values of the number of message fields, and using the number of static parameter values to configure the second test data of the message structure, wherein each static parameter value corresponds to a message field.
[0011] Optionally, configuring the test data of the message structure includes: determining a target field in the source DDS message, and determining a response field associated with the target field in the response DDS message; and configuring the dynamic parameter value of the target field as third test data of the message structure.
[0012] Optionally, configuring the message response rules between the business module and the simulation module includes: responding to a user's first selection instruction, selecting a DDS interface of the business module to be tested, wherein the DDS interface is used to transmit the source DDS message; parsing a data structure of the DDS interface, wherein the data structure includes multiple fields; responding to a user's second selection instruction, selecting a target field from the data structure, wherein the target field is a field in the source DDS message that is associated with the response DDS message.
[0013] According to another embodiment of the present invention, a DDS-based simulation test device is provided, including: a monitoring module, used to monitor a source data distribution service DDS message sent by a business module to be tested; a reading module, used to read a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of a response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated; a simulation module, used to simulate and arrange the response DDS message of the source DDS message based on the relationship configuration table; and a sending module, used to send the response DDS message to the business module.
[0014] Optionally, the simulation module includes: a processing unit, used to search the relationship configuration table for a message structure that matches the source DDS message, and generate test data that matches the message structure based on the relationship configuration table; and an orchestration unit, used to fill the test data into the message structure and orchestrate the response DDS message.
[0015] Optionally, the device also includes: a first configuration module, used to configure the message response rules between the business module and the simulation module before the reading module reads the pre-configured relationship configuration table; a second configuration module, used to configure the message transmission rules between the business module and the simulation module based on the message response rules, wherein the message transmission rules are used to characterize the first mapping relationship and the second mapping relationship; a generation module, used to generate the relationship configuration table using the message response rules and the message transmission rules.
[0016] Optionally, the second configuration module includes: a determination unit, used to determine the DDS interface to be tested of the business module based on the message response rule, wherein the DDS interface is used to transmit the source DDS message; a first configuration unit, used to configure the message structure of a response DDS message of the source DDS message; and a second configuration unit, used to configure test data of the message structure.
[0017] Optionally, the second configuration unit includes one of the following: a first configuration subunit, used to configure the first test data of the message structure using fixed configuration data; a second configuration subunit, used to determine a number of message fields of the message structure, construct a number of static parameter values of the number of message fields, and configure the second test data of the message structure using the number of static parameter values, wherein each static parameter value corresponds to a message field.
[0018] Optionally, the second configuration unit includes: a determination subunit, used to determine the target field in the source DDS message, and to determine the response field associated with the target field in the response DDS message; and a third configuration subunit, used to configure the dynamic parameter value of the target field as the third test data of the message structure.
[0019] Optionally, the first configuration module includes: a first selection unit, used to respond to a user's first selection instruction and select the DDS interface of the business module to be tested, wherein the DDS interface is used to transmit the source DDS message; a parsing unit, used to parse the data structure of the DDS interface, wherein the data structure includes multiple fields; a second selection unit, used to respond to a user's second selection instruction and select a target field from the data structure, wherein the target field is a field in the source DDS message associated with the response DDS message.
[0020] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0021] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0022] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0023] Beneficial effects of the present invention:
[0024] A configuration method is provided to specify the data interaction relationship to complete the generation and sending of test data, which solves the problem of being unable to flexibly provide test data for the module to be tested during the test process. It is more general and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present invention;
[0027] Figure 2 is a flow chart of a DDS-based simulation test method according to an embodiment of the present invention;
[0028] Figure 3 is a flow chart of configuring a simulated DDS message in an embodiment of the present invention;
[0029] Figure 4 It is a structural block diagram of a DDS-based simulation test device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Example 1
[0033] The method embodiment provided in the first embodiment of the present application can be executed in an emulator, a computer, a test terminal or a similar processing device. Taking running on a computer as an example, Figure 1 is a hardware structure block diagram of a computer according to an embodiment of the present invention. Figure 1 As shown, the server may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the server may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the above server. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0034] The memory 104 can be used to store server programs, for example, software programs and modules of application software, such as a server program corresponding to a remote control method of a computer in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the server program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] In this embodiment, a simulation test method based on DDS is provided. Figure 2 is a flow chart of a DDS-based simulation test method according to an embodiment of the present invention, such as Figure 2 As shown, the process includes the following steps:
[0037] Step S202, monitoring the source service DDS message sent by the service module to be tested;
[0038] The solution of this embodiment can be applied in a scenario of testing and simulating a business module. The execution subject of this embodiment is a simulation module that executes the simulation test.
[0039] Optionally, the business module may be various functional modules of the car, such as an air-conditioning module, a voice module, and other control modules.
[0040] Step S204, reading a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated;
[0041] For example, the business module to be tested is A, and the simulation module is B. Because A's business needs to be tested, the orchestration scheme configures B's behavior and test data, and the entire process is based on DDS message interaction. The test process needs to consider two points: 1. After the A module sends a DDS message, according to the normal business process, the B module needs to respond to A with what DDS message after receiving the message, and 2. The data content carried in the DDS message responded by the B module. The above two points are respectively implemented through the first mapping relationship and the second mapping relationship in the relationship configuration table, which are explained here respectively:
[0042] Assume that in the entire business flow, after A sends message 1 to B, it needs to receive message 2 (or even message 3, message 4...) from B in order to drive A module to continue to execute according to normal business. For example, A requests B to adjust the air conditioner temperature to 26° (currently 30°), and B needs to respond that the air conditioner temperature has been adjusted to 26° before A can confirm that the air conditioner temperature has been adjusted to 26°. If A does not receive this response message from B, it will not make subsequent temperature changes (still believe that the current temperature is 30°).
[0043] Taking the above air conditioning temperature as an example, when B responds to A's air conditioning temperature, for example, assuming that the lowest setting of module B can only be 27°, module B considers that any request from A for a temperature setting lower than the lowest setting of 27° is set to 27°. If A requests 26°, then B's response message is 27°. If A requests 28°, then B's response DDS message is 28°. Or at this time, module B is limited and always responds to other data. Therefore, the simulation module B not only responds to A's message, but also supports custom response data values in this arrangement.
[0044] Here, the first mapping relationship in the relationship configuration table is: the relationship between the source DDS message sent by module A and the DDS message type responded by simulation module B, for example, message a of A corresponds to message b of B, and message c of A corresponds to message d and message e of B, that is, when B receives a, it needs to respond to b; when B receives c, it needs to respond to d and e. The second mapping relationship is illustrated by an example: the relationship information between the DDS message data sent by A and the test data released by the subsequent response DDS message sent by B, that is, the generation method of the test data used by B when responding to the message of A, such as fixed value, static value, dynamic value, etc.
[0045] Step S206, simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table;
[0046] Step S208: Send the response DDS message to the service module.
[0047] The purpose is to test whether the business of the module under test is normal, the consistency of the DDS message data sent by the module under test, and whether the business flow of the module under test is normal after receiving the DDS message data sent by the simulation module.
[0048] Through the above steps, the source data distribution service DDS message sent by the business module to be tested is monitored; the pre-configured relationship configuration table is read, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and the test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated; the response DDS message of the source DDS message is simulated and arranged based on the relationship configuration table; the response DDS message is sent to the business module, and the response DDS message of the source DDS message is flexibly generated based on the relationship configuration table by configuring the first mapping relationship and the second mapping relationship in the relationship configuration table, thereby solving the technical problem in the related art that the related art cannot flexibly provide test data for the business module to be tested during the test process, and realizing the flexible customization of the test process and test data during the DDS message simulation test process.
[0049] In one implementation of the present embodiment, simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table includes: searching the relationship configuration table for a message structure that matches the source DDS message, and generating test data that matches the message structure according to the relationship configuration table; filling the test data into the message structure, and arranging the response DDS message.
[0050] In one example, generating test data matching the message structure according to the relationship configuration table includes: determining a generation rule for the test data based on the second mapping relationship, the second mapping relationship including a generation rule for the test data corresponding to the message structure, and generating test data matching the message structure based on the generation rule.
[0051] Optionally, generating test data that matches the message structure based on the generation rule includes one of the following: if the generation rule is fixed configuration data, determining the fixed configuration data as test data that matches the message structure; if the generation rule is a static matching rule, determining the configuration field of the message structure based on the relationship configuration table, reading the static parameter value from the relationship configuration table, and determining the static parameter value as test data that matches the configuration field in the message structure; if the generation rule is a dynamic matching rule, determining the target field of the source DDS message and the response field of the response DDS message based on the relationship configuration table, reading the dynamic parameter value from the source DDS message, and determining the dynamic parameter value as test data that matches the response field in the message structure.
[0052] Under the premise that the simulation software provides the ability to publish DDS messages related to the business, it matches the received source DDS message by loading the relationship configuration table. That is, whenever a DDS message is received, the relationship configuration table is traversed first. If it exists in the configuration table, the first mapping relationship and the second mapping relationship are extracted. The simulation software publishes the response DDS messages of the source DDS messages one by one according to the message structure associated with it in the relationship table and the test data of the subsequent DDS message configuration to realize the simulation test.
[0053] In this embodiment, before reading the preconfigured relationship configuration table, it also includes: configuring message response rules between the business module and the simulation module; configuring message transmission rules between the business module and the simulation module based on the message response rules, wherein the message transmission rules are used to characterize the first mapping relationship and the second mapping relationship; and generating the relationship configuration table using the message response rules and the message transmission rules.
[0054] In one example, configuring the message response rules between the business module and the simulation module includes: responding to a user's first selection instruction, selecting a DDS interface of the business module to be tested, wherein the DDS interface is used to transmit the source DDS message; parsing a data structure of the DDS interface, wherein the data structure includes multiple fields; responding to a user's second selection instruction, selecting a target field from the data structure, wherein the target field is a field in the source DDS message that is associated with the response DDS message.
[0055] In another example, configuring the message response rules between the service module and the simulation module includes: responding to a first selection instruction of a user, selecting a DDS interface of the service module to be tested, wherein the DDS interface is used to transmit the source DDS message.
[0056] Still taking the business module to be tested as A and the simulation module as B as an example, when configuring the DDS message of module A and the message response rules of B, the user first selects a DDS message of A (source DDS message); according to the selected DDS message data structure information, the user selects a field of interest in the process in the data structure (optional step). For example, the data structure of the message consists of studentNum, age, name, and grade. After being sent to B, the data value of the studentNum field (target field) will affect the data of certain topics in B (such as the data of the subsequent response DDS message), so the user needs to mark studentNum as the target field. If the data of the subsequent process is not associated with any parameters carried by the source DDS message, no configuration is required.
[0057] In one implementation of the present embodiment, configuring the message transmission rules between the business module and the simulation module includes: determining the DDS interface to be tested of the business module based on the message response rules, wherein the DDS interface is used to transmit the source DDS message; configuring the message structure of the response DDS message of the source DDS message; and configuring the test data of the message structure.
[0058] In one example, configuring the test data of the message structure includes: configuring first test data of the message structure using fixed configuration data.
[0059] In this example, a response DDS message is configured after B receives step 1, and test data is configured based on the default rule. The data of the response DDS message uses the default configuration data.
[0060] In one example, configuring the test data of the message structure includes: determining several message fields of the message structure, constructing several static parameter values of the several message fields, and configuring second test data of the message structure using the several static parameter values, wherein each static parameter value corresponds to a message field.
[0061] In this example, a response DDS message is configured after B receives the source DDS message. Test data is configured based on static rules, and the user constructs the corresponding test data according to the data structure. In this example, the test data is specified by the user. Since the data structure of the response DDS message is fixed, it only needs to be displayed to the user. The user fills in the expected test data corresponding to the field type in the data structure, and the backend assembles the message content of the response DDS message according to the information entered by the user. For example, the structure struct student{string num; string name; int age}; includes three or more message fields. The user can fill in (202311725; Lihuan; 18) three corresponding non-static parameter values. The parameter information is filled in according to this agreed rule, and the backend parses and assigns values.
[0062] In another example, configuring the test data of the message structure includes: determining a target field in the source DDS message, and determining a response field associated with the target field in the response DDS message; and configuring the dynamic parameter value of the target field as third test data of the message structure.
[0063] In this example, a response DDS message is configured after B receives the source DDS message. The dynamic configuration configures the assignment of the response field associated with the value carried by the target field selected in the message response rule stage. The response field for the test data needs to be configured in the response DDS message. According to the data value of the selected target field, it is filled into the currently selected configured field. For example, after the B module receives the message in the source DDS message, the source DDS message carries the student information, and the value of studentNum obtained by B is 202311725. B needs to respond to a response DDS message configured in the relationship configuration table. Assume that the data structure of the response DDS message contains the structure structScores{string stuNo; float chinese; float math; float english;}; When assembling the message content of the response DDS message, stuNo is the field that the user needs to dynamically configure. stuNo should be filled with the value of studentNum in the source DDS message, that is, 202311725. In this example, the dynamically configured field is Scores.stuNo, which corresponds to a field in the source DDS message sent by A.
[0064] In DDS communication, the interface agreement between the publisher and the subscriber usually includes data type definition, message format, security and encryption, etc., which is the basic part of the entire communication. The present invention is based on the established message data structure agreement and has all the DDS message capabilities involved in registration. The user then writes the configuration relationship, selects the source DDS message to be monitored, and after monitoring the corresponding message, the custom simulation module returns and the response DDS message data to be published subsequently. This embodiment is a message-based process arrangement invented to achieve a continuous and complete message interaction process, which not only receives the DDS message sent by the module to be tested, but also makes a subsequent DDS message response to the received DDS message.
[0065] Figure 3 The invention is a flowchart for configuring a simulated DDS message in an embodiment of the present invention, including: configuring a DDS interface to be tested; judging whether it is necessary to pay attention to the DDS data to be tested; if so, configuring the data field to be paid attention to; if not, configuring the DDS interface to be sent subsequently (response DDS message); judging whether it is necessary to use the data of the DDS message to be tested; if so, configuring the field to use the DDS field data to be paid attention to; if not, continuing to judge whether it is necessary to manually configure the test data; if so, filling in the test data according to the configured subsequent DDS interface data structure; if not, the subsequent DDS message release uses the default data.
[0066] This embodiment provides a general message simulation test design method for service module testing based on DDS Ethernet communication. The user connects the service of the module to be tested with the communication interaction of the simulation module through configuration, automatically / manually simulates the test data of the module to be tested, and can complete the simulation only according to the data agreement of the communication interface between the service modules. When testing the module to be tested, it is often necessary to create some test data according to different situations. In this embodiment, the user provides a configuration method to specify the data interaction relationship based on the agreed data format of the response DDS message to complete the generation and sending of test data, which solves the problem of not being able to flexibly provide test data for the module to be tested during the test process. This design method is more general and more efficient.
[0067] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0068] Example 2
[0069] In the present embodiment, a DDS-based simulation test device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.
[0070] Figure 4 is a structural block diagram of a DDS-based simulation test device according to an embodiment of the present invention, such as Figure 4 As shown, the device comprises:
[0071] A monitoring module 40, used for monitoring a source data distribution service DDS message sent by a service module to be tested;
[0072] A reading module 42 is used to read a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated;
[0073] A simulation module 44, configured to simulate and arrange a response DDS message of the source DDS message based on the relationship configuration table;
[0074] The sending module 46 is used to send the response DDS message to the service module.
[0075] Optionally, the simulation module includes: a processing unit, used to search the relationship configuration table for a message structure that matches the source DDS message, and generate test data that matches the message structure based on the relationship configuration table; and an orchestration unit, used to fill the test data into the message structure and orchestrate the response DDS message.
[0076] Optionally, the device also includes: a first configuration module, used to configure the message response rules between the business module and the simulation module before the reading module reads the pre-configured relationship configuration table; a second configuration module, used to configure the message transmission rules between the business module and the simulation module based on the message response rules, wherein the message transmission rules are used to characterize the first mapping relationship and the second mapping relationship; a generation module, used to generate the relationship configuration table using the message response rules and the message transmission rules.
[0077] Optionally, the second configuration module includes: a determination unit, used to determine the DDS interface to be tested of the business module based on the message response rule, wherein the DDS interface is used to transmit the source DDS message; a first configuration unit, used to configure the message structure of a response DDS message of the source DDS message; and a second configuration unit, used to configure test data of the message structure.
[0078] Optionally, the second configuration unit includes one of the following: a first configuration subunit, used to configure the first test data of the message structure using fixed configuration data; a second configuration subunit, used to determine a number of message fields of the message structure, construct a number of static parameter values of the number of message fields, and configure the second test data of the message structure using the number of static parameter values, wherein each static parameter value corresponds to a message field.
[0079] Optionally, the second configuration unit includes: a determination subunit, used to determine the target field in the source DDS message, and to determine the response field associated with the target field in the response DDS message; and a third configuration subunit, used to configure the dynamic parameter value of the target field as the third test data of the message structure.
[0080] Optionally, the first configuration module includes: a first selection unit, used to respond to a user's first selection instruction and select the DDS interface of the business module to be tested, wherein the DDS interface is used to transmit the source DDS message; a parsing unit, used to parse the data structure of the DDS interface, wherein the data structure includes multiple fields; a second selection unit, used to respond to a user's second selection instruction and select a target field from the data structure, wherein the target field is a field in the source DDS message associated with the response DDS message.
[0081] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0082] Example 3
[0083] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0084] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0085] S1, monitor the source data distribution service DDS message sent by the business module to be tested;
[0086] S2, reading a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated;
[0087] S3, simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table;
[0088] S4, sending the response DDS message to the service module.
[0089] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0090] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0091] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0092] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0093] S1, monitor the source data distribution service DDS message sent by the business module to be tested;
[0094] S2, reading a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated;
[0095] S3, simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table;
[0096] S4, sending the response DDS message to the service module.
[0097] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0098] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0100] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0101] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A simulation test method based on DDS, characterized in that: include: Monitor the source DDS messages sent by the business module to be tested; Reading a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated; A response DDS message for arranging the source DDS message based on the relationship configuration table simulation; Send the response DDS message to the service module.
2. The method according to claim 1, characterized in that: The response DDS message of simulating and arranging the source DDS message based on the relationship configuration table includes: Searching the relationship configuration table for a message structure that matches the source DDS message, and generating test data that matches the message structure according to the relationship configuration table; The test data is filled into the message structure, and the response DDS message is obtained by composing.
3. The method according to claim 1, characterized in that Before reading the pre-configured relationship configuration table, the method further includes: Configure the message response rules between the business module and the simulation module; configuring a message transmission rule between the business module and the simulation module based on the message response rule, wherein the message transmission rule is used to characterize the first mapping relationship and the second mapping relationship; The relationship configuration table is generated by using the message response rule and the message transmission rule.
4. The method according to claim 3, characterized in that: Configuring the message transmission rules between the business module and the simulation module includes: Determining a DDS interface to be tested of the service module based on the message response rule, wherein the DDS interface is used to transmit the source DDS message; Configure the message structure of the response DDS message of the source DDS message; Configure test data for the message structure.
5. The method according to claim 4, characterized in that The test data for configuring the message structure includes one of the following: Using fixed configuration data to configure first test data of the message structure; Determine a number of message fields of the message structure, construct a number of static parameter values of the number of message fields, and configure second test data of the message structure using the number of static parameter values, wherein each static parameter value corresponds to a message field.
6. The method according to claim 4, characterized in that The test data for configuring the message structure includes: Determining a target field in the source DDS message, and determining a response field in the response DDS message that is associated with the target field; The dynamic parameter value of the target field is configured as third test data of the message structure.
7. The method according to claim 3, characterized in that Configuring the message response rules between the business module and the simulation module includes: In response to a first selection instruction of a user, selecting a DDS interface of the service module to be tested, wherein the DDS interface is used to transmit the source DDS message; Parsing a data structure of the DDS interface, wherein the data structure includes a plurality of fields; In response to a second selection instruction of the user, a target field is selected from the data structure, wherein the target field is a field in the source DDS message that is associated with the response DDS message.
8. A simulation test device based on DDS, characterized in that: include: A monitoring module is used to monitor the source DDS message sent by the service module to be tested; A reading module, used to read a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the source DDS message and the message structure of the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to characterize the message type of the response DDS message to be simulated, and the test data is used to characterize the message content of the response DDS message to be simulated; A simulation module, used for simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table; A sending module is used to send the response DDS message to the service module.
9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Internet of vehicles simulation test method and device, electronic equipment and storage medium
CN116300833A
Automobile domain controller DDS Ethernet communication simulation test method and system
CN117834498A
Service simulation test method and device and electronic equipment
CN118672151A
Simulation test method and device for scene construction, electronic equipment, vehicle and storage medium
CN118748646A
Metadata-based Test Data Generation
US20140007056A1
Cited By
Simulation test method and device and electronic equipment
CN120523168A