Data distribution service testing method and apparatus, electronic device, and storage medium

By driving the creation and parsing of protocol semantic information by communication entities in data distribution service testing, the problem of coupling between the test environment and the protocol stack is solved, enabling non-intrusive testing across heterogeneous protocol stacks and improving the versatility and coverage of the test.

CN123164032APending Publication Date: 2026-11-24CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611446676.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing data distribution service testing methods, the testing environment is strongly coupled with the underlying protocol stack of the device under test, making it difficult to be universal across heterogeneous protocol stacks. Furthermore, it is impossible to perform non-intrusive semantic parsing and dynamic fault injection to decouple the protocol stack, resulting in poor test universality and low coverage.

Method used

By acquiring test cases, control commands are sent to the device under test and the peer communication device to drive the communication entity to create and execute communication behaviors, extract the protocol semantic information of the target protocol message, generate protocol events, process the events according to preset test rules, determine the test results, use a first-in-first-out queue to save the event sequence, adapt to different message forwarding modes for different test requirements, and realize non-intrusive semantic parsing and dynamic fault injection with decoupled protocol stack.

Benefits of technology

It achieves universal adaptation across heterogeneous protocol stacks, improves the universality and coverage of data distribution service testing, ensures the accuracy of test results and the efficiency of problem localization, and meets the needs of different testing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164032A_ABST
    Figure CN123164032A_ABST
Patent Text Reader

Abstract

This application relates to the field of data testing technology, providing a data distribution service testing method, apparatus, electronic device, and storage medium. The method is executed by a test terminal connected to both the device under test (DUT) and a peer communication device. The method includes: acquiring test cases; sending control commands to the DUT and peer communication device based on the test cases to drive them to create a data distribution service communication entity and execute communication behavior; acquiring target protocol messages and extracting protocol semantic information from the target protocol messages to generate corresponding protocol events; processing the protocol events according to preset test rules to obtain processing results; and determining the data distribution service test result based on the processing results and the communication interaction responses of the DUT and peer communication device under the influence of the processing results. This application can improve the versatility and coverage of DDS testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of data testing technology, and in particular relates to a data distribution service testing method, apparatus, electronic device and storage medium. Background Technology

[0002] Data Distribution Service (DDS), as a data-centric publish / subscribe middleware, is widely used in distributed real-time systems. Existing testing solutions typically bind deeply to vendor-specific DDS protocol stack application programming interfaces (APIs) for test case writing and interactive testing. This results in strong coupling between the test environment and the underlying protocol stack implementation of the device under test, making it difficult to achieve cross-hybrid protocol stack compatibility. Furthermore, it lacks the ability to perform non-intrusive semantic parsing and dynamic fault injection on the original communication messages, decoupling them from the protocol stack. Therefore, the testing methods in related technologies suffer from poor test versatility and low coverage. Summary of the Invention

[0003] In view of the shortcomings of the prior art, this application provides a data distribution service testing method, apparatus, electronic device and storage medium to solve the problems of strong coupling between the test environment and the underlying protocol stack of the device under test in the related technologies, which makes it difficult to be universal across heterogeneous protocol stacks, and cannot perform non-intrusive semantic parsing and dynamic fault injection on the original communication messages to decouple the protocol stack, resulting in poor test universality and low coverage.

[0004] In a first aspect, this application provides a data distribution service testing method, which is executed by a test terminal connected to both the device under test and the peer communication device, and includes: Obtain test cases, and based on the test cases, send control commands to the device under test and the peer communication device respectively to drive the device under test and the peer communication device to create data distribution service communication entities and execute communication behaviors; Acquire the target protocol message generated by the device under test based on its communication behavior, extract the protocol semantic information of the target protocol message, and generate the corresponding protocol event; The protocol events are processed according to the preset test rules in the test cases to obtain the processing results; Based on the processing results and the communication interaction responses between the tested device and the peer communication device under the influence of the processing results, the test results of the data distribution service are determined.

[0005] In one embodiment of this application, after generating the corresponding protocol event, the method further includes: Before writing protocol events into the first-in-first-out queue and processing the protocol events according to the preset test rules in the test cases, the process also includes reading protocol events from the first-in-first-out queue.

[0006] The beneficial effects of the above embodiments are as follows: by using a first-in-first-out queue to store protocol events arranged in the order of reception, the timing information of protocol interactions in the DDS network can be preserved, avoiding the disorder of event order caused by multi-task processing, providing accurate timing basis for subsequent test rule matching, and ensuring the accuracy of test result judgment.

[0007] In one embodiment of this application, before obtaining the target protocol message generated by the device under test based on communication behavior, the method further includes: determining test requirements based on the obtained test cases; determining the forwarding mode based on the test requirements; and configuring the device according to the forwarding mode.

[0008] The beneficial effects of adopting the above embodiments are that different message forwarding modes are adapted to different types of test requirements. This can not only meet the requirements of conventional performance testing for forwarding efficiency, but also support the semantic-level message processing requirements of special test scenarios such as anomaly injection and protocol compliance verification, thereby improving the adaptability of multiple DDS test scenarios.

[0009] In one embodiment of this application, obtaining the target protocol message generated by the device under test based on communication behavior includes: The system acquires the initial message generated by the device under test based on its communication behavior, identifies the payload of the initial message, and determines whether the initial message contains a real-time publish-subscribe protocol header and sub-messages. If the initial message contains a real-time publish-subscribe protocol header and sub-messages, the corresponding initial message is used as the target protocol message.

[0010] The beneficial effects of adopting the above embodiments are as follows: by performing payload-level protocol identification on the initial message, non-target service messages can be filtered out, and only target protocol messages that conform to the real-time publish-subscribe protocol specification can be retained for subsequent testing processes. This can not only avoid invalid messages occupying test resources to a certain extent, but also ensure the accuracy of DDS service traffic testing.

[0011] In one embodiment of this application, protocol events are processed according to preset test rules in the test cases to obtain processing results, including: Identify matching messages in the protocol semantic information that match the preset test rules; perform message processing operations on the matching messages according to the preset test rules to obtain the processing results, wherein the message processing operations are used to trigger the device under test to perform protocol control interaction, data retransmission interaction or abnormal response behavior.

[0012] The beneficial effects of adopting the above embodiments are as follows: the precise handling of messages is achieved by matching the preset test rules at the protocol semantic level, which can perform differentiated operations on specific messages with specified topics and sequence numbers. To a certain extent, this avoids the defects of traditional link layer packet loss and packet modification methods that cannot accurately locate target service messages, improves the pertinence and accuracy of data distribution service testing, and can meet the customized needs of different test cases for message control.

[0013] In one embodiment of this application, before determining the data distribution service test result, the method further includes: Input heterogeneous bus stimulus signals or service call requests to the device under test; monitor the protocol messages published by the device under test in response to the heterogeneous bus stimulus signals or service call requests, or monitor the bus interaction signals output by the device under test on the heterogeneous bus side in response to the data distribution service subscription data; cross-validate the monitored protocol messages or bus interaction signals with the interface return results of the device under test to determine the cross-domain test results.

[0014] The beneficial effects of adopting the above embodiments are as follows: by introducing cross-verification between the heterogeneous bus side and the DDS network side, it is possible to simultaneously obtain the internal execution state of the device under test and the actual behavior of the external communication link, realize the full-link testability of cross-domain interaction between the heterogeneous bus and the data distribution service, improve the accuracy of cross-domain integration testing of the data distribution service and the efficiency of problem localization, and meet the testing requirements of cross-bus DDS service interaction in vehicle domain control scenarios.

[0015] In one embodiment of this application, after determining the data distribution service test results, the method further includes: Based on the cross-domain test results and the data distribution service test results, a closed-loop test report is generated.

[0016] The beneficial effects of adopting the above embodiments are as follows: integrating the test results of the entire test process of the device under test can present the operation status of the data distribution service from communication establishment to business interaction, helping testers to quickly locate protocol compliance issues and cross-domain interaction anomalies, and improving the standardization of test result output and the efficiency of problem investigation.

[0017] Secondly, this application also provides a data distribution service testing apparatus, comprising: The instruction sending module is configured to acquire test cases and send control instructions to the device under test and the peer communication device based on the test cases, so as to drive the device under test and the peer communication device to create data distribution service communication entities and execute communication behaviors. The event generation module is configured to acquire the target protocol message generated by the device under test based on the communication behavior, extract the protocol semantic information of the target protocol message, and generate the corresponding protocol event; The event handling module is configured to process protocol events according to preset test rules in the test cases and obtain the processing results; The service testing module is configured to determine the data distribution service test results based on the processing results and the communication interaction responses between the device under test and the peer communication device under the influence of the processing results.

[0018] Thirdly, this application also provides an electronic device, which includes: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the steps of the above-described data distribution service testing method.

[0019] Fourthly, this application also provides a computer-readable storage medium, which includes a stored program, wherein, when the program is running, it controls the device where the computer-readable storage medium is located to perform the steps of the above-described data distribution service testing method.

[0020] The beneficial effects of this technical solution are as follows: Firstly, it acquires test cases and sends control commands to the device under test (DUT) and the peer communication device based on these test cases. This directly drives the DUT and the peer communication device to create DDS entities and execute communication behaviors. The control commands are standardized control content corresponding to the test objective, rather than being directly embedded into the protocol stacks of the DUT and the peer communication device to execute test logic. Entity creation and communication behavior execution can be completed without calling the proprietary APIs of a specific vendor's DDS protocol stack. This removes the binding relationship between the test process and the underlying implementation of a specific protocol stack from the source of test execution, achieving universal adaptation across heterogeneous protocol stacks. Secondly, it directly acquires the original target protocol messages generated by the DUT based on communication behaviors, allowing for protocol language implementation independently of the vendor's protocol stack. The system extracts semantic information and generates protocol events, achieving non-intrusive semantic parsing that decouples the protocol stack. It can obtain the complete semantics of the communication process without relying on the parsing capabilities of the protocol stack. Then, the generated protocol events are processed based on the preset test rules in the test cases. Dynamic fault injection tests can be performed directly at the protocol event level according to the preset test rules without intruding into the protocol stack of the device under test. The test results are comprehensively judged by combining the processing results of the protocol events with the actual communication interaction responses of the device under test and the peer communication device under the influence of the processing results. This can effectively solve the problem in related technologies where DDS testing depends on a specific vendor's protocol stack and cannot achieve semantic parsing of the original message and dynamic faults at the protocol layer, thus improving the universality and coverage of DDS testing.

[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings: Figure 1 This is a flowchart illustrating a data distribution service testing method as shown in an exemplary embodiment of this application; Figure 2 This is a system architecture diagram illustrating a CANoe-based testing method, as shown in an exemplary embodiment of this application. Figure 3 This is an exemplary embodiment of the present application illustrating an architecture diagram of a protocol-aware gateway; Figure 4 This is a test architecture diagram illustrating a plurality of devices under test, as shown in an exemplary embodiment of this application; Figure 5 This is a schematic diagram illustrating the structure of a data distribution service testing apparatus according to an exemplary embodiment of this application; Figure 6 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation

[0023] The embodiments of this application will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be understood that the preferred embodiments are only for illustrating this application and are not intended to limit the scope of protection of this application.

[0024] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0025] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the present application. However, it will be apparent to those skilled in the art that embodiments of the present application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the present application.

[0026] Interface-level testing in related technologies typically involves constructing test scripts based on application programming interfaces (APIs) provided by a specific protocol stack. When the interface format, call order, or software version of the protocol stack changes, the test scripts often need to be adjusted accordingly. The execution status returned by the API primarily reflects the internal call results of the device and cannot independently prove that transmitted messages conforming to the protocol's expectations have been generated in the real network. Meanwhile, link fault injection usually performs delay, drop, and out-of-order processing based on Internet Protocol (IP) addresses, User Datagram Protocol (UDP) ports, or link traffic ratios. This approach lacks recognition of data distribution service semantics such as subject, sub-message type, and writer sequence number, making it difficult to reliably apply anomaly handling to specified service data. Random network disturbances may also simultaneously affect discovery messages, control messages, and non-target service messages, making it difficult to establish a definite correspondence between the cause of the anomaly and the response result.

[0027] The root cause of these problems lies in the fact that test control, real network packets, and test judgment reside at different tool or data layers. Directly calling the internal interfaces of the device under test (DUT) is beneficial for controlling device behavior, but it easily increases the test script's dependence on the protocol stack implementation. Capturing packets only on the network side can reduce intrusion, but without parsing the semantics of the real-time publish-subscribe protocol, it is difficult to determine the topic, entity, and sequence position of the packet. There is also a contradiction in resource allocation between high-speed forwarding and deep parsing; continuously performing deep parsing on all traffic may have additional impacts on the test gateway itself regarding the communication under test.

[0028] In view of this, this application provides a data distribution service testing method, apparatus, electronic device, and storage medium to solve the problems existing in the related technologies.

[0029] The following is an explanation of the terms used in this application: CANoe refers to test software used for vehicle network simulation, test execution, data acquisition, and result reporting. The data distribution service test method of this application can be adapted and developed within this test software.

[0030] The Communication Access Programming Language (CAPL) is an event-driven language for writing node behavior and test logic in the CANoe environment.

[0031] TesterNode (protocol-aware gateway) refers to a test node built based on CAPL. In this application, TesterNode undertakes at least one of the following functions: control command distribution, message reception, protocol parsing, message forwarding, condition determination, and test result recording.

[0032] A Data Distribution Service Internet Tester (DDS IT) refers to a control program installed on both the device under test (DUT) and the peer communication device to receive and execute test control commands. The DDS IT control channel represents the communication channel between the CANoe side and the DDS IT for transmitting control commands and command responses.

[0033] The Device Under Test (DUT) represents the data distribution service node that the current test case primarily verifies. The peer communication device represents the link partner (LP) that establishes publish and subscribe communication with the DUT.

[0034] Please see Figure 1 , Figure 1 This is a flowchart illustrating a data distribution service testing method as shown in an exemplary embodiment of this application. Figure 1 As shown, in an exemplary embodiment, the data distribution service testing method includes steps S110 to S140, and each step is described in detail below.

[0035] S110, Obtain test cases, and send control commands to the device under test and the peer communication device based on the test cases to drive the device under test and the peer communication device to create data distribution service communication entities and execute communication behaviors; S120: Acquire the target protocol message generated by the device under test based on communication behavior, extract the protocol semantic information of the target protocol message, and generate the corresponding protocol event; S130, Process the protocol events according to the preset test rules in the test cases and obtain the processing results; S140. Based on the processing results and the communication interaction responses between the tested device and the peer communication device under the influence of the processing results, determine the data distribution service test results.

[0036] See Figure 2 The data distribution service testing method of this application can be run on Figure 2 The test architecture is based on CANoe and executed by the test terminal within that architecture. This test architecture includes a test terminal running CANoe, a device under test (DDS-DUT), a peer communication device (DDS-LP), and an onboard Ethernet interface card (VN5650). The DUT and peer communication device run the Data Distribution Service protocol stack and DDS IT, respectively. CANoe and DDS-LP can run on Windows operating systems, while the DUT can run on Linux operating systems.

[0037] The VN5650 connects to the test terminal via a Universal Serial Bus (USB) and connects to the device under test (DUT) and the peer communication device via Ethernet channels Eth1 and Eth2, respectively. Real-time publish-subscribe protocol messages between Ethernet channels Eth1 and Eth2 are configured via the TesterNode on the test terminal. DDS IT control messages sent to the DUT and the peer communication device can also be transmitted through the corresponding Ethernet channels.

[0038] Before testing begins, the CANoe project can be loaded and configured accordingly for the test cases. Configuration details include the Ethernet channel, CAN channel, Internet Protocol address of the device under test (DUT), data distribution service communication domain, topic, quality of service (QoS), expected sequence number rules, and test report path. Different test cases can select the parameters needed for this execution from the above configuration.

[0039] Test cases are used to determine the test execution data for control actions, preset test rules, and expected communication responses. Test cases can be loaded by the CANoe test project or generated by the test project based on configured parameters. Preset test rules may include at least one of the following: target topic, target sub-message type, writer serial number range, specific serial number set, time window, Controller Area Network (CAN) signal conditions, and expected response type.

[0040] During test execution, CANoe starts the CAPL TesterNode (protocol-aware gateway). The protocol-aware gateway registers Ethernet packet reception events and prepares cache resources for subsequent packet reception, protocol parsing, and event processing.

[0041] When performing publish capability tests on the device under test (DUT), the TesterNode can send control commands to the DUT via the DDS IT control channel, driving the DUT to create participants, publishers, topics, and data writers. The TesterNode can also send control commands to the peer communication device via another DDS IT control channel, driving the peer communication device to create participants, subscribers, matching topics, and data readers. The topic and quality of service configurations of both the DUT and the peer communication device are determined by the test cases to form publish and subscribe relationships corresponding to the test objectives.

[0042] After the device under test (DUT) and the peer communication device complete participant creation, the Simple Participant Discovery Protocol (SPDP) message performs participant discovery. After creating the data writer and data reader, both parties exchange endpoint information via the Simple Endpoint Discovery Protocol (SEDP) message. The TesterNode receives the discovery message from one side and forwards it to the other side, enabling the DUT and the peer communication device to complete communication entity identification and endpoint matching under the normal data distribution service discovery mechanism.

[0043] The TesterNode resides on the communication path between the device under test (DUT) and the peer communication device, but the DUT and the peer communication device still complete discovery, matching, and data interaction according to the data distribution service protocol. The TesterNode obtains the communication status of both parties through network-side packets and decides on transparent forwarding, asynchronous recording, or semantic-level handling based on the test cases.

[0044] It's understandable that the control commands sent by the TesterNode to the device under test (DUT) and the peer communication device are standardized control contents corresponding to the test objectives, rather than directly embedded within the DUT's protocol stack to execute test logic. Specifically, the test client where CANoe resides does not directly call the DDS interface functions in the DUT and peer communication devices. Instead, it sends control commands implemented by a vendor-specific DDS to the DUT and peer communication devices through the TesterNode. The DUT and peer communication devices only need to deploy a lightweight instruction parsing and execution module (i.e., DDS IT) to convert the received control commands into specific API calls of the current underlying DDS protocol stack. In this way, the upper-layer logic of the test client where CANoe resides is decoupled from the underlying DDS implementation. When the DDS protocol stack under test is changed, only the DDS IT instruction layer on the DUT side needs to be adapted, while the test project, CAPL scripts, and criterion logic on the CANoe side do not require any modification. This achieves cross-heterogeneous protocol stack compatibility, to some extent solving the problem of poor test versatility caused by the coupling between the test environment and the DUT's protocol stack in related technologies.

[0045] After the device under test and the peer communication device execute the control command, they can send the command response back to the TesterNode. The command response can indicate whether the communication entity has been created, whether the communication action has started, whether the data has been submitted to the data writer, or whether the resource has been released.

[0046] At the end of the test, TesterNode can send resource release commands to both the device under test (DUT) and the peer communication device. The DUT and peer communication device delete the corresponding entities created in this test, including data writers, data readers, publishers, subscribers, topics, and participants, and return the execution results to CANoe. After resource release, both devices return to a state of waiting for the next test case, minimizing the impact of entities left over from the previous test case on the subsequent test case.

[0047] The TesterNode receives target protocol messages from the Ethernet channel connected to the device under test, then parses the target protocol messages to extract protocol semantic information related to the current test case.

[0048] For example, for the DATA sub-message, the writer sequence number, writer entity identifier, message direction, timestamp, and information that can determine the topic association can be extracted. Topic association information can be determined based on the entity-topic correspondence formed during the discovery phase. The association data between participants, endpoints, and topics can be obtained from the discovery message, and the topic to which the business message belongs can be determined based on the globally unique identifier prefix and entity identifier in the business message. Alternatively, topic association information can be established by test cases combined with known entity configurations. For the HEARTBEAT and ACKNACK sub-messages, the corresponding fields used to determine reliability control interactions can be extracted.

[0049] It is understood that in this application, the TesterNode is deployed in series between the Ethernet link between the device under test and the peer communication device. All communication packets are captured by bypass through the Ethernet interface card of CANoe. No probes, hook functions or log printing code need to be implanted in the DDS protocol stack of the device under test. Therefore, it does not affect the original code logic and execution timing of the device under test, and achieves semantic zero intrusion on the protocol stack of the device under test.

[0050] TesterNode can organize the extracted protocol semantic information into protocol events. Each protocol event is associated with a corresponding target protocol message, so as to locate the original message when it is necessary to forward, drop, or modify the message, and to directly read the structured semantics when judging the result. The timestamp in the protocol event corresponds to the time when the message is received or recorded by the protocol-aware gateway, which can be used to determine whether the communication behavior falls within the time window set by the test case.

[0051] Then, the protocol events are processed according to preset test rules. These preset test rules can be used to record, allow, filter, discard, or determine the corresponding messages in the protocol events. Preset test rules can use only one semantic condition or combine multiple semantic conditions.

[0052] The processing result represents the state formed after handling the protocol event. For protocol format checks, the processing result may be recording the parsed fields and forming a judgment on whether they meet or do not meet preset conditions; for reliability testing, the processing result may be discarding DATA messages that match the rules; for selective reception testing, the processing result may be allowing messages that meet the subject or sequence number conditions and blocking other messages within the matching range.

[0053] In this way, by using TesterNode to perform semantic parsing on the target protocol messages and then processing the protocol events generated by the semantic parsing through preset test rules, fault injection can be directly applied to the protocol semantic layer without intruding on the protocol stack of the device under test. This avoids deviations in the scope of fault injection due to ambiguity in the underlying network information, meets the testing needs of various complex scenarios, and improves the depth and breadth of test coverage.

[0054] After the processing result is generated, the TesterNode continues to monitor the communication interaction responses generated by the device under test (DUT) and the peer communication device. These responses may include HEARTBEAT sub-messages, ACKNACK sub-messages, DATA retransmission messages, subsequent writer sequence numbers, exception responses, or data reception results after recovery. These responses are compared with the expected behavior defined in the test cases to determine whether the DUT has processed the aforementioned message handling results according to the data distribution service mechanism.

[0055] The test results for data distribution services are determined jointly by the processing results and the communication interaction responses. For example, if a test rule requires discarding a DATA packet with a specified writer sequence number, it not only records that the packet has been hit and discarded by the rule, but also checks whether subsequent reliability control interactions related to the lost data occur and whether the target data has been retransmitted. Thus, the anomaly injection action and the recovery behavior of the device under test form a closed loop, rather than simply proving that packet loss occurred in the network.

[0056] For example, if the preset test rule in the test case is "discard the DATA packet with writerSN=100", then after the TesterNode executes the discard, the processing result is "the DATA packet with writerSN=100 has been discarded". If the device under test follows the DDS reliability protocol, it will trigger a retransmission because it has not received a message from the peer communication device for SN=100, and will send a new DATA (writerSN=100) or HEARTBEAT message; at the same time, the peer communication device may also send an ACKNACK sub-message to request retransmission. The system controller can take this retransmission interaction behavior between the device under test and the peer communication device as a communication interaction response, and then take the processing result (the DATA packet with writerSN=100 has been discarded) and the communication interaction response (retransmission interaction behavior) as the final data distribution service test result.

[0057] According to the technical solution provided in this application, test cases are obtained, and control commands are sent to the device under test (DUT) and the peer communication device based on the test cases. This directly drives the DUT and the peer communication device to create DDS entities and execute communication behaviors. The control commands are standardized control content corresponding to the test objective, rather than being directly embedded into the protocol stacks of the DUT and the peer communication device to execute test logic. Entity creation and communication behavior execution can be completed without calling the proprietary APIs of a specific vendor's DDS protocol stack. This removes the binding relationship between the test process and the underlying implementation of a specific protocol stack from the source of test execution, achieving universal adaptation across heterogeneous protocol stacks. Furthermore, the original target protocol messages generated by the DUT based on communication behaviors are directly obtained, allowing for protocol implementation independent of the vendor's protocol stack. Semantic information is extracted and protocol events are generated, achieving non-intrusive semantic parsing that decouples the protocol stack. Complete communication process semantics can be obtained without relying on the protocol stack's parsing capabilities. Then, the generated protocol events are processed based on preset test rules in the test cases. Dynamic fault injection tests can be performed directly at the protocol event level according to these rules, without intruding into the protocol stack of the device under test. The test results are comprehensively judged by combining the processing results of the protocol events with the actual communication interaction responses of the device under test and the peer communication device under the influence of the processing results. This effectively solves the problem in related technologies where DDS testing relies on specific vendor protocol stacks and cannot achieve original message semantic parsing and dynamic fault handling at the protocol layer, thus improving the versatility and coverage of DDS testing.

[0058] In some embodiments, after generating the corresponding protocol event, the method further includes: Before writing protocol events into the first-in-first-out queue and processing the protocol events according to the preset test rules in the test cases, the process also includes reading protocol events from the first-in-first-out queue.

[0059] First-In-First-Out (FIFO) queues maintain the timing of protocol events according to the first-to-write, first-to-read rule. The order in which protocol events are enqueued corresponds to the order in which the protocol awareness gateway receives and parses the target protocol messages.

[0060] After the protocol-aware gateway completes the parsing of the target protocol message, it can perform the enqueue operation according to the generation order of the protocol events. The enqueued protocol events can include message direction, source address, destination address, GuidPrefix (globally unique identifier prefix), EntityId (entity identifier), topic association information, sub-message type, writerSN (writer sequence number), and message timestamp.

[0061] In some examples, the device under test (DUT) can continuously generate multiple DATA sub-messages. The protocol-aware gateway parses the corresponding packets sequentially in the network reception events and writes the writerSN and timestamp of each DATA sub-message into a first-in-first-out (FIFO) queue. It then reads protocol events in queue order, compares the sequence relationships of adjacent events, and uses a time window to determine the data transmission order.

[0062] First-In, First-Out (FIFO) queues can also be used to store HEARTBEAT, ACKNACK, and other use case-related protocol events. After a target DATA packet is dropped during reliability testing, subsequent HEARTBEAT, ACKNACK, and retransmission DATA events can be read sequentially. This sequential record reflects the evolution of protocol behavior before and after anomaly injection, providing continuous evidence for determining whether the reliability recovery mechanism is functioning as expected.

[0063] According to the technical solution provided in this embodiment, by using a first-in-first-out queue to store protocol events arranged in the order of reception, the timing information of protocol interactions in the DDS network can be preserved, avoiding the disorder of event order caused by multi-task processing, providing accurate timing basis for subsequent test rule matching, and ensuring the accuracy of test result judgment.

[0064] In some embodiments, before acquiring the target protocol message generated by the device under test based on its communication behavior, the method further includes: Based on the obtained test cases, determine the test requirements; based on the test requirements, determine the forwarding mode, and configure it according to the forwarding mode.

[0065] Test requirements represent the communication properties that the current test case aims to verify. Test requirements can be throughput tests, transmission latency tests, real-time publish / subscribe protocol sub-message format tests, error injection tests, or message retransmission tests.

[0066] Forwarding modes can be direct, simple forwarding, or filtering and modification forwarding. Each of these three modes corresponds to a different packet processing path.

[0067] In pass-through mode, the protocol-aware gateway does not analyze the protocol structure in the packets, but instead forwards the packets received from the input channel directly to the corresponding output channel. This pass-through mode can be used for throughput and latency testing.

[0068] In simple forwarding mode, the protocol-aware gateway adds the received packets to a FIFO queue and then performs forwarding. The real-time forwarding path of the protocol-aware gateway does not perform deep semantic analysis on the packets; subsequent modules or asynchronous processing flows read the packets from the FIFO queue and analyze the sub-message format.

[0069] In the filtering and modification forwarding mode, the protocol-aware gateway selectively parses specific sub-messages based on test cases. After finding a message that meets the test rules, the gateway can either discard the message or modify the fields specified by the test rules and reassemble the message before forwarding it.

[0070] When testing requirements change, the processing path of the protocol-aware gateway can be reconfigured. For example, the same test process can first use the pass-through mode to check link communication, and then switch to the filtering and modification forwarding mode during the anomaly construction phase. However, whether to switch modes is determined by the test case.

[0071] According to the technical solution provided in this embodiment, different message forwarding modes are adapted to different types of testing needs. This not only meets the requirements of conventional performance testing for forwarding efficiency, but also supports the semantic-level message processing needs of special testing scenarios such as anomaly injection and protocol compliance verification, thereby improving the adaptability of various DDS testing scenarios.

[0072] In some embodiments, acquiring the target protocol message generated by the device under test based on its communication behavior includes: The system acquires the initial message generated by the device under test based on its communication behavior, identifies the payload of the initial message, and determines whether the initial message contains a real-time publish-subscribe protocol header and sub-messages. If the initial message contains a real-time publish-subscribe protocol header and sub-messages, the corresponding initial message is used as the target protocol message.

[0073] The initial message represents a message received by the protocol-aware gateway via an Ethernet message receive event, but has not yet been confirmed as belonging to the current DDS service traffic. The initial message can originate from the device under test, the peer communication device, or the test control side. See also... Figure 3The CAPL TesterNode (protocol-aware gateway) operates on the CANoe Ethernet node side, capturing DDS / RTPS packets in the test network via the onethernetPacket event (an event handler in the CAPL scripting language of the CANoe tool, used to receive Ethernet packets). The gateway first distinguishes between DDS IT control traffic and the DDS service traffic under test.

[0074] DDS IT control traffic is used to remotely drive the device under test (DUT) to execute test commands such as creating Participants, setting QoS (Quality of Service), creating Topics, creating DataWriters / DataReaders, starting transmission, stopping transmission, setting delays, throughput, and filtering. DDS service traffic, on the other hand, enters the RTPS parsing process. This control traffic enters the control command parsing and response processing path, but not the Real-Time Publish-Subscribe Protocol (RTPS) service semantic extraction path. By logically isolating the two types of traffic, test commands are not directly treated as target service packets simply because they both use Ethernet transmission. This ensures that test control commands and the service packets under test are not confused, avoiding to some extent the strong coupling problems caused by traditional scripts directly calling protocol stack interfaces.

[0075] For initial messages outside of control traffic, the CAPL TesterNode protocol-aware gateway operates on the CANoe Ethernet node side, capturing RTPS packets in the test network via the `on ethernetPacket` event. The protocol-aware gateway identifies the user datagram protocol payload. Payload identification determines whether an RTPS header (Real-Time Publish / Subscribe Protocol header) exists in the payload, and whether an RTPS Submessage (sub-message structure) follows the header. The identification content of the RTPS header may include the protocol identifier, protocol version, vendor identifier, and GuidPrefix. The identification content of the sub-message structure may include the sub-message identifier, flags, sub-message length, and the corresponding sub-message data area. After confirming that the header and sub-message structure can be parsed according to the RTPS format, the protocol-aware gateway identifies the initial message as the target protocol message.

[0076] When a payload contains multiple sub-messages, the protocol-aware gateway can parse them one by one according to their order in the payload and form protocol semantic information for each. A target protocol message can generate a protocol event containing multiple sub-message records, or protocol events can be generated separately for each sub-message related to the test case. Both methods preserve the association between the sub-messages and the original target protocol message.

[0077] For the DATA sub-message, the protocol-aware gateway extracts the EntityId, writerSN, and information used for topic association. For the HEARTBEAT sub-message, the protocol-aware gateway records the message type and related sequence information that it belongs to the reliability control interaction. For the ACKNACK sub-message, the protocol-aware gateway records its corresponding response relationship. Other sub-messages can also enter the protocol event generation process when they are related to test cases.

[0078] If the initial message does not simultaneously meet the identification conditions of the real-time publish-subscribe protocol header and sub-message structure, the protocol-aware gateway may not use the message as the target protocol message in the current step.

[0079] According to the technical solution provided in this embodiment, by performing payload-level protocol identification on the initial message, non-target service messages can be filtered out, and only target protocol messages that conform to the real-time publish-subscribe protocol specification can be retained to enter the subsequent testing process. This can not only avoid invalid messages occupying test resources to a certain extent, but also ensure the accuracy of DDS service traffic testing.

[0080] In some embodiments, protocol events are processed according to preset test rules in the test cases to obtain processing results, including: Identify matching messages in the protocol semantic information that match the preset test rules; perform message processing operations on the matching messages according to the preset test rules to obtain the processing results, wherein the message processing operations are used to trigger the device under test to perform protocol control interaction, data retransmission interaction or abnormal response behavior.

[0081] Preset test rules can be set via CANoe calling the CAPL interface, specifying the topic to be inspected, DATA sub-message type, writerSN range, or a specific sequence number set. They can also include message direction and time window to limit processing to messages sent from the device under test to the peer communication device and occurring during the anomaly injection phase. Each condition can be used individually or in combination depending on the use case purpose. The original message associated with the protocol event that satisfies the rule conditions is identified as the matching message.

[0082] The processing operation performed on a matching message can be logging. The logging operation saves the protocol semantic information, arrival time, and rule hit status of the matching message, but does not change the message forwarding. This operation can be used for protocol format checking, sequence number continuity checking, and communication behavior statistics.

[0083] The processing operation for a matching message can be either allow or discard. Allowing the matching message allows it to continue being sent to the peer communication device. Discarding the matching message prevents it from entering the corresponding output channel. Because the matching conditions are based on protocol semantics such as topic, DATA sub-message type, and writerSN, the discarding action can be applied to a specified service sequence without needing to randomly discard all messages in the same link.

[0084] The processing operations performed on matching messages can also include modification and reassembly forwarding. The protocol-aware gateway modifies the target fields according to the location specified in the test case, reassembles the message, and sends it to the peer communication device. This action can be integrated into the error injection process.

[0085] For example, in a reliability scenario, a preset test rule can identify a DATA message with a specified writerSN as a matching message and discard the matching message. Since the peer communication device has not received data of the corresponding sequence, it can interact with the device under test (DUT) via HEARTBEAT and ACKNACK through a reliability mechanism. When the DUT retransmits the missing data based on the interaction result, the protocol-aware gateway captures the retransmitted DATA message and extracts the writerSN to verify whether the retransmitted data corresponds to the previously discarded data.

[0086] For example, in a filtering scenario, preset test rules can only allow messages that meet sequence number or topic conditions. By changing the sequence relationship of the allowed messages, the processing capabilities of the device under test or the peer communication device for missing frames, duplicate frames, out-of-order frames, and selective reception conditions can be verified. As a specific sequence number rule, test cases can be configured with a single target sequence number, a range of consecutive sequence numbers, or a set of several discrete sequence numbers. A single target sequence number is used to construct a single missing frame; a range of consecutive sequence numbers is used to construct consecutive missing frames; and a set of discrete sequence numbers is used to construct selective missing frames.

[0087] According to the technical solution provided in this embodiment, precise message processing is achieved by matching the preset test rules at the protocol semantic level. Differentiated operations can be performed on specific messages with specified topics and sequence numbers. To a certain extent, this avoids the shortcomings of traditional link layer packet loss and packet modification methods that cannot accurately locate target service messages, improves the pertinence and accuracy of data distribution service testing, and can meet the customized needs of different test cases for message control.

[0088] In some embodiments, before determining the data distribution service test results, the method further includes: Input heterogeneous bus stimulus signals or service call requests to the device under test; monitor the protocol messages published by the device under test in response to the heterogeneous bus stimulus signals or service call requests, or monitor the bus interaction signals output by the device under test on the heterogeneous bus side in response to the data distribution service subscription data; cross-validate the monitored protocol messages or bus interaction signals with the interface return results of the device under test to determine the cross-domain test results.

[0089] Heterogeneous bus refers to a vehicle bus that uses a different communication mechanism than the Ethernet communication for data distribution services. For example, a heterogeneous bus could be a CAN bus or a local interconnect network bus. Heterogeneous bus excitation signals represent vehicle status signals input to the device under test (DUT) via the corresponding bus, used to trigger cross-domain service processing within the DUT. Service call requests represent service requests input to the DUT via the Ethernet service interface.

[0090] Cross-domain testing can be performed along the heterogeneous bus to the DDS network. The CANoe inputs vehicle status signals to the device under test (DUT) via the CAN channel. Upon receiving the vehicle status signal, the DUT, according to its business logic, delivers the corresponding status data to the data distribution service's data writer and publishes the corresponding topic. The protocol-aware gateway captures the RTPS DATA packets generated by the DUT on the Ethernet side.

[0091] The protocol-aware gateway parses the Topic association information, writerSN, and timestamp of RTPS DATA sub-messages. Based on the Topic matching relationship, sequence number continuity, and time window set in the test cases, it determines whether the network-side response meets expectations.

[0092] Service call requests can also serve as trigger inputs for DDS network-side publishing actions. CANoe initiates an Ethernet service call specified in the test case to the device under test (DUT). After processing the request, the DUT publishes the corresponding topic through the data distribution service. The protocol-aware gateway uses the same RTPS semantic extraction method as in the heterogeneous bus excitation scenario to obtain network-side evidence and associates this evidence with the return result of the service call interface.

[0093] Cross-domain testing can also be performed along the DDS network to a heterogeneous bus. The peer communication device or test device publishes subscription data to the device under test (DUT) via a data distribution service. After receiving the topic data, the DUT's data reader outputs a CAN signal or diagnostic response according to the business logic. The CANoe monitors the bus interaction signals output by the DUT through the CAN channel or diagnostic channel.

[0094] In the reverse cross-domain scenario, the test script associates the service content in the DDS subscription data with the monitored CAN signals or diagnostic responses. The protocol-aware gateway simultaneously records the RTPS DATA sub-messages, their writerSNs, and timestamps input to the device under test (DUT), while the CANoe records the timing of the DUT's output bus interaction signals. Test cases can determine the cross-domain test results based on preset time windows, signal correspondences, and interface return status.

[0095] The interface return results indicate the execution status of the device under test (DUT) or DDS IT in response to control commands, data transmission, data reception, or service calls. Monitored protocol messages or bus interaction signals represent the actual behavior of the DUT on the external communication link. Cross-validation establishes a correspondence between internal execution status and external communication behavior according to the same test action, rather than performing independent checks on two types of logs.

[0096] When the interface returns a result indicating successful data publication, cross-validation also checks whether the data distribution service network side has protocol messages with matching topics, sequence numbers conforming to rules, and within the time window. When the network side has corresponding protocol messages but the interface returns an exception, the test report can record the status of both sides simultaneously. Only when the results on both sides meet the correspondence configured in the test case can the corresponding cross-domain test conclusion be formed.

[0097] When the device under test (DUT) responds to DDS subscription data by outputting a CAN signal, cross-validation checks whether the target topic DATA message is input to the DUT on the network side and whether a corresponding signal appears on the CAN side. This allows for differentiation between different scenarios, such as DDS data not reaching the DUT, the DUT receiving the data but not generating a bus output, and a mismatch between the bus output and the target subscription data.

[0098] According to the technical solution provided in this embodiment, by introducing cross-verification between the heterogeneous bus side and the DDS network side, the internal execution state of the device under test and the actual behavior of the external communication link can be obtained simultaneously. This enables the full-link testability of cross-domain interaction between the heterogeneous bus and the data distribution service, improves the accuracy of cross-domain integration testing of the data distribution service and the efficiency of problem localization, and can meet the testing requirements of cross-bus DDS service interaction in vehicle domain control scenarios.

[0099] In some embodiments, after determining the data distribution service test results, the method further includes: Based on the cross-domain test results and the data distribution service test results, a closed-loop test report is generated.

[0100] After the test is completed, CANoe can summarize the DDS IT control commands and their responses, real-time publish / subscribe protocol parsing results, protocol event handling results, communication interaction responses of the device under test, and error information generated during the execution process, and generate a test case-level report.

[0101] According to the technical solution provided in this embodiment, by integrating the test results of the entire testing process of the device under test, the operational status of the data distribution service from communication establishment to business interaction can be presented, helping testers to quickly locate protocol compliance issues and cross-domain interaction anomalies, and improving the standardization of test result output and the efficiency of problem investigation.

[0102] Furthermore, in some embodiments, see Figure 4 When multiple devices under test (DUTs) are connected to the test project, the CANoe hardware configuration tool can be used to activate the Ethernet ports in the VN5650 connected to each DUT and add the corresponding Ethernet channels in the forwarding module. Multiple DUTs can be represented as DUT1, DUT2, to DUTn, where n is the number of devices determined according to the test project configuration.

[0103] For each device under test, the test system can configure the corresponding Internet Protocol address, DDS IT control channel, service message input channel, and forwarding destination channel. The protocol-aware gateway determines the forwarding direction based on the Ethernet channel and destination mapping relationship of the incoming message. Protocol events for different channels can be written to their respective FIFO queues or to a shared FIFO queue containing channel identifiers.

[0104] When testing multiple devices under test concurrently, the forwarding mode can be configured uniformly according to the test project or configured on a channel basis. One channel can perform throughput testing in pass-through mode, while another channel can perform retransmission testing in filtering and modified forwarding mode. The channel information, source address, and destination address in the protocol event are used to distinguish different devices under test and reduce the probability of confusion when concurrent packets are matched according to rules.

[0105] In some examples, during the test execution phase, the TesterNode in CANoe sends DDS IT control commands to both the peer communication device (LP) and the device under test (DUT) via UDP unicast. This controls the DDS IT's operational behavior, including establishing participants, publishers / subscribers, etc., and executing test cases according to test case requirements. For example, the RTPS test case "RTPS Sub-Message Format—Data" aims to verify the correct format of the Data type sub-message sent by the DUT. The test steps are as follows: 1. The DUT creates a Data Writer with domain ID=<domainid>Topic=<DDS IT TestTopic> QoS default; 2. LP creates a Data Reader with domain ID= <domainid>Topic=<DDS IT TestTopic> QoS default; 3. The connection between the DUT and LP needs to be established; 4. The TesterNode extracts the Data sub-message from the received message sequence; 5. Extract the sub-message header from the Data sub-message; During testing, the TesterNode first instructs the DUT to create participants, publishers, topics, and writers via IT commands. Then, it instructs the LP to create participants, subscribers, topics, and readers via IT commands as well. Once the writers and readers are successfully matched, the TesterNode analyzes all RTPS DATA sub-messages sent by the DUT to ensure they conform to the RTPS protocol definition and generates a test report. At the end of the test, the TesterNode instructs the DUT and LP to delete all entities, release resources, and restore the system to its initial state to await the next test case execution.

[0106] The specific message interaction flow (IT commands and RTPS messages) during the test is as follows: All communication is initiated by the TesterNode. During the IT command issuance process, UDP packets are sent to the DUT via the Eth1 interface of the VN5650. After receiving the command, the DUT immediately performs actions such as creating entities and feeds back the execution results to the TesterNode via the link. Similarly, the IT commands sent to the LP are sent via Eth2.

[0107] Once the LP node and DUT node are established, they will communicate based on RTPS messages. Taking the DUT's RTPS messages as an example, its SPDP and SEDP messages arrive at the TesterNode through the Eth1 interface. After the node analyzes that they are RTPS messages, it forwards them to the Eth2 interface, where they are received by the LP. Similarly, the LP's RTPS messages are forwarded by the TesterNode to the Eth1 interface through the Eth2 interface. Ultimately, the LP and DUT complete RTPS communication seamlessly.

[0108] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the process of the embodiments of this application.

[0109] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.

[0110] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0111] Figure 5 This is a schematic diagram illustrating the structure of a data distribution service testing apparatus according to an exemplary embodiment of this application. Figure 5 As shown, the exemplary data distribution service testing apparatus includes: The instruction sending module 510 is configured to acquire test cases and send control instructions to the device under test and the peer communication device based on the test cases, so as to drive the device under test and the peer communication device to create a data distribution service communication entity and execute communication behavior. The event generation module 520 is configured to acquire the target protocol message generated by the device under test based on the communication behavior, extract the protocol semantic information of the target protocol message, and generate the corresponding protocol event. The event handling module 530 is configured to process protocol events according to preset test rules in the test cases and obtain the processing results; The service testing module 540 is configured to determine the data distribution service test result based on the processing result and the communication interaction response between the device under test and the peer communication device under the effect of the processing result.

[0112] In some embodiments, the event generation module 520 is further configured to write protocol events into a first-in-first-out queue; the event processing module 530 is further configured to read protocol events from the first-in-first-out queue.

[0113] In some embodiments, the instruction sending module 510 is further configured to determine test requirements based on the acquired test cases; determine a forwarding mode based on the test requirements; and configure the system according to the forwarding mode.

[0114] In some embodiments, the event generation module 520 is further configured to acquire the initial message generated by the device under test based on communication behavior, and to identify the payload of the initial message to determine whether the initial message contains a real-time publish-subscribe protocol header and sub-messages; if the initial message contains a real-time publish-subscribe protocol header and sub-messages, then the corresponding initial message is used as the target protocol message.

[0115] In some embodiments, the event processing module 530 is further configured to determine matching messages in the protocol semantic information that match preset test rules; perform message processing operations on the matching messages according to the preset test rules to obtain processing results, wherein the message processing operations are used to trigger the device under test to perform protocol control interaction, data retransmission interaction or abnormal response behavior.

[0116] In some embodiments, the service testing module 540 is further configured to input a heterogeneous bus stimulus signal or service call request to the device under test; monitor the protocol messages published by the device under test in response to the heterogeneous bus stimulus signal or service call request, or monitor the bus interaction signals output by the device under test on the heterogeneous bus side in response to the data distribution service subscription data; and cross-validate the monitored protocol messages or bus interaction signals with the interface return results of the device under test to determine the cross-domain test results.

[0117] In some embodiments, the service testing module 540 is further configured to generate a closed-loop test report based on the cross-domain test results and the data distribution service test results.

[0118] Embodiments of this application also provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, cause the electronic device to implement the methods provided in the above embodiments.

[0119] Figure 6 A schematic diagram of a computer system suitable for implementing the embodiments of this application is shown. It should be noted that... Figure 6 The computer system 600 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0120] like Figure 6 As shown, the computer system 600 includes a CPU 601, which can perform various appropriate actions and processes according to a program stored in ROM 602 or a program loaded from storage portion 608 into RAM 603, such as executing the methods in the above embodiments. The CPU 601 is a Central Processing Unit, ROM 602 is a Read-Only Memory, and RAM 603 is a Random Access Memory.

[0121] RAM 603 also stores various programs and data required for system operation. CPU 601, ROM 602, and RAM 603 are interconnected via bus 604. I / O interface 605 is also connected to bus 604. I / O interface 605 is an input / output interface.

[0122] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0123] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs various functions defined in the system of this application.

[0124] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation that may be implemented in systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0126] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0127] Another aspect of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0128] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods described in the various embodiments above.

[0129] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the steps of this application.< / domainid> < / domainid>

Claims

1. A data distribution service testing method, characterized in that, The method is executed by a test terminal, which is connected to both the device under test and the peer communication device, and includes: Obtain test cases, and based on the test cases, send control commands to the device under test and the peer communication device respectively, so as to drive the device under test and the peer communication device to create a data distribution service communication entity and execute communication behavior; The target protocol message generated by the device under test based on the communication behavior is obtained, and the protocol semantic information of the target protocol message is extracted to generate the corresponding protocol event; The protocol events are processed according to the preset test rules in the test cases to obtain the processing results; Based on the processing results and the communication interaction responses between the tested device and the peer communication device under the influence of the processing results, the data distribution service test results are determined.

2. The method according to claim 1, characterized in that, After generating the corresponding protocol event, the process also includes: Write the protocol event into a first-in-first-out queue; Before processing the protocol event according to the preset test rules in the test case, the method further includes: Read the protocol events from the first-in-first-out queue.

3. The method according to claim 2, characterized in that, Before acquiring the target protocol message generated by the device under test based on the communication behavior, the method further includes: Based on the obtained test cases, determine the test requirements; Based on the test requirements, determine the forwarding mode and configure it accordingly.

4. The method according to claim 3, characterized in that, The step of obtaining the target protocol message generated by the device under test based on the communication behavior includes: The device under test obtains the initial message generated based on the communication behavior, and performs payload identification on the initial message to determine whether the initial message contains a real-time publish-subscribe protocol header and sub-messages; If the initial message contains a real-time publish-subscribe protocol header and sub-messages, then the corresponding initial message will be used as the target protocol message.

5. The method according to any one of claims 1-4, characterized in that, The step of processing the protocol events according to the preset test rules in the test cases to obtain the processing results includes: Identify matching messages in the protocol semantic information that match the preset test rules; According to the preset test rules, the matching message is processed to obtain the processing result, wherein the message processing operation is used to trigger the device under test to perform protocol control interaction, data retransmission interaction or abnormal response behavior.

6. The method according to claim 5, characterized in that, Before determining the test results of the data distribution service, the following steps are also included: Input heterogeneous bus excitation signals or service call requests to the device under test; Monitor the protocol messages published by the device under test in response to the heterogeneous bus excitation signal or service call request, or monitor the bus interaction signals output by the device under test on the heterogeneous bus side in response to the data distribution service subscription data; The monitored protocol messages or bus interaction signals are cross-validated with the interface return results of the device under test to determine the cross-domain test results.

7. The method according to claim 6, characterized in that, After determining the test results of the data distribution service, the following is also included: Based on the cross-domain test results and the data distribution service test results, a closed-loop test report is generated.

8. A data distribution service testing device, characterized in that, include: The instruction sending module is configured to acquire test cases and send control instructions to the device under test and the peer communication device based on the test cases, so as to drive the device under test and the peer communication device to create a data distribution service communication entity and execute communication behavior. The event generation module is configured to acquire the target protocol message generated by the device under test based on the communication behavior, extract the protocol semantic information of the target protocol message, and generate the corresponding protocol event; The event handling module is configured to process the protocol events according to the preset test rules in the test cases and obtain the processing results; The service testing module is configured to determine the data distribution service test result based on the processing result and the communication interaction response between the device under test and the peer communication device under the action of the processing result.

9. An electronic device, characterized in that, include: One or more processors and a memory, wherein the memory stores a computer program that, when executed by the one or more processors, causes the device to perform the steps of the data distribution service testing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device containing the computer-readable storage medium to perform the steps of the data distribution service testing method as described in any one of claims 1 to 7.