Network test method, device, equipment, medium and vehicle
By analyzing the test instructions, generating test packets that meet the target application parameters, processing sending or receiving data, solving the problem of inaccurate test results of the existing vehicle-mounted Ethernet test methods, and achieving more accurate and reliable network testing.
Patent Information
- Application Number
- CN202310621816.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-12-03
AI Technical Summary
The existing on-board Ethernet testing method uses unified packets, and the test results have a large error from the actual situation, so it is impossible to comprehensively test complex transmission performance, resulting in inaccurate test results.
By analyzing the test instructions, a test message is generated that meets the test parameters of the target application, and the data at the time of transmission or reception are obtained for processing, network test results are generated, and the network environment in real application scenarios is simulated to improve the accuracy of the test.
It improves the accuracy and reliability of on-board Ethernet network testing, and truly simulates the transmission process of actual data between different ECUs to ensure the accuracy of the test results.
Smart Images

Figure CN119071176A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of vehicle testing technology, and in particular, relates to a network testing method, device, equipment, medium and vehicle. Background Art
[0002] As cars become more and more intelligent, more and more intelligent functions need to be realized in a network environment. Therefore, the automotive industry has generally introduced the automotive Ethernet standard. With its high bandwidth and low latency transmission performance, automotive Ethernet is widely accepted by the automotive field and is currently the mainstream network environment for intelligent automotive data transmission.
[0003] At present, in the test of automotive Ethernet, only a simple packet group test is performed. The messages used in the test are unified messages, and the test message generation method is single, which makes the test results have a large error with the actual situation. Therefore, only through a simple packet group test, it is impossible to comprehensively test the complex transmission performance of automotive Ethernet in various application environments, resulting in inaccurate test results. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a network testing method, device, equipment, medium and vehicle, which can improve the accuracy of vehicle Ethernet network test results.
[0005] In a first aspect, an embodiment of the present application provides a network testing method, the method comprising:
[0006] When receiving the test instruction, parsing the test instruction, obtaining the application identifier of the target application involved in the test, and the test parameters corresponding to the target application;
[0007] Generate a test message that meets the test parameters;
[0008] Send test messages to other ECUs;
[0009] Acquire first message test data corresponding to the application identifier recorded when sending the test message;
[0010] The first message test data is processed according to a preset first test indicator to generate a first network test result.
[0011] In a second aspect, an embodiment of the present application provides a network testing method, the method comprising:
[0012] Receiving a test message, wherein the test message is a message that meets the test parameters corresponding to the target application;
[0013] Acquire second message test data corresponding to the target application recorded when receiving the test message;
[0014] The second message test data is processed according to the preset second test index to generate a second network test result.
[0015] In a third aspect, an embodiment of the present application provides a network testing device, including a traffic testing module and an Ethernet subsystem.
[0016] The flow test module includes:
[0017] The instruction processing submodule is used to parse the test instruction when receiving the test instruction, obtain the application identification of the target application involved in the test, and the test parameters corresponding to the target application;
[0018] A test data generation submodule is used to generate a test message that meets the test parameters;
[0019] A data statistics submodule, used to obtain first message test data corresponding to the application identifier recorded when sending the test message;
[0020] A reporting submodule, configured to process the first message test data according to a preset first test indicator to generate a first network test result;
[0021] The Ethernet subsystem is used for:
[0022] Send test messages to other ECUs.
[0023] In a fourth aspect, an embodiment of the present application provides a network testing device, including a traffic testing module and an Ethernet subsystem.
[0024] The Ethernet subsystem is used to receive a test message, wherein the test message is a message that meets the test parameters corresponding to the target application;
[0025] The flow test module includes:
[0026] A data statistics submodule, used to obtain second message test data corresponding to the target application recorded when receiving the test message;
[0027] The reporting submodule is used to process the second message test data according to the preset second test index to generate a second network test result.
[0028] In a fifth aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
[0029] When the processor executes the computer program instructions, the steps of the network testing method as described in any one of the first aspect or the second aspect are implemented.
[0030] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the network testing method of any one of the first aspect or the second aspect are implemented.
[0031] In a seventh aspect, an embodiment of the present application provides a vehicle, comprising at least one of the following:
[0032] The network testing device as in the third aspect;
[0033] The network testing device as in the fourth aspect;
[0034] The electronic device as in the fifth aspect;
[0035] As a computer-readable storage medium in the sixth aspect.
[0036] The network testing method, device, equipment, medium and vehicle in the embodiments of the present application, when the ECU receives the test instruction, generates a test message that meets the test parameters according to the test parameters corresponding to the target application by parsing the test instruction, and obtains the data recorded when sending or receiving the test message to obtain the network test result. Since the test message used for testing in the embodiments of the present application is generated according to the test parameters of the target application involved in the test, the generated test message is closer to the network environment in the real application scenario, and the obtained test results will be more accurate. Secondly, the test message is sent to other ECUs for other ECUs to generate network test results. This process truly simulates the transmission process of actual data between different ECUs, so it not only realizes the network test for the vehicle-mounted Ethernet, but also makes the test process reliable and authentic, thereby improving the accuracy of the test results. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0038] Figure 1 It is a structural schematic diagram of an ECU provided in an embodiment of the present application;
[0039] Figure 2 It is a flowchart of a network testing system provided by an embodiment of the present application;
[0040] Figure 3 It is a flowchart of a network testing method provided in an embodiment of the present application;
[0041] Figure 4It is a flowchart of another network testing method provided in an embodiment of the present application;
[0042] Figure 5 It is a structural schematic diagram of a network testing device provided in an embodiment of the present application;
[0043] Figure 6 is a structural diagram of another network testing device provided in an embodiment of the present application;
[0044] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0046] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0047] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0048] In order to solve the problems existing in the prior art, the embodiments of the present application provide a network testing method, device, equipment, medium and vehicle, and each part is introduced in detail below.
[0049] Figure 1 It is a schematic diagram of an architecture applicable to the network testing method provided in the embodiment of the present application.
[0050] like Figure 1As shown, the architecture includes a first ECU (Electronic Control Unit) 11 and a second ECU 12. The first ECU 11 and the second ECU 12 respectively include a flow test module, an upper layer virtual module (Upper Layer Simulator) and an ETH (Ethernet) subsystem. The flow test module is mainly used for network testing of vehicle Ethernet, and the upper layer virtual module is used to simulate the behavior of upper layer applications, control the call of Ethernet storage protocol stack interface functions in the Ethernet subsystem, and parse the received messages.
[0051] Furthermore, the traffic test module may specifically include: an instruction processing submodule, which is used to receive control commands sent by the shell command line and obtain execution results; a test data generation submodule, which is used to simulate the way in which upper-layer applications generate data packets to generate test packets required for network testing; a data statistics submodule, which is used to record real-time network data; and a report submodule, which is used to generate a network performance test report based on the data recorded by the data statistics submodule after the test task is completed.
[0052] Based on this, the network testing method proposed in the embodiment of the present application can be specifically as follows.
[0053] In the first ECU 11, the instruction processing submodule in the flow test module receives the control command of the network test, parses the test command to obtain the test parameters required by the target application, and then sends the test parameters to the test data generation submodule.
[0054] The test data generation submodule generates the test message required by the target application based on the test parameters, and then sends the test message to the upper-layer virtual module.
[0055] The upper virtual module simulates the upper application to process the generated test message, and sends the processed test message to the second ECU 12 through the Ethernet subsystem and the underlying Ethernet transmission interface for network testing. At the same time, the data statistics submodules in the first ECU 11 and the second ECU 12 will record the data of parameters such as the time of receiving the message and the time of sending the message, and perform data statistics.
[0056] The data statistics submodule sends the statistical data to the reporting submodule, and the reporting submodule generates a test report of the network performance and sends it to the main control terminal of the vehicle.
[0057] The network testing method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0058] Figure 2It is a flow chart of a network testing system provided in an embodiment of the present application.
[0059] like Figure 2 As shown, the embodiment of the present application provides a network test system, including a first ECU and a second ECU. Based on this system, the network test method provided by the embodiment of the present application includes: when the first ECU receives the test instruction, it parses the test instruction to obtain the application identifier of the target application participating in the test, and the test parameters corresponding to the target application; the first ECU generates a test message that meets the test parameters; the first ECU generates a test message that meets the test parameters; the first ECU obtains the first message test data corresponding to the application identifier recorded when sending the test message; the first ECU processes the first message test data according to the preset first test index to generate a first network test result; the second ECU receives the test message sent by the first ECU; the second ECU obtains the second message test data corresponding to the target application recorded when receiving the test message; the second ECU processes the second message test data according to the preset second test index to generate a second network test result. The embodiment of the present application can generate a network test result based on the process of transmitting the test message of the first ECU and the second ECU, thereby improving the accuracy of the network test.
[0060] Figure 3 1 is a flow chart of a network testing method provided in an embodiment of the present application. The network testing method can be applied to a first ECU.
[0061] like Figure 3 As shown, the network testing method may specifically include steps S310 to S350, which are specifically as follows.
[0062] S310: When a test instruction is received, the test instruction is parsed to obtain an application identifier of a target application involved in the test and test parameters corresponding to the target application.
[0063] In the embodiment of the present application, when the first ECU receives the test instruction sent by the vehicle's main control terminal, it will parse the test instruction, which may include network test instructions for a variety of different applications, such as network test instructions for video applications, network test instructions for image applications, and network test instructions for control commands. In addition, the first ECU can obtain the application identifier of the target application participating in the test based on the analysis of the test instruction. The application identifier of the target application can be used as an identifier to indicate a unique target application, such as the name of the target application or a version number formed by a number or date. At the same time, the first ECU will also parse the test parameters corresponding to the target application, which may be some test parameters that need to be set when simulating the data transmission environment of the target application, such as the bandwidth upper limit of the target application, the message data packet size, the flow test duration, and other parameters.
[0064] In addition, the number of target applications participating in the network test may be one or more.
[0065] S320: Generate a test message that meets the test parameters.
[0066] After parsing the test instructions, the first ECU will generate corresponding test messages based on the test requirements under different target application test environments. Specifically, it can generate corresponding test messages based on the test parameters corresponding to different application software. For example, when the target application is a video application, the first ECU can generate a test message that meets the test parameters corresponding to the video application, and the test message can be a message that simulates video data; when the target application is an image application, the first ECU can generate a corresponding test message about the image application, and the test message can be a message that simulates image data; at the same time, when the target application is a control application, the first ECU can also generate a control command test message, and the test message can be a message that simulates control command data.
[0067] Based on this, in some embodiments, the above S320 may specifically include:
[0068] Obtain a message template corresponding to the application identifier; and generate a test message that meets the test parameters according to the message template.
[0069] In the embodiment of the present application, different message templates can be pre-set for different applications, so that when generating a test message, the message template of the corresponding application can be referred to to generate the test message.
[0070] Exemplarily, when the first ECU generates a test message that meets the test parameters, it can first obtain the message template corresponding to the application identifier of the target application, wherein the messages required by different target applications may have different requirements. For example, for video applications and image applications, the total length of the message sent in the test message may be different. Therefore, it is necessary to first obtain the message template corresponding to the application identifier so that the first ECU can generate the corresponding test message based on the message template.
[0071] In this way, by acquiring the message template of the target application involved in the test to generate a test message, the test message can be generated based on the requirements of different target applications, and the network test result obtained by using the test message test is more accurate.
[0072] S330: Send test messages to other ECUs.
[0073] After the first ECU generates a test message, it will send the test message to the second ECU, and the second ECU can communicate with the first ECU. Figure 1As shown, for example, an Ethernet subsystem can be set in the first ECU and the second ECU respectively, and the two ECUs can communicate based on the Ethernet TCP / IP network protocol through the interface registered by the first ECU and the second ECU on the network protocol stack of the Ethernet subsystem.
[0074] S340: Acquire first message test data corresponding to the application identifier recorded when the test message is sent.
[0075] When the first ECU sends a test message to the second ECU, the first ECU will record the first message test data corresponding to the application identifier. The first message test data may be test data generated when the first ECU sends a test message, such as the length of the test message sent, the time when the test message is sent, the number of messages sent, and other information.
[0076] In some embodiments, the first message test data may include at least information such as the test start time, the time of successful connection with the ECU, the time of closing the connection with the ECU, and the total length of the message sent. Of course, it may also include one or more of these data, or other data, such as the number of sent messages, the number of received messages, etc.
[0077] Exemplarily, the first message test data may include the test start time, which is the time when the first ECU receives the test instruction. The first message test data may also include the connection success time of the communication connection between the first ECU and the second ECU. When the first ECU sends a test message to the second ECU, the first ECU needs to establish communication with the second ECU, so the connection success time with the ECU is the time when the first ECU and the second ECU successfully establish communication. After the first ECU completes the sending of the test message to the second ECU, the two ECUs may end the communication, so the first message test data may also include the connection closing time of the communication connection when the first ECU and the second ECU end the communication. The first message test data may also include information on the total length of the message sent by the first ECU to the second ECU. Through the above-mentioned first message test data, the network performance when the first ECU sends a test message to the second ECU can be tested. For example, the delay information of the communication connection between the two ECUs can be determined by the difference between the connection success time of the communication connection and the connection closing time of the communication connection, thereby improving the accuracy of the network test.
[0078] S350: Process the first message test data according to a preset first test indicator to generate a first network test result.
[0079] Here, the preset first test indicator may include connection establishment time, total message length, transmission throughput, etc.
[0080] The first ECU processes the first message test data according to the preset first test index. The process of processing the data according to the preset first test index can be a data processing process based on the calculation of the first message test data. For example, the delay information of the first ECU sending the test message to the second ECU can be obtained by the difference between the successful connection time of the communication connection and the connection closing time of the communication connection. Based on the calculation result and other recorded data, the first network test result is generated. In addition, the first network test result can be a test report displayed in a tabular form.
[0081] In some embodiments, the above S350 may specifically include:
[0082] Calculate the difference between the connection success time and the test start time to obtain the connection establishment time; substitute the total length of message sending, the connection closing time and the test start time into the throughput calculation formula to calculate the sending throughput; take the connection establishment time, the total length of message sending and the sending throughput as the first network test result.
[0083] Exemplarily, the connection establishment duration can be calculated using the following formula (1):
[0084] Connection establishment time = connection success time - test start time (1)
[0085] In formula (1), the test start time may be the time when the first ECU receives the test instruction, and the connection success time may be the time when the first ECU successfully establishes a communication connection with the second ECU.
[0086] In addition, the throughput calculation formula can be:
[0087]
[0088] In formula (2), the connection closing time may be the time when the first ECU closes the communication connection with the second ECU.
[0089] The network test results obtained through three calculations, namely, connection establishment time, total message length and sending throughput, can intuitively reflect the network performance of the first ECU when sending test messages to the second ECU, which meets the network environment requirements for the first ECU as the sender in actual scenarios, making the test results accurate.
[0090] In this way, when the first ECU receives the test instruction in the embodiment of the present application, the test message corresponding to the target application is simulated and generated according to the identifier of the target application and the corresponding test parameters by parsing the test instruction, and the network test result can be obtained by obtaining the data recorded when sending or receiving the test message. Since the test message used for testing in the embodiment of the present application is simulated and generated according to the test parameters of the target application involved in the test, the generated test message is closer to the network environment in the real application scenario, and the obtained test result will be more accurate. Secondly, the test message is sent to the second ECU for the second ECU to generate the second test result. This process truly simulates the transmission process of actual data between different ECUs, so it not only realizes the network test for the vehicle-mounted Ethernet, but also makes the test process reliable and authentic, thereby improving the accuracy of the test results.
[0091] In addition, in some embodiments, before the above S330, the network testing method provided in the embodiment of the present application may further include:
[0092] The test message is processed according to the data processing method of the target application to obtain a processed test message.
[0093] Here, before sending the test message to the second ECU, the first ECU will perform data processing on the test message, and the data processing process is to simulate the process of data processing of the target application on the data to be sent in the real environment. For example, in the real environment, the video application needs to compress the video data to be sent, so the data processing of the test message about the video application may be to compress the test message to obtain the processed test message.
[0094] Based on this, the above S330 may specifically include:
[0095] Send the processed test message to the second ECU.
[0096] After the first ECU processes the test message according to the data processing method of the target application, it will send the processed test message to the second ECU.
[0097] In this embodiment, by processing the test message to be sent according to the data processing method of the target application and then sending the processed test message to the second ECU, the actual network environment can be simulated to the maximum extent, thereby making the network testing process more realistic and further improving the accuracy of the network testing results.
[0098] In some embodiments, the first ECU is provided with upper-layer virtual modules corresponding to a plurality of applications respectively, and the upper-layer virtual modules may be some function codes for simulating the data processing method before the corresponding application sends a message.
[0099] In the present application embodiment, Figure 1 As shown, multiple upper-layer virtual modules corresponding to the applications can be set in the first ECU 11 and the second ECU 12, that is, different upper-layer virtual modules are set for different applications, and each upper-layer virtual module can simulate the data processing method of the corresponding application. For example, multiple upper-layer virtual modules including upper-layer virtual modules for simulating video applications, upper-layer virtual modules for simulating image applications, or upper-layer virtual modules for simulating control applications are set in the first ECU 11. Different upper-layer virtual modules have different data processing methods for test messages. The upper-layer virtual modules for simulating video applications or the upper-layer virtual modules for simulating image applications can simulate the compression process of video applications or image applications on videos or images, and compress the test messages; the upper-layer virtual modules for simulating control applications can simulate the encryption process of control applications for control commands, and encrypt the test messages.
[0100] Based on this, in some embodiments, the step of performing data processing on the test message according to the data processing mode of the target application to obtain the processed test message may specifically include:
[0101] A target upper-layer virtual module corresponding to a target application is determined from multiple upper-layer virtual modules; the target upper-layer virtual module processes the test message according to the target data processing method simulated by the target upper-layer virtual module to obtain a processed test message.
[0102] Here, since there may be multiple upper virtual modules in the first ECU, it is necessary to determine the target upper virtual module corresponding to the target application according to the test message. In addition, since the test instruction carries the application identifier of the target application, the target upper virtual module corresponding to the target application can be determined according to the application identifier.
[0103] Exemplarily, the target upper-layer virtual module corresponding to the target application may be called, and the target upper-layer virtual module simulates the data processing mode of the upper-layer target application, that is, the target data processing mode, to perform data processing on the test message. For example, the upper-layer virtual module corresponding to the video application is called to perform data compression and other data processing on the test message, and the upper-layer virtual module corresponding to the control application is called to perform data encryption and other data processing on the test message.
[0104] In this way, by simulating the target data processing method of the target application for the test message through the target upper-layer virtual module corresponding to the target application, it is possible to simulate the actual network environment and accurately perform network testing on the in-vehicle Ethernet with less development difficulty, so that the network test results are accurate.
[0105] In addition, in order to realize data communication between different ECUs and receive information fed back by the underlying transport layer, in some embodiments, a plurality of simulation callback interfaces are provided in the upper virtual module.
[0106] In the actual target application, it is necessary to perceive the reception and sending of test messages through a callback interface. Therefore, in order to simulate the real network environment, a plurality of simulated callback interfaces are set in the upper-layer virtual module in the embodiment of the present application to perceive the reception and sending of test messages.
[0107] For example, multiple simulation callback interfaces that can be set may include:<Up_RxIndication> ,<Up_TcpIpEvent> ,<Up_TxConfirmation> ,<Up_TcpAccepted> ,<Up_TcpConnected> as well as<Up_CopyTxData> wait.
[0108] Based on this, before the above S330, the network testing method provided in the embodiment of the present application may further include:
[0109] Register multiple simulated callback interfaces on the network protocol stack.
[0110] In order to realize the reception and sending of the test message through the simulated callback interface, the simulated callback interface needs to be registered on the network protocol stack of the Ethernet subsystem. In this embodiment, the simulated callback interface can be registered on the TCP / IP network protocol stack.
[0111] Based on this, in some embodiments, the above S340 may specifically include:
[0112] The first message test data corresponding to the application identifier recorded when the test message is sent is obtained from the data returned by the multiple simulation callback interfaces.
[0113] Since the simulation callback interface is registered on the network protocol stack, the simulation callback interface can be used to obtain the first message test data corresponding to the application identifier recorded when sending the test message from the multiple data returned. As mentioned above, the first message test data may include the total length of the message sent, the time of successful connection, and the time of connection closing. Therefore, different data can be obtained through different simulation callback interfaces, for example,<Up_CopyTxData> Get the total length of the message sent, through<Up_TcpConnected> Get the connection success time and connection closing time, etc.
[0114] In this way, by setting up multiple simulation callback interfaces, the reception and sending of the simulated target application-aware test message can be realized, thereby obtaining the first message test data, making the test process more realistic and increasing the accuracy of the network test results.
[0115] Figure 4 FIG. 1 is a flow chart of another network testing method provided in an embodiment of the present application. The network testing method can be applied to the second ECU.
[0116] like Figure 4 As shown, the network testing method may specifically include steps S410 to S430, which are specifically as follows.
[0117] S410: Receive a test message, where the test message is a message that meets the test parameters corresponding to the target application.
[0118] Since the first ECU is communicatively connected with the second ECU, the second ECU can receive the test message sent by the first ECU. The test message can be a message generated according to the network testing method provided in the above embodiment and conforming to the test parameters corresponding to the target application.
[0119] S420: Acquire second message test data corresponding to the target application recorded when receiving the test message.
[0120] In the embodiment of the present application, when receiving the test message, the second ECU parses the data in the test message, or records the data related to the target application as the second message test data.
[0121] In some embodiments, the second message test data may at least include: message sending time, total message sending length, message receiving time, total message receiving length, connection closing time and test start time. Of course, it may also include one or more of these data, or other data, such as the number of sent messages, the number of received messages, etc.
[0122] The message sending time is the message sending time when the first ECU sends the test message to the second ECU, the total message sending length is the total length of the test message sent by the first ECU, the message receiving time is the time when the second ECU receives the test message, and the total message receiving length is the total length of the test message received by the second ECU.
[0123] Through the above test data, the network performance of the second ECU when receiving the test message can be determined. For example, the delay information can be obtained based on the difference between the message sending time and the message receiving time; the packet loss rate can be obtained through the total length of the message sent and the total length of the message received, etc., thereby obtaining the network test results of the receiving end.
[0124] S430: Process the second message test data according to a preset second test indicator to generate a second network test result.
[0125] Here, the preset second test index may include the total length of message reception, reception throughput, packet loss rate, delay information, etc.
[0126] The second ECU may perform data processing according to a preset second test indicator based on the second message test data. The process of performing data processing according to the preset second test indicator may be a data processing process of performing calculations based on the second message test data.
[0127] In some embodiments, the above S430 may specifically include:
[0128] Substitute the total length of received messages, the connection closing time, and the test start time into the throughput calculation formula to calculate the received throughput; substitute the total length of sent messages and the total length of received messages into the packet loss rate calculation formula to calculate the packet loss rate; calculate the difference between the message receiving time and the message sending time to obtain the delay information; take the total length of received messages, the received throughput, the packet loss rate, and the delay information as the second network test result.
[0129] Here, the delay information may specifically include at least one of a maximum delay, a minimum delay and an average delay.
[0130] For example, the throughput calculation formula may be as shown in the following formula (3):
[0131]
[0132] The packet loss rate calculation formula can be shown as the following formula (4):
[0133]
[0134] In the delay information, the calculation formula for the maximum delay can be shown as the following formula (5):
[0135] Maximum delay = MAX (message receiving time - message sending time) (5)
[0136] In the delay information, the calculation formula for the minimum delay can be shown as the following formula (6):
[0137] Minimum delay = MIN (message receiving time - message sending time) (6)
[0138] In the delay information, the calculation formula for the average delay can be shown as the following formula (7):
[0139] Average delay = AVERAGE (message receiving time - message sending time) (7)
[0140] By including the total length of message reception, reception throughput, packet loss rate and delay information, the test requirements of the second ECU currently serving as the receiving end for network performance can be basically covered. Therefore, the second network test results including the total length of message reception, reception throughput, packet loss rate and delay information can improve the accuracy of network testing.
[0141] Thus, in this embodiment, since the test message received by the second ECU is a message that meets the test parameters corresponding to the target application, by receiving the test message, the network data transmission process of the two ECUs in the actual application environment can be simulated, and then data processing is performed on the test data recorded when the test message is received, and the obtained second network test result is more accurate, thereby improving the accuracy of the network test result.
[0142] In some embodiments, after the above S410, the network testing method provided in the embodiment of the present application may further include:
[0143] Parse the test message according to the data parsing method of the target application.
[0144] Here, when the second ECU receives the test message sent by the first ECU, it will parse and process the test message. Similarly, the parsing process will be different based on different target applications. For example, for test messages about video applications, the test message may be decompressed, and for test messages about control commands, it may be decrypted.
[0145] In this way, by simulating the data parsing method of the target application, the parsing and processing process of the target application for the received data can be restored to the greatest extent, thereby improving the accuracy of the network test.
[0146] In addition, in some embodiments, the second ECU is provided with upper-layer virtual modules corresponding to the plurality of applications respectively, and the upper-layer virtual modules are used to simulate the data parsing method after the corresponding application receives the message.
[0147] Similar to the first ECU, multiple upper virtual modules corresponding to the applications can be set in the second ECU, that is, different upper virtual modules are set for different applications, and each upper virtual module can simulate the data processing method of the corresponding application. For example, an upper virtual module for simulating the data processing method of video applications, an upper virtual module for simulating the data processing method of image applications, or an upper virtual module for simulating the data processing method of control applications can be set in the second ECU.
[0148] In some embodiments, the step of parsing the test message according to the data processing method of the target application may specifically include:
[0149] A target upper-layer virtual module corresponding to a target application is determined from a plurality of upper-layer virtual modules; and the target upper-layer virtual module parses and processes the test message according to a target data parsing method simulated by the target upper-layer virtual module.
[0150] Similar to the first ECU, there are multiple upper-level virtual modules in the second ECU. Therefore, it is necessary to first determine the target upper-level virtual module corresponding to the target application based on the test message, and then parse and process the target upper-level virtual module test message. For details, please refer to the relevant description of the first ECU in the aforementioned embodiment, which will not be repeated here.
[0151] In this way, the target upper-layer virtual module corresponding to the target application simulates the target data parsing method of the target application for the received data and parses the test message. This can not only simulate the actual network environment and improve the accuracy of the network test results, but also realize the network test of the in-vehicle Ethernet with less development difficulty.
[0152] In addition, in some embodiments, a plurality of simulation callback interfaces are provided in the upper virtual module of the second ECU, and before receiving the test message, the plurality of simulation callback interfaces need to be registered on the network protocol stack.
[0153] Registering the simulation callback interface on the network protocol stack can realize the reception and transmission of messages through the simulation callback interface. For details, please refer to the relevant description of the first ECU in the above embodiment, which will not be repeated here.
[0154] Based on this, the above S430 may specifically include:
[0155] The second message test data corresponding to the target application recorded when the test message is received is obtained from the data returned by the multiple simulation callback interfaces.
[0156] Similar to the first ECU, the second ECU can also obtain different test data according to multiple simulation callback interfaces, for example,<Up_CopyTxData> Get the total length of the sent message through<Up_TcpConnected> Get the connection success time and connection closing time, etc.
[0157] In this way, by setting up multiple simulation callback interfaces, the reception and sending of the simulated target application-aware test message can be realized, thereby obtaining the second message test data, making the test process more realistic and increasing the accuracy of the network test results.
[0158] Figure 5 1 is a schematic diagram of the structure of a network testing device provided in an embodiment of the present application. The network testing device can be configured in a first ECU.
[0159] like Figure 5 As shown, the network testing device 500 may include a traffic testing module 510 and an Ethernet subsystem 520 .
[0160] The flow test module 510 includes:
[0161] The instruction processing submodule 511 is used to parse the test instruction when receiving the test instruction, and obtain the application identifier of the target application involved in the test and the test parameters corresponding to the target application.
[0162] The test data generation submodule 512 is used to generate a test message that meets the test parameters.
[0163] The data statistics submodule 513 is used to obtain the first message test data corresponding to the application identifier recorded when the test message is sent.
[0164] The reporting submodule 514 is used to process the first message test data according to the preset first test indicator to generate a first network test result.
[0165] The Ethernet subsystem 520 is used to send test messages to other ECUs.
[0166] In some embodiments, the network testing device 500 may further include:
[0167] The upper virtual module is used to process the test message according to the data processing method of the target application before the sending module sends the test message to other ECUs to obtain the processed test message.
[0168] Based on this, the Ethernet subsystem 520 is also used to send processed test messages to other ECUs.
[0169] In some embodiments, the upper-layer virtual module includes upper-layer virtual modules corresponding to a plurality of applications respectively, and the upper-layer virtual module is used to simulate the data processing method before the corresponding application sends a message.
[0170] Based on this, the test data generation submodule is further used to determine a target upper-layer virtual module corresponding to the target application from a plurality of upper-layer virtual modules.
[0171] The upper-layer virtual module is further used to: perform data processing on the test message according to the target data processing mode simulated by the target upper-layer virtual module to obtain a processed test message.
[0172] In some embodiments, a plurality of simulation callback interfaces are provided in the upper-layer virtual module.
[0173] Based on this, the upper-layer virtual module is also used to register multiple simulation callback interfaces on the network protocol stack of the Ethernet subsystem 520 before sending test messages to other ECUs.
[0174] The data statistics submodule 513 is further used to obtain, from the data returned by the multiple simulation callback interfaces, the first message test data corresponding to the application identifier recorded when the test message is sent.
[0175] In some embodiments, the test data generation submodule 512 may be specifically used for:
[0176] Get the message template corresponding to the application identifier.
[0177] Generate a test message that meets the test parameters according to the message template.
[0178] In some embodiments, the first message test data includes at least: the test start time, the time of successful connection with the ECU, the time of closing the connection with the ECU and the total length of the message sent.
[0179] Based on this, the reporting submodule 514 can be specifically used for:
[0180] The difference between the connection success time and the test start time is calculated to obtain the connection establishment duration.
[0181] Substitute the total length of sent messages, connection closing time, and test start time into the throughput calculation formula to calculate the sending throughput.
[0182] The connection establishment time, the total length of message sending and the sending throughput are taken as the first network test result.
[0183] Figure 6 1 is a schematic diagram of the structure of a network testing device provided in an embodiment of the present application. The network testing device can be configured in the second ECU.
[0184] like Figure 6 As shown, the network testing device 600 includes a traffic testing module 610 and an Ethernet subsystem 620 .
[0185] The Ethernet subsystem 620 is used to receive a test message, wherein the test message is a message that meets the test parameters corresponding to the target application.
[0186] The flow test module 610 includes:
[0187] The data statistics submodule 611 is used to obtain the second message test data corresponding to the target application recorded when the test message is received.
[0188] The reporting submodule 612 is used to process the second message test data according to the preset second test index to generate a second network test result.
[0189] In some embodiments, the network testing device 600 may further include:
[0190] The upper layer virtual module is used to parse and process the test message according to the data parsing method of the target application after receiving the test message.
[0191] In some embodiments, the upper-layer virtual module includes upper-layer virtual modules corresponding to a plurality of applications respectively, and the upper-layer virtual module is used to simulate the data parsing method after the corresponding application receives the message.
[0192] Based on this, the network testing device 600 may further include:
[0193] A test data generation submodule, used to determine a target upper-layer virtual module corresponding to a target application from a plurality of upper-layer virtual modules;
[0194] The upper-layer virtual module is also used to parse and process the test message according to the target data parsing method simulated by the target upper-layer virtual module.
[0195] In some embodiments, a plurality of simulation callback interfaces are provided in the upper-layer virtual module.
[0196] Based on this, the upper-layer virtual module is further used to: register multiple simulated callback interfaces on the network protocol stack of the Ethernet subsystem 620 before the receiving module receives the test message.
[0197] The data statistics submodule 611 is further used to obtain the second message test data corresponding to the target application recorded when receiving the test message from the data returned by the multiple simulation callback interfaces.
[0198] In some embodiments, the second message test data includes at least: message sending time, total message sending length, message receiving time, total message receiving length, connection closing time and test start time.
[0199] The reporting submodule 612 may be specifically used for:
[0200] Substitute the total length of received messages, connection closing time, and test start time into the throughput calculation formula to calculate the receiving throughput.
[0201] Substitute the total length of sent messages and the total length of received messages into the packet loss rate calculation formula to calculate the packet loss rate.
[0202] The difference between the message receiving time and the message sending time is calculated to obtain the delay information.
[0203] The total length of received messages, receiving throughput, packet loss rate and delay information are taken as the second network test result.
[0204] The device of the above embodiment is used to implement the corresponding plug-in loading method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0205] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application.
[0206] The electronic device 700 may include a processor 701 and a memory 702 storing computer program instructions.
[0207] Specifically, the processor 701 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0208] The memory 702 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 702 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 702 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 702 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 702 is a non-volatile solid-state memory.
[0209] In certain embodiments, the memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present application.
[0210] The processor 701 implements any one of the network testing methods in the above embodiments by reading and executing computer program instructions stored in the memory 702 .
[0211] In some examples, the electronic device 700 may further include a communication interface 703 and a bus 710. Figure 7 As shown, the processor 701, the memory 702, and the communication interface 703 are connected via a bus 710 and communicate with each other.
[0212] The communication interface 703 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0213] Bus 710 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus 710 may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 710 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0214] Exemplarily, the electronic device 700 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).
[0215] The electronic device 700 can execute the network testing method in the embodiment of the present application, thereby realizing the combination Figure 1-Figure 6 The network testing method and device described.
[0216] In addition, in combination with the network testing method in the above embodiment, the embodiment of the present application may provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the network testing methods in the above embodiment is implemented. Examples of computer-readable storage media include non-transitory computer-readable storage media, such as portable disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, etc.
[0217] An embodiment of the present application also provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes a network testing method as provided in an embodiment of the present application.
[0218] A vehicle is also provided in an embodiment of the present application, which may include at least one of a power battery charging device, an electronic device, and a computer storage medium. The specific network testing device, electronic device, and computer storage medium involved are consistent with the above description and will not be repeated here.
[0219] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0220] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0221] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0222] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.
[0223] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A network testing method, characterized in that: include: When receiving the test instruction, parsing the test instruction to obtain the application identifier of the target application involved in the test and the test parameters corresponding to the target application; Generate a test message that meets the test parameters; Sending the test message to other ECUs; Acquire first message test data corresponding to the application identifier recorded when sending the test message; The first message test data is processed according to a preset first test indicator to generate a first network test result.
2. The method according to claim 1, characterized in that Before sending the test message to other ECUs, the method further includes: Performing data processing on the test message according to the data processing mode of the target application to obtain a processed test message; The sending the test message to other ECUs includes: The processed test message is sent to other ECUs.
3. The method according to claim 1, characterized in that The generating of the test message conforming to the test parameters comprises: Obtaining a message template corresponding to the application identifier; Generate a test message that meets the test parameters according to the message template.
4. The method according to claim 1, characterized in that The first message test data at least includes: the test start time, the time of successful connection with the ECU, the time of closing the connection with the ECU and the total length of the message sent; The step of processing the first message test data according to a preset first test indicator to generate a first network test result includes: Calculate the difference between the connection success time and the test start time to obtain the connection establishment duration; Substituting the total length of the message sent, the connection closing time and the test start time into the throughput calculation formula to calculate the sending throughput; The connection establishment time, the total length of the message sent and the sending throughput are used as the first network test result.
5. A network testing method, characterized in that: include: Receiving a test message, wherein the test message is a message that meets the test parameters corresponding to the target application; Acquire second message test data corresponding to the target application recorded when the test message is received; The second message test data is processed according to a preset second test indicator to generate a second network test result.
6. The method according to claim 5, characterized in that After receiving the test message, the method further includes: The test message is parsed and processed according to the data parsing method of the target application.
7. The method according to claim 5, characterized in that The second message test data at least includes: message sending time, total message sending length, message receiving time, total message receiving length, connection closing time and test start time; The step of processing the second message test data according to a preset second test indicator to generate a second network test result includes: Substituting the total length of received messages, the connection closing time and the test start time into a throughput calculation formula to calculate the receiving throughput; Substituting the total length of the message sent and the total length of the message received into the packet loss rate calculation formula to calculate the packet loss rate; Calculate the difference between the message receiving time and the message sending time to obtain delay information; The total length of message reception, the reception throughput, the packet loss rate and the delay information are taken as the second network test result.
8. A network testing device, characterized in that: It includes a flow test module and an Ethernet subsystem, among which: The flow test module comprises: The instruction processing submodule is used to parse the test instruction when receiving the test instruction, obtain the application identification of the target application involved in the test, and the test parameters corresponding to the target application; A test data generation submodule, used to generate a test message that meets the test parameters; A data statistics submodule, used to obtain the first message test data corresponding to the application identifier recorded when the test message is sent; A reporting submodule, configured to process the first message test data according to a preset first test indicator to generate a first network test result; The Ethernet subsystem is used to: Send the test message to other ECUs.
9. The device according to claim 8, characterized in that It also includes upper-layer virtual modules corresponding to the multiple applications, and the upper-layer virtual modules are used to simulate the data processing method before the corresponding application sends a message; The test data generation submodule is further used to: determine a target upper-layer virtual module corresponding to the target application from the plurality of upper-layer virtual modules; The upper-layer virtual module is further used to: perform data processing on the test message according to the target data processing mode simulated by the target upper-layer virtual module to obtain a processed test message.
10. The device according to claim 9, characterized in that The upper virtual module is provided with a plurality of simulation callback interfaces; The upper virtual module is also used to: register the multiple simulation callback interfaces on the network protocol stack of the Ethernet subsystem before sending the test message to other ECUs; The data statistics submodule is further used to obtain, from the data returned by the multiple simulation callback interfaces, first message test data corresponding to the application identifier recorded when the test message is sent.
11. A network testing device, characterized in that: It includes a flow test module and an Ethernet subsystem, among which: The Ethernet subsystem is used to receive a test message, wherein the test message is a message that meets the test parameters corresponding to the target application; The flow test module comprises: A data statistics submodule, used to obtain second message test data corresponding to the target application recorded when receiving the test message; The reporting submodule is used to process the second message test data according to a preset second test indicator to generate a second network test result.
12. An electronic device, characterized in that: The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the steps of the network testing method as described in any one of claims 1-4 or 5-7 are implemented.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the steps of the network testing method according to any one of claims 1-4 or 5-7 are implemented.
14. A vehicle, characterized in that: Include at least one of the following: The network testing device according to any one of claims 8 to 10; The network testing device as claimed in claim 11; The electronic device as claimed in claim 12; The computer readable storage medium of claim 13.
