A performance testing method and system for service-oriented vehicular Ethernet communication
By deploying measurement points at each layer of the protocol stack of the vehicle-mounted Ethernet communication node and using test control frames and load strategies to switch state machines online, a closed-loop transmission path is formed. This solves the problem of not being able to accurately locate end-to-end latency bottlenecks and capacity assessments in existing technologies, and achieves efficient performance testing.
Patent Information
- Application Number
- CN202611526395.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-11-17
AI Technical Summary
Existing technologies cannot accurately pinpoint end-to-end transmission latency bottlenecks without altering the main architecture of mass production software, cannot switch test conditions online, cannot construct large-load mixed traffic close to mass production status, and lack quantitative assessment of the MCU's capacity to carry service-oriented communication.
Multiple runtime measurement points are deployed at the layer interfaces of each layer of the protocol stack of the communication node. The test state machine is switched online through test control frames and load policy identifiers. Simulation messages are injected to form a closed-loop transmission path, decompose the end-to-end transmission delay into segmented delays, and read performance data through hardware timers and calibration and debugging channels.
It enables precise location of performance bottlenecks and construction of near-production-ready mixed traffic loads without recompiling or reprogramming the software, providing capacity assessment for MCUs to carry service-oriented communication and improving testing efficiency and accuracy.
Smart Images

Figure CN123123219A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vehicle network communication testing technology, specifically relating to a performance testing method and system for service-oriented vehicle Ethernet communication. Background Technology
[0002] As automotive electronic and electrical architecture evolves from distributed to centralized, the vehicle communication architecture is shifting from signal-level communication based on buses such as CAN and LIN to a service-oriented architecture with in-vehicle Ethernet as the backbone and services as the organizational unit. In this architecture, traditional signals are encapsulated as service interfaces, and nodes dynamically subscribe to and provide services through service discovery protocols. Communication content is carried on Ethernet using service-oriented protocols such as SOME / IP. At the same time, a large number of body and power signals that were originally transmitted on the CAN bus need to be converted by the central gateway and mapped to Ethernet services for forwarding. As a result, the vehicle communication load has migrated from the bus side to the Ethernet side on a large scale. When performing performance tests on the aforementioned service-oriented in-vehicle Ethernet communication system, the test system typically includes a host computer and at least two communication nodes interconnected via in-vehicle Ethernet. At least one of these communication nodes is a gateway node that converts in-vehicle bus messages into service-oriented messages. This migration places two pressures on communication performance: First, the gateway needs to handle the bidirectional mapping and forwarding of thousands of signals between CAN and SOME / IP, with a large number of messages, multiple period levels, and varying payload lengths. Second, the implementation of the vehicle's functions imposes clear constraints on end-to-end transmission latency, message loss rate, and CPU usage of the protocol stack. Whether the performance meets the standards directly determines whether the service-oriented architecture can be mass-produced and deployed. It should also be noted that the mainstream carrier of the CP software architecture is the automotive microcontroller (MCU), whose computing power and memory resources are far inferior to those of the microprocessor (MPU) on which the AP architecture relies. Running service-oriented communication on the MCU faces multiple constraints: At the CPU level, the encapsulation, segmentation, and task scheduling of service messages all rely on software processing, and the already strained CPU resources become overwhelmed when the transmission volume is large; At the memory level, the effective payload of a single CAN message frame is only 8 bytes, while the payload of a single service message can reach the kilobyte level. The message also needs to carry service header information such as message identifier, length, and session identifier. When a large packet exceeds the maximum transmission unit of the transport layer, it must be segmented by the transmission protocol, and the demand for transmit and receive buffers and memory management increases significantly; At the real-time level, the signal communication matrix under CP is fixed and highly deterministic, while the service discovery mechanism makes the publication and subscription of services dynamic. The additional network messages and event processing generated during runtime introduce non-deterministic latency into the hard real-time system; At the architectural level, there is a paradigm conflict between the static signal design concept of CP and the dynamic communication concept of service-oriented communication. When a single MCU simultaneously handles a large number of concurrent service requests, the scheduling complexity increases significantly.
[0003] Under the aforementioned multiple constraints, how to decompose end-to-end transmission latency into each layer of the protocol stack to accurately locate bottlenecks without changing the main architecture of mass production software, how to achieve online switching of different test conditions without re-burning, and how to construct large-load mixed traffic close to mass production state have become engineering problems that urgently need to be solved in performance testing. In addition, the lack of quantitative evaluation methods for the capacity boundary of MCU to carry service-oriented communication also limits the refinement of architecture design.
[0004] The aforementioned verification requirements pose significant challenges to existing testing methods. Using Ethernet packet capture tools to mirror packet capture at the switch only provides the time difference between packets entering and leaving the node, failing to distinguish which layer of the protocol stack the latency is consumed at, or the time consumed by each segment within the node from bus interruption to application processing. Using bus emulation tools to perform request-response tests on a single service cannot construct multi-cycle, multi-load mixed loads close to mass production conditions. Temporarily inserting performance observation code into the software under test requires recompiling and flashing each time the observation points are adjusted, resulting in low test iteration efficiency. Furthermore, the observation code itself can alter the behavior of the object under test. In addition, existing solutions lack effective engineering methods for unifying multiple nodes under test into the same test condition and for quickly switching between different load levels. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a performance testing method and system for service-oriented in-vehicle Ethernet communication, which solves the problems of existing testing methods being unable to perform hierarchical positioning of cross-node end-to-end latency, unable to switch test conditions online, unable to construct large-load mixed traffic close to mass production status, and unable to quantitatively evaluate the capacity boundary of MCU to carry service-oriented communication.
[0006] The technical objective of this invention is to provide a performance testing method for service-oriented vehicular Ethernet communication, applicable to multiple communication nodes interconnected via vehicular Ethernet, wherein the communication nodes include at least a gateway node and a receiving-side communication node; the method includes the following steps: S1. Measurement point deployment: Multiple runtime measurement points are pre-deployed on the communication link of each communication node. The measurement points are located at the layer interfaces of each layer of the protocol stack on the message transmission path. S2. Test control frame issuance and working condition switching: The test host computer sends test control frames to each of the communication nodes via the vehicle Ethernet. The test control frame carries a predetermined protocol type identifier, test case identifier, and load policy identifier. The communication node identifies the protocol type identifier in the Ethernet receiving hook and switches the local test state machine according to the test case identifier and load policy identifier. S3. Load injection and forwarding: The load injection device injects vehicle bus simulation messages into the gateway node according to the sending period and load length corresponding to the load policy identifier. The gateway node maps the vehicle bus messages into service-oriented messages and forwards them through the vehicle Ethernet. S4. Closed-loop response: The receiving communication node generates response data for the received service-oriented message according to a preset transformation rule and transmits it back via the vehicle Ethernet to form a closed-loop transmission path spanning multiple communication nodes. S5. Segmented timing: On the closed-loop transmission path, each communication node triggers the start and stop of timing at the corresponding measurement point according to the test state machine, decomposing the end-to-end transmission delay into segmented delays between several adjacent measurement points. S6. Data Reading and Result Summary: Read the measurement point timing data, protocol stack task CPU usage data, and message transmission and reception count data of each communication node through the calibration and debugging channel, and obtain the performance test results corresponding to the test case identifier.
[0007] Using the above technical solution, multiple runtime measurement points are pre-deployed at the layered interfaces of each protocol stack on the communication link of each communication node. Timing is triggered based on the test state machine along the closed-loop transmission path, thereby decomposing the end-to-end transmission delay into segmented delays between adjacent measurement points. If performance fails to meet standards, the specific delay consumption can be directly located in the bus reception, application processing, service encapsulation, or Ethernet transmission / reception segment, without the need for external packet capture for speculation, significantly shortening the problem localization cycle. The test host computer can switch test cases and load strategies online via test control frames sent through Ethernet. Nodes identify and switch their local test state machines in the Ethernet receive hooks. The entire testing process does not require recompilation. With the programming software, a single software can continuously execute regression tests with multiple levels and test cases. The load injection device injects simulated messages into the gateway node according to the load strategy. The gateway node maps the vehicle bus messages into service-oriented messages for forwarding. The receiving communication node generates response data and sends it back according to the preset transformation rules, forming a closed-loop transmission path across multiple communication nodes. End-to-end performance verification can be performed under real network topology. By reading the measurement point timing data, protocol stack task CPU usage data, and message transmission and reception count data of each communication node through the calibration and debugging channel, latency, load, and loss indicators can be obtained simultaneously in one test. Moreover, all data have a unified time base, which facilitates cross-analysis.
[0008] A further provision of the present invention: the measurement points include at least a first measurement point to a seventh measurement point arranged sequentially along the closed-loop transmission path; the first measurement point is set at the vehicle bus receive interrupt entry point of the gateway node, the second measurement point is set at the application layer signal arrival time of the gateway node, the third measurement point is set at the service-oriented message transmission trigger time of the gateway node, the fourth measurement point is set at the Ethernet transmission time of the gateway node, the fifth measurement point is set at the Ethernet reception time of the receiving-side communication node, the sixth measurement point is set at the Ethernet reception processing completion time of the receiving-side communication node, and the seventh measurement point is set at the vehicle bus transmission confirmation time of the receiving-side communication node; the end-to-end transmission delay is thus decomposed into six segmented delays between adjacent measurement points.
[0009] By adopting the above further settings, the specific deployment locations of the seven measurement points on the closed-loop transmission path and the decomposition method of the six segmented delays are defined, enabling those skilled in the art to clearly understand the correspondence between each measurement point and each layer of the protocol stack, and decompose the total end-to-end delay across nodes into six independent observation segments: bus reception uplink time, application processing time, protocol stack downlink time, Ethernet link transmission time, receiving side protocol stack uplink time, and bus transmission acknowledgment time, thereby accurately locating the protocol stack layer where the performance bottleneck is located.
[0010] A further feature of the present invention is that the test state machine drives the start and stop of the measurement point by the change of the value of the status flag bit. The same measurement point is only allowed to be started once in a test cycle. The status flag bit is reset after the closed-loop transmission path has completed one cycle, so as to enter the next test cycle.
[0011] By adopting the above further settings, the state transition rules of the state flag are clarified, ensuring that each measurement point is triggered only once and stopped once under the preset timing in each round of testing, avoiding re-entry or repeated timing; the state flag is reset after the closed loop completes one round, ensuring the independence between the previous and subsequent test rounds and avoiding state pollution across rounds.
[0012] A further feature of the present invention is that the load policy identifier corresponds to a pre-configured communication matrix database, which defines the sending period, payload length, and mapping relationship between the simulation messages and the service-oriented interface for several sets of simulation messages; different test case identifiers correspond to different sets of simulation message combinations to construct mixed service loads with different bandwidth utilization rates on the vehicle Ethernet.
[0013] By further configuring the above settings and using the communication matrix database as the configuration input, test cases and load strategies are decoupled, allowing the same test framework to quickly switch between different load scenarios by changing the test case identifier and the load strategy identifier. The period, load, and mapping relationship defined in the database cover the mixed traffic characteristics of multiple period levels and multiple load lengths in mass production conditions, making the test load representative of production.
[0014] A further setting of the present invention: the preset transformation rule is to perform a bitwise inversion operation on the value of the received data after adding one; before generating the response data, the receiving communication node first compares the current received data with the previous received data, and only triggers the response transmission when the two are different.
[0015] By adopting the above further settings, the transformation rule of adding one and then inverting the bits is defined, so that the response data and the original data have a definite but not identical numerical relationship. This makes it easier for the host computer to uniquely distinguish whether the message has been correctly received and has not been repeatedly forwarded as is during the verification process. At the same time, by comparing two adjacent data on the receiving side, it avoids the same message triggering responses multiple times due to Ethernet retransmission or duplicate subscription.
[0016] A further setting of the present invention: before the test host computer sends the test control frame, each communication node completes the protocol stack initialization locally and then delays for a preset time, first setting the services it provides to the offline state and then switching to the available state; after the service provider completes the service online, the service consumer initiates subscription requests to each service in sequence at preset time intervals, so that the service discovery states of all communication nodes are aligned before the test begins.
[0017] By adopting the above further settings, the complete service discovery negotiation is triggered by the operation of going offline and then coming back online. Combined with the staggered subscription on the consumer side, the problem of inconsistent service discovery status caused by the difference between the power-on time and the initialization progress in the multi-node system is solved, and the packet loss count pollution caused by the non-convergence of status in the early stage of testing is eliminated.
[0018] A further feature of this invention is that the subscription scale is bound to the test case identifier, with different test case identifiers corresponding to different numbers of event groups to subscribe to; the consumer-side node controls the subscription timing with a one-time trigger flag, and only requests all event groups corresponding to a test case in batches during the task cycle of entering a certain test case for the first time, and thereafter only reads event data and does not re-initiate subscription.
[0019] By further configuring the above settings, the subscription scale is bound to the test case identifier, so that the subscription scale changes synchronously with the load injection, avoiding the pollution of CPU usage measurement results caused by the idle overhead of pre-subscribing to all service interfaces; the one-time trigger flag controls the subscription timing, preventing repeated subscription requests from being initiated in subsequent periodic tasks and occupying protocol stack resources.
[0020] A further feature of this invention is as follows: task-level measurement points are arranged at the entry and exit points of each main function task in the Ethernet protocol stack and the service-oriented protocol stack, and interrupt-level measurement points are arranged at the entry and exit points of the Ethernet receive interrupt. The runtime measurement module calculates the execution time and response time of each task based on the hardware timer count value and converts them into CPU utilization per unit time. The CPU utilization is further subdivided into application task-level utilization, Ethernet protocol stack task-level utilization, service-oriented protocol stack task-level utilization, and overall machine utilization according to the software level. The overall machine utilization is obtained by back-calculating the remaining time of the operating system's idle tasks. The utilization rates of each level are output through the same calibration and debugging channel. The performance test results also include the frame drop rate, which is obtained by dividing the difference between the Ethernet transmit acknowledgment count on the sending side and the Ethernet receive count on the receiving side by the transmit count; the measurement data is read online through the calibration and debugging channel based on the User Datagram Protocol.
[0021] By further refining the CPU utilization rate into four software layers and outputting it uniformly, we can directly compare the sources of the increase in utilization rate at each layer under different loads and accurately determine whether the CPU bottleneck is located at the application processing layer or the protocol stack processing layer. The frame loss rate is calculated based on the difference between the sent acknowledgment count and the received count, avoiding dependence on the internal buffer of the protocol stack and providing a unified reference benchmark for frame loss measurement across all nodes.
[0022] A further setting of the present invention: the load injection is performed by stacking load groups in a preset order; for each stacking level, timing data, CPU usage data, and transmit / receive count data are read and summarized; when any one of the end-to-end transmission delay, CPU usage, and frame loss rate exceeds a preset threshold, the stacking stops, and the load combination corresponding to the previous level is determined as the capacity boundary for the communication node to carry service-oriented communication; capacity configuration information is generated based on the capacity boundary, and the capacity configuration information includes at least one of the following: the number of service interfaces that the communication node can subscribe to, the number of forwarding paths from the bus to the service, and a recommended communication matrix combination; The load strategy also includes large packet packets, the payload length of which is greater than the maximum transmission unit of a single user datagram. The gateway node forwards the service-oriented message corresponding to the large packet packet after segmentation by the transport layer protocol. The performance test results also include the protocol stack buffer occupancy rate obtained by reading through the calibration and debugging channel. The performance test results also include a service discovery nondeterministic metric: after service discovery converges and the system is in a stable operating state, the first set of segmented timing data is continuously sampled within the first stable window as a baseline; then, the service provided by a communication node is first taken offline and then restored to availability to trigger a service discovery renegotiation; the second set of segmented timing data is continuously sampled within the renegotiation window and the subsequent second stable window; the changes in the mean, extreme values and jitter of the two sets of data are used to characterize the nondeterministic latency introduced by dynamic service discovery.
[0023] By further configuring the above-mentioned parameters, combining load stacking at each level with threshold comparison, the capacity boundary of communication nodes carrying service-oriented communication can be identified, and quantifiable capacity configuration information can be output. This provides a practical basis for service allocation and database design in service-oriented architecture, avoiding capacity design deviations caused by relying on empirical estimations. The large packet grouping special observation quantitatively evaluated the memory management overhead introduced by the transport layer segmentation mechanism. The service discovery renegotiation control experiment quantified the interference of the service discovery mechanism on real-time performance into changes in mean, extreme values, and jitter, which were used to evaluate the degree of interference of dynamic service discovery on hard real-time paths.
[0024] Another object of the present invention is to provide a performance testing system for service-oriented vehicular Ethernet communication for implementing the above method, comprising: The data acquisition and operating condition injection unit is used to generate and send test control frames and summarize performance test results. The test control frames carry predetermined protocol type identifiers, test case identifiers, and load policy identifiers. At the same time, it is used to inject vehicle bus simulation messages into the gateway node according to the sending period and load length corresponding to the load policy identifier. The communication node includes at least one gateway node and at least one receiving-side communication node. The gateway node is used to map received vehicle bus messages into service-oriented messages for forwarding. The receiving-side communication node is used to generate response data for the received service-oriented messages according to a preset transformation rule and send it back to form a closed-loop transmission path. Both the gateway node and the receiving-side communication node integrate a runtime measurement module. The runtime measurement module includes multiple measurement points arranged at the protocol stack layer interface and a hardware timer for timing the measurement points. The measurement data is output through a calibration and debugging channel.
[0025] By adopting the above technical solution, the data acquisition and load injection unit and the runtime measurement module in the communication node form a closed-loop chain from load condition issuance, load injection, data acquisition to result aggregation. The measurement data is uniformly output between the modules through the calibration and debugging channel, which enhances the reproducibility, auditability and deployment availability of the test. Attached Figure Description
[0026] Figure 1This is a block diagram of the performance testing system provided in an embodiment of the present invention; Figure 2 A flowchart of the performance testing method provided in the embodiments of the present invention; Figure 3 This is a schematic diagram showing the distribution of measurement points along the closed-loop transmission path in an embodiment of the present invention; Figure 4 This is a timing diagram of the test state machine driving segmented timing in an embodiment of the present invention; Figure 5 This is a schematic diagram of load grouping in the communication matrix database in an embodiment of the present invention; Figure 6 This is a schematic diagram of the capacity boundary detection process in an embodiment of the present invention; Figure 7 This is a schematic diagram of a bidirectional service link in an embodiment of the present invention.
[0027] In the diagram: 10, Test host computer; 20, Load injection device; 30, Gateway node; 40, First area node; 50, Second area node. Detailed Implementation
[0028] The technical solutions in this embodiment will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] It should be noted that in the description of this invention, all directional indications (such as up, down, forward, backward, etc.) are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0030] Furthermore, in this invention, the use of terms such as "first," "second," etc., is for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. In the description of this invention, "a number" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0031] Furthermore, the technical solutions of the various embodiments of the present invention can be combined with each other, but only if they are feasible for those skilled in the art. If the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by the present invention.
[0032] like Figure 1-7As shown in the figure, this embodiment provides a performance testing method and system for service-oriented vehicular Ethernet communication.
[0033] Example 1: As Figure 1 As shown, this embodiment provides a performance testing system for service-oriented vehicular Ethernet communication, including a test host computer 10, a load injection device 20, a gateway node 30, a first area node 40, and a second area node 50.
[0034] Gateway node 30, first area node 40, and second area node 50 are all electronic control units based on multi-core vehicle microcontrollers. Each integrates the AUTOSAR CP software architecture, and the software stack from bottom to top includes Ethernet driver, Ethernet interface module, Ethernet status management module, TCP / IP protocol stack, socket adapter module, SOME / IP protocol stack, service discovery module, and runtime environment. Gateway node 30 also integrates a multi-channel CAN controller driver for accessing the vehicle bus. The three nodes are interconnected via a vehicle Ethernet switch. In this embodiment, the Ethernet link bandwidth is 100 Mbit / s.
[0035] Gateway node 30 acts as the central gateway in this system. On the one hand, it receives the simulation messages injected by the load injection device 20 via the CAN bus, maps the signals it carries into SOME / IP service messages, and forwards them via Ethernet. On the other hand, it subscribes to the services provided by the regional nodes, generates response messages after receiving service data, and sends them back through the service channel. At the appropriate time, it also sends the data back to the CAN bus, thus extending the original unidirectional gateway forwarding into a closed-loop transmission path. The first regional node 40 and the second regional node 50 each act as providers of several services, subscribe to the services forwarded by gateway node 30, and generate responses according to preset transformation rules after receiving data and send them back.
[0036] The test host computer 10 is test management software running on a PC, connected to an Ethernet switch, and is responsible for sending test control frames, reading measurement data, and summarizing results. The load injection device 20 is a multi-channel bus simulation device that injects simulation messages into the CAN channel of the gateway node 30 according to the period and load defined in the communication matrix database.
[0037] Example 2: Figure 2 As shown, this embodiment provides a performance testing method for service-oriented vehicular Ethernet communication, including steps S1 to S6.
[0038] Step S1: Measurement point deployment. A runtime measurement module is integrated into the software of the three nodes. This module uses the internal hardware timer of each node as a unified time base. In this embodiment, the timer has a 32-bit width and a counting frequency of 10,000 counts per millisecond. Measurement points are pre-allocated timing channels within the module. Each channel independently records the start and stop times and calculates the difference. The deployment of measurement points follows a principle: a measurement point is set whenever a message crosses a layer boundary in the protocol stack. Accordingly, the first measurement point T1 to the fourth measurement point T4 are deployed on the gateway node 30 side, and the fifth measurement point T5 to the seventh measurement point T7 are deployed on the first area node 40 side. The specific locations are as follows... Figure 3 As shown: T1 is located at the CAN receive interrupt service routine entry point of gateway node 30, that is, the first moment when the bus message enters the node; T2 is the time when the application layer receives the notification callback at the gateway node 30, representing the time consumed for the message to be delivered to the application via the communication abstraction layer and the runtime environment; T3 represents the moment when the application layer of gateway node 30 triggers the SOME / IP service to be sent, indicating the application processing time. T4 represents the actual time when the Ethernet driver at gateway node 30 sends a message, indicating the total time spent on service encapsulation, socket adaptation, and protocol stack downlink. The time when the Ethernet driver of T5, located at node 40 in the first area, receives the message and generates a receive indication, the difference between the two nodes in this segment reflects the transmission time of the Ethernet link and the switch. T6 is located at the moment when the Ethernet receive buffering process and message delivery to the upper layer are completed at the first area node 40. T7 is located at the first area node 40 when it sends the response data via the CAN bus and receives confirmation of transmission.
[0039] In addition to the link measurement points mentioned above, three types of auxiliary measurement points are also deployed: First, task-level measurement points, which are paired and placed at the entry and exit points of the main function tasks of the Ethernet protocol stack and the SOME / IP protocol stack, covering the Ethernet driver main function, Ethernet interface status processing, Ethernet status management, TCP / IP main function, socket adaptation main function, and service discovery main function; second, interrupt-level measurement points, which are placed at the entry and exit points of Ethernet receive interrupts and CAN-related interrupts; and third, periodic monitoring measurement points, which are placed on the basic periodic tasks of the nodes to verify that the scheduling period has not drifted during the test.
[0040] Step S2: Test control frame distribution and working condition switching. The test host computer 10 constructs a test control frame and broadcasts it via Ethernet. This frame is an Ethernet data link layer frame, which uses a pre-agreed protocol type identifier as the frame type field. In this embodiment, it is 0x1234. The first two bytes of the payload carry the test case identifier and the load policy identifier, respectively. The Ethernet driver receive hook of each node has built-in identification logic: any frame whose frame type field is equal to the agreed identifier will not be sent to the protocol stack. Instead, two bytes in the payload will be directly extracted and written into the current test case variable and the current sub-test case variable of this node.
[0041] This enables online switching of test conditions; all test cases and sub-test cases are pre-numbered, for example, test cases 1 to 3 correspond to different load levels of the first group of services, test cases 4 to 6 correspond to the second group of services, and so on; sub-test cases distinguish between load and observation focus; switching conditions only requires the host computer to resend a test control frame, and the node completes the state transition within microseconds, without the need for recompilation and flashing.
[0042] Step S2 also includes a service discovery synchronization operation. After each node powers on and completes protocol stack initialization, it does not immediately start service announcements, but delays for a preset duration, which is 5 seconds in this embodiment. After the delay, the service provider first sets the local service status to offline and then switches it to available. The service consumer initiates subscription requests to each service sequentially at preset time intervals after the service becomes available. In this embodiment, the requests are initiated sequentially at 50 millisecond intervals to avoid a service discovery message storm caused by multiple subscription requests being sent at the same time. Since the power-on time and initialization progress of each node in a multi-node system are different, direct announcements may result in some nodes having started subscribing while others are not yet ready, which may pollute the message loss count in the early stages of testing. The operation of going offline and then becoming available will re-initiate a complete round of service discovery negotiation. Combined with the staggered subscription on the consumer side, this ensures that all nodes enter a stable state from a unified starting point.
[0043] The subscription scale is bound to the test case; when the consumer node first enters the task cycle of a certain test case, it requests subscriptions to all event groups corresponding to that test case in batches by triggering a one-time flag; after the one-time trigger flag is set, subsequent cycle tasks only read event data and do not re-initiate subscriptions; after switching test cases, subscriptions are re-subscribed according to the subscription scale of the new test case; thus, the subscription scale changes synchronously with the load injection, avoiding the pollution of CPU usage measurement results caused by the idle overhead of pre-subscribing to all service interfaces.
[0044] Step S3, load injection and forwarding, as follows Figure 5As shown, the load injection device 20 injects simulated messages according to the load groups defined in the communication matrix database. The communication matrix database consists of several groups, and the messages in each group have a uniform payload length and transmission period. The payload length covers four levels: 1 byte, 2 bytes, 4 bytes, and 8 bytes, and the transmission period covers multiple levels from 4ms to 100ms. Within the same period level, it is further divided into multiple parallel message groups. The database also defines the mapping relationship between each simulated message and the target service interface, including the service identifier, interface name, interface type, and method identifier. After the test case identifier selects one or more groups, the load injection device 20 continuously injects according to the corresponding period. After receiving the message, the gateway node 30 converts it into a SOME / IP message through the signal-to-service mapping and forwards it to the Ethernet, forming a mixed service traffic on the link that is close to the mass production condition.
[0045] Step S4, closed-loop response, such as Figure 4 As shown, the working process of the state machine is illustrated using a complete test cycle as an example; assume that the state is driven by a state flag bit, with the initial value of the flag bit being 0.
[0046] When the payload message arrives at gateway node 30, a CAN receive interrupt is triggered. The state machine recognizes that the message's identifier belongs to the observation message corresponding to the current use case and that the flag bit is 0. Therefore, it starts timing at T1 and sets the flag bit to 1. The message is sent uplink through the protocol stack to the application layer to receive the notification callback. The flag bit changes from 1 to 2, T1 stops timing, and T2 starts. After the application layer completes processing, it triggers service transmission. The flag bit changes from 2 to 3, T2 stops, and T3 starts. When the Ethernet driver actually sends the message, the flag bit is reset from 3, and T3 stops.
[0047] After receiving the message, the first area node 40 triggers the start of T5 by the Ethernet receive indication; when the receive buffer processing is completed, T5 stops and T6 starts; after the application layer reads the data, it generates an acknowledgment according to the transformation rules. In this embodiment, the transformation rule is to add one to the value of the received data and then invert the bits. The use of adding one and then inverting is not the common practice of sending back the data as is or only inverting it. This is to allow the host computer to uniquely distinguish whether the message has been correctly received on the path and has not been repeatedly forwarded by the node as is when verifying the data. Before generating the acknowledgment, the node first compares the received data with the previously saved received data. If the two are the same, the current acknowledgment is skipped to avoid repeated triggering caused by Ethernet retransmission or repeated subscription.
[0048] The response data is transmitted back to gateway node 30 via the service channel. The Ethernet receiving link of gateway node 30 records the reception count. After the application layer confirms that it can be sent, it transfers the data to the CAN channel. When the transmission confirmation arrives, the T7 timer ends. At this point, one round of closed loop is completed. After the status flag is reset, it waits for the next round.
[0049] It should be noted that the last hop of the closed-loop path can also be handled by the CAN transmission confirmation of the gateway node 30. That is, the bus transmission confirmation time of the seventh measurement point set on the gateway node side is interchangeable with the setting on the first area node 40 side, and both fall within the protection scope of this invention.
[0050] Step S5, segmented timing: On the closed-loop transmission path, each communication node triggers the start and stop of timing at the corresponding measurement point according to the test state machine, decomposing the end-to-end transmission delay into segmented delays between several adjacent measurement points. In this embodiment, the three differences from T1 to T3 correspond to the uplink bus reception time, application processing time, and downlink transmission time within the gateway node, respectively; segments T4 to T5 reflect the transmission time of the Ethernet link and switch; segments T5 to T6 reflect the uplink processing time of the receiving side protocol stack; segments T6 to T7 reflect the bus transmission acknowledgment time of the receiving side; the differences between segments T1 to T7 constitute a complete decomposition of the end-to-end delay.
[0051] Step S6: Data Reading and Result Summarization. All three nodes enable calibration and debugging channels based on the User Datagram Protocol (UDP). The host computer 10 reads the measurement data of each node online via Ethernet, including the time difference of each measurement point, the CPU utilization rate calculated from the task-level and interrupt-level measurement points, and the Ethernet transmit acknowledgment count and receive count. The CPU utilization rate is calculated by dividing the cumulative execution time of each task measurement point within the measurement cycle by the total duration of the cycle. Interrupt-level measurement points are counted separately to reflect the response overhead of the protocol stack. The frame loss rate is obtained by dividing the difference between the transmit acknowledgment count and the receive count by the transmit acknowledgment count. The host computer archives the above data according to the use case identifier and load policy identifier, and summarizes the application task level, Ethernet protocol stack task level, service-oriented protocol stack task level, and overall machine CPU utilization rate according to the software layer, forming a performance result matrix that includes three types of indicators: latency, load, and frame loss.
[0052] Example 3: This example uses the tiered stacking of load levels as an example to illustrate the process of determining the capacity boundary of a communication node for service-oriented communication. Figure 6 As shown; The load tiers are arranged in ascending order of load, with each tier adding one or more load packets to the previous tier, forming a monotonically increasing load sequence. The first tier selects all packets with 1-byte payload and a 10ms period, generating high-frequency small packet traffic on the Ethernet, focusing on observing protocol stack interruption overhead and task scheduling response. The second tier adds a combination of 4-byte payload and 20ms period packets and 8-byte payload and 100ms period packets to simulate mixed services. The third tier further adds the remaining packets, bringing the link bandwidth usage close to the design limit. If necessary, large packet packets can be added at the end of the sequence, with a payload length exceeding the maximum transmission unit of a single user datagram. The corresponding service message needs to be segmented and forwarded by the transport layer protocol to examine the buffer and segmentation overhead under large loads.
[0053] The execution process for each gear is as follows: the host computer sends out the corresponding test control frame, and the state machine of each node completes the switching; wait for a stable window to allow the service discovery and subscription relationship to converge; start load injection; run continuously for several minutes, during which the host computer reads the measurement data at fixed intervals; after stopping injection, summarize the results of that gear; the gears proceed sequentially, and no software needs to be re-flashed for any node throughout the process.
[0054] Upon completion of each tier, the three key metrics for that tier are compared with preset thresholds: whether the end-to-end segmented latency exceeds the allocated target, whether the CPU utilization of each node exceeds the preset margin, and whether the frame drop rate exceeds the allowable value. If all three criteria are met, the test proceeds to the next tier; if any criterion is not met, the test terminates, and the load combination corresponding to the previous tier is determined as the capacity boundary for the node to carry service-oriented communication. Based on the capacity boundary, capacity configuration information is generated, including the maximum number of service interfaces that the node can subscribe to, the number of bus-to-service forwarding paths that the gateway can carry, and the recommended communication matrix combination. This information can be directly fed back to the electrical and electronic architecture design phase as a quantitative basis for service partitioning and communication matrix pruning.
[0055] Taking three tiers as an example, if all indicators for the second tier pass and the CPU utilization rate for the third tier exceeds the margin, it indicates that the node can stably support the service scale corresponding to the second tier combination. During the result evaluation, the latency of each segment from T1 to T7 can be compared with the allocation indicators segment by segment to determine the responsible segment for exceeding the standard. For example, if segments T4 to T5 are normal but segment T2 is significantly high, it indicates that the bottleneck is in application processing or runtime environment scheduling, and the task priority configuration should be checked. If segments T5 to T6 are high, it indicates that the uplink processing capacity of the receiving side protocol stack is insufficient. CPU utilization data is used to verify whether each node has sufficient margin under the target load, and frame loss rate is used to verify whether the transmission reliability meets the requirements.
[0056] Example 4: This example provides two specific tests for the memory and real-time constraints of MCU carrying service-oriented communication.
[0057] The first test involves large packet segmentation. Large packet groups are set up in the communication matrix database. The payload length of these groups exceeds the maximum transmission unit of a single user datagram. The corresponding service messages are segmented by the transport layer protocol and then forwarded. Two types of indicators are observed: first, the protocol stack buffer occupancy rate read through the calibration and debugging channel, used to verify whether the buffer configuration can cover the worst-case scenario of large packet transmission and reception, providing a basis for buffer capacity design; second, the segmentation latency and CPU usage during the large packet forwarding process, compared with the working condition of small packets in the same period, to quantitatively evaluate the additional processing overhead and memory management burden introduced by the segmentation mechanism.
[0058] The second test is the service discovery nondeterministic test. The specific process is as follows: After the system completes service discovery and enters stable operation, it continuously samples segmented timing data from T1 to T7 within the first stable window as a baseline. Then, the host computer triggers a node to temporarily take its locally provided services offline, delay them, and then restore their availability. All relevant nodes are thus forced to re-execute a complete negotiation process involving service offline notification, service announcement, service lookup, and event group subscription. From the triggering moment, throughout the negotiation process and the subsequent second stable window of equal length to the baseline, the second set of segmented timing data is continuously sampled. The mean, maximum latency, and jitter of the two sets of data are compared. During the negotiation period, nodes need to process an additional batch of service discovery messages, occupying CPU and protocol stack tasks and squeezing forwarding resources for normal business messages. If the mean, extreme values, or jitter of the second set of data significantly increase compared to the baseline, this increment represents the nondeterministic latency introduced by dynamic service discovery. This result can be used to evaluate the degree of interference of service discovery events on hard real-time paths.
[0059] Example 5: This example further explains the implementation details of the aforementioned examples from a software implementation perspective: The application layer software of all three nodes is organized according to the AUTOSAR software component method, consisting of bus signal transceiver components, service and signal conversion components, and test scheduling main function; the consumer node is configured with three periodic tasks of 2 milliseconds, 5 milliseconds, and 10 milliseconds, while the service node is configured with multiple periodic tasks of 2 milliseconds, 4 milliseconds, 5 milliseconds, 10 milliseconds, and 20 milliseconds; the reading and forwarding of load data are completed within each periodic task, and all are subject to branch gating by test case identifiers and load policy identifiers. Inactive test case branches do not generate any runtime overhead.
[0060] The implementation of a bidirectional service link consists of two parts, such as... Figure 7As shown; firstly, the first regional node maps the bus signal to the first set of service events, and only triggers the event transmission when the signal value changes relative to the previous transmission value. The consumer node receives the event as a subscriber. Secondly, the consumer node reads the subscribed event data in batches in the periodic task, calculates the transformation value according to the transformation rule, and packages it into the second set of service events for transmission. After receiving the event, the second regional node maps it back to the bus transmission signal and sends it out through the bus. Thus, there is service traffic in both directions on the link, from the service node to the consumer node and from the consumer node to the service node. The closed-loop path is fully covered under bidirectional traffic.
[0061] The subscription scale is arranged in a progressive manner based on load grouping; the progressive use cases are divided into three tiers: the first tier subscribes to 4 service interfaces, the second tier subscribes to 60 service interfaces, and the third tier subscribes to 120 service interfaces, corresponding to small-scale, medium-scale, and large-scale subscription scenarios, respectively; the mixed traffic use case further superimposes and subscribes to multiple signal groups with 1-byte and 8-byte payloads and periods of 4 milliseconds to 20 milliseconds to reproduce mixed business under mass production conditions; the consumer node controls the subscription timing with a one-time trigger flag, making a batch request to all event groups corresponding to the use case in the first task cycle of a new use case, and then only reading data without re-initiating subscriptions.
[0062] CPU utilization measurement is refined into four levels; application task-level measurement points are paired to cover the entire task body of each periodic task, and the overhead of bus signal transmission and reception and service conversion is statistically analyzed; Ethernet protocol stack task-level measurement points respectively cover the Ethernet driver main function, Ethernet interface status processing main function, Ethernet status management main function, TCP / IP main function and socket adaptation main function; service-oriented protocol stack task-level measurement points separately cover the service discovery main function; the overall system utilization is obtained by back-calculating the remaining time of the operating system's idle tasks; the four levels share a unified measurement time base and are output through the same calibration and debugging channel, which can directly compare the sources of incremental utilization at each level under different subscription scales.
Claims
1. A performance testing method for service-oriented vehicular Ethernet communication, characterized in that, The method is applied to multiple communication nodes interconnected via vehicular Ethernet, wherein the communication nodes include at least a gateway node and a receiving-side communication node; the method includes the following steps: S1. Measurement point deployment: Multiple runtime measurement points are pre-deployed on the communication link of each communication node. The measurement points are located at the layer interfaces of each layer of the protocol stack on the message transmission path. S2. Test control frame issuance and working condition switching: The test host computer sends test control frames to each of the communication nodes via the vehicle Ethernet. The test control frame carries a predetermined protocol type identifier, test case identifier, and load policy identifier. The communication node identifies the protocol type identifier in the Ethernet receiving hook and switches the local test state machine according to the test case identifier and load policy identifier. S3. Load injection and forwarding: The load injection device injects vehicle bus simulation messages into the gateway node according to the sending period and load length corresponding to the load policy identifier. The gateway node maps the vehicle bus messages into service-oriented messages and forwards them through the vehicle Ethernet. S4. Closed-loop response: The receiving communication node generates response data for the received service-oriented message according to a preset transformation rule and transmits it back via the vehicle Ethernet to form a closed-loop transmission path spanning multiple communication nodes. S5. Segmented timing: On the closed-loop transmission path, each communication node triggers the start and stop of timing at the corresponding measurement point according to the test state machine, decomposing the end-to-end transmission delay into segmented delays between several adjacent measurement points. S6. Data Reading and Result Summary: Read the measurement point timing data, protocol stack task CPU usage data, and message transmission and reception count data of each communication node through the calibration and debugging channel, and obtain the performance test results corresponding to the test case identifier.
2. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, The measurement points include at least a first measurement point to a seventh measurement point arranged sequentially along the closed-loop transmission path; the first measurement point is set at the vehicle bus receive interrupt entry point of the gateway node, the second measurement point is set at the application layer signal arrival time of the gateway node, the third measurement point is set at the service-oriented message transmission trigger time of the gateway node, the fourth measurement point is set at the Ethernet transmission time of the gateway node, the fifth measurement point is set at the Ethernet reception time of the receiving side communication node, the sixth measurement point is set at the Ethernet reception processing completion time of the receiving side communication node, and the seventh measurement point is set at the vehicle bus transmission confirmation time of the receiving side communication node; the end-to-end transmission delay is thus decomposed into six segmented delays between adjacent measurement points.
3. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, The test state machine drives the start and stop of the measurement point by the change of the value of the status flag bit. The same measurement point is only allowed to be started once in a test cycle. The status flag bit is reset after the closed-loop transmission path has completed one cycle, so as to enter the next test cycle.
4. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, The load policy identifier corresponds to a pre-configured communication matrix database, which defines the sending period, payload length, and mapping relationship between simulation messages and service-oriented interfaces for several sets of simulation messages. Different test case identifiers correspond to different groups of simulated message combinations to construct mixed service loads with different bandwidth utilization rates on the vehicle Ethernet.
5. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, The preset transformation rule is to add one to the value of the received data and then invert the bits. Before generating the response data, the receiving communication node first compares the current received data with the previous received data, and only triggers the response transmission when the two are different.
6. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, Before the host computer sends the test control frame, each communication node completes the protocol stack initialization locally and then delays for a preset time before setting its respective service to offline and then switching it to available. After the service provider completes the service online, the service consumer initiates subscription requests to each service in sequence at preset time intervals to align the service discovery status of all communication nodes before starting the test.
7. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, The subscription size is bound to the test case identifier, and different test case identifiers correspond to different numbers of event group subscriptions; The consumer-side node controls the subscription timing with a one-time trigger flag, requesting all event groups corresponding to a test case in batches only during the task cycle of entering a test case for the first time, and then only reading event data without re-initiating subscriptions.
8. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, Task-level measurement points are set at the entry and exit points of each main function task in the Ethernet protocol stack and the service-oriented protocol stack, respectively. Interrupt-level measurement points are set at the entry and exit points of the Ethernet receive interrupt. The runtime measurement module calculates the execution time and response time of each task based on the hardware timer count value and converts them into CPU utilization per unit time. The CPU utilization is subdivided into application task-level utilization, Ethernet protocol stack task-level utilization, service-oriented protocol stack task-level utilization, and overall machine utilization according to the software level. The overall machine utilization is obtained by back-calculating the remaining time of the operating system's idle tasks. The utilization of each level is output through the same calibration and debugging channel. The performance test results also include the frame drop rate, which is obtained by dividing the difference between the Ethernet transmit acknowledgment count on the sending side and the Ethernet receive count on the receiving side by the transmit count; the measurement data is read online through the calibration and debugging channel based on the User Datagram Protocol.
9. The performance testing method for service-oriented vehicular Ethernet communication according to claim 1, characterized in that, The load injection is performed by stacking load groups in a preset order. Each time a load group is stacked, timing data, CPU usage data, and transmit / receive count data are read and summarized. When any one of the end-to-end transmission latency, CPU usage, or frame loss rate exceeds a preset threshold, the stacking stops, and the load combination corresponding to the previous level is determined as the capacity boundary for the communication node to carry service-oriented communication. Capacity configuration information is generated based on the capacity boundary. The capacity configuration information includes at least one of the following: the number of service interfaces that the communication node can subscribe to, the number of forwarding paths from the bus to the service, and a recommended communication matrix combination. The load strategy also includes large packet packets, the payload length of which is greater than the maximum transmission unit of a single user datagram. The gateway node forwards the service-oriented message corresponding to the large packet packet after segmentation by the transport layer protocol. The performance test results also include the protocol stack buffer occupancy rate obtained from the calibration and debugging channel; The performance test results also include a service discovery nondeterminism metric: after service discovery converges and the system is in a stable operating state, the first set of segmented timing data is continuously sampled within the first stable window as a benchmark; then, the service provided by a communication node is first taken offline and then restored to availability to trigger a service discovery renegotiation; The second set of segmented timing data is continuously sampled within the renegotiation window and the subsequent second stable window; the changes in the mean, extreme values and jitter of the two sets of data are used to characterize the nondeterministic delay introduced by dynamic service discovery.
10. A performance testing system for implementing the method according to any one of claims 1-9, characterized in that, include: The data acquisition and operating condition injection unit is used to generate and send test control frames and summarize performance test results. The test control frames carry predetermined protocol type identifiers, test case identifiers, and load policy identifiers. At the same time, it is used to inject vehicle bus simulation messages into the gateway node according to the sending period and load length corresponding to the load policy identifier. A communication node, wherein the communication node includes at least one gateway node and at least one receiving-side communication node; The gateway node is used to map the received vehicle bus messages into service-oriented messages for forwarding; the receiving-side communication node is used to generate response data for the received service-oriented messages according to preset transformation rules and send it back to form a closed-loop transmission path; both the gateway node and the receiving-side communication node are integrated with a runtime measurement module, which includes multiple measurement points arranged at the protocol stack layer interface and a hardware timer for timing the measurement points, and the measurement data is output through the calibration and debugging channel.
