Simulation test method and device based on DDS, storage medium and electronic device

Through the DDS-based simulation test method, the relational configuration table mapping is used to generate the response DDS message, which solves the problem of inflexible test data in automotive module testing and realizes a more efficient and accurate test process.

CN119854191BActive Publication Date: 2025-10-10CHONGQING CHANGAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510040237.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-10-10
Estimated Expiration
2045-01-10

AI Technical Summary

Technical Problem

In the prior art, when testing automotive modules, it is impossible to flexibly provide test data for the module to be tested, resulting in an inefficient and inaccurate testing process.

Method used

Through the DDS-based simulation test method, the relationship configuration table is used to monitor the source DDS message of the module to be tested, map and generate the response DDS message, and send it to the business module to achieve flexible customization of test data.

Benefits of technology

It provides flexible and universal test data for the module to be tested during the test process, improving the test efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854191B_ABST
    Figure CN119854191B_ABST
Patent Text Reader

Abstract

The application provides a DDS-based simulation test method and device, a storage medium and an electronic device, and the method comprises the following steps: listening to a source data distribution service (DDS) message sent by a service module to be tested; reading a pre-configured relationship configuration table, wherein the relationship configuration table is used for storing a first mapping relationship between a source DDS message and a response DDS message, and a second mapping relationship between a message structure and test data; 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 service module. Through the embodiment of the application, the technical problem that the related art cannot flexibly provide test data for the service module to be tested in the test process is solved, and the flexible customization of the test process and test data in the DDS message simulation test process is realized.
Need to check novelty before this filing date? Find Prior Art

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] With the continuous development of connected vehicle technology, the number of sensor devices used in vehicles has increased. The amount of data communicated between vehicle ad hoc networks and various heterogeneous networks is far greater than that of traditional vehicles. DDS (Data Distribution Service) is a data-centric middleware protocol that receives data from publishers and distributes it to subscribers. DDS offers low-latency data connections, high reliability, and high scalability, making it suitable for vehicle-side applications.

[0003] In related technologies, when testing a vehicle's module under test, it is often necessary to create some test data according to different situations. The most common method is to use scripts to drive the test steps. During the test process, there is a problem that test data cannot be flexibly provided for the module under test.

[0004] For the above-mentioned problems existing in 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 for a message structure matching the source DDS message in the relationship configuration table, and generating test data matching 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 further comprises: configuring a message response rule between the service module and the simulation module; configuring a message transmission rule between the service module and the simulation module based on the message response rule, wherein the message transmission rule is used to represent the first mapping relationship and the second mapping relationship; and generating the relationship configuration table by using the message response rule and the message transmission rule.

[0009] Optionally, the configuring the message transmission rule between the service module and the simulation module comprises: determining a DDS interface to be tested by the service module based on the message response rule, wherein the DDS interface is used to transmit the source DDS message; configuring a message structure of a response DDS message of the source DDS message; and configuring test data of the message structure.

[0010] Optionally, the configuring the test data of the message structure comprises one of: configuring first test data of the message structure by using fixed configuration data; determining a plurality of message fields of the message structure, constructing a plurality of static parameter values of the plurality of message fields, and configuring second test data of the message structure by using the plurality of static parameter values, wherein each static parameter value corresponds to a message field.

[0011] Optionally, the configuring the test data of the message structure comprises: 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 a dynamic parameter value of the target field as third test data of the message structure.

[0012] Optionally, the configuring the message response rule between the service module and the simulation module comprises: selecting a DDS interface to be tested by the service module in response to a first selection instruction of a user, wherein the DDS interface is used to transmit the source DDS message; parsing a data structure of the DDS interface, wherein the data structure comprises a plurality of fields; and selecting a target field from the data structure in response to a second selection instruction of the user, wherein the target field is a field in the source DDS message 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 for monitoring a source data distribution service DDS message sent by a business module to be tested; a reading module for 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 simulation module for simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table; and a sending module for sending 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 for determining 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 for configuring the message structure of the response DDS message of the source DDS message; and a second configuration unit for configuring test data of the message structure.

[0017] Optionally, the second configuration unit includes one of the following: a first configuration subunit, used to use fixed configuration data to configure the first test data of the message structure; a second configuration subunit, used to determine several message fields of the message structure, construct several static parameter values ​​of the several message fields, and use the several static parameter values ​​to configure the second test data of the message structure, 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 determine the response field associated with the target field in the response DDS message; 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 the 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, an electronic device is also provided, 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 through the communication bus; wherein: the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the program stored in the memory.

[0022] An embodiment of the present application also provides a computer program product comprising 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] Providing a configuration method to specify the data interaction relationship can complete the generation and sending of test data, solving the problem of being unable to flexibly provide test data for the module to be tested during the test process. It is more universal and more 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 This 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 4 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 this field without making creative work should fall within the scope of protection of this application. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[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 sequential order. 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 This is a hardware structure 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) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) 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 will 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 than shown, or with Figure 1 Different configurations shown.

[0034] The memory 104 can be used to store server programs, for example, software programs and modules of application software, such as the server program corresponding to the 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, implementing the above-mentioned 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 located 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. Specific examples of the aforementioned network may include a wireless network provided by the server's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, the transmission device 106 may 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 FIG. 1 is a flow chart of a DDS-based simulation test method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0037] Step S202: monitoring the source 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 service module. The execution subject of this embodiment is a simulation module that performs simulation testing.

[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: Read a preconfigured relationship configuration table, wherein the relationship configuration table is used to store a first mapping relationship between the message structure of the source DDS message and the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to represent the message type of the response DDS message to be simulated, and the test data is used to represent the message content of the response DDS message to be simulated;

[0041] For example, let's say the business module to be tested is A, and the simulation module is B. Because A's business needs to be tested, the orchestration solution configures B's behavior and test data, and the entire process is based on DDS message interaction. The test process requires two considerations: 1. After module A sends a DDS message, what DDS message should module B respond to after receiving it according to the normal business process? 2. The data content of module B's response DDS message. These two points are implemented through the first and second mapping relationships in the relationship configuration table, respectively, and are explained here:

[0042] Assume that during the entire business process, after A sends Message 1 to B, it is designed to receive Message 2 (or even Message 3, Message 4, etc.) from B in order for A's module to continue normal business execution. For example, if A requests B to adjust the air conditioner temperature to 26° (currently 30°), B must respond that the temperature has been adjusted to 26° before A can confirm that the temperature has been adjusted to 26°. If A does not receive this response from B, it will not make subsequent temperature changes (and will still believe that the current temperature is 30°).

[0043] Taking the air conditioner temperature example above, when module B responds to A's air conditioner temperature, let's assume that module B can only set the lowest setting to 27°. Module B assumes that any temperature setting request from A below the minimum of 27° will be set to 27°. If A requests 26°, module B's response message is 27°. If A requests 28°, module B's DDS response message is 28°. Alternatively, module B may be limited and always respond with other data. Therefore, the simulation module B not only responds to A's messages, but the orchestration also supports custom response data values.

[0044] Here, the first mapping relationship in the relationship configuration table shows the relationship between the source DDS message sent by module A and the DDS message type responded by simulation module B. For example, A's message a corresponds to B's message b, and A's message c corresponds to B's messages d and e. 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 as follows: the relationship between the DDS message data sent by A and the test data published in the subsequent response DDS message sent by B. This is the test data generation method used by B in responding to A's message, 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; a 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 flexible customization of the test process and test data during the DDS message simulation test.

[0049] In one implementation of this embodiment, simulating and arranging a response DDS message of the source DDS message based on the relationship configuration table includes: searching for a message structure that matches the source DDS message in the relationship configuration table, and generating test data that matches the message structure based on 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 that matches 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 that matches 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] The simulation software provides the ability to publish business-related DDS messages. It then loads the relationship configuration table and matches received source DDS messages. Upon receiving a DDS message, the software first traverses the relationship configuration table and extracts the first and second mapping relationships if they exist. Based on the associated message structure in the relationship table and the test data configured for subsequent DDS messages, the simulation software then publishes response DDS messages to the source DDS messages one by one, implementing simulation testing.

[0053] In this embodiment, before reading the preconfigured relationship configuration table, it also includes: configuring the message response rules between the business module and the simulation module; configuring 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; 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 the DDS interface of the business module to be tested, wherein the DDS interface is used to transmit the source DDS message; parsing the 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 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 A and the simulation module B as an example, when configuring the DDS message of the A module and the message response rule of the B module, a user first selects a DDS message (source DDS message) of the A module; according to the data structure information of the selected DDS message, the user selects a field (optional step) in the data structure that is concerned in the flow. For example, the data structure of the message is composed of studentNum, age, name, and grade, and after being sent to the B, the data value of the studentNum field (target field) will affect the data of some topics (such as the data of the subsequent response DDS message) in the B, so the user needs to mark the studentNum as the target field, and if the data of the subsequent flow has no correlation with any parameter carried by the source DDS message, no configuration is needed.

[0057] In one embodiment of the present embodiment, configuring the message transmission rule between the business module and the simulation module includes: determining a DDS interface of the business module to be tested based on the message response rule, wherein the DDS interface is used to transmit the source DDS message; configuring a message structure of a response DDS message of the source DDS message; and configuring test data of the message structure.

[0058] In one example, configuring the test data of the message structure includes: using fixed configuration data to configure first test data of the message structure.

[0059] In this example, a response DDS message received by the B after 1 step is configured, test data of the response DDS message is configured based on a default rule, and the data of the response DDS message uses default configuration data.

[0060] In one example, configuring the test data of the message structure includes: determining a plurality of message fields of the message structure, constructing a plurality of static parameter values of the plurality of message fields, and using the plurality of static parameter values to configure second test data of the message structure, 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, because the data structure of the response DDS message is fixed, and 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, and 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 for B after it receives a source DDS message. Dynamic configuration involves assigning values ​​to response fields associated with the values ​​carried by the target fields selected during the message response rule phase. The response field for the test data is selected for the response DDS message, and the data value of the selected target field is populated into the currently configured field. For example, after module B receives a message from a source DDS message containing student information, B obtains the value of studentNum as 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 content of the response DDS message, stuNo is the field that the user needs to dynamically configure. It should be populated with the value of studentNum in the source DDS message, i.e., 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 publishers and subscribers typically includes data type definitions, message formats, security, and encryption, which serve as the foundation of the entire communication process. Based on established message data structure agreements, the present invention possesses all the DDS message capabilities involved in registration. Users then write configuration relationships, select source DDS messages to monitor, and, after monitoring corresponding messages, customize the simulation module's return and subsequent response DDS message data to be published. This embodiment implements a message-based process orchestration scheme to achieve a continuous and complete message interaction process, both receiving DDS messages sent by the module under test and generating subsequent DDS message responses to the received DDS messages.

[0065] Figure 3 The present 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; determining whether attention needs to be paid to the DDS data to be tested; if so, configuring the data field to be paid attention to; if not, configuring a DDS interface to be sent subsequently (response DDS message); determining whether data of the DDS message to be tested needs to be used; if so, configuring the field to use the data of the DDS field to be tested; if not, continuing to determine whether manual configuration of test data is required; if so, filling in the test data according to the configured subsequent DDS interface data structure; if not, using default data for subsequent DDS message publishing.

[0066] This embodiment provides a universal message simulation test design method for testing service modules based on DDS Ethernet communication. Users configure the service of the module under test to link the communication interactions of the simulation module, automatically or manually simulating the test data of the module under test. Simulation can be completed simply by following the data conventions of the communication interfaces between the service modules. When testing a module under test, it is often necessary to generate test data based on different circumstances. In this embodiment, based on the agreed data format of the response DDS message, users provide a configuration method to specify the data interaction relationship to complete the generation and transmission of test data. This solves the problem of being unable to flexibly provide test data for the module under test during the test process. This design method is more universal and efficient.

[0067] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially 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, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0068] Example 2

[0069] In this embodiment, a DDS-based simulation test device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments. The details that have been described will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements 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 includes:

[0071] A monitoring module 40 is configured to monitor the source data distribution service DDS message sent by the service module to be tested;

[0072] a reading module 42 configured to read a preconfigured relationship configuration table, wherein the relationship configuration table is configured to store a first mapping relationship between the message structure of the source DDS message and the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is configured to represent the message type of the response DDS message to be simulated, and the test data is configured to represent the message content of the response DDS message to be simulated;

[0073] A simulation module 44 is 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 configured 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 for determining 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 for configuring the message structure of the response DDS message of the source DDS message; and a second configuration unit for configuring test data of the message structure.

[0078] Optionally, the second configuration unit includes one of the following: a first configuration subunit, used to use fixed configuration data to configure the first test data of the message structure; a second configuration subunit, used to determine several message fields of the message structure, construct several static parameter values ​​of the several message fields, and use the several static parameter values ​​to configure the second test data of the message structure, 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 determine the response field associated with the target field in the response DDS message; 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 the 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 various modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: all the above modules are located in the same processor; or the above various modules are located in different processors in any combination.

[0082] Embodiment 3

[0083] The embodiments of the present application also provide a storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the method embodiments when running.

[0084] Optionally, in the embodiment, the storage medium can be configured to store a computer program for executing the following steps:

[0085] S1, listening to a source data distribution service (DDS) message sent by a service 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 a 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 represent a message type of the response DDS message to be simulated, and the test data is used to represent 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 the embodiment, the storage medium can include but is not limited to a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various storage media that can store computer programs.

[0090] The embodiments of the present application also provide an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor is configured to execute the computer program to execute the steps in any of the method embodiments.

[0091] Optionally, the electronic device can further comprise a transmission device and an input and output device, wherein the transmission device is connected with the processor, and the input and output device is connected with the processor.

[0092] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:

[0093] S1, monitors 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 message structure of the source DDS message and the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is used to represent the message type of the response DDS message to be simulated, and the test data is used to represent 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: Send the response DDS message to the service module.

[0097] Optionally, 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. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0099] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling 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 certain parts of the embodiment.

[0100] It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises", "comprising", "includes", "including" and "has" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their performance in the particular order

[0101] The above description is merely that of the specific embodiments of the application and as such is not to be taken in a limiting sense. Various modifications and alterations of the embodiments described herein will become apparent to those skilled in the art from the foregoing description, which does not limit the generality presented. It is the intention that all such modifications and alterations be considered equaliy by the spirit and scope of this application. It is therefore intended to cover in the appended claims all such changes and alterations that come within the scope of this application.

Claims

1. A DDS-based simulation test method, 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 represent the message type of the response DDS message to be simulated, and the test data is used to represent the message content of the response DDS message to be simulated; Simulate and arrange a response DDS message of the source DDS message based on the relationship configuration table; Send the response DDS message to the service module.

2. The method according to claim 1, characterized in that The step of 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; Fill the test data into the message structure and arrange to obtain the response DDS message.

3. The method according to claim 1, characterized in that Before reading the pre-configured relationship configuration table, the method further includes: Configure 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 using the message response rule and the message transmission rule.

4. The method according to claim 3, characterized in that Configuring message transmission rules between the business module and the simulation module includes: Determining a DDS interface to be tested for 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, configuring first test data of the message structure; Determine several message fields of the message structure, construct several static parameter values ​​of the several message fields, and configure second test data of the message structure using the several static parameter values, wherein each static parameter value corresponds to one 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 associated with the target field in the response DDS message; 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 from 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 from 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 DDS-based simulation test device, characterized in that: include: The monitoring module is used to monitor the source DDS messages sent by the business module to be tested; a reading module, configured to read a preconfigured relationship configuration table, wherein the relationship configuration table is configured to store a first mapping relationship between the message structure of the source DDS message and the response DDS message, and a second mapping relationship between the message structure and test data, wherein the message structure is configured to represent the message type of the response DDS message to be simulated, and the test data is configured to represent the message content of the response DDS message to be simulated; A simulation module, configured to simulate and arrange 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