WO2019024405A1 - 故障诊断自动测试方法及装置 - Google Patents

故障诊断自动测试方法及装置 Download PDF

Info

Publication number
WO2019024405A1
WO2019024405A1 PCT/CN2017/119047 CN2017119047W WO2019024405A1 WO 2019024405 A1 WO2019024405 A1 WO 2019024405A1 CN 2017119047 W CN2017119047 W CN 2017119047W WO 2019024405 A1 WO2019024405 A1 WO 2019024405A1
Authority
WO
WIPO (PCT)
Prior art keywords
tested
fault
frame data
freeze frame
fault code
Prior art date
Application number
PCT/CN2017/119047
Other languages
English (en)
French (fr)
Inventor
曹海燕
代康伟
黄颖华
刘希
Original Assignee
北京新能源汽车股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京新能源汽车股份有限公司 filed Critical 北京新能源汽车股份有限公司
Publication of WO2019024405A1 publication Critical patent/WO2019024405A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics

Definitions

  • the invention relates to the technical field of automobile electronic control, and in particular relates to an automatic test method and device for fault diagnosis.
  • the present invention aims to solve at least one of the above technical problems.
  • the present invention provides an automatic test method for fault diagnosis, which realizes automatic test of fault diagnosis function, does not require manual operation by a user, saves labor cost, improves test efficiency, and has simple environment configuration, and can realize multiple scenarios. The next test improves test coverage.
  • the invention also provides an automatic test device for fault diagnosis.
  • the invention also proposes a computer device.
  • the invention also proposes a computer readable storage medium.
  • the invention also proposes a computer program product.
  • the first aspect of the present invention provides an automatic fault diagnosis method, including:
  • test case corresponding to the object to be tested and the type of the fault to be tested, wherein the test case is data executable by the object to be tested generated according to a preset test specification;
  • the method before the performing the test case corresponding to the object to be tested and the type of the fault to be tested, the method further includes:
  • a fault code is requested from the object to be tested, and if the request fails, determining that there is no stored fault code in the object to be tested.
  • the method further includes:
  • the method further includes:
  • the determining, according to the first fault code and the second fault code, the first freeze frame data, and the second freeze frame data, Whether the fault diagnosis function of the object to be tested is normal including:
  • the method further includes:
  • test case is erroneously labeled to enable the user to correct the test case.
  • the fault diagnosis automatic test method provided by the embodiment first determines the object to be tested and the type of the fault to be tested, and then executes a test case corresponding to the object to be tested and the type of the fault to be tested, and when determining the fault trigger corresponding to the fault type to be tested Recording the first fault code and the first freeze frame data on the bus, and after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby according to the first fault code and the second fault code
  • the first freeze frame data and the second freeze frame data determine whether the fault diagnosis function of the object to be tested is normal.
  • the second aspect of the present invention provides an automatic fault testing apparatus, including:
  • a first determining module configured to determine an object to be tested and a type of fault to be tested
  • An execution module configured to execute a test case corresponding to the object to be tested and a type of the fault to be tested, where the test case is data executable by the object to be tested generated according to a preset test specification;
  • a recording module configured to record a first fault code and a first freeze frame data on the bus when determining a fault trigger corresponding to the fault type to be tested;
  • a first requesting module configured to request a second fault code and a second freeze frame data from the object to be tested after the fault ends
  • a second determining module configured to determine, according to the first fault code and the second fault code, the first freeze frame data and the second freeze frame data, whether the fault diagnosis function of the object to be tested is normal .
  • the device further includes:
  • a first clearing module configured to clear a fault code in the object to be tested
  • a third determining module configured to request a fault code from the object to be tested, and if the request fails, determine that the fault code is not stored in the object to be tested.
  • the device further includes:
  • An observing module configured to: when the state of the object to be tested meets a fault cancellation state, observe whether the fault flag on the bus has been successfully restored;
  • control module configured to: when the fault flag on the bus has been restored, control the object to be tested to be powered on again, so that the second fault code and the second freeze frame are stored in the to-be-tested In the hardware storage medium in the object;
  • a second requesting module configured to request a third fault code and a third freeze frame data from the object to be tested again;
  • a fourth determining module configured to determine, when the third fault code is consistent with the first fault code, and the first freeze frame data is consistent with the third freeze frame data, determining the object to be tested The power-on to hardware storage function is normal.
  • the device further includes:
  • a second clearing module configured to clear a fault code in the hardware storage medium in the object to be tested.
  • the second determining module is specifically configured to:
  • the device further includes:
  • An obtaining module configured to obtain a test result corresponding to the test case
  • the labeling module is configured to perform error labeling of the test case when the test result is determined to be different from the preset test result, so that the user can correct the test case.
  • the fault diagnosis automatic test device provided by the embodiment of the present invention first determines the object to be tested and the type of the fault to be tested, and then executes a test case corresponding to the object to be tested and the type of the fault to be tested, and determines a fault trigger corresponding to the type of the fault to be tested. Recording the first fault code and the first freeze frame data on the bus, and after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby according to the first fault code and the second fault.
  • the code, the first freeze frame data, and the second freeze frame data determine whether the fault diagnosis function of the object to be tested is normal.
  • a third aspect of the present invention provides a computer device comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program The automatic fault diagnosis method according to the first aspect.
  • a fourth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the automatic fault diagnosis method described in the first aspect.
  • the fifth aspect of the present invention provides a computer program product for performing the fault diagnosis automatic test method according to the first aspect when the instructions in the computer program product are executed by the processor.
  • FIG. 1 is a flow chart of a method for automatically testing fault diagnosis according to an embodiment of the present invention
  • FIG. 2 is a flow chart of a method for automatically testing fault diagnosis according to another embodiment of the present invention.
  • FIG. 3 is a structural diagram of a fault diagnosis automatic test apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of an automatic fault detecting apparatus according to another embodiment of the present invention.
  • the embodiments of the present invention are directed to the existing fault diagnosis test method, and mainly use the CANoe supporting tool or the ETS supporting tool to parse the diagnostic protocol, requiring the user to manually test, waste user energy, and the environment configuration is complicated, and the test is performed.
  • the problem of low efficiency and incomplete test coverage proposes an automatic test method for fault diagnosis.
  • the fault diagnosis automatic test method provided by the embodiment of the present invention first determines the object to be tested and the type of the fault to be tested, and then executes a test case corresponding to the object to be tested and the type of the fault to be tested, and determines a fault trigger corresponding to the fault type to be tested. Recording the first fault code and the first freeze frame data on the bus, and after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby according to the first fault code and the second fault.
  • the code, the first freeze frame data, and the second freeze frame data determine whether the fault diagnosis function of the object to be tested is normal.
  • FIG. 1 is a flow chart of an automatic fault detection test method in accordance with one embodiment of the present invention.
  • the automatic fault diagnosis method includes the following steps:
  • Step 101 Determine an object to be tested and a type of fault to be tested.
  • the fault diagnosis automatic test method provided by the embodiment of the present invention can be performed by the fault diagnosis automatic test device provided by the embodiment of the present invention to automatically test the automobile fault diagnosis function.
  • the object to be tested may be a vehicle control unit (VCU), a motor controller unit (MCU), a battery management system (BMS), and the like.
  • VCU vehicle control unit
  • MCU motor controller unit
  • BMS battery management system
  • the type of fault to be tested may be a fault type such as loss of communication between the onboard computer and the BMS, and unstable internal communication of the BMS.
  • Step 102 Perform a test case corresponding to the object to be tested and the type of the fault to be tested, where the test case is data executable by the object to be tested generated according to a preset test specification.
  • the diagnostic service format keyword, the fault code (DTC), the data stream definition, and the like used in the test case can be pre-defined according to the preset test specification.
  • the embodiment of the present invention provides a format for writing a unified diagnostic services (UDS) mapping table, which is used to define a diagnostic service format keyword, a DTC code, and a data flow definition.
  • UDS unified diagnostic services
  • the diagnostic service format definition defines the actual hexadecimal data corresponding to the diagnostic service format keyword used in the test case. As shown in Table 1, the "name” column defines the keywords used in the test case, and the "byte padding" column refers to the specific hexadecimal number corresponding to the keyword.
  • the default padding means that if the length of a packet of data bytes is less than 8 bytes during the transmission of diagnostic data, in addition to the effective byte length, other unused bytes are filled with hexadecimal data AA.
  • DTC code Define the fault definition name and the corresponding DTC code, and the DID data frozen at the time of the fault occurrence.
  • the "Name” column defines the fault name keyword used in the test case
  • "byte fill” defines a 3-byte fault code hexadecimal number
  • the "Freeze Frame” column defines the fault occurrence time.
  • Data Flow Defines the name of the data stream used in the test case, the corresponding DID, the corresponding byte length, the dbc name, the signal precision, and the offset.
  • the "Name” column defines the data stream name key used in the test case
  • the "Code” column defines the 2-byte data stream DID
  • the "byte” column defines the data stream DID.
  • the "dbc name” column defines the corresponding interface of the signal represented by the DID of the data stream in the CAN protocol.
  • the "precision” and “offset” are respectively filled in the signal defined in the diagnostic specification. Precision and offset.
  • the embodiment of the present invention uses the writing method as shown in Table 4 to write a test case.
  • each row of Table 4 represents a test sequence. There is no limit to the number of test sequences.
  • the measurement method and the method of sending can be left undefined by default. No processing is performed when not filled.
  • TX1 and TX2 represent the signal names of the values to be transmitted, which can be replaced by actual names.
  • RX1 and RX2 indicate the names of the signals to be measured, which can be replaced by actual names.
  • the UDS sends a corresponding diagnostic request ID, and the UDS receives the corresponding diagnostic response ID.
  • the time methods are:
  • Absolute time refers to a specified time point on the time axis. The specific position of the point on the time axis is related to the previous time 0 point. If the absolute time value is 18, it means the distance is set. The distance from time 0 is 18s.
  • Qualified trigger refers to one or more measurement signal data that must be agreed by the measurement method within a certain period of time. When the data is acquired within a limited time, the data jumps to the next test sequence. If the time limit is exceeded, the time limit is exceeded. If the data is not obtained, it will determine that the test fails, and jump to the next test sequence. When the jump occurs, the moment of the jump is taken as the new time 0.
  • Both transmit signal 1 and transmit signal 2 have two values: the simulated value and the manual value.
  • the simulated value refers to the value calculated by the closed loop of the environment model, and when the manual value is used, the simulated value is masked to send any value specified.
  • Expected signal 1 and expected signal 2 are set:
  • the expected signal refers to the expected output that should be there after testing a set of data. It can be a constant value or a previously stored value. Measurement and judgment logic relationship: greater than, less than, all equal to, not equal to, greater than or equal to, less than or equal to.
  • test cases related to UDS faults are written, including clearing fault codes, requesting fault codes, fault code locations, and freeze frames. These two columns are required when writing UDS fault-related test cases.
  • the keywords used must be consistent with the definitions in the UDS mapping table.
  • the automatic execution script After the automatic execution script detects this keyword, it searches the 59 03 message of the UDS response for the fault code following P, and saves the storage address of the fault code.
  • ML1 After detecting this keyword, the frozen frame information of the controller response will be read and compared with the frozen frame of the previously stored fault occurrence time.
  • Step 103 Record a first fault code and a first freeze frame data on the bus when determining a fault trigger corresponding to the fault type to be tested.
  • the bus may be a Controller Area Network (CAN) bus or other bus, which is not limited herein.
  • CAN Controller Area Network
  • the fault code and freeze frame can be defined as shown in Table 5:
  • the definitions of the diagnostic service format keyword, the DTC, the data stream, the fault code, the freeze frame, and the like, which are shown in the embodiments of the present invention, are only illustrative. In actual use, the method may be used in any manner as needed.
  • the DTC, data stream, and the like required in the test case are defined, and are not limited herein.
  • a fault corresponding to the type of the fault to be tested may be triggered, so that the first fault code and the first freeze frame data on the bus may be recorded.
  • the first fault code and the first freeze frame data on the bus are the correct fault code and freeze frame data that are responded after the fault occurs.
  • Step 104 After the fault ends, request the second fault code and the second freeze frame data from the object to be tested.
  • Step 105 Determine whether the fault diagnosis function of the object to be tested is normal according to the first fault code and the second fault code, the first freeze frame data, and the second freeze frame data.
  • the second fault code corresponding to the fault and the second freeze frame data may be generated in the object to be tested.
  • the second fault code and the second freeze frame data may be generated in the object to be tested.
  • step 105 can be implemented in the following manner:
  • the fault diagnosis function of the object to be tested may be determined to be abnormal, and only when the two items are consistent, the test may be determined.
  • the object's fault diagnosis function is normal.
  • the fault code and the freeze frame data are generated in the object to be tested, so that the fault code and the freeze frame data can be requested from the object to be tested, and the fault diagnosis function of the object to be tested is tested. .
  • the test process may be affected, resulting in inaccurate test results. Therefore, after each test is completed, or before the test, the fault code in the object to be tested needs to be cleared, that is, before step 102, the method may further include:
  • the fault code is requested from the object to be tested, and if the request fails, it is determined that there is no stored fault code in the object to be tested.
  • the failure code is requested from the object to be tested, it may be determined that the fault code in the object to be tested has been cleared, and there is no stored fault code, so that the test case can be executed to perform the fault diagnosis test.
  • the fault diagnosis automatic test method proposed in this embodiment first determines the object to be tested and the type of the fault to be tested, and then executes a test case corresponding to the object to be tested and the type of the fault to be tested, and determines the fault trigger corresponding to the fault type to be tested. And recording the first fault code and the first freeze frame data on the bus, and after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby, according to the first fault code and the second fault code
  • the first freeze frame data and the second freeze frame data determine whether the fault diagnosis function of the object to be tested is normal.
  • the above analysis shows that the first fault code and the first freeze frame data on the bus can be recorded when the fault trigger corresponding to the fault type to be tested is determined by executing the test case corresponding to the object to be tested and the fault type to be tested. And after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby determining the test according to the first fault code and the second fault code, the first freeze frame data, and the second freeze frame data. Whether the object's fault diagnosis function is normal. In the actual application, after determining whether the fault diagnosis function of the object to be tested is normal, whether the power-on hardware storage function in the object to be tested is further determined, and the automatic fault diagnosis provided by the embodiment of the present invention is tested in conjunction with FIG. The method is further explained.
  • FIG. 2 is a flow chart of a method for automatically testing fault diagnosis according to another embodiment of the present invention.
  • the fault diagnosis automatic test method may further include the following steps:
  • Step 201 Determine an object to be tested and a type of fault to be tested.
  • Step 202 Perform a test case corresponding to the object to be tested and the type of the fault to be tested, where the test case is data executable by the object to be tested generated according to a preset test specification.
  • Step 203 Record a first fault code and a first freeze frame data on the bus when determining a fault trigger corresponding to the fault type to be tested.
  • Step 204 After the fault ends, request the second fault code and the second freeze frame data from the object to be tested.
  • Step 205 Determine whether the fault diagnosis function of the object to be tested is normal according to the first fault code and the second fault code, the first freeze frame data, and the second freeze frame data.
  • Step 206 When it is determined that the state of the object to be tested meets the fault cancellation state, observe whether the fault flag on the bus has been successfully restored.
  • the fault state of the object to be tested can be released.
  • different states of the object to be tested may be preset, corresponding to different fault flag bits, so that when the state of the object to be tested satisfies the fault cancellation state, the fault flag bit on the bus may be used to determine the state of the object to be tested. Whether it is successful.
  • the fault flag is set to "1"
  • the state of the object to be tested is the fault state
  • the fault flag is "0”
  • the state of the object to be tested is the fault cancel state
  • the fault flag on the bus is “0”
  • Step 207 If successful, control the object to be tested to be powered on again, so that the second fault code and the second freeze frame are stored in the hardware storage medium in the object to be tested.
  • Step 208 requesting the third fault code and the third freeze frame data from the object to be tested again.
  • Step 209 When it is determined that the third fault code is consistent with the first fault code, and the first freeze frame data is consistent with the third freeze frame data, it is determined that the power-on hardware storage function of the object to be tested is normal.
  • the power-on hardware storage function of the object to be tested can be implemented to store the previously generated data in the hardware storage medium after power-on.
  • the object to be tested is controlled to be powered on again, thereby the second fault code and the second fault code.
  • the second freeze frame is stored in the hardware storage medium in the object to be tested.
  • the third fault code and the third freeze frame data requested from the object to be tested are the fault code and the freeze frame data in the hardware storage medium in the object to be tested.
  • the power-on hardware storage function of the object to be tested may be determined. abnormal.
  • the first fault code is consistent with the third fault code, and the first freeze frame data is consistent with the third freeze frame data, it may be determined that the power-on hardware storage function of the object to be tested is normal.
  • the object to be tested is also required to be stored in the object to be tested.
  • the fault code in the hardware storage medium is cleared. That is, after step 209, the method may further include:
  • the test case can be improved according to the application situation of the test case. That is, after step 201, the method may further include:
  • test case is mislabeled so that the user can correct the test case.
  • the test result corresponding to the test case may be preset according to the test case, so that after the test case is executed, the actual test result may be compared with the preset test result to correct the test case according to the comparison result.
  • the test case after each test case is executed, the test case can be correspondingly labeled according to the comparison result between the actual test result and the preset test result. If the actual test result is different from the preset test result after the test case is executed, the test case may be marked as having an error; if the test result is executed, the actual test result is the same as the preset test result, then Mark this test case correctly.
  • the user can correct the test case every time the test case is executed after determining that there is an error in the test case; or, after the test case is executed multiple times, the user can determine the ratio of the number of errors to the correct number according to the label, thereby determining according to the determination.
  • the ratio choose whether to modify the test case, there is no limit here.
  • the fault diagnosis automatic test method proposed in this embodiment can determine whether the fault flag on the bus has been successfully recovered after determining whether the fault diagnosis function of the object to be tested is normal or not, and determining that the state of the object to be tested satisfies the fault cancellation state. If successful, control the object to be tested to be powered on again, and request the third fault code and the third freeze frame data from the object to be tested again, so that the third fault code is consistent with the first fault code, and the first freeze frame When the data is consistent with the third freeze frame data, it is determined that the power-on hardware storage function of the object to be tested is normal.
  • an embodiment of the present invention further provides an automatic fault testing apparatus.
  • FIG. 3 is a structural diagram of a fault diagnosis automatic test apparatus according to an embodiment of the present invention.
  • the fault diagnosis automatic test device includes:
  • a first determining module 31 configured to determine an object to be tested and a type of fault to be tested
  • the execution module 32 is configured to execute a test case corresponding to the object to be tested and the type of the fault to be tested, where the test case is data executable by the object to be tested generated according to the preset test specification;
  • the recording module 33 is configured to record the first fault code and the first freeze frame data on the bus when determining the fault trigger corresponding to the fault type to be tested;
  • the first requesting module 34 is configured to request the second fault code and the second freeze frame data from the object to be tested after the fault ends;
  • the second determining module 35 is configured to determine whether the fault diagnosis function of the object to be tested is normal according to the first fault code and the second fault code, the first freeze frame data, and the second freeze frame data.
  • the fault diagnosis automatic test device provided by the embodiment of the present invention can perform the fault diagnosis automatic test method provided by the embodiment of the present invention to automatically test the automobile fault diagnosis function.
  • the foregoing second determining module 35 is specifically configured to:
  • the fault diagnosis automatic test device provided by the embodiment first determines the object to be tested and the type of the fault to be tested, and then executes a test case corresponding to the object to be tested and the type of the fault to be tested, and when determining the fault trigger corresponding to the fault type to be tested And recording the first fault code and the first freeze frame data on the bus, and after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby, according to the first fault code and the second fault code
  • the first freeze frame data and the second freeze frame data determine whether the fault diagnosis function of the object to be tested is normal.
  • FIG. 4 is a structural diagram of an automatic fault detecting apparatus according to another embodiment of the present invention.
  • the fault diagnosis automatic test device may further include:
  • the first clearing module 41 is configured to clear a fault code in the object to be tested
  • the third determining module 42 is configured to request a fault code from the object to be tested, and if the request fails, determine that the fault code is not stored in the object to be tested.
  • the observing module 43 is configured to: when the state of the object to be tested meets the fault cancellation state, observe whether the fault flag on the bus has been successfully restored;
  • the control module 44 is configured to control the object to be tested to be powered on again when the fault flag on the bus has been restored, so that the second fault code and the second freeze frame are stored in the hardware storage medium in the object to be tested;
  • the second requesting module 45 is configured to request the third fault code and the third freeze frame data from the object to be tested again;
  • the fourth determining module 46 is configured to determine that the power-on hardware storage function of the object to be tested is normal when the third fault code is consistent with the first fault code, and the first freeze frame data is consistent with the third freeze frame data.
  • the second clearing module 47 is configured to clear a fault code in the hardware storage medium in the object to be tested.
  • the obtaining module 48 is configured to obtain a test result corresponding to the test case
  • the labeling module 49 is configured to perform error labeling of the test case when the test result is determined and is different from the preset test result, so that the user can correct the test case.
  • the fault diagnosis automatic test device provided by the embodiment first determines the object to be tested and the type of the fault to be tested, and then executes a test case corresponding to the object to be tested and the type of the fault to be tested, and when determining the fault trigger corresponding to the fault type to be tested And recording the first fault code and the first freeze frame data on the bus, and after the fault ends, requesting the second fault code and the second freeze frame data from the object to be tested, thereby, according to the first fault code and the second fault code
  • the first freeze frame data and the second freeze frame data determine whether the fault diagnosis function of the object to be tested is normal.
  • a third aspect of the present invention provides a computer device comprising: a memory, a processor, and a computer program stored on the memory and operable on the processor, the processor implementing the program The automatic fault diagnosis method according to the first aspect.
  • Another aspect of the present invention also provides a computer readable storage medium having stored thereon a computer program that, when executed by a processor, implements the fault diagnosis automatic test method of the first aspect.
  • a further aspect of the present invention provides a computer program product for performing the fault diagnosis automatic test method according to the first aspect when the instructions in the computer program product are executed by the processor.
  • portions of the invention may be implemented in hardware, software, firmware or a combination thereof.
  • multiple steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
  • a suitable instruction execution system For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or combination of the following techniques well known in the art: having logic gates for implementing logic functions on data signals. Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Testing Electric Properties And Detecting Electric Faults (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

一种故障诊断自动测试方法及装置,方法包括:确定待测对象及待测故障类型(101,201);执行与待测对象及待测故障类型对应的测试用例,其中测试用例为根据预设的测试规范生成的、待测对象可执行的数据(102,202);在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据(103,203);在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据(104,204);根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常(105,205)。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。

Description

故障诊断自动测试方法及装置
相关申请的交叉引用
本申请要求北京新能源汽车股份有限公司于2017年7月31日提交的、发明名称为“故障诊断自动测试方法及装置”的、中国专利申请号“2017106427517”的优先权。
技术领域
本发明涉及汽车电子控制技术领域,尤其涉及一种故障诊断自动测试方法及装置。
背景技术
随着科学技术的发展以及人们经济能力的提高,汽车越来越受到人们的青睐。在汽车的应用过程中,可能会出现各种故障问题。
现有的故障诊断测试方法主要有两种。一种是使用汽车总线仿真开发软件CANoe配套工具,另一种是使用汽车工程诊断工具集(Electrical Tester System,简称ETS)配套工具,对诊断协议进行解析。
但是,上述两种故障诊断测试方法,需要用户手动进行测试,浪费用户精力,且环境配置比较复杂,测试效率低,测试覆盖度不全。
发明内容
本发明旨在至少解决上述技术问题之一。
为此,本发明提出一种故障诊断自动测试方法,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
本发明还提出一种故障诊断自动测试装置。
本发明还提出一种计算机设备。
本发明还提出一种计算机可读存储介质。
本发明还提出一种计算机程序产品。
本发明第一方面实施例提出了一种故障诊断自动测试方法,包括:
确定待测对象及待测故障类型;
执行与所述待测对象及待测故障类型对应的测试用例,其中所述测试用例为根据预设的测试规范生成的、所述待测对象可执行的数据;
在确定与所述待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据;
在故障结束后,从所述待测对象中请求第二故障码及第二冻结帧数据;
根据所述第一故障码与所述第二故障码、所述第一冻结帧数据与所述第二冻结帧数据,确定所述待测对象的故障诊断功能是否正常。
在第一方面的一种可能的实现形式中,所述执行与所述待测对象及待测故障类型对应的测试用例之前,还包括:
清除所述待测对象中的故障码;
从所述待测对象中请求故障码,若请求失败,则确定所述待测对象中无存储的故障码。
在第一方面的另一种可能的实现形式中,所述确定所述待测对象的故障诊断功能正常之后,还包括:
确定所述待测对象的状态满足故障解除状态时,观测所述总线上的故障标志位,是否已恢复成功;
若成功,则控制所述待测对象重新上电,以使所述第二故障码及所述第二冻结帧存入所述待测对象中的硬件存储介质中;
再次从所述待测对象中请求第三故障码及第三冻结帧数据;
在确定所述第三故障码与所述第一故障码一致,且所述第一冻结帧数据与所述第三冻结帧数据一致时,确定所述待测对象的上电转硬件存储功能正常。
在第一方面的另一种可能的实现形式中,所述确定所述待测对象的上电转硬件存储功能正常之后,还包括:
清除所述待测对象中硬件存储介质中的故障码。
在第一方面的另一种可能的实现形式中,所述根据所述第一故障码与所述第二故障码、所述第一冻结帧数据与所述第二冻结帧数据,确定所述待测对象的故障诊断功能是否正常,包括:
在所述第一故障码与所述第二故障码不一致时、或所述第一冻结帧数据与所述第二冻结帧数据不一致时,确定所述待测对象的故障诊断功能异常;
或者,在所述第一故障码与所述第二故障码一致时、且所述第一冻结帧数据与所述第二冻结帧数据一致,确定所述待测对象的故障诊断功能正常。
在第一方面的另一种可能的实现形式中,所述执行与所述待测对象及待测故障类型对应的测试用例之后,还包括:
获取与所述测试用例对应的测试结果;
在确定所述测试结果,与预先设置的测试结果不同时,将所述测试用例进行错误标注,以使用户对所述测试用例进行修正。
本实施例提供的故障诊断自动测试方法,首先确定待测对象及待测故障类型,然后执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时, 记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
本发明第二方面实施例提出了一种故障诊断自动测试装置,包括:
第一确定模块,用于确定待测对象及待测故障类型;
执行模块,用于执行与所述待测对象及待测故障类型对应的测试用例,其中所述测试用例为根据预设的测试规范生成的、所述待测对象可执行的数据;
记录模块,用于在确定与所述待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据;
第一请求模块,用于在故障结束后,从所述待测对象中请求第二故障码及第二冻结帧数据;
第二确定模块,用于根据所述第一故障码与所述第二故障码、所述第一冻结帧数据与所述第二冻结帧数据,确定所述待测对象的故障诊断功能是否正常。
在第二方面的一种可能的实现形式中,所述装置,还包括:
第一清除模块,用于清除所述待测对象中的故障码;
第三确定模块,用于从所述待测对象中请求故障码,若请求失败,则确定所述待测对象中无存储的故障码。
在第二方面的另一种可能的实现形式中,所述装置,还包括:
观测模块,用于确定所述待测对象的状态满足故障解除状态时,观测所述总线上的故障标志位,是否已恢复成功;
控制模块,用于在所述总线上的故障标志位已恢复成功时,控制所述待测对象重新上电,以使所述第二故障码及所述第二冻结帧存入所述待测对象中的硬件存储介质中;
第二请求模块,用于再次从所述待测对象中请求第三故障码及第三冻结帧数据;
第四确定模块,用于在确定所述第三故障码与所述第一故障码一致,且所述第一冻结帧数据与所述第三冻结帧数据一致时,确定所述待测对象的上电转硬件存储功能正常。
在第二方面的另一种可能的实现形式中,所述装置,还包括:
第二清除模块,用于清除所述待测对象中硬件存储介质中的故障码。
在第二方面的另一种可能的实现形式中,所述第二确定模块,具体用于:
在所述第一故障码与所述第二故障码不一致时、或所述第一冻结帧数据与所述第二冻结帧数据不一致时,确定所述待测对象的故障诊断功能异常;
或者,在所述第一故障码与所述第二故障码一致时、且所述第一冻结帧数据与所述第二冻结帧数据一致,确定所述待测对象的故障诊断功能正常。
在第二方面的另一种可能的实现形式中,所述装置,还包括:
获取模块,用于获取与所述测试用例对应的测试结果;
标注模块,用于在确定所述测试结果,与预先设置的测试结果不同时,将所述测试用例进行错误标注,以使用户对所述测试用例进行修正。
本发明实施例提供的故障诊断自动测试装置,首先确定待测对象及待测故障类型,然后执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
本发明第三方面实施例提出了一种计算机设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如第一方面所述的故障诊断自动测试方法。
本发明第四方面实施例提出了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面所述的故障诊断自动测试方法。
本发明第五方面实施例提出了一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,执行如第一方面所述的故障诊断自动测试方法。
本发明附加的方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。
附图说明
本发明上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中,
图1是根据本发明一个实施例的故障诊断自动测试方法的流程图;
图2是根据本发明另一个实施例的故障诊断自动测试方法的流程图;
图3是根据本发明一个实施例的故障诊断自动测试装置的结构图;
图4是根据本发明另一个实施例的故障诊断自动测试装置的结构图。
具体实施方式
下面详细描述本发明的实施例,所述实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本发明,而不能理解为对本发明的限制。相反,本发明的实施例包括落入所附加权利要求书的精神和内涵范围内的所有变化、修改和等同物。
具体的,本发明各实施例针对现有的故障诊断测试方法,主要使用CANoe配套工具或ETS配套工具,对诊断协议进行解析,需要用户手动进行测试,浪费用户精力,且环境配置比较复杂,测试效率低,测试覆盖度不全的问题,提出一种故障诊断自动测试方法。
本发明实施例提供的故障诊断自动测试方法,首先确定待测对象及待测故障类型,然后执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
下面参考附图描述根据本发明实施例的故障诊断自动测试方法及装置。
图1是根据本发明一个实施例的故障诊断自动测试方法的流程图。
如图1所示,故障诊断自动测试方法,包括以下步骤:
步骤101,确定待测对象及待测故障类型。
具体的,本发明实施例提供的故障诊断自动测试方法,可以由本发明实施例提供的故障诊断自动测试装置执行,以对汽车故障诊断功能进行自动测试。
其中,待测对象,可以是整车控制器(Vehicle Control Unit,简称VCU)、电机控制器(Motor Controller Unit,简称MCU)、电池管理系统(Battery Management System,简称BMS),等等。
待测故障类型,可以是车载电脑与BMS通讯丢失、BMS内部通信不稳定等故障类型。
步骤102,执行与待测对象及待测故障类型对应的测试用例,其中,测试用例为根据预设的测试规范生成的、待测对象可执行的数据。
可以理解的是,在生成测试用例前,可以根据预设的测试规范,预先定义测试用例中所用到的诊断服务格式关键字、故障码(DTC)及数据流定义等等。
具体的,本发明实施例提供一种统一诊断服务(Unified diagnostic services,简称UDS)映射表的编写格式,用于定义诊断服务格式关键字、DTC码及数据流定义。
具体的,诊断服务格式定义:定义测试用例中用到的诊断服务格式关键字对应的实际十六进制数据。如表1所示,“名称”一列定义在测试用例中用到的关键字,“byte填充” 一列指关键字对应的具体十六进制数。
缺省填充是指在诊断数据发送过程中,如果一包数据字节长度不足8个字节,除了有效字节长度外,其他无用字节用十六进制数据AA来填充。
表1 诊断服务格式定义
Figure PCTCN2017119047-appb-000001
DTC码:定义故障定义名称以及对应的DTC码、故障发生时刻冻结的DID数据。
表2 DTC定义
Figure PCTCN2017119047-appb-000002
如表2所示,“名称”一列定义在测试用例中用到的故障名称关键字,“byte填充”定义3个字节的故障码十六进制数,“冻结帧”列定义故障发生时刻需要存储的数据流数据,此处定义需要与诊断协议中完全一致。
数据流:定义测试用例中用到的数据流名称、对应的DID、对应的字节长度、dbc名称、信号精度和偏移量。如表3所示,“名称”一列定义在测试用例中用到的数据流名称关键字,“编码”列定义2个字节的数据流DID,“byte”列定义该数据流DID所代表的信号在诊断规范中定义的数据长度,“dbc名称”列定义该数据流DID所代表的信号在CAN协 议中对应的接口,“精度”和“偏移”分别填写该信号在诊断规范中定义的精度和偏移。
表3 数据流定义
数据流读写          
名称 编码(2byte) byte dbc名称 精度 偏移
数据流1名称 0100 2 signal_1 1 0
数据流2名称 0101 3 signal_2 1 0
数据流3名称 0102 1 signal_3 0.1 0
数据流4名称 0103 1 signal_4 1 0
数据流5名称 0104 1 signal_5 1 0
进一步的,本发明实施例采用如表4所示的编写方式,编写测试用例。
其中,表4的每行代表一个测试序列。测试序列数量没有限制,测量方法以及发送方法处可缺省不填,当不填时不作任何处理。
表4中TX1、TX2表示待发送数值的信号名称,可用实际名称替代,RX1、RX2表示待测量的信号名称,可用实际名称替代。UDS发送对应诊断请求ID,UDS接收对应诊断响应ID。
表4 测试用例编写方式
Figure PCTCN2017119047-appb-000003
时间方法有:
1、绝对时间:绝对时间指时间轴上的某一个指定时间点,该点在时间轴上的具体位置与前一个时间0点相关,如绝对时间数值为18,则表示该点距离设定的时间0点的距离为18s。
2、限定触发:指限定在某段时间内一定会有测量方法约定的某一个或多个测量信号数据,当在限定时间内获取到该数据则跳转到下一个测试序列,若超出限定时间均未获取到该数据则会判定该行测试不通过,同时跳转到下一个测试序列,当跳转发生时将跳转的那一刻时间作为新的时间0点。比如限定触发时间为5,TX1的发送方法为定值2,RX1在该行的测试方法为定值1,那么则表示发送1次TX1=2,之后在5s内会收到RX1==1的情况,但不确定是5s内具体哪一刻收到,也可能收不到,收不到时判定为不通过。
3、持续等待:指在限定的时间内一直都存在测量方法约定的某一个或多个信号的测量数据,若有不等同于约定的测量数据则判定为测试不通过,但会持续运行到约定时间结束才跳转到下一个测试序列。比如持续等待时间为5,TX1的发送方法为定值2,RX1在该行的测试方法为定值1,则表示发送1次TX1=2,之后在5s内会持续收到RX1==1的情况,若5s内有1次RX1~=1的情况,则判定为不通过。
发送信号1和发送信号2设置:
发送信号1和发送信号2均有两种取值:仿真值和手动值。仿真值指环境模型闭环运算出来的数值,而使用手动值时则会屏蔽仿真值发送指定的任意数值。
预期信号1和预期信号2设置:
预期信号指的是测试输入一组数据后,应该有的预期输出,可以是常数值,也可以读取之前存储的值。测量判断逻辑关系:大于、小于、全等于、不等于、大于等于、小于等于。
表4中UDS发送列和UDS接收列中,UDS故障相关的测试用例编写方式,包括清除故障码、请求故障码、故障码位置及冻结帧等内容,编写UDS故障相关测试用例时要求这两列用到的关键字必须和UDS映射表中定义一致。
另外,还需要用到其它关键字如Zt、P0、Q0、ML1。
Zt:自动执行脚本检测到此关键字后,将保存UDS返回值,并与测试用例对故障状态的预期进行比较。
P0:自动执行脚本检测到此关键字后,将UDS响应的59 03报文中搜索P后面的故障码,并保存该故障码的存储地址。
Q0:检测到此关键字后,将向控制器请求发送DTC存储在Q0位置的冻结帧。
ML1:检测到此关键字后,将读取控制器响应的冻结帧信息,并与之前存储的故障发生 时刻的冻结帧进行比对及判断。
步骤103,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据。
其中,总线,可以是控制器局域网(Controller Area Network,简称CAN)总线或其它总线,此处不作限制。
故障码及冻结帧可以采用如表5所示的定义:
表5 故障码及冻结帧定义
Figure PCTCN2017119047-appb-000004
需要说明的是,本发明实施例所示的诊断服务格式关键字、DTC、数据流、故障码、冻结帧等定义,仅是示意性说明,在实际运用中,可以根据需要,以任意方式对测试用例中所需要的DTC、数据流等进行定义,此处不作限制。
具体的,在执行与待测对象及待测故障类型对应的测试用例后,可以触发与待测故障类型对应的故障,从而可以将总线上的第一故障码及第一冻结帧数据记录下来。
通常,总线上的第一故障码及第一冻结帧数据,为故障发生后响应的正确的故障码及冻结帧数据。
步骤104,在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据。
步骤105,根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。
具体的,在故障结束后,待测对象中即可生成故障对应的第二故障码及第二冻结帧数据。通过请求待测对象中的第二故障码及第二冻结帧数据,并将第二故障码与第二冻结帧数据,与总线上的第一故障码及第一冻结帧数据进行比较,即可确定待测对象的故障诊断功能是否正常。
具体的,步骤105可以通过以下方式实现:
在第一故障码与第二故障码不一致时、或第一冻结帧数据与第二冻结帧数据不一致时,确定待测对象的故障诊断功能异常;
或者,在第一故障码与第二故障码一致时、且第一冻结帧数据与第二冻结帧数据一致时,确定待测对象的故障诊断功能正常。
具体的,在故障码和冻结帧数据两项中,任意一项不一致,或两项都不一致时,均可以确定待测对象的故障诊断功能异常,仅在两项都一致时,可以确定待测对象的故障诊断功能正常。
需要注意的是,每次故障结束后,待测对象中均会生成故障码及冻结帧数据,从而可以从待测对象中请求故障码及冻结帧数据,以对待测对象的故障诊断功能进行测试。然而,若在此次执行测试用例前,待测对象中存在上次测试时生成的故障码,则可能会影响此次的测试过程,造成测试结果不准确。因此,在每次测试结束后,或在测试前,需要清除待测对象中的故障码,即,在步骤102之前,还可以包括:
清除待测对象中的故障码;
从待测对象中请求故障码,若请求失败,则确定待测对象中无存储的故障码。
具体的,若从待测对象中请求故障码失败,则可以确定待测对象中的故障码已经清除,没有存储的故障码,从而可以执行测试用例,以进行故障诊断测试。
本实施例提出的故障诊断自动测试方法,首先确定待测对象及待测故障类型,然后执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
通过上述分析可知,可以通过执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。在实际运用中,在确定待测对象的故障诊断功能是否正常后,还可以进一步确定待测对象中的上电转硬件存储功能是否正常,下面结合图2,对本发明实施例提供的故障诊断自动测试方法进行进一步说明。
图2是根据本发明另一个实施例的故障诊断自动测试方法的流程图。
如图2所示,故障诊断自动测试方法中,还可以包括以下步骤:
步骤201,确定待测对象及待测故障类型。
步骤202,执行与待测对象及待测故障类型对应的测试用例,其中,测试用例为根据预设的测试规范生成的、待测对象可执行的数据。
步骤203,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据。
步骤204,在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据。
步骤205,根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。
其中,上述步骤201-步骤205的具体实现过程及原理,可以参照上述实施例的详细描述,此处不再赘述。
步骤206,确定待测对象的状态满足故障解除状态时,观测总线上的故障标志位,是否已恢复成功。
具体的,在确定待测对象的故障诊断功能是否正常之后,即可解除待测对象的故障状态。
具体实现时,可以预先设置待测对象的不同状态,对应不同的故障标志位,从而在确定待测对象的状态满足故障解除状态时,可以通过总线上的故障标志位,判断待测对象的状态是否恢复成功。
比如,可以设置故障标志位为“1”时,待测对象的状态为故障状态;故障标志位为“0”时,待测对象的状态为故障解除状态,则若总线上的故障标志位为“0”,可以确定待测对象的状态已恢复成功。
步骤207,若成功,则控制待测对象重新上电,以使第二故障码及第二冻结帧存入待测对象中的硬件存储介质中。
步骤208,再次从待测对象中请求第三故障码及第三冻结帧数据。
步骤209,在确定第三故障码与第一故障码一致,且第一冻结帧数据与第三冻结帧数据一致时,确定待测对象的上电转硬件存储功能正常。
可以理解的是,待测对象的上电转硬件存储功能,可以实现在上电后,将之前生成的数据存入硬件存储介质中。
因此,为了确定待测对象的上电转硬件存储功能是否正常,在本发明实施例中,可以在待测对象的状态恢复成功后,控制待测对象重新上电,从而将第二故障码及第二冻结帧存入待测对象中的硬件存储介质中。此时,再次从待测对象中请求的第三故障码及第三冻结帧数据,即为待测对象中的硬件存储介质中的故障码及冻结帧数据。 通过将第三故障码及第三冻结帧数据,与总线上的第一故障码及第一冻结帧数据进行比较,即可确定待测对象的上电转硬件存储功能正常。
若第一故障码与第三故障码不一致时、或第一冻结帧数据与第三冻结帧数据不一致,或故障码及冻结帧数据均不一致时,则可以确定待测对象的上电转硬件存储功能异常。
若第一故障码与第三故障码一致、且第一冻结帧数据与第三冻结帧数据一致,则可以确定待测对象的上电转硬件存储功能正常。
另外,为了避免此次测试过程中,存入待测对象中的硬件存储介质中的故障码对下次的测试过程造成影响,在本发明实施例中,还需要对存入待测对象中的硬件存储介质中的故障码进行清除。即,在步骤209之后,还可以包括:
清除待测对象中硬件存储介质中的故障码。
进一步的,在本发明实施例中,还可以根据测试用例的应用情况,对测试用例进行改进。即,在步骤201之后,还可以包括:
获取与测试用例对应的测试结果;
在确定测试结果,与预先设置的测试结果不同时,将测试用例进行错误标注,以使用户对测试用例进行修正。
具体的,可以根据测试用例,预先设置测试用例对应的测试结果,从而在测试用例执行后,可以将实际测试结果,与预先设置的测试结果进行比较,以根据比较结果,对测试用例进行修正。
具体实现时,每次测试用例执行后,均可以根据实际测试结果与预先设置的测试结果的比较结果,将测试用例进行对应的标注。若此次测试用例执行后,实际测试结果与预先设置的测试结果不同,则可以标注此次测试用例存在错误;若此次测试用例执行后,实际测试结果与预先设置的测试结果相同,则可以标注此次测试用例正确。
用户可以在每次执行测试用例后,确定测试用例存在错误时,对测试用例进行修正;或者,用户也可以在多次执行测试用例后,根据标注确定错误次数与正确次数的比例,从而根据确定的比例,选择是否对测试用例进行修正,此处不作限制。
本实施例提出的故障诊断自动测试方法,在确定待测对象的故障诊断功能是否正常后,可以在确定待测对象的状态满足故障解除状态时,观测总线上的故障标志位,是否已恢复成功,若成功,则控制待测对象重新上电,并再次从待测对象中请求第三故障码及第三冻结帧数据,从而在第三故障码与第一故障码一致、且第一冻结帧数据与第三冻结帧数据一致时,确定待测对象的上电转硬件存储功能正常。由此,实现了对故障诊断功能及待测对象的上电转硬件存储功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆 盖度。
基于上述实施例,本发明实施例还提出一种故障诊断自动测试装置。
图3是根据本发明一个实施例的故障诊断自动测试装置的结构图。
如图3所示,该故障诊断自动测试装置,包括:
第一确定模块31,用于确定待测对象及待测故障类型;
执行模块32,用于执行与待测对象及待测故障类型对应的测试用例,其中测试用例为根据预设的测试规范生成的、待测对象可执行的数据;
记录模块33,用于在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据;
第一请求模块34,用于在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据;
第二确定模块35,用于根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。
具体的,本发明实施例提供的故障诊断自动测试装置,可以执行本发明实施例提供的故障诊断自动测试方法,以对汽车故障诊断功能进行自动测试。
在一种可能的实现形式中,上述第二确定模块35,具体用于:
在第一故障码与第二故障码不一致时、或第一冻结帧数据与第二冻结帧数据不一致时,确定待测对象的故障诊断功能异常;
或者,在第一故障码与第二故障码一致时、且第一冻结帧数据与第二冻结帧数据一致,确定待测对象的故障诊断功能正常。
需要说明的是,上述对故障诊断自动测试方法实施例的说明,也适用于本实施例提供的故障诊断自动测试装置,此处不再赘述。
本实施例提供的故障诊断自动测试装置,首先确定待测对象及待测故障类型,然后执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
图4是根据本发明另一个实施例的故障诊断自动测试装置的结构图。
如图4所示,在图3所示的基础上,该故障诊断自动测试装置中,还可以包括:
第一清除模块41,用于清除待测对象中的故障码;
第三确定模块42,用于从待测对象中请求故障码,若请求失败,则确定待测对象中无存储的故障码。
观测模块43,用于确定待测对象的状态满足故障解除状态时,观测总线上的故障标志位,是否已恢复成功;
控制模块44,用于在总线上的故障标志位已恢复成功时,控制待测对象重新上电,以使第二故障码及第二冻结帧存入待测对象中的硬件存储介质中;
第二请求模块45,用于再次从待测对象中请求第三故障码及第三冻结帧数据;
第四确定模块46,用于在确定第三故障码与第一故障码一致,且第一冻结帧数据与第三冻结帧数据一致时,确定待测对象的上电转硬件存储功能正常。
第二清除模块47,用于清除待测对象中硬件存储介质中的故障码。
获取模块48,用于获取与测试用例对应的测试结果;
标注模块49,用于在确定测试结果,与预先设置的测试结果不同时,将测试用例进行错误标注,以使用户对测试用例进行修正。
需要说明的是,上述对故障诊断自动测试方法实施例的说明,也适用于本实施例提供的故障诊断自动测试装置,此处不再赘述。
本实施例提供的故障诊断自动测试装置,首先确定待测对象及待测故障类型,然后执行与待测对象及待测故障类型对应的测试用例,在确定与待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据,并在故障结束后,从待测对象中请求第二故障码及第二冻结帧数据,从而根据第一故障码与第二故障码、第一冻结帧数据与第二冻结帧数据,确定待测对象的故障诊断功能是否正常。由此,实现了对故障诊断功能的自动测试,无需用户手动操作,节约了人力成本,提高了测试效率,且环境配置简单,可以实现对多种场景下的测试,提高了测试覆盖度。
本发明第三方面实施例提出了一种计算机设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现如第一方面所述的故障诊断自动测试方法。
本发明另一方面还提出了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面所述的故障诊断自动测试方法。
本发明又一方面实施例提出了一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,执行如第一方面所述的故障诊断自动测试方法。
在本发明的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。在本发明的描述中,需要说明的是,除非另有明确的规定 和限定,术语“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。此外,在本发明的描述中,除非另有说明,“多个”的含义是两个或两个以上。
流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。

Claims (15)

  1. 一种故障诊断自动测试方法,其特征在于,包括:
    确定待测对象及待测故障类型;
    执行与所述待测对象及待测故障类型对应的测试用例,其中所述测试用例为根据预设的测试规范生成的、所述待测对象可执行的数据;
    在确定与所述待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据;
    在故障结束后,从所述待测对象中请求第二故障码及第二冻结帧数据;
    根据所述第一故障码与所述第二故障码、所述第一冻结帧数据与所述第二冻结帧数据,确定所述待测对象的故障诊断功能是否正常。
  2. 如权利要求1所述的方法,其特征在于,所述执行与所述待测对象及待测故障类型对应的测试用例之前,还包括:
    清除所述待测对象中的故障码;
    从所述待测对象中请求故障码,若请求失败,则确定所述待测对象中无存储的故障码。
  3. 如权利要求1所述的方法,其特征在于,所述确定所述待测对象的故障诊断功能正常之后,还包括:
    确定所述待测对象的状态满足故障解除状态时,观测所述总线上的故障标志位,是否已恢复成功;
    若成功,则控制所述待测对象重新上电,以使所述第二故障码及所述第二冻结帧存入所述待测对象中的硬件存储介质中;
    再次从所述待测对象中请求第三故障码及第三冻结帧数据;
    在确定所述第三故障码与所述第一故障码一致,且所述第一冻结帧数据与所述第三冻结帧数据一致时,确定所述待测对象的上电转硬件存储功能正常。
  4. 如权利要求3所述的方法,其特征在于,所述确定所述待测对象的上电转硬件存储功能正常之后,还包括:
    清除所述待测对象中硬件存储介质中的故障码。
  5. 如权利要求1-4任一所述的方法,其特征在于,所述根据所述第一故障码与所述第二故障码、所述第一冻结帧数据与所述第二冻结帧数据,确定所述待测对象的故障诊断功能是否正常,包括:
    在所述第一故障码与所述第二故障码不一致时、或所述第一冻结帧数据与所述第 二冻结帧数据不一致时,确定所述待测对象的故障诊断功能异常;
    或者,在所述第一故障码与所述第二故障码一致时、且所述第一冻结帧数据与所述第二冻结帧数据一致,确定所述待测对象的故障诊断功能正常。
  6. 如权利要求1-4任一所述的方法,其特征在于,所述执行与所述待测对象及待测故障类型对应的测试用例之后,还包括:
    获取与所述测试用例对应的测试结果;
    在确定所述测试结果,与预先设置的测试结果不同时,将所述测试用例进行错误标注,以使用户对所述测试用例进行修正。
  7. 一种故障诊断自动测试装置,其特征在于,包括:
    第一确定模块,用于确定待测对象及待测故障类型;
    执行模块,用于执行与所述待测对象及待测故障类型对应的测试用例,其中所述测试用例为根据预设的测试规范生成的、所述待测对象可执行的数据;
    记录模块,用于在确定与所述待测故障类型对应的故障触发时,记录总线上的第一故障码及第一冻结帧数据;
    第一请求模块,用于在故障结束后,从所述待测对象中请求第二故障码及第二冻结帧数据;
    第二确定模块,用于根据所述第一故障码与所述第二故障码、所述第一冻结帧数据与所述第二冻结帧数据,确定所述待测对象的故障诊断功能是否正常。
  8. 如权利要求7所述的装置,其特征在于,还包括:
    第一清除模块,用于清除所述待测对象中的故障码;
    第三确定模块,用于从所述待测对象中请求故障码,若请求失败,则确定所述待测对象中无存储的故障码。
  9. 如权利要求7所述的装置,其特征在于,还包括:
    观测模块,用于确定所述待测对象的状态满足故障解除状态时,观测所述总线上的故障标志位,是否已恢复成功;
    控制模块,用于在所述总线上的故障标志位已恢复成功时,控制所述待测对象重新上电,以使所述第二故障码及所述第二冻结帧存入所述待测对象中的硬件存储介质中;
    第二请求模块,用于再次从所述待测对象中请求第三故障码及第三冻结帧数据;
    第四确定模块,用于在确定所述第三故障码与所述第一故障码一致,且所述第一冻结帧数据与所述第三冻结帧数据一致时,确定所述待测对象的上电转硬件存储功能正常。
  10. 如权利要求9所述的装置,其特征在于,还包括:
    第二清除模块,用于清除所述待测对象中硬件存储介质中的故障码。
  11. 如权利要求7-10任一所述的装置,其特征在于,所述第二确定模块,具体用于:
    在所述第一故障码与所述第二故障码不一致时、或所述第一冻结帧数据与所述第二冻结帧数据不一致时,确定所述待测对象的故障诊断功能异常;
    或者,在所述第一故障码与所述第二故障码一致时、且所述第一冻结帧数据与所述第二冻结帧数据一致,确定所述待测对象的故障诊断功能正常。
  12. 如权利要求7-10任一所述的装置,其特征在于,还包括:
    获取模块,用于获取与所述测试用例对应的测试结果;
    标注模块,用于在确定所述测试结果,与预先设置的测试结果不同时,将所述测试用例进行错误标注,以使用户对所述测试用例进行修正。
  13. 一种计算机设备,包括:
    存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1-6中任一所述的故障诊断自动测试方法。
  14. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-6中任一所述的故障诊断自动测试方法。
  15. 一种计算机程序产品,其特征在于,当所述计算机程序产品中的指令由处理器执行时,执行如权利要求1-6中任一所述的故障诊断自动测试方法。
PCT/CN2017/119047 2017-07-31 2017-12-27 故障诊断自动测试方法及装置 WO2019024405A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710642751.7A CN107450515A (zh) 2017-07-31 2017-07-31 故障诊断自动测试方法及装置
CN201710642751.7 2017-07-31

Publications (1)

Publication Number Publication Date
WO2019024405A1 true WO2019024405A1 (zh) 2019-02-07

Family

ID=60489319

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/119047 WO2019024405A1 (zh) 2017-07-31 2017-12-27 故障诊断自动测试方法及装置

Country Status (2)

Country Link
CN (1) CN107450515A (zh)
WO (1) WO2019024405A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306042A (zh) * 2020-10-30 2021-02-02 重庆长安汽车股份有限公司 一种自动驾驶控制器自动测试系统及方法

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107450515A (zh) * 2017-07-31 2017-12-08 北京新能源汽车股份有限公司 故障诊断自动测试方法及装置
CN108121326A (zh) * 2017-12-11 2018-06-05 北京经纬恒润科技有限公司 一种故障诊断方法及系统
CN108052448A (zh) * 2017-12-13 2018-05-18 北京易诚高科科技发展有限公司 探索式手机bug测试工艺
CN108490922B (zh) * 2018-04-27 2020-03-24 北京新能源汽车股份有限公司 一种统一诊断服务测试用例的生成方法及装置
CN109088780B (zh) * 2018-10-25 2021-11-12 北京新能源汽车股份有限公司 一种信号检测方法和检测装置
CN111782499B (zh) * 2019-04-03 2023-09-22 北京车和家信息技术有限公司 测试用例生成方法及系统
CN112147967A (zh) * 2019-06-27 2020-12-29 北京新能源汽车股份有限公司 一种汽车控制器的场景测试用例自动生成方法及装置
CN110955554B (zh) * 2019-12-13 2023-08-18 潍柴动力股份有限公司 故障的处理方法、装置、设备及存储介质
CN113341906B (zh) * 2020-03-02 2022-12-27 北京新能源汽车股份有限公司 一种故障处理方法、装置、设备及汽车
CN114205261B (zh) * 2020-08-27 2024-02-20 中车株洲电力机车研究所有限公司 网络通信数据正确性的自动化测试方法及存储介质
CN111983998B (zh) * 2020-09-04 2021-11-30 华人运通(江苏)技术有限公司 一种自动化诊断测试用例生成系统及方法
CN112463473B (zh) * 2020-11-06 2023-01-10 苏州浪潮智能科技有限公司 一种存储数据流单元测试方法、系统、终端及存储介质
CN116032798A (zh) * 2022-12-28 2023-04-28 天翼云科技有限公司 一种针对零信任身份授权的自动化测试方法及装置
CN116009457A (zh) * 2023-01-19 2023-04-25 重庆长安新能源汽车科技有限公司 一种对车辆的远程故障诊断功能进行hil测试的方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080221751A1 (en) * 2004-08-31 2008-09-11 Daimlerchrysler Ag Checking of Repairs for Electronic Vehicle Systems
CN102608993A (zh) * 2012-03-09 2012-07-25 北京经纬恒润科技有限公司 网络自动化测试的方法、机柜及测试主机
CN103439961A (zh) * 2013-08-02 2013-12-11 浙江吉利汽车研究院有限公司 汽车电子控制单元诊断功能测试方法和系统
US20150105972A1 (en) * 2008-04-14 2015-04-16 Innova Electronics, Inc. Hand held data retrieval device with fixed solution capability
CN104865948A (zh) * 2014-12-19 2015-08-26 北汽福田汽车股份有限公司 一种汽车控制器自动诊断装置及方法
CN105573296A (zh) * 2016-01-15 2016-05-11 上海汽车变速器有限公司 基于硬件在环的汽车诊断自动化测试系统及方法
CN107450515A (zh) * 2017-07-31 2017-12-08 北京新能源汽车股份有限公司 故障诊断自动测试方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4901025A (en) * 1987-08-13 1990-02-13 Mitsubishi Denki Kabushiki Kaisha Fault diagnosis system for electronic devices on automobiles
JPH08164827A (ja) * 1994-12-13 1996-06-25 Nissan Motor Co Ltd 車両故障診断装置
CN102523052B (zh) * 2011-12-01 2014-07-09 无锡中星微电子有限公司 测试方法和装置
CN103034227A (zh) * 2012-09-20 2013-04-10 北京智行鸿远汽车技术有限公司 纯电动汽车整车控制器模型在回路测试方法
CN105224447B (zh) * 2014-06-11 2017-11-14 联创汽车电子有限公司 发动机控制器软件诊断模块测试方法及测试系统
CN104076814A (zh) * 2014-07-09 2014-10-01 哈尔滨工业大学 基于硬件在环仿真的汽车电子控制单元测量系统
CN105223897A (zh) * 2015-08-27 2016-01-06 株洲南车时代电气股份有限公司 一种铁路车辆电气控制柜测试装置及测试方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080221751A1 (en) * 2004-08-31 2008-09-11 Daimlerchrysler Ag Checking of Repairs for Electronic Vehicle Systems
US20150105972A1 (en) * 2008-04-14 2015-04-16 Innova Electronics, Inc. Hand held data retrieval device with fixed solution capability
CN102608993A (zh) * 2012-03-09 2012-07-25 北京经纬恒润科技有限公司 网络自动化测试的方法、机柜及测试主机
CN103439961A (zh) * 2013-08-02 2013-12-11 浙江吉利汽车研究院有限公司 汽车电子控制单元诊断功能测试方法和系统
CN104865948A (zh) * 2014-12-19 2015-08-26 北汽福田汽车股份有限公司 一种汽车控制器自动诊断装置及方法
CN105573296A (zh) * 2016-01-15 2016-05-11 上海汽车变速器有限公司 基于硬件在环的汽车诊断自动化测试系统及方法
CN107450515A (zh) * 2017-07-31 2017-12-08 北京新能源汽车股份有限公司 故障诊断自动测试方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112306042A (zh) * 2020-10-30 2021-02-02 重庆长安汽车股份有限公司 一种自动驾驶控制器自动测试系统及方法

Also Published As

Publication number Publication date
CN107450515A (zh) 2017-12-08

Similar Documents

Publication Publication Date Title
WO2019024405A1 (zh) 故障诊断自动测试方法及装置
CN107222362B (zh) 一种整车can网络自动化测试平台及其优化方法
CN108833170B (zh) 一种网络级自适应can总线故障诊断方法
US9082242B2 (en) Vehicle network health assessment
US10621797B2 (en) System and method for transferring diagnostic commands to a vehicle
Li et al. A design for automotive CAN bus monitoring system
CN103312818A (zh) 一种车辆诊断方法及服务器
US20120166605A1 (en) Remote Management Systems and Methods for Servers
WO2022041720A1 (zh) 一种基于uds的通信方法、ecu及上位机
CN111078492B (zh) 一种SoC内部总线的状态监控系统及方法
US20180275646A1 (en) Information Storage System and Apparatus
CN110445635B (zh) 控制报文发送方法、装置及总线仿真测试系统
CN105183575A (zh) 处理器故障的诊断方法、装置及系统
WO2024037304A1 (zh) 车辆诊断通信方法、装置、设备、介质及程序产品
CN110554929B (zh) 数据校验方法、装置、计算机设备及存储介质
CN116627877B (zh) 一种片上总线状态记录系统和记录方法
CN115542875A (zh) 一种基于soa服务的车辆检测方法及相关设备
CN113225232B (zh) 硬件测试方法、装置、计算机设备及存储介质
KR20120126873A (ko) Uds 통신 기반의 자동차용 소프트웨어 동적 분석 장치
US9396145B1 (en) In-chip bus tracer
CN103885441A (zh) 一种控制器局域网络的自适应故障诊断方法
CN113960991A (zh) 车辆故障诊断系统、方法、装置、片上系统芯片及车辆
US7788546B2 (en) Method and system for identifying communication errors resulting from reset skew
Xu et al. Design of vehicle gateway automatic test system based on CANoe
JPH10133905A (ja) 車両通信ネットワークシステム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17920537

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17920537

Country of ref document: EP

Kind code of ref document: A1