Disclosure of Invention
The invention provides an automatic test method and system for a small mileage zero clearing function of an automobile instrument, which overcome the problems or at least partially solve the problems, and can realize the small mileage zero clearing function of the automobile instrument by automatic simulation test.
According to a first aspect of the invention, an automatic test method for a small-meter mileage zero clearing function of an automobile instrument is provided, which comprises the following steps:
the method comprises the steps that a PC terminal collects the small mileage message data of the automobile instrument, and when the small mileage of the automobile instrument is determined to be larger than a preset threshold value according to the small mileage message data, mileage reset message data are sent in a simulation mode;
receiving the sub-mileage message data which is sent to the PC end again after the automobile instrument executes the sub-mileage zero clearing according to the mileage zero clearing message data;
and the PC terminal judges whether the sub-mileage zero clearing function of the automobile instrument is normal or not according to the sub-mileage message data.
On the basis of the technical scheme, the invention can be further improved as follows.
Optionally, the PC end is connected to a Can tool, and the Can tool is connected to a Can bus of the automobile instrument, so that communication connection between the PC end and the automobile instrument is achieved.
Optionally, when it is determined that the subtotal mileage of the automobile instrument is greater than the preset threshold value according to the subtotal mileage message data, the simulated sending of the mileage zero clearing message data includes:
the PC end judges whether the subtotal mileage of the automobile instrument reaches a preset threshold value or not according to the subtotal mileage message data through a Can script program;
if yes, sending clear message data of long-time-pressing distance of the steering wheel key to the automobile instrument through the Can upper computer script program simulation.
Optionally, the mileage clear message data and the subtotal mileage message data are both Can message data, where a transmission format of the Can message data is defined according to a standard Can protocol.
Optionally, the step of judging, by the PC terminal, whether the subtotal mileage zero clearing function of the automobile instrument is normal according to the subtotal mileage packet data includes:
the PC end judges whether the subtotal mileage data of the automobile instrument is 0 or not according to the subtotal mileage message data through a Can script program, and if the subtotal mileage data is 0, the test result is determined to be normal; otherwise, the test result is abnormal.
According to a second aspect of the invention, an automatic test method for a small-meter mileage zero clearing function of an automobile instrument is provided, which comprises the following steps:
receiving vehicle speed message data sent by a PC (personal computer) end or vehicle speed message data generated by a function signal generator;
accumulating the subtotal mileage according to the vehicle speed message data, and sending the subtotal mileage message data to a PC (personal computer) end;
the method comprises the steps of receiving mileage zero clearing message data sent by an automobile instrument, and executing a sub-mileage zero clearing function based on the mileage zero clearing message data, wherein the mileage zero clearing message data is sent to the automobile instrument when a PC terminal determines that the sub-mileage of the automobile instrument is larger than a preset threshold value according to the sub-mileage message data sent by the automobile instrument;
and sending the sub-mileage message data to the PC end again so that the PC end can judge whether the sub-mileage zero clearing function of the automobile instrument is normal or not according to the sub-mileage message data.
Optionally, the vehicle speed message data sent by the PC includes a vehicle speed of a Can signal, and the vehicle speed message data generated by the function signal generator includes a vehicle speed of a frequency signal.
According to a third aspect of the invention, an automatic test system for a small mileage zero clearing function of an automobile instrument is provided, which comprises a PC (personal computer) end and the automobile instrument;
the automobile instrument is used for receiving the speed message data sent by the PC terminal or the speed message data generated by the function signal generator; accumulating the subtotal mileage according to the vehicle speed message data, and sending the subtotal mileage message data to a PC (personal computer) end; receiving mileage zero clearing message data sent by an automobile instrument, and executing a sub-mileage zero clearing function based on the mileage zero clearing message data; sending the subtotal mileage message data to the PC end again;
the PC terminal is used for simulating and sending mileage zero clearing message data when determining that the mileage of the automobile instrument is greater than a preset threshold value according to the mileage packet data; receiving the sub-mileage message data which is sent to the PC end again after the automobile instrument executes the sub-mileage zero clearing according to the mileage zero clearing message data; and judging whether the sub-mileage zero clearing function of the automobile instrument is normal or not according to the sub-mileage message data.
According to the automatic testing method and system for the mileage zero clearing function of the automobile instrument, the mileage zero clearing message can be sent to the automobile instrument through the PC end in a simulated mode, so that the automobile instrument executes the mileage zero clearing function, the mileage zero clearing function of the automobile instrument is automatically tested, manual press keys are not needed, the repeated workload of personnel is reduced, the testing efficiency is improved, and the automatic testing method and system have high practicability.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 is a flowchart of an automated testing method for a trip mileage zero clearing function of an automobile instrument, as shown in fig. 1, the method includes: 101. the PC terminal collects the data of the small mileage message of the automobile instrument, and when the small mileage of the automobile instrument is determined to be larger than a preset threshold value according to the small mileage message, the data of the mileage reset message is sent in a simulation mode; 102. receiving the sub-mileage message data which is sent to the PC end again after the automobile instrument executes the sub-mileage zero clearing according to the mileage zero clearing message data; 103. and the PC terminal judges whether the sub-mileage zero clearing function of the automobile instrument is normal or not according to the sub-mileage message data.
Based on the defects in the background art, the invention simulates the Can signal after the sending of the instrument key or the triggering of the steering wheel key to the automobile instrument by the PC end to clear the subtotal mileage, and checks whether the clearing is successful by checking the value of the subtotal mileage in the instrument outgoing message by the script program of the upper computer, thereby achieving the automatic repeated pressure test of the subtotal mileage automatic clearing function. The automobile instrument mentioned in the invention is an automobile instrument which is connected with a multifunctional steering wheel through Can communication and has a Can mileage outgoing function.
The invention can send the mileage zero clearing message to the automobile instrument through the PC end in a simulated way, so that the automobile instrument executes the mileage zero clearing function and automatically tests the mileage zero clearing function of the automobile instrument without depending on manual keys, thereby reducing the repeated workload of personnel, improving the testing efficiency and having very high practicability.
In a possible embodiment, it Can be understood that a Can upper-computer script is installed on the PC side, the PC side is connected with a Can tool, and the Can tool is connected with a Can bus of the automobile instrument so as to realize communication connection between the PC side and the automobile instrument.
In a possible embodiment, when it is determined that the subtotal mileage of the automobile instrument is greater than the preset threshold according to the subtotal mileage message data, the simulated sending of the mileage clear message data includes: the PC end judges whether the subtotal mileage of the automobile instrument reaches a preset threshold value or not according to the subtotal mileage message data through a Can script program; if yes, long-time-pressing steering wheel key mileage zero clearing message data is sent to the automobile instrument through the Can upper computer script program simulation.
It can be understood that when the mileage zero clearing function of the automobile instrument needs to be tested, the speed message data is sent to the automobile instrument through the PC terminal or the external function signal generator, when the automobile instrument receives the speed message data, the driving mileage is accumulated, and the accumulated mileage is sent to the PC terminal in the form of the mileage message data in real time.
And the PC end judges whether the subtotal mileage of the automobile instrument reaches a preset threshold value according to the subtotal mileage message data, for example, the subtotal mileage of the automobile instrument reaches 10km, the PC end sends a mileage zero clearing message of long-time pressing of a steering wheel key through the simulation of a Can upper computer script program, and sends mileage zero clearing message data to the automobile instrument.
In a possible embodiment, the mileage clear message data and the mileage subtotal message data are both Can message data, wherein a transmission format of the Can message data is defined according to a standard Can protocol.
It Can be understood that the vehicle speed message data, the mileage clear message sent by the PC to the vehicle instrument, and the mileage small message data sent by the vehicle instrument to the PC are Can message data, and the transmission format of these Can message data Can be customized according to a Can protocol, for example, the Can message data Can be defined as 8-byte data, and each byte data uses 0 and 1 to represent the request and feedback result in communication.
In a possible embodiment, the determining, by the PC terminal, whether a mileage clearing function of an automobile instrument is valid according to the mileage packet data includes: the PC end judges whether the subtotal mileage data of the automobile instrument is 0 or not according to the subtotal mileage message data through a Can script program, and if the subtotal mileage data is 0, the test result is determined to be normal; otherwise, the test result is abnormal.
It can be understood that when the automobile instrument receives the mileage zero clearing message sent by the PC, the function of resetting the small mileage is executed, and the accumulated mileage is cleared. And after the zero clearing operation is executed, sending the subtotal mileage message data to the PC end again. And the PC end receives the subtotal mileage message data sent by the automobile instrument, compares the currently received subtotal mileage message data through the Can script program and judges whether the mileage data is the data after the subtotal mileage is cleared, namely the subtotal mileage data is 0 (kilometer). If the result is 0, the test result of the subtotal mileage zero clearing function of the automobile instrument is normal, and if the result is not 0, the test result is abnormal.
In a possible implementation manner, the method further includes: and repeatedly testing the small mileage zero clearing function of the automobile instrument for many times, wherein when the test result of each time is successful, the small mileage zero clearing function of the automobile instrument is normal.
It can be understood that the small mileage zero clearing function of the automobile instrument is repeatedly tested by the PC end for multiple times, and the test result of each test is obtained, when the test result of each test is normal, the small mileage zero clearing function of the automobile instrument is normal, otherwise, the small mileage zero clearing function of the automobile instrument is abnormal.
Referring to fig. 2, an automatic testing method for the trip mileage zero clearing function of an automobile instrument is provided, which includes: 201. receiving vehicle speed message data sent by a PC (personal computer) end or vehicle speed message data generated by a function signal generator; 202. accumulating the subtotal mileage according to the vehicle speed message data, and sending the subtotal mileage message data to a PC (personal computer) end; 203. the method comprises the steps of receiving mileage zero clearing message data sent by an automobile instrument, and executing a sub-mileage zero clearing function based on the mileage zero clearing message data, wherein the mileage zero clearing message data is sent to the automobile instrument when a PC terminal determines that the sub-mileage of the automobile instrument is larger than a preset threshold value according to the sub-mileage message data sent by the automobile instrument; 204. and sending the sub-mileage message data to the PC end again so that the PC end can judge whether the sub-mileage zero clearing function of the automobile instrument is normal or not according to the sub-mileage message data.
It can be understood that the invention describes the automatic test method of the subtotal mileage zero clearing function of the automobile instrument from the automobile instrument side, when the subtotal mileage zero clearing function of the automobile instrument needs to be tested, the speed message data is sent to the automobile instrument through the PC end or the external function signal generator, when the automobile instrument receives the speed message data, the driving mileage is accumulated, and the accumulated mileage is sent to the PC end in the form of the subtotal mileage message data in real time.
And the PC end judges whether the subtotal mileage of the automobile instrument reaches a preset threshold value according to the subtotal mileage message data, for example, the subtotal mileage of the automobile instrument reaches 10km, the PC end sends a mileage zero clearing message of long-time pressing of a steering wheel key through the simulation of a Can upper computer script program, and sends mileage zero clearing message data to the automobile instrument.
And when the automobile instrument receives the mileage zero clearing message sent by the PC terminal, executing a sub-mileage zero clearing function and performing zero clearing operation on the accumulated mileage. And after the zero clearing operation is executed, sending the subtotal mileage message data to the PC end again. And the PC end receives the subtotal mileage message data sent by the automobile instrument, compares the currently received subtotal mileage message data through the Can script program and judges whether the mileage data is the data after the subtotal mileage is cleared, namely the subtotal mileage data is 0 (kilometer). If the result is 0, the test result of the subtotal mileage zero clearing function of the automobile instrument is normal, and if the result is not 0, the test result is abnormal.
Referring to fig. 3, an automatic test system for a small mileage clearing function of an automobile instrument is provided, which includes a PC terminal 31 and an automobile instrument 32, where the PC terminal 31 and the automobile instrument 32 are connected by a Can bus in a communication manner, where:
the automobile instrument 32 is used for receiving the speed message data sent by the PC terminal or the speed message data generated by the function signal generator; accumulating the subtotal mileage according to the vehicle speed message data, and sending the subtotal mileage message data to a PC (personal computer) end; receiving mileage zero clearing message data sent by an automobile instrument, and executing a sub-mileage zero clearing function based on the mileage zero clearing message data; sending the subtotal mileage message data to the PC end again;
the PC terminal 31 is used for simulating and sending mileage zero clearing message data when determining that the small mileage of the automobile instrument is larger than a preset threshold value according to the small mileage message data; receiving the sub-mileage message data which is sent to the PC end again after the automobile instrument executes the sub-mileage zero clearing according to the mileage zero clearing message data; and judging whether the sub-mileage zero clearing function of the automobile instrument is effective or not according to the sub-mileage message data.
It can be understood that the automatic test system for the auto meter sub-meter mileage zero clearing function provided in the embodiments of the present invention corresponds to the automatic test method for the auto meter sub-meter mileage zero clearing function provided in the foregoing embodiments, and the relevant technical features of the automatic test system for the auto meter sub-meter mileage zero clearing function may refer to the relevant technical features of the automatic test method for the auto meter sub-meter mileage zero clearing function, and are not described herein again.
According to the automatic testing method and system for the mileage zero clearing function of the automobile instrument, the mileage zero clearing message can be sent to the automobile instrument through the PC end in a simulated mode, so that the automobile instrument executes the mileage zero clearing function, the mileage zero clearing function of the automobile instrument is automatically tested, manual press keys are not needed, the repeated workload of personnel is reduced, the testing efficiency is improved, and the automatic testing method and system have high practicability.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.