Disclosure of Invention
The application mainly aims to provide a method, a device and computer equipment for testing functions of an OBD (on-board diagnostics) diagnostic system, and aims to solve the technical problems that at present, a complete method and a complete process for testing the functions and the normativity of the OBD diagnostic system are not available.
In a first aspect, the present application provides a method for testing the function of an OBD diagnostic system, the method comprising the steps of:
setting a standard output of a controller of a vehicle according to a diagnostic protocol in an OBD diagnostic system, and enabling the set controller to communicate with the OBD diagnostic system;
after a vehicle driving cycle is started, injecting a fault into the set controller;
and after the MIL fault indicator lamp is lightened, the set controller reports an actual output object to the OBD diagnosis system, and whether the OBD diagnosis system is qualified or not is determined according to the actual output object and the standard output object.
In some embodiments, the setting of the specification output of the controller of the vehicle according to the diagnostic protocol in the OBD diagnostic system specifically includes: and setting a generation mechanism, a reporting mechanism and a reporting position of a plurality of fault codes of the controller according to a diagnosis protocol in the OBD diagnosis system so as to determine the standard output.
In some embodiments, said determining whether said OBD diagnostic system is qualified based on actual output and normative output specifically comprises:
and if the actual generation time and the reporting time of the pending fault codes in the actual output object and the injection time of the faults are in the first driving cycle and the pending fault codes are reported to the position of a first diagnosis module set in the OBD diagnosis system, determining that the functions corresponding to the pending fault codes of the OBD diagnosis system are qualified.
In some embodiments, said determining whether said OBD diagnostic system is qualified based on actual output and normative output specifically comprises:
if the input moment of the fault is in the first driving cycle, the actual generation moment and the reporting moment of the confirmed fault code in the actual output object are in a second driving cycle, and the confirmed fault code is reported to a second diagnosis module position set in the OBD diagnosis system, determining that the function corresponding to the confirmed fault code of the OBD diagnosis system is qualified;
wherein the second driving cycle is a next driving cycle of the first driving cycle.
In some embodiments, said determining whether said OBD diagnostic system is qualified based on actual output and normative output specifically comprises:
and if the freeze frame and the pending fault code in the actual output object are generated simultaneously, the freeze frame and the confirmed fault code are reported simultaneously, and the freeze frame is reported to a third diagnosis module position set in the OBD diagnosis system, determining that the function corresponding to the freeze frame of the OBD diagnosis system is qualified.
In some embodiments, said determining whether said OBD diagnostic system is qualified based on actual output and normative output further comprises:
controlling a fourth diagnosis module set in the OBD diagnosis system to clear the pending fault codes and the confirmed fault codes;
when a power system of the whole vehicle is in a high-voltage activation state, the pending fault code and the confirmed fault code are not cleared, and the OBD diagnosis system is determined to be qualified; or,
when the whole vehicle is in a KL15 ON power-ON state and a power system of the whole vehicle is not in a high-voltage activation state, the pending fault code and the confirmation fault code are cleared, and the OBD diagnosis system is determined to be qualified.
In some embodiments, after the pending fault code and the acknowledge fault code are cleared, the method further comprises the steps of:
controlling a warming machine on the vehicle to perform circulation work for a preset number of times, and if the circulation work number of the warming machine in the actual output object is the same as the preset number of times, determining that the OBD diagnosis system is qualified;
and controlling the vehicle to run on the rotating hub for a preset distance, and if the running distance of the vehicle in the actual output is the same as the preset distance, determining that the OBD diagnosis system is qualified.
In some embodiments, if a permanent fault code and the confirmed fault code in the actual output are generated and reported at the same time, and the permanent fault code is reported to a fifth diagnostic module position set in the OBD diagnostic system, it is determined that the OBD diagnostic system is qualified.
In a second aspect, the present application also provides a device for testing the functionality of an OBD diagnostic system, the device comprising:
a setting module for setting a specification output of a controller of a vehicle according to a diagnostic protocol in an OBD diagnostic system and communicating the set controller with the OBD diagnostic system;
the fault injection module is used for injecting faults into the set controller after the vehicle driving cycle is started;
and the determining module is used for reporting an actual output to the OBD diagnostic system by the set controller after the MIL fault indicator lamp is lightened, and determining whether the OBD diagnostic system is qualified or not according to the actual output and the standard output.
In a third aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of a method for testing the functionality of an OBD diagnostic system as described above.
The application provides a method, a device and computer equipment for testing functions of an OBD (on-board diagnostics) system, wherein standard output of a controller of a vehicle is set according to a diagnostic protocol in the OBD system, and the set controller is communicated with the OBD system; after a vehicle driving cycle is started, injecting a fault into the set controller; and after the MIL fault indicator lamp is lightened, the set controller reports an actual output object to the OBD diagnosis system, and whether the OBD diagnosis system is qualified or not is determined according to the actual output object and the standard output object. The method and the device have the advantages that the functional software of the OBD system is tested and verified in the process of building the OBD system, the defects of the OBD system are discovered in time, subsequent correction and development are facilitated, and the standardization and the comprehensiveness of the function of the OBD system are guaranteed.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The embodiment of the application provides a method and a device for testing functions of an OBD diagnostic system and computer equipment. The OBD diagnosis system function testing method can be applied to computer equipment, and the computer equipment can be electronic equipment such as a notebook computer and a desktop computer.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flow chart illustrating a method for testing functions of an OBD diagnostic system according to an embodiment of the present disclosure.
As shown in fig. 1, the method includes steps S1 through S3.
And step S1, setting the standard output of the controller of the vehicle according to the diagnostic protocol in the OBD diagnostic system, and enabling the set controller to communicate with the OBD diagnostic system.
In step S2, after the vehicle driving cycle is started, a failure is injected into the set controller.
And step S3, after the MIL fault indicator lamp is lightened, the set controller reports an actual output to the OBD diagnosis system, and whether the OBD diagnosis system is qualified is determined according to the actual output and a standard output.
It should be noted that the controller of the vehicle may be any one controller or any several controllers in the vehicle, and may also be a new energy controller.
The OBD diagnostic protocol is a functional protocol of the OBD diagnostic system, and after a controller of the vehicle is set according to the OBD diagnostic protocol, data connection is generated between the OBD diagnostic system and the controller, namely the set controller can communicate with the OBD diagnostic system, so that the set controller can report the PID output of the controller to the OBD diagnostic system. It will be appreciated that the OBD diagnostic protocol may be considered to be comprised of code, with one desired result being used as a reference. When the controller is set using the diagnostic protocol, the diagnostic protocol sets the PID output of the controller to a standard output that the controller outputs.
Specifically, the setting of the standard output of the controller of the vehicle includes setting a generation mechanism, a reporting mechanism and a reporting position of a plurality of fault codes of the controller according to a diagnostic protocol in the OBD diagnostic system, so as to determine the standard output.
The plurality of fault codes includes, among others, pending fault codes, acknowledged fault codes, freeze frames, and the like.
Further, after the controller is set, the controller controls the vehicle to start a driving cycle, and after the driving cycle of the vehicle is started, a fault is injected into the controller. When the fault is injected, fault information CAN be directly input into the controller, the fault CAN also be manufactured on the vehicle, and then the fault is injected into the controller through the whole vehicle CAN bus according to the fault information generated by the fault.
Further, after a fault is injected into the set controller, the set controller can operate according to the setting of the OBD diagnostic protocol, so that the MIL fault indicator lamp is lightened, and meanwhile, an actual output object can be output and uploaded to an OBD diagnostic system.
It should be noted that, in the process of lighting the MIL fault indicator lamp, the controller may generate a pending fault code, a confirmed fault code, a freeze frame, and the like in a set driving cycle according to an input fault, and report the fault codes in a certain driving cycle. The reported information also comprises the generation time and the reporting time of the fault codes and the driving cycle of the time. This information is part of the controller output, and another part includes various parameters of the vehicle.
Further, an actual output object received by the OBD diagnosis system is scanned through a scanning program, the scanned actual output object is compared with a standard output object for verification, if the result is consistent, the function of the OBD system is the same as that preset, the function of the OBD system is qualified, and if the result is inconsistent, the problem of the OBD diagnosis protocol code is caused, so that the actual output object of the controller is inconsistent with an ideal output result, the function of the OBD diagnosis system is unqualified or not standardized, and improvement or processing is needed.
As a preferred embodiment, as shown in fig. 2, the generation time and the reporting time of the pending fault code set in the specification output are in the first driving cycle together with the fault injection time, and the pending fault code is reported to the first diagnostic module position set in the OBD diagnostic system. After the actual output object is uploaded to the OBD diagnostic system, the scanning program scans the first diagnostic module set in the OBD diagnostic system, if the pending fault code is scanned, the pending fault code is reported to the position of the first diagnostic module set in the OBD diagnostic system, the reported position is correct, and otherwise, the reported position is incorrect. And after the pending fault code is scanned, if the real generation time and the reporting time of the pending fault code and the injection time of the fault are in the first driving cycle, determining that the function corresponding to the pending fault code of the OBD diagnostic system is qualified. And if the pending fault signal is not scanned by the first diagnosis module, or the generation time or the reporting time of the pending fault signal and the fault injection time are not in the same driving cycle, determining that the function corresponding to the pending fault code of the OBD diagnosis system is unqualified. Wherein the first diagnostic module is a Mode 07 diagnostic module of the OBD diagnostic system.
Therefore, the actual output is compared with the standard output, and if the actual output is consistent with the standard output, the OBD diagnosis system is qualified, and if the actual output is inconsistent with the standard output, the OBD diagnosis system is unqualified. The results of passing the OBD diagnostic system test are described below.
Preferably, as shown in fig. 3, a second diagnostic module of the OBD diagnostic system is scanned, and if it is scanned that a confirmed fault code is reported to a second diagnostic module position set in the OBD diagnostic system, the input time of the fault is in the first driving cycle, and the actual generation time and the reporting time of the confirmed fault code in the actual output object are in the second driving cycle, it is determined that the function corresponding to the confirmed fault code of the OBD diagnostic system is qualified; wherein the second driving cycle is a next driving cycle of the first driving cycle. Wherein the second diagnostic module is a Mode 03 module of the OBD diagnostic module
Preferably, as shown in fig. 4, a third diagnostic module of the OBD diagnostic system is scanned, and if a freeze frame is scanned and reported to a position of the third diagnostic module set in the OBD diagnostic system, the freeze frame and the pending fault code in the actual output object are generated at the same time, and the freeze frame and the confirmed fault code are reported at the same time, it is determined that the function corresponding to the freeze frame of the OBD diagnostic system is qualified. And the third diagnostic module is a Mode 02 module in the OBD diagnostic system.
In some embodiments, as shown in fig. 5 and 6, a fourth diagnostic module configured in the OBD diagnostic system performs a clearing operation on the pending fault code and the confirmed fault code; when a power system of the whole vehicle is in a high-voltage activation state, the pending fault code and the confirmed fault code are not cleared, and the OBD diagnosis system is determined to be qualified; or when the whole vehicle is in a KL15 ON power-ON state and a power system of the whole vehicle is not in a high-voltage activation state, the pending fault code and the confirmation fault code are cleared, and the OBD diagnosis system is determined to be qualified. Wherein the fourth diagnostic module is a Mode04 module in the OBD diagnostic system.
Specifically, when the power system is in a high-voltage activated state, namely PT ready, Mode04 executes the fault code clearing operation, the confirmed fault code of the Mode 03 and the pending fault code of the Mode 07 of each controller respond to the operation negatively, the fault code is executed, the action of not clearing is executed, and the OBD diagnosis system is determined to be qualified; when the power system is in the KL15 ON state, namely the power system is not PT ready, the Mode04 executes the fault code clearing operation, the confirmed fault code in the Mode 03 and the pending fault code in the Mode 07 respond to the operation, the fault code clearing action is executed, and the OBD diagnosis system is determined to be qualified.
In some embodiments, if a permanent fault code and the confirmed fault code in the actual output are generated and reported at the same time, and the permanent fault code is reported to a fifth diagnostic module position set in the OBD diagnostic system, it is determined that the OBD diagnostic system is qualified. The fifth diagnostic module is Mode 0A.
As a preferred embodiment, after the MIL fault lamp is turned on, the vehicle is controlled to travel a preset distance on the rotating hub, and then whether the distance in the actual output by the controller is consistent with the preset distance is compared, if so, the OBD diagnostic system is determined to be qualified, and if not, the OBD diagnostic system is determined to be unqualified.
After the pending fault code and the confirmed fault code are cleared, controlling a warming machine on the vehicle to perform cycle work for a preset number of times, and if the cycle work number of the warming machine in the actual output object is the same as the preset number of times, determining that the OBD diagnosis system is qualified; and controlling the vehicle to run on the rotating hub for a preset distance, and if the running distance of the vehicle in the actual output is the same as the preset distance, determining that the OBD diagnosis system is qualified. Otherwise, the OBD diagnosis system is considered to be unqualified.
The application provides a method, a device and computer equipment for testing functions of an OBD (on-board diagnostics) system, wherein standard output of a controller of a vehicle is set according to a diagnostic protocol in the OBD system, and the set controller is communicated with the OBD system; after a vehicle driving cycle is started, injecting a fault into the set controller; and after the MIL fault indicator lamp is lightened, the set controller reports an actual output object to the OBD diagnosis system, and whether the OBD diagnosis system is qualified or not is determined according to the actual output object and the standard output object. The method and the system have the advantages that the functional software of the OBD diagnostic system is tested and verified in the process of building the OBD diagnostic system, the defects of the OBD diagnostic system are discovered in time, subsequent development and correction are facilitated, and the normativity and the comprehensiveness of the function of the OBD system are guaranteed.
The test method in the application sets the standard output of the controller through the diagnostic protocol of the OBD diagnostic system, and the set standard output standard is an ideal result or is set. And then inputting a fault, so that the controller truly processes the fault to generate a processing result, namely an actual output object, if the generation time, the reporting time and the reporting position of the fault code generated in the actual output object are the same as those of the fault code of the standard output object, the OBD system is considered to be standard and qualified, the function is satisfied, otherwise, the OBD system is considered to be non-standard and needs to be improved or processed.
Referring to fig. 7, fig. 7 is a schematic block diagram of a device for testing functions of an OBD diagnostic system according to an embodiment of the present disclosure.
As shown in fig. 7, the apparatus includes: the device comprises a setting module, a fault injection module and a determination module.
The setting module is used for setting the standard output of a controller of the vehicle according to a diagnosis protocol in the OBD diagnosis system and enabling the set controller to communicate with the OBD diagnosis system;
the fault injection module is used for injecting faults into the set controller after the vehicle driving cycle is started;
the determination module is used for reporting actual output to the OBD diagnosis system by the set controller after the MIL fault indicator lamp is lightened, and determining whether the OBD diagnosis system is qualified or not according to the actual output and the standard output.
The setting module is used for setting a generating mechanism, a reporting mechanism and a reporting position of a plurality of fault codes of the controller according to a diagnosis protocol in the OBD diagnosis system so as to determine the standard output.
Wherein the determining module is further configured to: and if the actual generation time and the reporting time of the pending fault code in the actual output product and the injection time of the fault are in the first driving cycle and the pending fault code is reported to the position of a first diagnosis module set in the OBD diagnosis system, determining that the function corresponding to the pending fault code of the OBD diagnosis system is qualified.
Wherein the determining module is further configured to: if the input moment of the fault is in the first driving cycle, the actual generation moment and the reporting moment of the confirmed fault code in the actual output product are in a second driving cycle, and the confirmed fault code is reported to a second diagnosis module position set in the OBD diagnosis system, determining that the function corresponding to the confirmed fault code of the OBD diagnosis system is qualified;
wherein the second driving cycle is a next driving cycle of the first driving cycle.
The determining module is further configured to determine that a function corresponding to a freeze frame of the OBD diagnostic system is qualified if the freeze frame and the pending fault code are generated simultaneously in the actual output object, the freeze frame and the confirmed fault code are reported simultaneously, and the freeze frame is reported to a third diagnostic module position set in the OBD diagnostic system.
The determination module is further used for controlling a fourth diagnosis module set in the OBD diagnosis system to perform clearing operation on the pending fault codes and the confirmed fault codes;
when a power system of the whole vehicle is in a high-voltage activation state, the pending fault code and the confirmed fault code are not cleared, and the OBD diagnosis system is determined to be qualified; or,
when the whole vehicle is in a KL15 ON power-ON state and a power system of the whole vehicle is not in a high-voltage activation state, the pending fault code and the confirmation fault code are cleared, and the OBD diagnosis system is determined to be qualified.
Controlling a warming machine on the vehicle to perform cycle work for a preset number of times, and if the cycle work number of the warming machine in the actual output object is the same as the preset number of times, determining that the OBD diagnosis system is qualified;
and controlling the vehicle to run on the rotating hub for a preset distance, and if the running distance of the vehicle in the actual output is the same as the preset distance, determining that the OBD diagnosis system is qualified.
And if the permanent fault code and the confirmed fault code in the actual output object are generated and reported simultaneously, and the permanent fault code is reported to a fifth diagnosis module position set in the OBD diagnosis system, determining that the OBD diagnosis system is qualified.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules and units described above may refer to the corresponding processes in the foregoing embodiments, and are not described herein again.
The apparatus provided by the above embodiments may be implemented in the form of a computer program, which can be run on a computer device as shown in fig. 8.
Referring to fig. 8, fig. 8 is a schematic block diagram illustrating a structure of a computer device according to an embodiment of the present disclosure. The computer device may be a terminal.
As shown in fig. 8, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause the processor to perform any one of the methods for testing the functionality of the OBD diagnostic system.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for the execution of a computer program on a non-volatile storage medium, which when executed by the processor, causes the processor to perform any one of the methods for testing the functionality of the OBD diagnostic system.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 8 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The computer device further includes a computer-readable storage medium, on which a computer program is stored, the computer program including program instructions, and the method implemented when the program instructions are executed can refer to the embodiments of the present application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.