CN112147983B - Vehicle diagnosis method and device, electronic equipment and storage medium - Google Patents

Vehicle diagnosis method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112147983B
CN112147983B CN202011031179.9A CN202011031179A CN112147983B CN 112147983 B CN112147983 B CN 112147983B CN 202011031179 A CN202011031179 A CN 202011031179A CN 112147983 B CN112147983 B CN 112147983B
Authority
CN
China
Prior art keywords
function
diagnostic
target
signature
vehicle
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202011031179.9A
Other languages
Chinese (zh)
Other versions
CN112147983A (en
Inventor
刘均
李河金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
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 Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202011031179.9A priority Critical patent/CN112147983B/en
Publication of CN112147983A publication Critical patent/CN112147983A/en
Application granted granted Critical
Publication of CN112147983B publication Critical patent/CN112147983B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Debugging And Monitoring (AREA)
  • Stored Programmes (AREA)

Abstract

The application is applicable to the technical field of automobile diagnosis, and provides a vehicle diagnosis method, a vehicle diagnosis device, electronic equipment and a storage medium, wherein the method comprises the following steps: when the vehicle to be diagnosed is diagnosed through the diagnostic program, calling an interface function in the diagnostic program, wherein the interface function comprises N function signatures and an arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence; sequentially calling the N function signatures according to the arrangement sequence of the N function signatures, and taking the called function signatures as target function signatures; and executing the test sequence meeting the preset condition in all the test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed. The method and the device can realize the corresponding diagnosis function only by associating the test sequence with the corresponding function signature, and the logic and the structure of the diagnosis program do not need to be modified when the new function is expanded, so that the development efficiency is improved, and the difficulty in expanding the new function is reduced.

Description

Vehicle diagnosis method and device, electronic equipment and storage medium
Technical Field
The present application belongs to the field of automotive diagnostic technologies, and in particular, to a vehicle diagnostic method, an apparatus, an electronic device, and a storage medium.
Background
In the field of automobile diagnosis, diagnosis of an automobile is realized by a diagnosis process written by a diagnosis program, and the diagnosis program is usually written by codes (such as c + + or Java).
The programming of diagnostic programs for diagnosing automobiles usually realizes one diagnostic program according to a step-by-step coding of a diagnostic protocol, the diagnostic program usually comprises a plurality of diagnostic test sequences, and the execution logic of all the diagnostic test sequences needs to be judged in the diagnostic program, so that the program of the diagnostic program is very numerous and complex, developers who need to participate in the development of the diagnostic program need to know the whole diagnostic process, and when a new function is developed, the content of each diagnostic test sequence in the diagnostic program and the logic between the diagnostic test sequences need to be known, which causes low development efficiency and great difficulty in expanding the new function.
Disclosure of Invention
The embodiment of the application provides a vehicle diagnosis method and device, electronic equipment and a storage medium, and aims to solve the problems that the existing diagnosis program is low in development efficiency and high in difficulty in expanding new functions.
In a first aspect, an embodiment of the present application provides a vehicle diagnostic method, including:
when a vehicle to be diagnosed is diagnosed through a diagnostic program, calling an interface function in the diagnostic program, wherein the interface function comprises N function signatures and an arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1;
sequentially calling the N function signatures according to the arrangement sequence of the N function signatures, and taking the called function signatures as target function signatures;
and executing the test sequence meeting the preset condition in all the test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed.
In one embodiment, the executing the test sequence satisfying the preset condition in all the test sequences associated with the target function signature includes:
detecting a number of test sequences associated with the target function signature;
when detecting that the number of the test sequences associated with the target function signature is multiple, executing a plurality of test sequences meeting preset conditions in the test sequences associated with the target function signature;
executing one test sequence associated with the target function signature when detecting that the number of test sequences associated with the target function signature is one.
In one embodiment, when a plurality of test sequences associated with the target function signature is detected, executing a plurality of test sequences satisfying a preset condition among the test sequences associated with the target function signature includes:
when a plurality of test sequences associated with the target function signature are detected, acquiring an environment variable of the vehicle to be diagnosed;
detecting whether a validity parameter matched with the environment variable exists in respective preset validity parameters in a plurality of test sequences associated with the target function signature;
and if so, executing a test sequence corresponding to the validity parameter matched with the environment variable.
In one embodiment, before calling an interface function in the diagnostic program, the method includes:
and converting the diagnostic data set created in advance based on the OTX standard into a diagnostic program created based on the target programming language according to a preset data model.
In one embodiment, after converting a diagnostic data set created based on OTX standard in advance into a diagnostic program created based on a target programming language according to a preset data model, the method includes:
and compiling the diagnostic program corresponding to the target programming language so as to convert the diagnostic program into a dynamic link library.
In one embodiment, the converting the diagnostic data set created in advance based on the OTX standard into the diagnostic program created based on the target programming language according to the preset data model includes:
parsing a logical structure of the diagnostic data set;
classifying the data content of the diagnostic data set according to preset classification marks to obtain K sections of OTX sequences respectively belonging to different classification marks; wherein K is not less than 1 and is an integer;
respectively converting the K-segment OTX sequence into a degree segment corresponding to a K-segment target programming language according to a function character mapping relation corresponding to each classification identifier in the K-segment OTX sequence in a preset data model;
and generating a diagnosis program based on the target programming language according to the logic structure and the degree section corresponding to the K sections of target programming languages.
In one embodiment, the converting the diagnostic data set created in advance based on the OTX standard into the diagnostic program created based on the target programming language according to the preset data model includes:
and converting a diagnostic data set created in advance based on the OTX standard into a diagnostic program programmed based on the C + + programming language according to a preset data model.
In a second aspect, an embodiment of the present application provides a vehicle diagnostic apparatus, including:
the diagnostic system comprises a first calling module, a second calling module and a third calling module, wherein the first calling module is used for calling an interface function in a diagnostic program when the vehicle to be diagnosed is diagnosed through the diagnostic program, and the interface function comprises N function signatures and the arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1;
the second calling module is used for calling the N function signatures in sequence according to the arrangement sequence of the N function signatures and taking the called function signatures as target function signatures;
and the execution module is used for executing the test sequences meeting preset conditions in all the test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed.
In one embodiment, the execution module includes:
a detection unit for detecting the number of test sequences associated with the target function signature;
a first execution unit, configured to execute, when detecting that there are multiple test sequences associated with the target function signature, a plurality of test sequences that satisfy a preset condition among the test sequences associated with the target function signature;
and the second execution unit is used for executing one test sequence associated with the target function signature when detecting that the number of the test sequences associated with the target function signature is one.
In one embodiment, the first execution unit specifically includes:
the first detection subunit is used for acquiring the environment variable of the vehicle to be diagnosed when detecting that the number of the test sequences associated with the target function signature is multiple;
the second detection subunit is used for detecting whether validity parameters matched with the environment variables exist in respective preset validity parameters in a plurality of test sequences associated with the target function signature;
and the execution subunit is used for executing the test sequence corresponding to the validity parameter matched with the environment variable if the test sequence exists.
In one embodiment, the vehicle diagnostic apparatus further includes:
and the conversion module is used for converting the diagnostic data set which is created in advance based on the OTX standard into a diagnostic program which is created based on the target programming language according to a preset data model.
In one embodiment, the vehicle diagnostic apparatus further includes:
and the compiling module is used for compiling the diagnostic program corresponding to the target programming language so as to convert the diagnostic program into a dynamic link library.
In one embodiment, the conversion module comprises:
an analysis unit for analyzing the logical structure of the diagnostic data set;
the classification unit is used for classifying the data content of the diagnosis data set according to preset classification marks to obtain K sections of OTX sequences respectively belonging to different classification marks; wherein K is not less than 1 and is an integer;
the conversion unit is used for respectively converting the K sections of OTX sequences into degree sections corresponding to K sections of target programming languages according to a function character mapping relation corresponding to each classification identifier in the K sections of OTX sequences in a preset data model;
and the generating unit is used for generating the diagnostic program based on the target programming language according to the logic structure and the degree segment corresponding to the K segments of the target programming language.
In one embodiment, the conversion module is specifically configured to: and converting a diagnostic data set created in advance based on the OTX standard into a diagnostic program programmed based on the C + + programming language according to a preset data model.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the vehicle diagnosis method when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the vehicle diagnosis method.
In a fifth aspect, the present application provides a computer program product, which when run on an electronic device, causes the electronic device to execute the steps of the above vehicle diagnosis method.
Compared with the prior art, the embodiment of the application has the advantages that: when a vehicle to be diagnosed is diagnosed through a diagnostic program, an interface function in the diagnostic program is called, wherein the interface function comprises N function signatures and an arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1; sequentially calling the N function signatures according to the arrangement sequence of the N function signatures, and taking the called function signatures as target function signatures; and executing the test sequence meeting the preset condition in all the test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed. The N function signatures can be sequentially called directly according to the arrangement sequence of the N function signatures, and the called function signatures are used as target function signatures; and executing the test sequences meeting preset conditions in all the test sequences associated with the target function signature to diagnose the vehicle to be diagnosed, wherein the logic and the specific implementation process among the test sequences are not required to be considered in the development process, the corresponding diagnosis function can be realized only according to the function signature associated with the test sequences, and the logic and the structure of the diagnosis program are not required to be modified when the new function is expanded, so that the development efficiency is improved, and the difficulty in expanding the new function is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a vehicle diagnostic method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a vehicle diagnostic method provided by an embodiment of the present application;
FIG. 3 is a diagram illustrating an exemplary application scenario provided by an embodiment of the present application;
FIG. 4 is a diagram illustrating a specific application scenario provided by an embodiment of the present application;
FIG. 5 is a diagram illustrating an exemplary application scenario provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a vehicle diagnostic apparatus provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
The vehicle diagnosis method provided in the embodiment of the present application may be applied to a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a mobile phone, a vehicle diagnosis device, or other various electronic devices capable of processing vehicle data.
In order to explain the technical solution described in the present application, the following description is given by way of specific examples.
Referring to fig. 1, a schematic flow chart of a vehicle diagnosis method provided by an embodiment of the present application is shown, the method including:
step S101, when a vehicle to be diagnosed is diagnosed through a diagnostic program, calling an interface function in the diagnostic program, wherein the interface function comprises N function signatures and an arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1.
Specifically, the diagnosis of the vehicle can be realized by executing a diagnostic program in a diagnostic application (i.e., diagnosis APP), and when some complex or special functions are diagnosed, the steps required to be executed by the diagnostic program are many. Each step is performed by a test sequence, and the process of diagnosing some functions is the result of performing a series of test sequences in a given order. An interface function in a diagnostic program is understood to be a series of general interfaces (i.e. function signatures) defined by test sequences in the diagnostic program in sequence, and a corresponding test sequence can be directly called through a certain function signature. The function signature may include a reference identification created from the function type of some test sequence. If the diagnostic program is formed by a plurality of test sequences according to a set sequence, the diagnostic program is realized without coding the test sequences according to the set sequence step by step according to a diagnostic protocol, for example, corresponding function signatures are written according to each function or step of the diagnostic program, and each function signature comprises a function name, a parameter list, a return type and the like; the function name may represent the function of the function signature, the parameter list may represent additional conditions (such as defined parameter types and parameter numbers) required by the test sequence corresponding to the function signature to complete the corresponding function, and the return type refers to the type of the result generated when the function completes its function. In the encoding, the caller of the function signature can know the function of the function signature, the parameter list required by the function signature and whether the return result and the type of the return result exist or not by knowing the function signature. The caller of the function signature can know the function of the corresponding execution test sequence only by knowing the function signature; for a test sequence developer, only the information of the function name, the parameter list, the return type and the like of the corresponding function signature needs to be known, and the function to be realized and the necessary conditions for realizing the function can be known, so that the compiling of the test sequence is realized, and the test sequence is associated with the corresponding function signature. One function signature may correspond to multiple test sequences. Each test sequence related to the same function signature can be written according to the requirement of the function signature (for example, the test sequence is written according to the requirements of the number, type and the like of the input and output parameters of the corresponding function signature). The interface function may be an external entry function provided by each diagnostic program, and when detecting that the vehicle to be diagnosed is diagnosed by the diagnostic program, the interface function may be detected to be called, N function signatures in the interface function are called in sequence, and each function signature is associated with at least one test sequence. Assuming that an interface function mian includes a function signature 1, a function signature 2, and a function signature 3 in order of arrangement, i.e., mian (function signature 1, function signature 2, and function signature 3), when a call to the interface function mian is detected, the function signature 1, the function signature 2, and the function signature 3 are sequentially called in order.
And step S102, sequentially calling the N function signatures according to the arrangement sequence of the N function signatures, and taking the called function signatures as target function signatures.
Specifically, when the interface function in the diagnostic program is called, the N function signatures are called in sequence according to the arrangement order of the N function signatures in the interface function, and the called function signature is referred to as a target function signature.
And step S103, executing the test sequence which meets the preset condition in all the test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed.
Specifically, when a certain function signature is called, the function signature is called a target function signature, and a test sequence meeting preset conditions is selected from test sequences associated with the target function signature to be executed, so that after all the test sequences selected by the function signature in the diagnostic program are executed, the diagnostic work of a certain function of the vehicle to be diagnosed can be completed.
In one embodiment, the executing the test sequence satisfying the preset condition in all the test sequences associated with the target function signature includes: detecting a number of test sequences associated with the target function signature; when detecting that the number of the test sequences associated with the target function signature is multiple, executing a plurality of test sequences meeting preset conditions in the test sequences associated with the target function signature; executing one test sequence associated with the target function signature when detecting that the number of test sequences associated with the target function signature is one.
Specifically, the number of test sequences associated with the target function signature may be detected first among all test sequences associated with the target function signature, and when there is only one test sequence, the only one test sequence is executed; and when the number of the test sequences associated with the target program is multiple, selecting the test sequence meeting the preset condition from the multiple test sequences associated with the target function signature for execution.
In one embodiment, when a plurality of test sequences associated with the target function signature is detected, executing a plurality of test sequences satisfying a preset condition among the test sequences associated with the target function signature includes: when a plurality of test sequences associated with the target function signature are detected, acquiring an environment variable of the vehicle to be diagnosed; detecting whether a validity parameter matched with the environment variable exists in respective preset validity parameters in a plurality of test sequences associated with the target function signature; and if so, executing a test sequence corresponding to the validity parameter matched with the environment variable.
Specifically, a validity parameter is stored in each test sequence in a correlated manner in advance, where the validity parameter may be understood as a parameter prestored for determining whether the test sequence is executed, an environment variable corresponding to a target function signature function in the vehicle to be diagnosed is read in, it is determined whether a validity parameter matched with the environment variable exists in each preset validity parameter in the plurality of test sequences correlated with the target function signature, and if a validity parameter matched with the environment variable exists, the test sequence corresponding to the validity parameter matched with the environment variable is used as an execution test sequence corresponding to the target function signature. Therefore, the test sequence can be selected and executed in each function signature according to the environment variable and the validity parameter read by the current environment.
In a specific application, the environment variable may be an environment parameter of a vehicle to be diagnosed, such as a vehicle speed, a vehicle door state, and for example, the objective function signature function is to perform a test diagnosis on the vehicle speed, the environment variable may be vehicle speed data acquired from the vehicle to be diagnosed, and the vehicle speed is recorded by the environment variable at this time. When the car door is detected to be opened, the acquired environment variable is in an open state, the assignable open state is 1, and then the environment variable is compared with the preset validity parameters, wherein the environment variable can be some data operated in the current environment.
In one embodiment, before calling an interface function in the diagnostic program, the method includes: and converting the diagnostic data set created in advance based on the OTX standard into a diagnostic program created based on the target programming language according to a preset data model.
Specifically, a set of diagnostic data created in advance based on the OTX standard, and each sub-function signature and a test sequence associated with each sub-function signature are all OTX sequences created based on the OTX standard; international standard ISO13209OTX is a sequence Open standard specifically established for the automotive industry, and diagnostic sequences can be created based on the standards of the Open Test sequence Exchange Format (OTX). Specifically, the OTX sequence may be represented by using an Extensible Markup Language (XML) format. The OTX sequence is a static descriptive language based on an XML format, and before calling an interface function in the diagnostic program, a diagnostic data set created in advance based on an OTX standard is converted into the diagnostic program created based on a target programming language according to a preset data model.
In one embodiment, the converting the diagnostic data set created in advance based on the OTX standard into the diagnostic program created based on the target programming language according to the preset data model includes: and converting a diagnostic data set created in advance based on the OTX standard into a diagnostic program programmed based on the C + + programming language according to a preset data model. Alternatively, the conversion is to a diagnostic program programmed based on a programming language such as C, JAVA or C #.
In one embodiment, after converting a diagnostic data set created based on OTX standard in advance into a diagnostic program created based on a target programming language according to a preset data model, the method includes: and compiling the diagnostic program corresponding to the target programming language so as to convert the diagnostic program into a dynamic link library. And automatically compiling the diagnostic program corresponding to the target programming language, and when a new test sequence is expanded, only adding a sequence corresponding to the function signature in the OTX source file, and converting and compiling the OTX source file into a new dynamic link library. The logic and structure of the diagnostic program do not need to be modified, thereby improving the development efficiency and reducing the difficulty of expanding new functions.
In one embodiment, as shown in fig. 2, the converting the diagnostic data set created in advance based on the OTX standard into the diagnostic program created based on the target programming language according to the preset data model includes steps S201 to S204:
step S201, the logical structure of the diagnostic data set is analyzed.
Specifically, the content and the structure of the OTX diagnostic data set based on the XML programming are clear and easy to understand, the design is strict, and the like, and the OTX diagnostic data set can be analyzed first to obtain the data content and the logic structure of the OTX diagnostic data set.
In an application scenario, an OTX Schema file structure can be analyzed in advance, and a data model is constructed according to the OTX Schema file structure, wherein the data model comprises index relations among function characters of various OTX diagnostic data sets based on XML programming. The function characters of the OTX diagnostic data set can be extracted by a keyword extraction method, and the logical structure of the file to be converted is analyzed by utilizing the index relation among the function characters.
Step S202, classifying the data content of the diagnosis data set according to preset classification marks to obtain K sections of OTX sequences respectively belonging to different classification marks; wherein K is an integer of 1 or more.
Specifically, the corresponding key characters can be extracted from the file content of the OTX diagnostic data set by using a key character extraction method, and the content of the K sections of OTX sequences can be obtained in a segmented manner according to the classification identifier of each key character. The classification identifier may be a name of a keyword, and the keywords with different names belong to different categories.
Step S203, respectively converting the K-segment OTX sequence into a degree segment corresponding to the K-segment target programming language according to a function character mapping relation corresponding to each classification identifier in the K-segment OTX sequence in a preset data model.
Specifically, the data model further includes a mapping relationship between a function of the OTX sequence and the c + + function, and the K segments of the OTX sequence are converted into degree segments corresponding to the K segments of the c + + programming language, respectively, according to the mapping relationship.
And step S204, generating a diagnosis program based on the target programming language according to the logic structure and the degree segment corresponding to the K segments of the target programming language.
Specifically, the logic structure includes an index relationship between function characters, so that an index relationship between degree segments corresponding to the K segments of the target programming language can be obtained, and then the degree segments corresponding to the K segments of the target programming language are generated into the c + + language-based diagnostic program according to the index relationship between the degree segments corresponding to the K segments of the target programming language.
In a specific application scenario, for example, a diagnostic data set created in advance based on an OTX standard is converted into a diagnostic program created based on a target programming language according to a preset data model, and when it is detected that a vehicle to be diagnosed is diagnosed through the diagnostic program, as shown in fig. 3, an interface function mian in the diagnostic program is called, where the interface function includes 2 function signatures, that is, WriteData and ReadData; wherein, as shown in fig. 4, the WriteData function signature associates two test sequences, WriteData _ a and WriteData _ B, when calling the WriteData function signature, because WriteData associates two test sequences, only one test sequence can be executed at this time, the internal implementation of the signature can determine the sequence to be executed according to the validity of the test sequence, for example, the validity parameter preset by the test sequence WriteData _ a is 1, the validity parameter preset by the test sequence WriteData _ B is 2, the environment variable is obtained, when the environment variable is 1, the test sequence WriteData _ a is executed, that is, the validity parameter of the test sequence WriteData _ a is determined to be valid, when the environment variable is 2, the test sequence WriteData _ B is executed, that is, the validity parameter of the test sequence WriteData _ B is determined to be valid, as shown in fig. 5, a code diagram of validity and declaration of the function signature is provided, the validity can determine the sequence to be executed according to the validity of the test sequence, where the reference is to be converted into an expression, after the declaration of the function signature, the sequence associated with the function signature must comply with the parameter hierarchy of the function signature (e.g., the number and type of input and output parameters must be consistent).
The N function signatures can be directly and sequentially called according to the arrangement sequence of the N function signatures, and the called function signatures are used as target function signatures; and executing the test sequences meeting preset conditions in all the test sequences associated with the target function signature to diagnose the vehicle to be diagnosed, wherein the logic and the specific implementation process among the test sequences are not required to be considered in the development process, the corresponding diagnosis function can be realized only according to the function signature associated with the test sequences, and the logic and the structure of the diagnosis program are not required to be modified when the new function is expanded, so that the development efficiency is improved, and the difficulty in expanding the new function is reduced.
Fig. 6 shows a block diagram of a vehicle diagnostic apparatus provided in the embodiment of the present application, corresponding to the vehicle diagnostic method described in the above embodiment, and only the relevant parts to the embodiment of the present application are shown for convenience of description.
Referring to fig. 6, the vehicle diagnostic apparatus 600 includes:
the first calling module 601 is configured to call an interface function in a diagnostic program when it is detected that a vehicle to be diagnosed is diagnosed through the diagnostic program, where the interface function includes N function signatures and an arrangement order of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1;
a second calling module 602, configured to sequentially call the N function signatures according to the arrangement order of the N function signatures, and use the called function signatures as target function signatures;
and the executing module 603 is configured to execute a test sequence that meets a preset condition among all test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed.
In one embodiment, the execution module includes:
a detection unit for detecting the number of test sequences associated with the target function signature;
a first execution unit, configured to execute, when detecting that there are multiple test sequences associated with the target function signature, a plurality of test sequences that satisfy a preset condition among the test sequences associated with the target function signature;
and the second execution unit is used for executing one test sequence associated with the target function signature when detecting that the number of the test sequences associated with the target function signature is one.
In one embodiment, the first execution unit specifically includes:
the first detection subunit is used for acquiring the environment variable of the vehicle to be diagnosed when detecting that the number of the test sequences associated with the target function signature is multiple;
the second detection subunit is used for detecting whether validity parameters matched with the environment variables exist in respective preset validity parameters in a plurality of test sequences associated with the target function signature;
and the execution subunit is used for executing the test sequence corresponding to the validity parameter matched with the environment variable if the test sequence exists.
In one embodiment, the vehicle diagnostic apparatus further includes:
and the conversion module is used for converting the diagnostic data set which is created in advance based on the OTX standard into a diagnostic program which is created based on the target programming language according to a preset data model.
In one embodiment, the vehicle diagnostic apparatus further includes:
and the compiling module is used for compiling the diagnostic program corresponding to the target programming language so as to convert the diagnostic program into a dynamic link library.
In one embodiment, the conversion module comprises:
an analysis unit for analyzing the logical structure of the diagnostic data set;
the classification unit is used for classifying the data content of the diagnosis data set according to preset classification marks to obtain K sections of OTX sequences respectively belonging to different classification marks; wherein K is not less than 1 and is an integer;
the conversion unit is used for respectively converting the K sections of OTX sequences into degree sections corresponding to K sections of target programming languages according to a function character mapping relation corresponding to each classification identifier in the K sections of OTX sequences in a preset data model;
and the generating unit is used for generating the diagnostic program based on the target programming language according to the logic structure and the degree segment corresponding to the K segments of the target programming language.
In one embodiment, the conversion module is specifically configured to: and converting a diagnostic data set created in advance based on the OTX standard into a diagnostic program programmed based on the C + + programming language according to a preset data model.
The N function signatures can be directly and sequentially called according to the arrangement sequence of the N function signatures, and the called function signatures are used as target function signatures; and executing the test sequences meeting preset conditions in all the test sequences associated with the target function signature to diagnose the vehicle to be diagnosed, wherein the logic and the specific implementation process among the test sequences are not required to be considered in the development process, the corresponding diagnosis function can be realized only according to the function signature associated with the test sequences, and the logic and the structure of the diagnosis program are not required to be modified when the new function is expanded, so that the development efficiency is improved, and the difficulty in expanding the new function is reduced.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 700 includes: a processor 701, a memory 702, and a computer program 703 stored in the memory 702 and executable on the processor 701. The steps in the vehicle diagnostic method embodiment are implemented when the processor 701 executes the computer program 703.
Illustratively, the computer program 703 may be divided into one or more units/modules, which are stored in the memory 702 and executed by the processor 701 to complete the present application. The one or more units/modules may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 703 in the electronic device 700. For example, the computer program 703 may be divided into a first calling module, a second calling module and an execution module, and specific functions of the modules are described in the foregoing embodiments, which are not described herein again.
The electronic device 700 may be a tablet computer, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a mobile phone, a vehicle diagnostic device, or other various electronic devices capable of processing vehicle data. The electronic device 700 may include, but is not limited to, a processor 701 and a memory 702. Those skilled in the art will appreciate that fig. 7 is merely an example of an electronic device 700 and does not constitute a limitation of electronic device 700 and may include more or fewer components than shown, or some components may be combined, or different components, e.g., electronic device 700 described above may also include input-output devices, network access devices, buses, etc.
The Processor 701 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 702 may be an internal storage unit of the electronic device 700, such as a hard disk or a memory of the electronic device 700. The memory 702 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the electronic device 700. Further, the memory 702 may include both an internal storage unit and an external storage device of the electronic device 700. The memory 702 is used for storing the computer program and other programs and data required by the electronic device 700. The memory 702 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the vehicle diagnostic device may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the above-described modules or units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, all or part of the flow in the method of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-mentioned computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium described above may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media excludes electrical carrier signals and telecommunications signals in accordance with legislation and patent practice. The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (9)

1. A vehicle diagnostic method, characterized by comprising:
when a vehicle to be diagnosed is diagnosed through a diagnostic program, calling an interface function in the diagnostic program, wherein the interface function comprises N function signatures and an arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1;
sequentially calling the N function signatures according to the arrangement sequence of the N function signatures, and taking the called function signatures as target function signatures;
executing the test sequence meeting the preset condition in all the test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed, wherein the test sequence comprises the following steps:
detecting a number of test sequences associated with the target function signature;
when detecting that the number of the test sequences associated with the target function signature is multiple, executing a plurality of test sequences meeting preset conditions in the test sequences associated with the target function signature;
executing one test sequence associated with the target function signature when detecting that the number of test sequences associated with the target function signature is one.
2. The vehicle diagnostic method according to claim 1, wherein when a plurality of test sequences associated with the target function signature is detected, executing a test sequence satisfying a preset condition among the plurality of test sequences associated with the target function signature includes:
when a plurality of test sequences associated with the target function signature are detected, acquiring an environment variable of the vehicle to be diagnosed;
detecting whether a validity parameter matched with the environment variable exists in respective preset validity parameters in a plurality of test sequences associated with the target function signature;
and if so, executing a test sequence corresponding to the validity parameter matched with the environment variable.
3. The vehicle diagnostic method according to claim 1 or 2, characterized in that before calling an interface function in the diagnostic program, the method further comprises:
and converting the diagnostic data set created in advance based on the OTX standard into a diagnostic program created based on the target programming language according to a preset data model.
4. The vehicle diagnostic method according to claim 3, characterized in that after converting a diagnostic data set created in advance based on the OTX standard into a diagnostic program created based on a target programming language according to a preset data model, the method further comprises:
and compiling the diagnostic program corresponding to the target programming language so as to convert the diagnostic program into a dynamic link library.
5. The vehicle diagnosis method according to claim 3, wherein the converting the diagnosis data set created in advance based on the OTX standard into the diagnosis program created based on the target programming language according to the preset data model includes:
parsing a logical structure of the diagnostic data set;
classifying the data content of the diagnostic data set according to preset classification marks to obtain K sections of OTX sequences respectively belonging to different classification marks; wherein K is not less than 1 and is an integer;
respectively converting the K-segment OTX sequence into a degree segment corresponding to a K-segment target programming language according to a function character mapping relation corresponding to each classification identifier in the K-segment OTX sequence in a preset data model;
and generating a diagnosis program based on the target programming language according to the logic structure and the degree section corresponding to the K sections of target programming languages.
6. The vehicle diagnosis method according to claim 5, wherein the converting the diagnosis data set created in advance based on the OTX standard into the diagnosis program created based on the target programming language according to the preset data model includes:
and converting a diagnostic data set created in advance based on the OTX standard into a diagnostic program programmed based on the C + + programming language according to a preset data model.
7. A vehicle diagnostic device characterized by comprising:
the diagnostic system comprises a first calling module, a second calling module and a third calling module, wherein the first calling module is used for calling an interface function in a diagnostic program when the vehicle to be diagnosed is diagnosed through the diagnostic program, and the interface function comprises N function signatures and the arrangement sequence of the N function signatures; wherein each function signature is associated with at least one test sequence, and N is an integer and is more than or equal to 1;
the second calling module is used for calling the N function signatures in sequence according to the arrangement sequence of the N function signatures and taking the called function signatures as target function signatures;
the execution module is used for executing a test sequence which meets a preset condition in all test sequences associated with the target function signature so as to diagnose the vehicle to be diagnosed;
the execution module includes:
a detection unit for detecting the number of test sequences associated with the target function signature;
a first execution unit, configured to execute, when detecting that there are multiple test sequences associated with the target function signature, a plurality of test sequences that satisfy a preset condition among the test sequences associated with the target function signature;
and the second execution unit is used for executing one test sequence associated with the target function signature when detecting that the number of the test sequences associated with the target function signature is one.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202011031179.9A 2020-09-27 2020-09-27 Vehicle diagnosis method and device, electronic equipment and storage medium Active CN112147983B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011031179.9A CN112147983B (en) 2020-09-27 2020-09-27 Vehicle diagnosis method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011031179.9A CN112147983B (en) 2020-09-27 2020-09-27 Vehicle diagnosis method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112147983A CN112147983A (en) 2020-12-29
CN112147983B true CN112147983B (en) 2022-01-04

Family

ID=73894276

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011031179.9A Active CN112147983B (en) 2020-09-27 2020-09-27 Vehicle diagnosis method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112147983B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113055250B (en) * 2021-03-29 2022-06-17 深圳市元征科技股份有限公司 Networking communication method, device, terminal equipment and storage medium
CN113408755A (en) * 2021-06-16 2021-09-17 深圳市道通科技股份有限公司 Automobile repair resource obtaining method, cloud platform and electronic equipment
CN114625106B (en) * 2022-03-07 2024-05-14 深圳市元征科技股份有限公司 Method, device, electronic equipment and storage medium for vehicle diagnosis

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007065585A1 (en) * 2005-12-06 2007-06-14 Volkswagen Ag Diagnostic method and diagnostic device for the function-oriented diagnosis of a system comprising interconnected components
CN102023922A (en) * 2010-12-28 2011-04-20 重庆恩菲斯软件有限公司 System and method for testing automotive electronic diagnostic software
CN103778061A (en) * 2014-01-17 2014-05-07 南京航空航天大学 Automatic detection and correction method for array out-of-bound errors
CN108227675A (en) * 2017-12-27 2018-06-29 深圳市元征软件开发有限公司 Vehicular diagnostic method, device, terminal and computer readable storage medium
CN108255152A (en) * 2017-12-26 2018-07-06 深圳市元征软件开发有限公司 Vehicular diagnostic method, diagnosis box and computer readable storage medium
CN110888418A (en) * 2019-12-23 2020-03-17 深圳市元征科技股份有限公司 Vehicle diagnosis method, device, equipment and readable storage medium
CN111552267A (en) * 2020-04-22 2020-08-18 深圳市元征科技股份有限公司 Vehicle diagnosis method and device and vehicle diagnosis equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104932480A (en) * 2015-04-29 2015-09-23 深圳市元征软件开发有限公司 Automobile diagnostic system design method and apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2007065585A1 (en) * 2005-12-06 2007-06-14 Volkswagen Ag Diagnostic method and diagnostic device for the function-oriented diagnosis of a system comprising interconnected components
CN102023922A (en) * 2010-12-28 2011-04-20 重庆恩菲斯软件有限公司 System and method for testing automotive electronic diagnostic software
CN103778061A (en) * 2014-01-17 2014-05-07 南京航空航天大学 Automatic detection and correction method for array out-of-bound errors
CN108255152A (en) * 2017-12-26 2018-07-06 深圳市元征软件开发有限公司 Vehicular diagnostic method, diagnosis box and computer readable storage medium
CN108227675A (en) * 2017-12-27 2018-06-29 深圳市元征软件开发有限公司 Vehicular diagnostic method, device, terminal and computer readable storage medium
CN110888418A (en) * 2019-12-23 2020-03-17 深圳市元征科技股份有限公司 Vehicle diagnosis method, device, equipment and readable storage medium
CN111552267A (en) * 2020-04-22 2020-08-18 深圳市元征科技股份有限公司 Vehicle diagnosis method and device and vehicle diagnosis equipment

Also Published As

Publication number Publication date
CN112147983A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN112147983B (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN111552267B (en) Vehicle diagnosis method and device and vehicle diagnosis equipment
US20210263841A1 (en) Machine code analysis for identifying software defects
CN112083709B (en) Vehicle diagnosis method, system, terminal device and storage medium
CN114895935A (en) Method and device for flashing vehicle ECU, electronic equipment and storage medium
CN112686019A (en) Vehicle sensor data analysis method, device and storage medium
CN112988215A (en) Method and device for realizing evaluation rule and evaluating user data and electronic equipment
CN112181411A (en) Menu generation method, menu generation device and diagnosis equipment
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN116521217A (en) Method, system and storage medium for rapidly configuring BSW based on AUTOSAR tool
CN115729560A (en) Program code processing method and device
CN115495363A (en) Software testing method, electronic equipment and readable storage medium
CN114879630A (en) Vehicle fault diagnosis method, device, equipment and readable storage medium
CN114611500A (en) Expression processing method and device, electronic equipment and computer readable storage medium
CN114625106A (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN110737431B (en) Software development method, development platform, terminal device and storage medium
CN113342430A (en) Fault code processing method and device, terminal equipment and readable storage medium
CN112433943A (en) Method, device, equipment and medium for detecting environment variable based on abstract syntax tree
CN113467815A (en) Application repair method and device for hot update, terminal equipment and storage medium
CN112162738B (en) Data conversion method and device, terminal equipment and storage medium
CN113467860B (en) Service logic execution method and device of program source code
CN112445797B (en) Vehicle diagnosis data reference method, device, terminal equipment and storage medium
CN117688564B (en) Detection method, device and storage medium for intelligent contract event log
CN112463194B (en) File data compatible method and device, terminal equipment and storage medium
CN117539761A (en) Test case supplementing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant