Test method and device, vehicle and readable storage medium
By sending test control instructions to the electronic control unit and verifying the result message, the problem that the electronic control unit cannot correctly send the result message after restarting is solved, and verification of the reliability and stability of the Internet of Vehicles system is achieved.
Patent Information
- Application Number
- CN202411853104.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-08
AI Technical Summary
After restarting, the electronic control unit may not be able to correctly send the result message that was not sent before restarting, resulting in the Internet of Vehicles Control Unit being unable to receive the control command result that was not sent before power outage.
By sending test control instructions to the electronic control unit and verifying the correspondence between the actual result message and the expected result message after restart, it is ensured that the unsent result message can be correctly sent after restart.
It effectively verifies whether the electronic control unit can correctly send the result messages that were not sent before after restarting, and improves the reliability and stability of the Internet of Vehicles system.
Smart Images

Figure CN119781431A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicles, and more specifically, to a testing method, a device, a vehicle and a readable storage medium in the field of vehicles. Background Art
[0002] At present, a large number of electronic control units are installed in vehicles to control various components in the vehicle. During the operation of the vehicle, the electronic control unit may need to receive external control instructions through the Internet of Vehicles control unit, and after responding to the control instructions, send the result message corresponding to the control instructions to the outside through the Internet of Vehicles control unit.
[0003] In actual applications, the electronic control unit may be powered off and restarted during operation. If the electronic control unit receives a control instruction before restarting, but fails to send the corresponding result message before restarting, the result message that was not sent before power failure may not be correctly sent to the outside after restarting. Therefore, it is necessary to verify whether the electronic control unit can correctly send the result message that was not sent before restarting after restarting. Summary of the invention
[0004] The present application provides a testing method, an apparatus, a vehicle and a readable storage medium, which can verify whether an electronic control unit can correctly send a result message that was not sent before restarting after restarting.
[0005] In a first aspect, a testing method is provided, which is applied to a vehicle networking control unit in a vehicle, and the method comprises:
[0006] Sending control commands used for testing to the electronic control unit in the vehicle;
[0007] Determine whether an actual result message sent by the electronic control unit is received; wherein the actual result message is a result message sent by the electronic control unit to the vehicle networking control unit after the electronic control unit restarts after receiving the control instruction, and the actual result message corresponds to the control instruction;
[0008] If an actual result message is received, a first test result is generated when the actual result message is identical to the expected result message corresponding to the control instruction; wherein the first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0009] In an embodiment of the present application, the vehicle networking control unit can actively send control instructions used for testing to the electronic control unit, trigger the electronic control unit to execute the control instructions through the control instructions to obtain the corresponding actual result message, and return the actual result message after restarting, and the vehicle networking control unit can obtain a test result that can indicate whether the electronic control unit can correctly send the result message before restart after restart by comparing the actual result message with the expected result message, and then verify whether the electronic control unit can correctly send the result message that was not sent before restart after restart.
[0010] In combination with the first aspect, in some possible implementations, there are multiple control instructions, and if an actual result message is received, a first test result is generated when the actual result message is the same as the expected result message corresponding to the control instruction, including:
[0011] When the actual result message corresponding to each control instruction is received, if each actual result message is the same as the corresponding expected result message, a first test result is generated.
[0012] In an embodiment of the present application, when the Internet of Vehicles control unit receives the actual result message corresponding to each control instruction, it can verify whether the electronic control unit can correctly execute multiple control instructions by determining whether each actual result message is the same as the corresponding expected result message.
[0013] In conjunction with the first aspect, in some possible implementations, sending a control instruction used in a test process to an electronic control unit in a vehicle includes: sending a plurality of control instructions to the electronic control unit in sequence;
[0014] If each actual result message is identical to the corresponding expected result message, generating the first test result includes: if each actual result message is identical to the corresponding expected result message, and the receiving order of multiple actual result messages corresponds to the sending order of multiple control instructions, generating the first test result.
[0015] In an embodiment of the present application, the Internet of Vehicles control unit can send multiple control instructions in sequence, so that the electronic control unit executes the multiple control instructions in sequence to obtain multiple result messages, and sends the multiple result messages in sequence. By determining whether the sending order of the multiple control instructions is consistent with the receiving order of the multiple result messages, it can be verified whether the electronic control unit can execute the multiple control instructions in sequence.
[0016] In combination with the first aspect, in some possible implementations, the priorities of the multiple control instructions are different, and if each actual result message is the same as the corresponding expected result message, a first test result is generated, including:
[0017] Determine the order in which multiple actual result messages are sent;
[0018] If each actual result message is identical to the corresponding expected result message, and the sending order of the multiple actual result messages corresponds to the priorities of the multiple control instructions, a first test result is generated.
[0019] In an embodiment of the present application, the Internet of Vehicles control unit can determine the sending order of multiple actual result messages according to the priority of the control instructions. By judging whether the sending order of multiple actual result messages is consistent with the priority of multiple control instructions, it can be verified whether the electronic control unit can execute multiple control instructions in the order of priority of the instructions.
[0020] In combination with the first aspect, in some possible implementations, if an actual result message is received, generating a first test result when the actual result message is the same as an expected result message corresponding to the control instruction includes:
[0021] If an actual result message is received, the reception time of the actual result message is determined;
[0022] When the actual result message is identical to the corresponding expected result message, if the receiving time is within the validity period of the control instruction, a first test result is generated.
[0023] In an embodiment of the present application, the Internet of Vehicles control unit can determine the reception time of the actual result message when receiving the actual message. By judging whether the reception time of the actual result message is within the validity period of the control instruction, it can verify whether the electronic control unit sends the actual result message within the validity period of the control instruction.
[0024] In a second aspect, a testing method is provided, which is applied to an electronic control unit in a vehicle, the method comprising:
[0025] Receive control instructions sent by the vehicle networking control unit in the vehicle during the test;
[0026] Restart the electronic control unit;
[0027] After restarting, an actual result message corresponding to the control instruction is sent to the Internet of Vehicles control unit; wherein, the actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the expected result message corresponding to the control instruction is the same as the actual result message, and the first test result indicates that the electronic control unit can correctly send the result message that was not sent before restarting after restarting.
[0028] In an embodiment of the present application, the electronic control unit sends an actual result message to the Internet of Vehicles control unit after restarting. The Internet of Vehicles control unit can compare the actual result message with the expected result message to verify whether the electronic control unit can correctly send the result message that was not sent before restarting after restarting.
[0029] In conjunction with the second aspect, in some possible implementations, there are multiple control instructions, and sending an actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes:
[0030] Send the actual result message corresponding to each control instruction to the Internet of Vehicles control unit;
[0031] Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message.
[0032] In an embodiment of the present application, when the Internet of Vehicles control unit receives the actual result message corresponding to each control instruction, it can verify whether the electronic control unit can correctly execute multiple control instructions by determining whether each actual result message is the same as the corresponding expected result message.
[0033] In conjunction with the second aspect, in some possible implementations, multiple control instructions are sent in sequence by the Internet of Vehicles control unit, and an actual result message corresponding to each control instruction is sent to the Internet of Vehicles control unit, including:
[0034] Sending the actual result message corresponding to each control instruction to the vehicle networking control unit in turn;
[0035] Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message, and the receiving order of the multiple actual result messages corresponds to the sending order of the multiple control instructions.
[0036] In an embodiment of the present application, the Internet of Vehicles control unit can send multiple control instructions in sequence, so that the electronic control unit executes the multiple control instructions in sequence to obtain multiple result messages, and sends the multiple result messages in sequence. By determining whether the sending order of the multiple control instructions is consistent with the receiving order of the multiple result messages, it can be verified whether the electronic control unit can execute the multiple control instructions in sequence.
[0037] In conjunction with the second aspect, in some possible implementations, sending an actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes:
[0038] According to the priorities of multiple control instructions, multiple actual result messages are sent in sequence;
[0039] Among them, multiple actual result messages are used to enable the vehicle network control unit to generate a first test result when each actual result message is the same as the corresponding expected result message, and the sending order of the multiple actual result messages corresponds to the priority of the multiple control instructions.
[0040] In an embodiment of the present application, the Internet of Vehicles control unit can verify whether the electronic control unit can correctly send the actual result messages corresponding to multiple control instructions to the Internet of Vehicles control unit in the sending order corresponding to the priorities after receiving multiple control instructions by determining whether the sending order of multiple actual result messages is consistent with the priorities of multiple control instructions.
[0041] In conjunction with the second aspect, in some possible implementations, sending an actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes:
[0042] Determine the validity period of the control order;
[0043] Within the validity period, an actual result message is sent to the Internet of Vehicles control unit; wherein the actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the actual result message is the same as the corresponding expected result message and the reception time of the actual result message is within the validity period of the control instruction.
[0044] In an embodiment of the present application, the Internet of Vehicles control unit can verify whether the electronic control unit sends the actual result message within the validity period of the control instruction by determining whether the reception time of the actual result message is within the validity period of the control instruction.
[0045] In a third aspect, a test device is provided, which is applied to a vehicle networking control unit in a vehicle, and the device includes:
[0046] A sending module, used for sending control instructions used for testing to an electronic control unit in a vehicle;
[0047] A determination module, used to determine whether an actual result message sent by the electronic control unit is received; wherein the actual result message is a result message sent by the electronic control unit to the vehicle networking control unit after the electronic control unit restarts after receiving the control instruction, and the actual result message corresponds to the control instruction;
[0048] A generation module is used to generate a first test result if an actual result message is received and the actual result message is the same as the expected result message corresponding to the control instruction; wherein the first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0049] In a fourth aspect, a testing device is provided, which is applied to an electronic control unit in a vehicle, and includes:
[0050] A receiving module, used to receive control instructions sent by a vehicle networking control unit in the vehicle during the test;
[0051] A restart module, used to restart the electronic control unit;
[0052] A sending module is used to send an actual result message corresponding to a control instruction to the Internet of Vehicles control unit after restart; wherein the actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the expected result message corresponding to the control instruction is the same as the actual result message, and the first test result indicates that the electronic control unit can correctly send the result message that was not sent before restart after restart.
[0053] In a fifth aspect, a vehicle is provided, comprising a memory for storing executable program code;
[0054] A processor is used to call and run executable program code from a memory so that the vehicle executes the method in any possible implementation of the first aspect or the second aspect mentioned above.
[0055] In a sixth aspect, an executable program code product is provided, which includes: an executable program code, which, when executed on a computer, enables the computer to execute a method in any possible implementation of the first aspect or the second aspect.
[0056] In a seventh aspect, a readable storage medium is provided, which stores an executable program code. When the executable program code runs on a computer, the computer executes a method in any possible implementation of the first aspect or the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 It is a schematic diagram of an application scenario of a testing method provided in an embodiment of the present application;
[0058] Figure 2 It is a step flow chart of a testing method provided in an embodiment of the present application;
[0059] Figure 3 It is a step flow chart of a testing method provided in an embodiment of the present application;
[0060] Figure 4 A schematic flow chart of a test method provided in an embodiment of the present application
[0061] Figure 5 is a structural schematic diagram of a testing device provided in an embodiment of the present application;
[0062] Figure 6 is a structural schematic diagram of a testing device provided in an embodiment of the present application;
[0063] Figure 7 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0065] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0066] With the development of the automobile industry, the degree of electrification of vehicles is constantly improving. A large number of electronic control units (ECUs) will be installed in vehicles to control various components in the vehicle. During the operation of the vehicle, the ECU can receive control instructions from the user terminal or server through the telematics box (T-BOX), control various components in the vehicle to perform corresponding operations according to the control instructions, and send the result message corresponding to the control instruction to the user terminal or server through the telematics box.
[0067] In actual applications, the electronic control unit may be powered off and restarted during operation. If the electronic control unit receives a control instruction before restarting, but fails to send the corresponding result message before restarting, the result message that was not sent before power failure may not be correctly sent to the outside after restarting. Therefore, it is necessary to verify whether the electronic control unit can correctly send the result message that was not sent before restarting after restarting.
[0068] See also Figure 1 , Figure 1 It is a schematic diagram of an application scenario of a testing method provided in an embodiment of the present application. The scenario may include: a vehicle 100 and a server 200. The vehicle 100 may include an Internet of Vehicles control unit 101 and multiple electronic control units 102.
[0069] The electronic control unit 102 can receive the control instruction of the server 200 through the vehicle networking control unit 101, and control each component in the vehicle 100 to perform corresponding operations according to the control instruction to obtain the execution result. The electronic control unit 102 includes a DLT Client module, which can generate a result message including the execution result and send the result message to the vehicle networking control unit 101.
[0070] The Internet of Vehicles control unit 101 includes a DLT Master module, which can centrally manage result messages sent by multiple electronic control units. After receiving the result message generated by the DLT Client module, the Internet of Vehicles control unit 101 can send the result message to the server 200. The server 200 can send a control instruction to the Internet of Vehicles control unit 101, receive and process the result message sent by the Internet of Vehicles control unit 101. The result message may include but is not limited to the instruction ID and execution result of the control instruction. For example, if the control instruction is an instruction to control the opening of the window, the execution result in the result message can be the current state of the window after the control instruction is executed (open state, closed state); if the control instruction is an instruction to control the turning on of the lights, the execution result in the result message can be the current state of the lights after the control instruction is executed (open state, closed state).
[0071] The server 200 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0072] See also Figure 2 , Figure 2 is a flowchart of the steps of a test method provided by an embodiment of the present application. The execution subject of the method may be a vehicle networking control unit in a vehicle, such as Figure 2 As shown, the method may include the following steps.
[0073] S201, sending a control instruction used for testing to an electronic control unit in a vehicle.
[0074] The control instruction refers to the instruction required in the current test process, and the control instruction may include an instruction ID and an instruction type; the instruction type may include but is not limited to an instruction to control the opening of a window, an instruction to control the turning on of a light, etc. For example, during the test process, if it is necessary to control the opening of a window of the vehicle, a control instruction to control the opening of the window may be sent to an electronic control unit for controlling the window in the vehicle; for another example, during the test process, if it is necessary to control the turning on of a light of the vehicle, a control instruction to control the turning on of the light may be sent to an electronic control unit for controlling the light in the vehicle.
[0075] Exemplarily, the tester can pre-configure different control instructions for the Internet of Vehicles control unit. During the test, the Internet of Vehicles control unit sends the control instructions used for the test to the electronic control unit. Correspondingly, after sending the control instructions used for the test to the electronic control unit, the electronic control unit can receive the control instructions sent by the Internet of Vehicles control unit and control the vehicle to perform corresponding operations according to the control instructions. For example, if the control instruction sent by the Internet of Vehicles control unit is a control instruction to control the opening of the window, then after receiving the control instruction to open the window, the electronic control unit controls the vehicle to open the window according to the control instruction; for another example, if the control instruction sent by the Internet of Vehicles control unit is a control instruction to control the turning on of the lights, then after receiving the instruction to turn on the lights, the electronic control unit controls the vehicle to turn on the lights according to the control instruction.
[0076] S202, determining whether an actual result message sent by the electronic control unit is received.
[0077] S203: If an actual result message is received, a first test result is generated when the actual result message is identical to the expected result message corresponding to the control instruction.
[0078] Among them, the actual result message is the result message sent by the electronic control unit to the vehicle network control unit after the electronic control unit restarts after receiving the control instruction, and the actual result message corresponds to the control instruction. The first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart. The expected result message refers to the correct result message configured for the control instruction during the test, which may include but is not limited to the instruction ID of the control instruction, and the correct execution result corresponding to the control instruction. For example, if the control instruction is to open the window, the expected result message can be configured in advance for the control instruction, and the execution result in the expected result message can be "open", and "open" means that the window of the vehicle is opened; if the control instruction is to turn off the lights, the expected result message can be configured in advance for the control instruction, and the execution result in the expected result message can be "closed", and "closed" means that the lights of the vehicle are turned on.
[0079] In one implementation, each control instruction corresponds to an actual result message, and the actual result message may include the instruction ID of the control instruction and the actual execution result corresponding to the control instruction. For example, the Internet of Vehicles control unit sends a control instruction to the electronic control unit, and the instruction ID of the control instruction is A. Then the actual result message sent by the electronic control unit to the Internet of Vehicles control unit includes the instruction ID (A) of the control instruction, and the actual execution result obtained by the electronic control unit after executing the control instruction. For another example, the Internet of Vehicles control unit sends a control instruction to the electronic control unit, and the instruction ID of the control instruction is B. Then the actual result message sent by the electronic control unit to the Internet of Vehicles control unit includes the instruction ID (B) of the control instruction, and the actual execution result obtained by the electronic control unit after executing the control instruction.
[0080] In another embodiment, a control instruction may correspond to multiple actual result messages, and the control instruction may include the validity period of the instruction. Exemplarily, the Internet of Vehicles control unit sends a control instruction to the electronic control unit in the vehicle, and the control instruction includes a validity period, which is 1 hour. After receiving the control instruction, within 1 hour, the electronic control unit executes the control instruction every 10 minutes to obtain an actual execution result, and sends an actual result message including the instruction ID of the control instruction and the actual execution result to the Internet of Vehicles control unit. Correspondingly, within 1 hour, the Internet of Vehicles control unit can receive an actual result message sent by the electronic control unit every 10 minutes.
[0081] For example, during the test, after receiving the control instruction, the electronic control unit can respond to the control instruction, execute the control instruction to obtain the execution result, and generate a result message including the execution result, which is the actual result message. After generating the actual result message, the electronic control unit can directly restart, and after restarting, send the actual result message to the vehicle network control unit.
[0082] Correspondingly, if the Internet of Vehicles control unit receives the actual result message, it obtains the expected result message pre-configured for the control instruction. If the actual result message is the same as the expected result message, the Internet of Vehicles control unit generates a first test result. For example, if the control instruction is to open the window, the Internet of Vehicles control unit can obtain the pre-configured expected result message, and the expected result message includes an execution result of "open" and the instruction ID is A. After the electronic control unit is restarted, if the Internet of Vehicles control unit receives the actual result message, it compares the actual result message and the expected message results to see if they are the same. If the execution result in the actual result message is "open" and the instruction ID is A, the Internet of Vehicles control unit can generate a first test result. The first test result means that the electronic control unit can correctly send a result message to the Internet of Vehicles control unit after restarting that was not sent before restarting.
[0083] On the contrary, if the control instruction is to open the window, the Internet of Vehicles control unit can obtain the pre-configured expected result message, which includes the execution result of "open" and the instruction ID is A. After the electronic control unit is restarted, if the Internet of Vehicles control unit receives the actual result message, it compares whether the actual result message and the expected message result are the same. If the execution result in the actual result message is "closed" and the instruction ID is A, the Internet of Vehicles control unit can generate a second test result, which means that the electronic control unit cannot correctly send a result message to the Internet of Vehicles control unit after restart that was not sent before restart. If the execution result in the actual result message is "closed" and the instruction ID is B, the Internet of Vehicles control unit can generate a second test result, which means that the electronic control unit cannot correctly send a result message to the Internet of Vehicles control unit after restart that was not sent before restart.
[0084] Alternatively, if the control instruction is to open the window, the Internet of Vehicles control unit may obtain a pre-configured expected result message, in which the expected result message includes that the execution result is "open", and the instruction ID is A. If the Internet of Vehicles control unit does not receive the actual result message after the electronic control unit is restarted, the Internet of Vehicles control unit may generate a second test result, which means that the electronic control unit cannot correctly send a result message to the Internet of Vehicles control unit after the restart that was not sent before the restart.
[0085] It should be noted that, in actual applications, after the Internet of Vehicles control unit generates the first test result or the second test result, the test result can be output to the corresponding computer device. For example, the Internet of Vehicles control unit can be connected to the computer device where the tester is located, and after obtaining the test result, it can be sent to the computer device so that the tester can view the test result and determine whether the electronic control unit can correctly send the result message that was not sent before the restart to the Internet of Vehicles control unit after the restart according to the test result. Furthermore, the tester can perform further analysis and verification according to the test result to take corresponding repair measures.
[0086] In the embodiment of the present application, the vehicle networking control unit sends a control instruction used for testing to the electronic control unit in the vehicle, and the vehicle networking control unit determines whether the actual result message sent by the electronic control unit is received. If the vehicle networking control unit receives the actual result message, it generates a first test result when the actual result message is the same as the expected result message corresponding to the control instruction; wherein the first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart. In the method provided in the embodiment of the present application, the vehicle networking control unit can actively send the control instruction used for testing to the electronic control unit, trigger the electronic control unit to execute the control instruction through the control instruction to obtain the corresponding actual result message, and return the actual result message after the restart, and the vehicle networking control unit can compare the actual result message with the expected result message to obtain a test result that can indicate whether the electronic control unit can correctly send the result message before the restart after the restart, and then verify whether the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0087] Furthermore, after determining that the electronic control unit cannot correctly send result messages that were not sent before restart after restart, R&D personnel can promptly improve the electronic control unit so that the electronic control unit can accurately send result messages that were not sent before restart to the Internet of Vehicles control unit, thereby improving the reliability of the electronic control unit.
[0088] Optionally, after sending a control instruction for testing to an electronic control unit in the vehicle, the method includes:
[0089] Sending a restart instruction to the electronic control unit after a first preset time interval; wherein the restart instruction is used to instruct the electronic control unit to restart;
[0090] Alternatively, after receiving a confirmation message sent by the electronic control unit, a restart instruction is sent to the electronic control unit; wherein the confirmation message is a message sent by the electronic control unit to the vehicle networking control unit after receiving the control instruction, and the confirmation message corresponds to the control instruction;
[0091] Alternatively, after receiving the confirmation message sent by the electronic control unit, a restart instruction is sent to the electronic control unit after a second preset time interval.
[0092] The first preset duration is greater than the duration from when the electronic control unit receives the control instruction sent by the vehicle networking control unit to when the result message is generated, and less than the duration from when the electronic control unit receives the control instruction sent by the vehicle networking control unit to when the result message is sent. The second preset duration refers to the preset waiting time before the vehicle networking control unit sends a restart instruction after receiving the confirmation message from the electronic control unit.
[0093] The confirmation message corresponds to the control instruction. Each control instruction will have a corresponding confirmation message, which can contain the instruction ID of the control instruction. For example, the Internet of Vehicles control unit sends a control instruction to the electronic control unit, and the instruction ID of the control instruction is A. Then the confirmation message sent by the electronic control unit to the Internet of Vehicles control unit contains the instruction ID (A) of the control instruction; for another example, the Internet of Vehicles control unit sends a control instruction to the electronic control unit, and the instruction ID of the control instruction is B. Then the confirmation message sent by the electronic control unit to the Internet of Vehicles control unit contains the instruction ID (B) of the control instruction.
[0094] In this embodiment, the vehicle networking control unit sends a control instruction used for testing to the electronic control unit, and after the electronic control unit receives the control instruction, the vehicle networking control unit can send a restart instruction to the electronic control unit to control the electronic control unit to restart.
[0095] In one embodiment, after the vehicle networking control unit sends a control instruction for testing to the electronic control unit in the vehicle, it sends a restart instruction to the electronic control unit after a first preset time interval. Correspondingly, the electronic control unit receives the restart instruction sent by the vehicle networking control unit, responds to the restart instruction after receiving the restart instruction, and restarts the electronic control unit.
[0096] Exemplarily, the vehicle networking control unit starts timing after sending a control instruction used for the test to the electronic control unit, and sends a restart instruction to the electronic control unit after the timing duration reaches a first preset duration. During the timing duration, the electronic control unit receives the control instruction, executes the control instruction to obtain an execution result, and then generates an actual result message according to the execution result. After the timing duration reaches the first preset duration, the vehicle networking control unit sends a restart instruction to the electronic control unit, at which time the electronic control unit generates an actual result message, but does not send the actual result message. After receiving the restart instruction, the electronic control unit restarts in response to the restart instruction, and after the restart, sends the actual result message that should have been sent before the restart.
[0097] In another implementation, the vehicle networking control unit sends a control instruction for testing to an electronic control unit in the vehicle, and after receiving the control instruction sent by the vehicle networking control unit, the electronic control unit sends a confirmation message corresponding to the control instruction to the vehicle networking control unit. Correspondingly, after receiving the confirmation message, the vehicle networking control unit sends a restart instruction to the electronic control unit, and the electronic control unit restarts the electronic control unit when receiving the restart instruction.
[0098] Exemplarily, the Internet of Vehicles control unit sends control instruction 1 to the electronic control unit, and the instruction ID of control instruction 1 is A. After receiving control instruction 1, the electronic control unit sends a confirmation message to the Internet of Vehicles control unit, and the confirmation message contains the instruction ID (A) of control instruction 1, then the Internet of Vehicles control unit can send a restart instruction to the electronic control unit. In another exemplary embodiment, the Internet of Vehicles control unit sends control instruction 1 to the electronic control unit, and the instruction ID of control instruction 1 is A. After receiving control instruction 1, the electronic control unit sends a confirmation message to the Internet of Vehicles control unit, and the confirmation message contains the instruction ID (B) of the control instruction, then the Internet of Vehicles control unit does not send a restart instruction to the electronic control unit.
[0099] In another embodiment, the electronic control unit sends a confirmation message corresponding to the control instruction to the Internet of Vehicles control unit. After receiving the confirmation message sent by the electronic control unit, the Internet of Vehicles control unit sends a restart instruction to the electronic control unit after a second preset time interval. When the electronic control unit receives the restart instruction sent by the Internet of Vehicles control unit, it restarts the electronic control unit.
[0100] Exemplarily, the Internet of Vehicles control unit sends a control instruction to the electronic control unit, and the instruction ID of the control instruction is A. Correspondingly, after receiving the control instruction, the electronic control unit sends a confirmation message to the Internet of Vehicles control unit, and the confirmation message contains the instruction ID (A) of the control instruction. After receiving the confirmation message, the Internet of Vehicles control unit starts timing, and after the timing reaches the second preset time, it sends a restart instruction to the electronic control unit.
[0101] It should be noted that, in actual applications, the first preset time length and the second preset time length are not greater than the validity period of the control instruction.
[0102] In an embodiment of the present application, by restarting the electronic control unit at a preset interval during the test process, it can be ensured that the electronic control unit has generated an actual result message, but the actual result message has not been sent to the Internet of Vehicles control unit before the restart. It can be verified whether the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0103] Optionally, there are multiple control instructions, and if an actual result message is received, a first test result is generated when the actual result message is the same as an expected result message corresponding to the control instruction, including:
[0104] When the actual result message corresponding to each control instruction is received, if each actual result message is the same as the corresponding expected result message, a first test result is generated.
[0105] In this embodiment, during the test, the vehicle networking control unit may send multiple control instructions to the electronic control unit. After receiving the multiple control instructions, the electronic control unit may generate a corresponding actual result message for each control instruction, and send the actual result message corresponding to each control instruction to the vehicle networking control unit. When the vehicle networking control unit receives the actual result message corresponding to each control instruction, if the actual result message of each control instruction is the same as the corresponding expected result message, a first test result is generated.
[0106] For example, during the test process, the vehicle networking control unit may send control instructions 1, control instructions 2, and control instructions 3 to the electronic control unit. After receiving control instructions 1, control instructions 2, and control instructions 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3, respectively. After generating actual result message 1, actual result message 2, and actual result message 3, the electronic control unit may restart, and after restarting, send actual result message 1, actual result message 2, and actual result message 3 to the vehicle networking control unit. When receiving actual result message 1, actual result message 2, and actual result message 3, the vehicle networking control unit obtains expected result message 1 corresponding to control instruction 1, expected result message 2 corresponding to control instruction 2, and expected result message 3 corresponding to control instruction 3. If actual result message 1 is the same as expected result message 1, actual result message 2 is the same as expected result message 2, and actual result message 3 is the same as expected result message 3, then a first test result is generated.
[0107] On the contrary, if part or all of the actual result messages are different from the corresponding expected result messages, a second test result is generated. For example, after receiving the actual result message 1, the actual result message 2, and the actual result message 3, if one or more of the actual result message 1, the actual result message 2, and the actual result message 3 are different from the corresponding expected result message, a second test result is generated.
[0108] In the embodiment of the present application, the vehicle networking control unit can send multiple control instructions to the electronic control unit, so that the electronic control unit executes the multiple control instructions in sequence to obtain multiple result messages, and sends them to the vehicle networking control unit. When the vehicle networking control unit receives the actual result message corresponding to each control instruction, it can verify whether the electronic control unit can correctly execute the multiple control instructions by judging whether each actual result message is the same as the corresponding expected result message.
[0109] Optionally, sending a control instruction used in the test process to an electronic control unit in the vehicle includes: sending a plurality of control instructions to the electronic control unit in sequence;
[0110] If each actual result message is identical to the corresponding expected result message, generating the first test result includes: if each actual result message is identical to the corresponding expected result message, and the receiving order of multiple actual result messages corresponds to the sending order of multiple control instructions, generating the first test result.
[0111] In this embodiment, the vehicle networking control unit can send multiple control instructions to the electronic control unit in sequence. Correspondingly, after receiving the multiple control instructions sent by the vehicle networking control unit, the electronic control unit sends the actual result message corresponding to each control instruction to the vehicle networking control unit in sequence. When the vehicle networking control unit receives the actual result message corresponding to each control instruction, if each actual result message is the same as the corresponding expected result message, and the order of receiving the multiple actual result messages corresponds to the order of sending the multiple control instructions, a first test result is generated.
[0112] Exemplarily, when the Internet of Vehicles control unit sends control instruction 1, control instruction 2, and control instruction 3 to the electronic control unit, it may first send control instruction 1, then send control instruction 2, and finally send control instruction 3. After receiving control instruction 1, control instruction 2, and control instruction 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3, respectively. After generating actual result message 1, actual result message 2, and actual result message 3, the electronic control unit may restart, and after restarting, first send actual result message 1 to the Internet of Vehicles control unit, then send actual result message 2 to the Internet of Vehicles control unit, and finally send actual result message 3 to the Internet of Vehicles control unit.
[0113] After receiving the actual result message 1, the actual result message 2 and the actual result message 3, the vehicle networking control unit determines the order of receiving the actual result message 1, the actual result message 2 and the actual result message 3. If the receiving order is to first receive the actual result message 1, then receive the actual result message 2, and finally receive the actual result message 3, then determine that the receiving order of the multiple actual result messages corresponds to the sending order of the multiple control instructions. At the same time, if the actual result message 1 is the same as the expected result message 1, the actual result message 2 is the same as the expected result message 2, and the actual result message 3 is the same as the expected result message 3, then generate the first test result.
[0114] On the contrary, if the receiving order is not to first receive the actual result message 1, then receive the actual result message 2, and finally receive the actual result message 3, it is determined that the receiving order of the multiple actual result messages does not correspond to the sending order of the multiple control instructions. At this time, a second test result can be generated. Alternatively, if the receiving order is to first receive the actual result message 1, then receive the actual result message 2, and finally receive the actual result message 3, but one or more of the actual result message 1, the actual result message 2, and the actual result message 3 are different from the corresponding expected result message, then a second test result is generated.
[0115] In an embodiment of the present application, the Internet of Vehicles control unit can send multiple control instructions in sequence, so that the electronic control unit executes the multiple control instructions in sequence to obtain multiple result messages, and sends the multiple result messages in sequence. By determining whether the sending order of the multiple control instructions is consistent with the receiving order of the multiple result messages, it can be verified whether the electronic control unit can execute the multiple control instructions in sequence.
[0116] Optionally, the priorities of the multiple control instructions are different, and if each actual result message is the same as the corresponding expected result message, a first test result is generated, including:
[0117] Determine the order in which multiple actual result messages are sent;
[0118] If each actual result message is identical to the corresponding expected result message, and the sending order of the multiple actual result messages corresponds to the priorities of the multiple control instructions, a first test result is generated.
[0119] The priority may be pre-set for the control instruction to indicate the importance of each control instruction. The sending order may be determined according to the priorities of the control instructions.
[0120] In one embodiment, the vehicle networking control unit sends multiple control instructions to the electronic control unit. After receiving the multiple control instructions sent by the vehicle networking control unit, the electronic control unit generates multiple actual result messages, and determines the sending order of the multiple actual result messages according to the priority of each control instruction. The electronic control unit sends the actual result message corresponding to each control instruction to the vehicle networking control unit according to the sending order. Correspondingly, when receiving the actual result message corresponding to each control instruction, the vehicle networking control unit determines the sending order of the multiple actual result messages. If each actual result message is the same as the corresponding expected result message and the sending order of the multiple actual result messages corresponds to the priority of the multiple control instructions, a first test result is generated.
[0121] Exemplarily, during the test, the vehicle networking control unit may send control instruction 1, control instruction 2, and control instruction 3 to the electronic control unit. Among them, the priorities of the three control instructions are control instruction 1 (highest priority), control instruction 3 (second priority), and control instruction 2 (lowest priority) from high to low. After receiving control instruction 1, control instruction 2, and control instruction 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3. After generating actual result message 1, actual result message 2, and actual result message 3, the order of sending multiple actual result messages is determined to be actual result message 1, actual result message 3, and actual result message 2 according to the priorities of control instruction 1, control instruction 2, and control instruction 3. The electronic control unit can be restarted, and after restarting, it first sends actual result message 1 to the vehicle networking control unit, then sends actual result message 3 to the vehicle networking control unit, and finally sends actual result message 2 to the vehicle networking control unit.
[0122] After receiving the actual result message 1, the actual result message 3 and the actual result message 2, the vehicle networking control unit determines the order of receiving the actual result message 1, the actual result message 3 and the actual result message 2. If the receiving order is to receive the actual result message 1 first, then receive the actual result message 3, and finally receive the actual result message 2, then determine that the sending order of multiple actual result messages corresponds to the priority of multiple control instructions. At the same time, if the actual result message 1 is the same as the expected result message 1, the actual result message 2 is the same as the expected result message 2, and the actual result message 3 is the same as the expected result message 3, then generate the first test result.
[0123] On the contrary, if the receiving order is not to first receive the actual result message 1, then receive the actual result message 3, and finally receive the actual result message 2, then determine that the sending order of multiple actual result messages does not correspond to the priority of multiple control instructions. At this time, a second test result can be generated. Alternatively, if the receiving order is to first receive the actual result message 1, then receive the actual result message 3, and finally receive the actual result message 2, but one or more of the actual result message 1, the actual result message 2, and the actual result message 3 are different from the corresponding expected result message, then a second test result is generated.
[0124] In another embodiment, the vehicle networking control unit sends multiple control instructions in sequence to the electronic control unit according to the priority of the control instructions. After receiving the multiple control instructions sent by the vehicle networking control unit, the electronic control unit generates multiple actual result messages, and sends the actual result message corresponding to each control instruction to the vehicle networking control unit in sequence according to the order in which each control instruction is received. Correspondingly, when the vehicle networking control unit receives the actual result message corresponding to each control instruction, it determines the order in which the multiple actual result messages are sent. If each actual result message is the same as the corresponding expected result message and the order in which the multiple actual result messages are sent corresponds to the priority of the multiple control instructions, a first test result is generated.
[0125] For example, during the test, the priorities of the three control instructions are control instruction 1 (highest priority), control instruction 3 (second highest priority) and control instruction 2 (lowest priority) from high to low. The Internet of Vehicles control unit can send control instruction 1 to the electronic control unit first, then send control instruction 2, and finally send control instruction 3 according to the priority of the control instructions. After receiving control instructions 1, control instructions 2 and control instructions 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3, respectively. After generating actual result message 1, actual result message 2 and actual result message 3, the electronic control unit can restart, and after restarting, first send actual result message 1 to the Internet of Vehicles control unit, then send actual result message 3 to the Internet of Vehicles control unit, and finally send actual result message 2 to the Internet of Vehicles control unit according to the order of receiving the control instructions.
[0126] After receiving the actual result message 1, the actual result message 3 and the actual result message 2, the vehicle networking control unit determines the order of receiving the actual result message 1, the actual result message 3 and the actual result message 2. If the receiving order is to receive the actual result message 1 first, then receive the actual result message 3, and finally receive the actual result message 2, then determine that the sending order of multiple actual result messages corresponds to the priority of multiple control instructions. At the same time, if the actual result message 1 is the same as the expected result message 1, the actual result message 2 is the same as the expected result message 2, and the actual result message 3 is the same as the expected result message 3, then generate the first test result.
[0127] On the contrary, if the receiving order is not to first receive the actual result message 1, then receive the actual result message 3, and finally receive the actual result message 2, then determine that the sending order of the multiple actual result messages does not correspond to the priority of the multiple control instructions, and generate a second test result. Alternatively, if the receiving order is to first receive the actual result message 1, then receive the actual result message 3, and finally receive the actual result message 2, but one or more of the actual result message 1, the actual result message 2, and the actual result message 3 are different from the corresponding expected result message, then generate a second test result.
[0128] In an embodiment of the present application, the Internet of Vehicles control unit can determine the sending order of multiple actual result messages according to the priority of the control instructions. By judging whether the sending order of multiple actual result messages is consistent with the priority of multiple control instructions, it can be verified whether the electronic control unit can execute multiple control instructions in the order of priority of the instructions.
[0129] Optionally, if an actual result message is received, generating a first test result when the actual result message is the same as an expected result message corresponding to the control instruction includes:
[0130] If an actual result message is received, the reception time of the actual result message is determined;
[0131] When the actual result message is identical to the corresponding expected result message, if the receiving time is within the validity period of the control instruction, a first test result is generated.
[0132] The receiving time of the actual result message refers to the specific time when the vehicle networking control unit receives the actual result message from the electronic control unit. The validity period of the control instruction can be the validity period pre-set by the tester for the control instruction.
[0133] In this embodiment, the electronic control unit can determine the validity period of the control instruction, and send the actual result message to the vehicle networking control unit within the validity period of the control instruction. Correspondingly, after receiving the actual result message, the vehicle networking control unit can determine the reception time of the actual result message; if the actual result message is the same as the corresponding expected result message and the reception time of the actual result message is within the validity period of the control instruction, a first test result is generated.
[0134] Exemplarily, during the test process, the Internet of Vehicles control unit may send a control instruction 1 to the electronic control unit, and the control instruction 1 includes validity period information. After receiving the control instruction 1, the electronic control unit generates an actual result message 1 corresponding to the control instruction 1, and determines that the validity period of the control instruction 1 is 4:00-5:00 pm according to the validity period information in the control instruction 1. After generating the actual result message 1, the electronic control unit may restart, and after restarting, send the actual result message 1 to the Internet of Vehicles control unit. When the Internet of Vehicles control unit receives the actual result message 1, it determines that the receiving time of the actual result message 1 is 4:20 pm, and then determines that the receiving time of the actual result message 1 is within the validity period of the control instruction 1. At the same time, if the actual result message 1 is the same as the expected result message 1, a first test result is generated.
[0135] On the contrary, when the vehicle networking control unit receives the actual result message 1, it determines that the receiving time of the actual result message 1 is 5:20 pm, and then determines that the receiving time of the actual result message 1 is not within the validity period of the control instruction 1. At the same time, if the actual result message 1 is the same as the expected result message 1, a second test result is generated. Alternatively, when the vehicle networking control unit receives the actual result message 1, it determines that the receiving time of the actual result message 1 is 4:20 pm, and then determines that the receiving time of the actual result message 1 is within the validity period of the control instruction 1. At the same time, if the actual result message 1 is different from the expected result message 1, a second test result is generated.
[0136] In another exemplary embodiment, during the test, the vehicle networking control unit may send control instructions 1, 2, and 3 to the electronic control unit. After receiving control instructions 1, 2, and 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3, respectively, and determines that the validity period of control instruction 1 is 4:00-5:00 p.m., the validity period of control instruction 2 is 4:00-4:30 p.m., and the validity period of control instruction 3 is 4:00-5:00 p.m. After generating actual result message 1, actual result message 2, and actual result message 3, the electronic control unit may restart, and after restarting, send actual result message 1, actual result message 2, and actual result message 3 to the vehicle networking control unit.
[0137] When the vehicle networking control unit receives the actual result message 1, the actual result message 2, and the actual result message 3, it determines that the receiving time of the actual result message 1 is 4:20 pm, the receiving time of the actual result message 2 is 4:30 pm, and the receiving time of the actual result message 3 is 4:30 pm, and then determines that the receiving time of the actual result message 1 is within the validity period of the control instruction 1, the receiving time of the actual result message 2 is within the validity period of the control instruction 2, and the receiving time of the actual result message 3 is within the validity period of the control instruction 3. At the same time, if the actual result message 1 is the same as the expected result message 1, the actual result message 2 is the same as the expected result message 2, and the actual result message 3 is the same as the expected result message 3, then the first test result is generated.
[0138] On the contrary, if the reception time of any one or more actual result messages is not within the validity period of the control instruction corresponding to the actual result message, it is determined that the reception time of the actual result message is not within the validity period of the control instruction, and a second test result is generated. Alternatively, if the reception time of all actual result messages is within the validity period of the control instruction corresponding to the actual result message, but any one or more actual result messages are different from the expected result message, a second test result is generated.
[0139] In another exemplary embodiment, during the test process, when the vehicle networking control unit sends control instructions 1, control instructions 2, and control instructions 3 to the electronic control unit, the vehicle networking control unit may first send control instruction 1, then send control instruction 2, and finally send control instruction 3. After receiving control instructions 1, control instructions 2, and control instructions 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3, respectively, and determines that the validity period of control instruction 1 is 4:00-5:00 p.m., the validity period of control instruction 2 is 4:00-4:30 p.m., and the validity period of control instruction 3 is 4:00-5:00 p.m. After generating actual result message 1, actual result message 2, and actual result message 3, the electronic control unit may restart, and after restarting, first send actual result message 1 to the vehicle networking control unit, then send actual result message 2 to the vehicle networking control unit, and finally send actual result message 3 to the vehicle networking control unit.
[0140] After receiving the actual result message 1, the actual result message 2 and the actual result message 3, the vehicle network control unit determines the order of receiving the actual result message 1, the actual result message 2 and the actual result message 3. If the order of receiving is to receive the actual result message 1 first, then receive the actual result message 2, and finally receive the actual result message 3, then it is determined that the order of receiving multiple actual result messages corresponds to the order of sending multiple control instructions. At the same time, it is determined that the receiving time of the actual result message 1 is 4:20 pm, the receiving time of the actual result message 2 is 4:30 pm, and the receiving time of the actual result message 3 is 4:30 pm, then it is determined that the receiving time of the actual result message 1 is within the validity period of the control instruction 1, the receiving time of the actual result message 2 is within the validity period of the control instruction 2, and the receiving time of the actual result message 3 is within the validity period of the control instruction 3. At the same time, if the actual result message 1 is the same as the expected result message 1, the actual result message 2 is the same as the expected result message 2, and the actual result message 3 is the same as the expected result message 3, then the first test result is generated.
[0141] On the contrary, if the receiving order is to first receive the actual result message 1, then receive the actual result message 2, and finally receive the actual result message 3, but the receiving time of any one or more actual result messages is not within the validity period of the control instruction corresponding to the actual result message, it is determined that the receiving time of the actual result message is not within the validity period of the control instruction, and the second test result is generated. Or, if the actual result message 1, the actual result message 3 and the actual result message 2 are within the validity period of the control instruction corresponding to the actual result message, and the receiving order is to first receive the actual result message 1, then receive the actual result message 2, and finally receive the actual result message 3; but. One or more of the actual result message 1, the actual result message 2 and the actual result message 3 are different from the corresponding expected result message, then the second test result is generated. Or, if the actual result message 1, the actual result message 3 and the actual result message 2 are within the validity period of the control instruction corresponding to the actual result message, but the receiving order is not to first receive the actual result message 1, then receive the actual result message 2, and finally receive the actual result message 3, then the second test result is generated.
[0142] In another exemplary embodiment, during the test process, the vehicle network control unit may send control instructions 1, control instructions 2, and control instructions 3 to the electronic control unit. The priorities of the control instructions are control instruction 1 (highest priority), control instruction 3 (second priority), and control instruction 2 (lowest priority) from high to low. After receiving control instructions 1, control instructions 2, and control instructions 3, the electronic control unit generates actual result message 1 corresponding to control instruction 1, actual result message 2 corresponding to control instruction 2, and actual result message 3 corresponding to control instruction 3, respectively. And determine that the validity period of control instruction 1 is 4:00-5:00 p.m., the validity period of control instruction 2 is 4:00-4:30 p.m., and the validity period of control instruction 3 is 4:00-5:00 p.m. After generating actual result message 1, actual result message 2, and actual result message 3, the order of sending multiple actual result messages is determined to be actual result message 1, actual result message 3, and actual result message 2 according to the priorities of control instructions 1, control instructions 2, and control instructions 3. The electronic control unit can be restarted, and after restarting, first sends actual result message 1 to the vehicle networking control unit, then sends actual result message 3 to the vehicle networking control unit, and finally sends actual result message 2 to the vehicle networking control unit.
[0143] After receiving the actual result message 1, the actual result message 3 and the actual result message 2, the vehicle network control unit determines the order of receiving the actual result message 1, the actual result message 3 and the actual result message 2. If the order of receiving is to receive the actual result message 1 first, then receive the actual result message 3, and finally receive the actual result message 2, then determine that the sending order of multiple actual result messages corresponds to the priority of multiple control instructions. At the same time, determine that the receiving time of the actual result message 1 is 4:20 pm, the receiving time of the actual result message 2 is 4:30 pm, and the receiving time of the actual result message 3 is 4:30 pm, then determine that the receiving time of the actual result message 1 is within the validity period of the control instruction 1, the receiving time of the actual result message 2 is within the validity period of the control instruction 2, and the receiving time of the actual result message 3 is within the validity period of the control instruction 3. At the same time, if the actual result message 1 is the same as the expected result message 1, the actual result message 2 is the same as the expected result message 2, and the actual result message 3 is the same as the expected result message 3, then generate the first test result.
[0144] On the contrary, if the receiving order is to first receive the actual result message 1, then receive the actual result message 3, and finally receive the actual result message 2, but the receiving time of any one or more actual result messages is not within the validity period of the control instruction corresponding to the actual result message, then it is determined that the receiving time of the actual result message is not within the validity period of the control instruction, and then the second test result is generated. Alternatively, if the actual result message 1, the actual result message 3 and the actual result message 2 are within the validity period of the control instruction corresponding to the actual result message, but the receiving order is not to first receive the actual result message 1, then receive the actual result message 3, and finally receive the actual result message 2, then it is determined that the sending order of multiple actual result messages does not correspond to the priority of multiple control instructions, and then the second test result can be generated. Alternatively, if the actual result message 1, the actual result message 3 and the actual result message 2 are within the validity period of the control instruction corresponding to the actual result message, and the receiving order is that the actual result message 1 is received first, then the actual result message 3 is received, and finally the actual result message 2 is received, but one or more of the actual result message 1, the actual result message 2 and the actual result message 3 are different from the corresponding expected result message, then a second test result is generated.
[0145] In an embodiment of the present application, the Internet of Vehicles control unit can determine the reception time of the actual result message when receiving the actual message. By judging whether the reception time of the actual result message is within the validity period of the control instruction, it can verify whether the electronic control unit sends the actual result message within the validity period of the control instruction.
[0146] Optionally, one control instruction corresponds to multiple actual result messages. If an actual result message is received, a first test result is generated when the actual result message is the same as an expected result message corresponding to the control instruction, including:
[0147] If multiple actual result messages are received, then the reception time of the multiple actual result messages is determined;
[0148] When each actual result message is identical to the corresponding expected result message, if the reception time interval between every two adjacent actual result messages is a third preset time length, and the reception time of each actual result message is within the validity period of the control instruction, a first test result is generated.
[0149] The third preset duration may be a pre-set time interval.
[0150] In this embodiment, the Internet of Vehicles control unit can send a control instruction to the electronic control unit, and the control instruction includes a validity period. Correspondingly, the electronic control unit executes the control instruction once every third preset time period within the validity period of the control instruction, and sends an actual result message to the Internet of Vehicles control unit. If the Internet of Vehicles control unit receives multiple actual result messages, it determines the receiving time of each actual result message; when each actual result message is the same as the expected result message, the receiving time of every two adjacent actual result messages is within the preset interval time, and the receiving time of each actual result message is within the validity period of the control instruction, then a first test result is generated.
[0151] For example, if the electronic control unit determines that the validity period of control instruction 1 is from 4:00 p.m. to 5:00 p.m., and the third preset duration is 30 minutes. After receiving control instruction 1, the electronic control unit executes control instruction 1 every 30 minutes within 1 hour, and generates an actual result message. At the same time, the electronic control unit sends actual result message 1 corresponding to control instruction 1 and actual result message 2 corresponding to control instruction 1 to the Internet of Vehicles control unit. If the Internet of Vehicles control unit receives actual result message 1 and actual result message 2, and determines that the receiving time of actual result message 1 is 4:30 p.m. and the receiving time of actual result message 2 is 5:00 p.m. At the same time, if actual result message 1 is the same as the corresponding expected result message, and actual result message 2 is the same as the corresponding expected result message, then a first test result is generated.
[0152] On the contrary, if the Internet of Vehicles control unit receives the actual result message 1 and the actual result message 2, and determines that the receiving time of the actual result message 1 is 4:50 pm, and the receiving time of the actual result message 2 is 5 pm. At the same time, if the actual result message 1 is the same as the corresponding expected result message, and the actual result message 2 is the same as the corresponding expected result message, then a second test result is generated. Alternatively, if the Internet of Vehicles control unit receives the actual result message 1 and the actual result message 2, and determines that the receiving time of the actual result message 1 is 4:30 pm, and the receiving time of the actual result message 2 is 5 pm. However, if one or more of the actual result message 1 and the actual result message 2 are different from the corresponding expected result message, then a second test result is generated.
[0153] In the embodiment of the present application, the electronic control unit repeatedly executes a control instruction within the preset interval time, so that the electronic control unit can continuously respond within the validity period, thereby verifying the continuity of the electronic control unit in executing the instruction. The vehicle networking control unit can verify whether the electronic control unit can send the actual result message at the preset interval time within the validity period by judging whether the reception time of each two adjacent actual result messages meets the preset interval time.
[0154] See also Figure 3 , Figure 3 is a flow chart of the steps of a test method provided by an embodiment of the present application. The execution subject of the method may be an electronic control unit in a vehicle, such as Figure 3 As shown, the method may include the following steps.
[0155] S301, receiving a control instruction sent by a vehicle networking control unit in a vehicle during a test.
[0156] For example, during the test process, after the Internet of Vehicles control unit sends a control instruction to the electronic control unit, the electronic control unit can receive the control instruction sent by the Internet of Vehicles control unit, and control the vehicle to perform corresponding operations according to the control instruction, obtain the execution result, and generate an actual result message including the execution result.
[0157] S302, restart the electronic control unit.
[0158] In this embodiment, during the test, the electronic control unit can directly restart after receiving the control instruction, and execute the control instruction after restarting to generate the actual result message, and send the actual result message to the vehicle network control unit. Alternatively, after receiving the control instruction, the electronic control unit executes the control instruction to generate the actual result message, performs a restart operation before generating the actual result message but before sending the actual result message, and sends the actual result message to the vehicle network control unit after restarting. Alternatively, after receiving the control instruction, the electronic control unit waits for a preset time length before restarting, and sends the actual result message to the vehicle network control unit after restarting.
[0159] In one implementation, the electronic control unit may receive a restart instruction sent by the Internet of Vehicles control unit; and respond to the restart instruction to restart the electronic control unit.
[0160] Among them, the restart instruction is an instruction sent by the Internet of Vehicles control unit to the electronic control unit at an interval of a first preset time after sending the control instruction; the first preset time is greater than the time from the electronic control unit receiving the control instruction sent by the Internet of Vehicles control unit to generating a result message, and is less than the time from the electronic control unit receiving the control instruction sent by the Internet of Vehicles control unit to sending the result message.
[0161] For example, the vehicle networking control unit starts timing after sending the control instruction, and sends a restart instruction to the electronic control unit after the timing reaches a first preset time. Correspondingly, the electronic control unit can receive the restart instruction sent by the vehicle networking control unit; and respond to the restart instruction to restart the electronic control unit.
[0162] In another embodiment, the electronic control unit sends a confirmation message corresponding to the control instruction to the vehicle networking control unit, so that the vehicle networking control unit sends a restart instruction after receiving the confirmation message, or sends the restart instruction after a second preset time interval after receiving the confirmation message;
[0163] When a restart instruction is received, the electronic control unit is restarted.
[0164] Exemplarily, after receiving the control instruction sent by the Internet of Vehicles control unit, the electronic control unit sends a confirmation message corresponding to the control instruction to the Internet of Vehicles control unit, so that the Internet of Vehicles control unit immediately sends a restart instruction to the electronic control unit after receiving the confirmation message. After receiving the restart instruction sent by the Internet of Vehicles control unit, the electronic control unit restarts the electronic control unit.
[0165] In another exemplary embodiment, after receiving the control instruction sent by the vehicle networking control unit, the electronic control unit sends a confirmation message corresponding to the control instruction to the vehicle networking control unit, so that the vehicle networking control unit sends a restart instruction to the electronic control unit after a second preset time interval after receiving the confirmation message. After receiving the restart instruction sent by the vehicle networking control unit, the electronic control unit restarts the electronic control unit.
[0166] S303, after restarting, sending an actual result message corresponding to the control instruction to the Internet of Vehicles control unit.
[0167] The actual result message is used to enable the vehicle network control unit to generate a first test result when the expected result message corresponding to the control instruction is the same as the actual result message. The first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0168] For example, during the test, after the electronic control unit is restarted, it can send an actual result message corresponding to the control instruction to the Internet of Vehicles control unit. Correspondingly, if the Internet of Vehicles control unit receives the actual result message, and the actual result message is the same as the expected result message, the Internet of Vehicles control unit generates a first test result.
[0169] In the embodiment of the present application, the electronic control unit receives the control instruction sent by the vehicle networking control unit in the test and then restarts. After the restart, the electronic control unit sends the actual result message corresponding to the control instruction to the vehicle networking control unit. After the restart, the electronic control unit sends the actual result message to the vehicle networking control unit. The vehicle networking control unit can compare the actual result message with the expected result message, and then verify whether the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0170] It should be noted that the specific implementation method of each step in the embodiment of the present application can refer to the relevant content in the above embodiment, which will not be repeated here.
[0171] Optionally, the control instruction is a plurality of control instructions, and an actual result message corresponding to the control instruction is sent to the Internet of Vehicles control unit, including:
[0172] Send the actual result message corresponding to each control instruction to the Internet of Vehicles control unit.
[0173] Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message.
[0174] In this embodiment, during the test, the vehicle networking control unit may send multiple control instructions to the electronic control unit. After receiving the multiple control instructions, the electronic control unit may generate a corresponding actual result message for each control instruction, and send the actual result message corresponding to each control instruction to the vehicle networking control unit. When the vehicle networking control unit receives the actual result message corresponding to each control instruction, if the actual result message of each control instruction is the same as the corresponding expected result message, a first test result is generated.
[0175] In the embodiment of the present application, after receiving multiple control instructions, the electronic control unit can generate a corresponding actual result message for each control instruction. When the vehicle network control unit receives the actual result message corresponding to each control instruction, it can verify whether the electronic control unit can correctly execute the multiple control instructions by judging whether each actual result message is the same as the corresponding expected result message.
[0176] Optionally, the control instructions are sent sequentially by the Internet of Vehicles control unit, and an actual result message corresponding to each control instruction is sent to the Internet of Vehicles control unit, including:
[0177] Sending the actual result message corresponding to each control instruction to the vehicle networking control unit in turn;
[0178] Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message, and the receiving order of the multiple actual result messages corresponds to the sending order of the multiple control instructions.
[0179] In this embodiment, the vehicle networking control unit can send multiple control instructions to the electronic control unit in sequence. Correspondingly, after receiving the multiple control instructions sent by the vehicle networking control unit, the electronic control unit sends the actual result message corresponding to each control instruction to the vehicle networking control unit in sequence. When the vehicle networking control unit receives the actual result message corresponding to each control instruction, if each actual result message is the same as the corresponding expected result message, and the order of receiving the multiple actual result messages corresponds to the order of sending the multiple control instructions, a first test result is generated.
[0180] In an embodiment of the present application, the Internet of Vehicles control unit can send multiple control instructions in sequence, so that the electronic control unit executes the multiple control instructions in sequence to obtain multiple result messages, and sends the multiple result messages in sequence. By determining whether the sending order of the multiple control instructions is consistent with the receiving order of the multiple result messages, it can be verified whether the electronic control unit can execute the multiple control instructions in sequence.
[0181] Optionally, sending an actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes:
[0182] According to the priorities of multiple control instructions, multiple actual result messages are sent in sequence;
[0183] Among them, multiple actual result messages are used to enable the vehicle network control unit to generate a first test result when each actual result message is the same as the corresponding expected result message, and the sending order of the multiple actual result messages corresponds to the priority of the multiple control instructions.
[0184] In one embodiment, the vehicle networking control unit sends multiple control instructions to the electronic control unit. After receiving the multiple control instructions sent by the vehicle networking control unit, the electronic control unit generates multiple actual result messages, and determines the sending order of the multiple actual result messages according to the priority of each control instruction. The electronic control unit sends the actual result message corresponding to each control instruction to the vehicle networking control unit according to the sending order. Correspondingly, when receiving the actual result message corresponding to each control instruction, the vehicle networking control unit determines the sending order of the multiple actual result messages. If each actual result message is the same as the corresponding expected result message and the sending order of the multiple actual result messages corresponds to the priority of the multiple control instructions, a first test result is generated.
[0185] In another embodiment, the vehicle networking control unit sends multiple control instructions in sequence to the electronic control unit according to the priority of the control instructions. After receiving the multiple control instructions sent by the vehicle networking control unit, the electronic control unit generates multiple actual result messages, and sends the actual result message corresponding to each control instruction to the vehicle networking control unit in sequence according to the order in which each control instruction is received. Correspondingly, when the vehicle networking control unit receives the actual result message corresponding to each control instruction, it determines the order in which the multiple actual result messages are sent. If each actual result message is the same as the corresponding expected result message and the order in which the multiple actual result messages are sent corresponds to the priority of the multiple control instructions, a first test result is generated.
[0186] In the embodiment of the present application, the electronic control unit can determine the order of sending the actual result message corresponding to each control instruction to the vehicle networking control unit according to the priority of the control instruction. The vehicle networking control unit can verify whether the electronic control unit can correctly send the actual result messages corresponding to the multiple control instructions to the vehicle networking control unit according to the sending order corresponding to the priority after receiving the multiple control instructions by judging whether the sending order of the multiple actual result messages is consistent with the priority of the multiple control instructions.
[0187] It should be noted that the specific implementation method of each step in the embodiment of the present application can refer to the relevant content in the above embodiment, which will not be repeated here.
[0188] Optionally, sending an actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes:
[0189] Determine the validity period of the control order;
[0190] During the validity period, the actual result message is sent to the Internet of Vehicles control unit.
[0191] The actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the actual result message is the same as the corresponding expected result message and the receiving time of the actual result message is within the validity period of the control instruction.
[0192] In this embodiment, the electronic control unit can determine the validity period of the control instruction, and send the actual result message to the vehicle networking control unit within the validity period of the control instruction. Correspondingly, after receiving the actual result message, the vehicle networking control unit can determine the reception time of the actual result message; if the actual result message is the same as the corresponding expected result message and the reception time of the actual result message is within the validity period of the control instruction, a first test result is generated.
[0193] In the embodiment of the present application, the electronic control unit can determine the validity period of the control instruction; and send the actual result message to the vehicle networking control unit within the validity period. The vehicle networking control unit can verify whether the electronic control unit sends the actual result message within the validity period of the control instruction by judging whether the reception time of the actual result message is within the validity period of the control instruction.
[0194] It should be noted that the specific implementation method of each step in the embodiment of the present application can refer to the relevant content in the above embodiment, which will not be repeated here.
[0195] Optionally, the test method may further include:
[0196] The electronic control unit can call the server through a preset test interface and send a control request used for the test to the server;
[0197] The electronic control unit determines whether a control instruction sent by the vehicle networking control unit is received;
[0198] If the electronic control unit receives the control instruction, a third test result is generated; the third test result is used to indicate that the Internet of Vehicles control unit can correctly forward the control instruction sent by the server to the electronic control unit; if the electronic control unit does not receive the control instruction sent by the Internet of Vehicles control unit, a fourth test result is generated; the fourth test result is used to indicate that the Internet of Vehicles control unit cannot correctly forward the control instruction sent by the server to the electronic control unit.
[0199] Correspondingly, the server receives the control request; and sends a control instruction corresponding to the control request to the Internet of Vehicles control unit according to the control request.
[0200] Correspondingly, the Internet of Vehicles control unit receives the control command and sends the control command to the electronic control unit.
[0201] Optionally, the test method may further include:
[0202] After the electronic control unit receives the control instruction sent by the vehicle networking control unit, the electronic control unit sends a confirmation message to the vehicle networking control unit;
[0203] The electronic control unit determines whether the server receives a confirmation message sent by the vehicle networking control unit;
[0204] If the server can receive the confirmation message, the electronic control unit generates a fifth test result; the fifth test result is used to indicate that the Internet of Vehicles control unit can correctly forward the confirmation message sent by the electronic control unit to the server. If the server cannot receive the confirmation message sent by the Internet of Vehicles control unit, a sixth test result is generated; the sixth test result is used to indicate that the Internet of Vehicles control unit cannot correctly forward the confirmation message sent by the electronic control unit to the server.
[0205] Correspondingly, the Internet of Vehicles control unit receives the confirmation message sent by the electronic control unit and sends the confirmation message to the server.
[0206] Correspondingly, the server receives a confirmation message.
[0207] Optionally, the testing method may further include:
[0208] After the server receives the confirmation message sent by the vehicle networking control unit, the electronic control unit sends an actual result message to the vehicle networking control unit;
[0209] The electronic control unit determines whether the server has received the actual result message sent by the vehicle networking control unit;
[0210] If the server can receive the actual result message sent by the Internet of Vehicles control unit, the seventh test result is generated when the actual result message is the same as the expected result message corresponding to the control instruction; the seventh test result is used to indicate that the Internet of Vehicles control unit can correctly send the actual result message to the server. If the server cannot receive the actual result message sent by the Internet of Vehicles control unit, the eighth test result is generated when the actual result message is the same as the expected result message corresponding to the control instruction; the eighth test result is used to indicate that the Internet of Vehicles control unit cannot correctly send the actual result message to the server.
[0211] Correspondingly, the Internet of Vehicles control unit receives the actual result message sent by the electronic control unit, and sends the actual result message to the server.
[0212] Correspondingly, the server receives the actual result message.
[0213] Optionally, the testing method may further include:
[0214] The electronic control unit determines whether a result confirmation message sent by the vehicle networking control unit is received;
[0215] If the electronic control unit can receive the result confirmation message sent by the vehicle networking control unit, a ninth test result is generated; the ninth test result is used to indicate that the vehicle networking control unit can correctly send the result confirmation message to the electronic control unit. If the electronic control unit cannot receive the result confirmation message sent by the vehicle networking control unit, a tenth test result is generated; the tenth test result is used to indicate that the vehicle networking control unit cannot correctly send the result confirmation message to the electronic control unit.
[0216] Correspondingly, the Internet of Vehicles control unit receives the result confirmation message sent by the server, and sends the result confirmation message to the electronic control unit.
[0217] Correspondingly, after the server receives the confirmation message sent by the Internet of Vehicles control unit, the server sends a result confirmation message to the Internet of Vehicles control unit.
[0218] See also Figure 4 , Figure 4 A schematic flow chart of a testing method provided in an embodiment of the present application. The method may include the following steps.
[0219] S401, the Internet of Vehicles control unit sends a control instruction used for testing to the electronic control unit.
[0220] S402, the electronic control unit receives a control instruction sent by the Internet of Vehicles control unit during the test.
[0221] S403, the electronic control unit executes the control instruction to generate an actual result message.
[0222] S404, the Internet of Vehicles control unit sends a restart instruction to the electronic control unit.
[0223] Among them, after sending the control instruction used for testing to the electronic control unit, the vehicle networking control unit may send a restart instruction to the electronic control unit after a first preset time interval; or, the electronic control unit sends a confirmation message corresponding to the control instruction to the vehicle networking control unit, and the vehicle networking control unit sends a restart instruction to the electronic control unit after receiving the confirmation message sent by the electronic control unit; or, the electronic control unit sends a confirmation message corresponding to the control instruction to the vehicle networking control unit, and the vehicle networking control unit sends a restart instruction to the electronic control unit after a second preset time interval after receiving the confirmation message sent by the electronic control unit.
[0224] S405, the electronic control unit restarts according to the restart instruction.
[0225] S406, the electronic control unit sends an actual result message corresponding to the control instruction to the Internet of Vehicles control unit.
[0226] S407, the vehicle networking control unit determines whether it has received an actual result message sent by the electronic control unit. If it has received the actual result message, step S408 is executed; if it has not received the actual result message, step S410 is executed.
[0227] S408, the vehicle networking control unit determines whether the actual result message is the same as the expected result message corresponding to the control instruction. If the actual result message is the same as the expected result message corresponding to the control instruction, step S409 is executed; if the actual result message is different from the expected result message corresponding to the control instruction, step S410 is executed.
[0228] S409, the Internet of Vehicles control unit generates a first test result.
[0229] The first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0230] S410, the vehicle networking control unit generates a second test result, wherein the second test result indicates that the electronic control unit cannot correctly send a result message that was not sent before the restart after the restart.
[0231] It should be noted that the specific implementation method of each step in the embodiment of the present application can refer to the relevant content in the above embodiment, which will not be repeated here.
[0232] See also Figure 5 , Figure 5 It is a structural schematic diagram of a test device provided in an embodiment of the present application. The test device can be set in a vehicle networking control unit in a vehicle and can include: a sending module 501, a determining module 502 and a generating module 503.
[0233] The sending module 501 is used to send control instructions used for testing to the electronic control unit in the vehicle;
[0234] The determination module 502 is used to determine whether an actual result message sent by the electronic control unit is received; wherein the actual result message is a result message sent by the electronic control unit to the vehicle networking control unit after the electronic control unit restarts after receiving the control instruction, and the actual result message corresponds to the control instruction;
[0235] The generation module 503 is used to generate a first test result if an actual result message is received and the actual result message is the same as the expected result message corresponding to the control instruction; wherein the first test result indicates that the electronic control unit can correctly send the result message that was not sent before the restart after the restart.
[0236] Optionally, there are multiple control instructions, and the generation module 503 is specifically used to generate a first test result when receiving an actual result message corresponding to each control instruction, if each actual result message is the same as the corresponding expected result message.
[0237] Optionally, the sending module 501 is specifically used to send multiple control instructions to the electronic control unit in sequence; correspondingly, the generating module 503 is specifically used to generate a first test result when an actual result message corresponding to each control instruction is received, if each actual result message is the same as the corresponding expected result message, and the receiving order of the multiple actual result messages corresponds to the sending order of the multiple control instructions.
[0238] Optionally, the priorities of multiple control instructions are different, and the generation module 503 is specifically used to determine the sending order of multiple actual result messages; if each actual result message is the same as the corresponding expected result message, and the sending order of multiple actual result messages corresponds to the priorities of multiple control instructions, then a first test result is generated.
[0239] Optionally, the generation module 503 is specifically used to determine the reception time of the actual result message if an actual result message is received; when the actual result message is the same as the corresponding expected result message, if the reception time is within the validity period of the control instruction, a first test result is generated.
[0240] Optionally, the determination module 502 is specifically used to send a restart instruction to the electronic control unit in the vehicle after sending a control instruction used for testing after a first preset time interval; wherein the restart instruction is used to instruct the electronic control unit to restart; or, after receiving a confirmation message sent by the electronic control unit, send a restart instruction to the electronic control unit; wherein the confirmation message is a message sent by the electronic control unit to the vehicle network control unit after receiving the control instruction, and the confirmation message corresponds to the control instruction; or, after receiving the confirmation message sent by the electronic control unit, send a restart instruction to the electronic control unit after a second preset time interval.
[0241] The testing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0242] See also Figure 6 , Figure 6 It is a structural schematic diagram of a test device provided in an embodiment of the present application. The test device can be arranged in an electronic control unit in a vehicle and can include: a receiving module 601, a restart module 602 and a sending module 603.
[0243] The receiving module 601 is used to receive the control command sent by the vehicle networking control unit in the vehicle during the test;
[0244] A restart module 602 is used to restart the electronic control unit;
[0245] The sending module 603 is used to send the actual result message corresponding to the control instruction to the Internet of Vehicles control unit after restarting; wherein the actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the expected result message corresponding to the control instruction is the same as the actual result message.
[0246] Optionally, there are multiple control instructions, and the sending module 603 is specifically used to send the actual result message corresponding to each control instruction to the Internet of Vehicles control unit; wherein, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message.
[0247] Optionally, multiple control instructions are sent in sequence by the Internet of Vehicles control unit, and the sending module 603 is specifically used to send actual result messages corresponding to each control instruction to the Internet of Vehicles control unit in sequence; wherein, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message, and the receiving order of the multiple actual result messages corresponds to the sending order of the multiple control instructions.
[0248] Optionally, the sending module 603 is specifically used to send multiple actual result messages in sequence according to the priorities of multiple control instructions; wherein, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate a first test result when each actual result message is the same as the corresponding expected result message and the sending order of the multiple actual result messages corresponds to the priorities of the multiple control instructions.
[0249] Optionally, the sending module 603 is specifically used to determine the validity period of the control instruction; within the validity period, the actual result message is sent to the Internet of Vehicles control unit; wherein the actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the actual result message is the same as the corresponding expected result message and the reception time of the actual result message is within the validity period of the control instruction.
[0250] Optionally, the restart module 602 is specifically used to receive a restart instruction sent by the Internet of Vehicles control unit; wherein the restart instruction is an instruction sent by the Internet of Vehicles control unit to the electronic control unit at an interval of a first preset time after sending the control instruction; in response to the restart instruction, the electronic control unit is restarted.
[0251] Optionally, the restart module 602 is specifically used to send a confirmation message corresponding to the control instruction to the Internet of Vehicles control unit, so that the Internet of Vehicles control unit sends the restart instruction after receiving the confirmation message, or sends the restart instruction after a second preset time interval after receiving the confirmation message; when the restart instruction is received, restart the electronic control unit.
[0252] See also Figure 7 , Figure 7 It is a structural schematic diagram of a vehicle provided in an embodiment of the present application.
[0253] For example, Figure 7As shown, the vehicle 700 includes: a memory 701 and a processor 702, wherein the memory 701 stores an executable program code 7011, and the processor 702 is used to call and execute the executable program code 7011 to perform a test method.
[0254] In addition, an embodiment of the present application also protects a vehicle, which may include a memory and a processor, wherein the memory stores executable program code, and the processor is used to call and execute the executable program code to perform a test method provided by an embodiment of the present application.
[0255] This embodiment also provides a readable storage medium, in which executable program code is stored. When the executable program code is run on a computer, the computer executes the above-mentioned related method steps to implement a testing method provided by the above-mentioned embodiment.
[0256] This embodiment also provides an executable program code product. When the executable program code product runs on a computer, the computer is enabled to execute the above-mentioned related steps to implement a testing method provided by the above embodiment.
[0257] Among them, the device, readable storage medium, executable program code product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0258] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0259] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0260] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A testing method, characterized in that: The method is applied to a vehicle networking control unit in a vehicle, and the method comprises: sending a control instruction for testing to an electronic control unit in the vehicle; Determine whether an actual result message sent by the electronic control unit is received; wherein the actual result message is a result message sent by the electronic control unit to the vehicle networking control unit after the electronic control unit restarts after receiving the control instruction, and the actual result message corresponds to the control instruction; If the actual result message is received, a first test result is generated when the actual result message is identical to the expected result message corresponding to the control instruction; wherein the first test result indicates that the electronic control unit can correctly send the result message that was not sent before restart after restart.
2. The method according to claim 1, characterized in that There are multiple control instructions, and if the actual result message is received, generating a first test result when the actual result message is the same as the expected result message corresponding to the control instruction, includes: When the actual result message corresponding to each of the control instructions is received, if each of the actual result messages is the same as the corresponding expected result message, the first test result is generated.
3. The method according to claim 2, characterized in that The sending of control instructions used in the test process to the electronic control unit in the vehicle comprises: sending a plurality of the control instructions to the electronic control unit in sequence; If each of the actual result messages is the same as the corresponding expected result message, then generating the first test result includes: if each of the actual result messages is the same as the corresponding expected result message, and the receiving order of multiple actual result messages corresponds to the sending order of multiple control instructions, then generating the first test result.
4. The method according to claim 2, characterized in that The priorities of the multiple control instructions are different, and if each of the actual result messages is the same as the corresponding expected result message, generating the first test result includes: Determining a sending order of the plurality of actual result messages; If each of the actual result messages is the same as the corresponding expected result message, and the sending order of the multiple actual result messages corresponds to the priorities of the multiple control instructions, the first test result is generated.
5. The method according to claim 1, characterized in that If the actual result message is received, generating a first test result when the actual result message is the same as the expected result message corresponding to the control instruction includes: If the actual result message is received, determining the reception time of the actual result message; When the actual result message is identical to the corresponding expected result message, if the receiving time is within the validity period of the control instruction, the first test result is generated.
6. A testing method, characterized in that: The method is applied to an electronic control unit in a vehicle, and the method comprises: Receiving a control instruction sent by a vehicle networking control unit in the vehicle during the test; restarting the electronic control unit; After restarting, the actual result message corresponding to the control instruction is sent to the Internet of Vehicles control unit; wherein, the actual result message is used to enable the Internet of Vehicles control unit to generate a first test result when the expected result message corresponding to the control instruction is the same as the actual result message, and the first test result indicates that the electronic control unit can correctly send the result message that was not sent before restarting after restarting.
7. The method according to claim 6, characterized in that There are multiple control instructions, and sending the actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes: Sending the actual result message corresponding to each control instruction to the Internet of Vehicles control unit; Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate the first test result when each actual result message is the same as the corresponding expected result message.
8. The method according to claim 7, characterized in that The multiple control instructions are sent in sequence by the Internet of Vehicles control unit, and the sending of the actual result message corresponding to each control instruction to the Internet of Vehicles control unit includes: Sending the actual result message corresponding to each control instruction to the vehicle networking control unit in sequence; Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate the first test result when each actual result message is identical to the corresponding expected result message, and the receiving order of the multiple actual result messages corresponds to the sending order of the multiple control instructions.
9. The method according to claim 7, characterized in that: The sending the actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes: sending the plurality of actual result messages in sequence according to the priorities of the plurality of control instructions; Among them, the multiple actual result messages are used to enable the Internet of Vehicles control unit to generate the first test result when each actual result message is the same as the corresponding expected result message, and the sending order of the multiple actual result messages corresponds to the priority of the multiple control instructions.
10. The method according to claim 6, characterized in that The sending the actual result message corresponding to the control instruction to the Internet of Vehicles control unit includes: determining a validity period of the control instruction; Within the validity period, the actual result message is sent to the Internet of Vehicles control unit; wherein, the actual result message is used to enable the Internet of Vehicles control unit to generate the first test result when the actual result message is the same as the corresponding expected result message and the reception time of the actual result message is within the validity period of the control instruction.
Citation Information
Patent Citations
Bus robustness testing method and system
CN108733523A
ECU management method on vehicle, ECU and readable storage medium
CN114460913A
Remote control test method and device, equipment and storage medium
CN115086384A
Electronic control unit exception handling method and device, storage medium and electronic equipment
CN116300823A
Communication method, electronic equipment and remote diagnosis system
CN117640686A