CN112181411A - Menu generation method, menu generation device and diagnosis equipment - Google Patents

Menu generation method, menu generation device and diagnosis equipment Download PDF

Info

Publication number
CN112181411A
CN112181411A CN202011022021.5A CN202011022021A CN112181411A CN 112181411 A CN112181411 A CN 112181411A CN 202011022021 A CN202011022021 A CN 202011022021A CN 112181411 A CN112181411 A CN 112181411A
Authority
CN
China
Prior art keywords
menu
diagnosed
source file
file
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.)
Pending
Application number
CN202011022021.5A
Other languages
Chinese (zh)
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 CN202011022021.5A priority Critical patent/CN112181411A/en
Publication of CN112181411A publication Critical patent/CN112181411A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01MTESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
    • G01M17/00Testing of vehicles
    • G01M17/007Wheeled or endless-tracked vehicles

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a menu generating method, a menu generating device, a diagnosis device and a computer readable storage medium, wherein the method comprises the following steps: loading a source file corresponding to a vehicle type according to the vehicle type of a vehicle to be diagnosed; generating a dynamic link library based on the source files, wherein each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function; generating a menu configuration file based on the source file and the dynamic link library; after the system to be diagnosed is determined, the menu configuration file is loaded, the name of the diagnosis function associated with the system to be diagnosed is obtained, and a diagnosis function menu of the system to be diagnosed is generated. By the aid of the method and the device, the diagnostic function menu can be dynamically generated, and the diagnostic equipment is more flexible to use.

Description

Menu generation method, menu generation device and diagnosis equipment
Technical Field
The present application belongs to the field of vehicle diagnosis technologies, and in particular, to a menu generation method, a menu generation apparatus, a diagnostic device, and a computer-readable storage medium.
Background
Conventional diagnostic software performs relevant diagnostic functions by setting up fixed system menus. This diagnostic approach, although simple, is also less flexible: if the vehicle type protocol changes or some functions are added to the electronic system of a certain vehicle type, research personnel are required to manually add corresponding menu options and codes.
Disclosure of Invention
The application provides a menu generation method, a menu generation device, a diagnosis device and a computer readable storage medium, which can realize dynamic generation of a diagnosis function menu and enable the use of the diagnosis device to be more flexible.
In a first aspect, the present application provides a menu generation method, including:
loading a source file corresponding to a vehicle type to be diagnosed according to the vehicle type of the vehicle;
generating a dynamic link library based on the source files, wherein each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
generating a menu configuration file based on the source file and the dynamic link library;
after a system to be diagnosed of the vehicle to be diagnosed is determined, the menu configuration file is loaded, the name of a diagnosis function associated with the system to be diagnosed is obtained, and a diagnosis function menu of the system to be diagnosed is generated, wherein the system to be diagnosed is an electronic system of the vehicle to be diagnosed selected by a user.
Optionally, after generating the diagnostic function menu of the system to be diagnosed, the menu generating method further includes:
determining a target diagnosis function according to a diagnosis function selection instruction input based on the diagnosis function menu;
and calling a target interface to execute the diagnosis operation of the target diagnosis function, wherein the target interface is an interface corresponding to the target diagnosis function in the dynamic link library.
Optionally, the invoking target interface includes:
searching a function address of the target interface in the menu configuration file according to the name of the target interface;
and calling the target interface through the function address.
Optionally, the loading a source file corresponding to the vehicle type according to the vehicle type of the vehicle to be diagnosed includes:
according to the type of the vehicle to be diagnosed, obtaining a preset vehicle type system configuration file and a source file corresponding to each system under the vehicle type;
detecting whether each source file is correct or not based on the vehicle type system configuration file;
and if all the source files are correct, loading all the source files.
Optionally, the detecting whether each source file is correct based on the vehicle type system configuration file includes:
determining the name of an electronic system corresponding to each acquired source file according to the file name of the source file;
detecting whether the name of an electronic system corresponding to the source file exists in the vehicle type system configuration file;
and if the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file, determining that the source file is correct.
Optionally, after detecting whether each source file is correct based on the vehicle model system configuration file, the menu generating method further includes:
if more than one source file is incorrect, an error prompt is output to remind that the source file is incorrect in content.
Optionally, the generating a dynamic link library based on the source file includes:
converting the content of the source file into a code aiming at each source file corresponding to the vehicle type to obtain a corresponding code file, wherein the code adopts a preset programming language;
compiling all the obtained code files into a dynamic link library.
In a second aspect, the present application provides a menu generating apparatus, including:
the system comprises a first loading unit, a second loading unit and a control unit, wherein the first loading unit is used for loading a source file corresponding to a vehicle type to be diagnosed according to the vehicle type of the vehicle;
the system comprises a first generation unit, a second generation unit and a third generation unit, wherein the first generation unit is used for generating a dynamic link library based on the source files, each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
a second generating unit, configured to generate a menu configuration file based on the source file and the dynamic link library;
and the second loading unit is used for loading the menu configuration file after a to-be-diagnosed system of the vehicle to be diagnosed is determined, obtaining the name of a diagnosis function associated with the to-be-diagnosed system, and generating a diagnosis function menu of the to-be-diagnosed system, wherein the to-be-diagnosed system is an electronic system of the vehicle to be diagnosed selected by a user.
Optionally, the menu generating device further includes:
a function determination unit for determining a target diagnosis function according to a diagnosis function selection instruction input based on the diagnosis function menu;
and an interface calling function, configured to call a target interface to perform a diagnosis operation of the target diagnosis function, where the target interface is an interface corresponding to the target diagnosis function in the dynamic link library.
Optionally, the invoking target interface includes:
a function address searching subunit, configured to search, in the menu configuration file, a function address of the target interface according to the name of the target interface;
and the target interface calling subunit is used for calling the target interface through the function address.
Optionally, the first loading unit includes:
a source file obtaining subunit, configured to obtain, according to the vehicle type of the vehicle to be diagnosed, a preset vehicle type system configuration file and a source file corresponding to each system under the vehicle type;
the source file detection subunit is used for detecting whether each source file is correct or not based on the vehicle type system configuration file;
and the source file loading subunit is used for loading each source file if the source files are correct.
Optionally, the source file detection subunit includes:
the name determining subunit is configured to determine, for each acquired source file, a name of an electronic system corresponding to the source file according to the file name of the source file;
a name detection subunit, configured to detect whether a name of an electronic system corresponding to the source file exists in the vehicle type system configuration file;
and the result determining subunit is used for determining that the source file is correct if the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file.
Optionally, the result determination subunit is further configured to output an error prompt to remind the source file that the content of the source file is incorrect, if more than one source file is incorrect.
Optionally, the first generating unit includes:
a conversion subunit, configured to convert, for each source file corresponding to the vehicle type, content of the source file into a code to obtain a corresponding code file, where the code is in a preset programming language;
and the compiling subunit is used for compiling all the obtained code files into the dynamic link library.
In a third aspect, the present application provides a diagnostic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the method of the first aspect as described above.
Compared with the prior art, the application has the beneficial effects that: the diagnostic function menu is not written in codes any more, but a dynamic link library is generated according to a source file corresponding to a vehicle type after a user selects the vehicle type of a vehicle to be diagnosed and before a system to be diagnosed is selected, a menu configuration file is further generated, then the user selects the system to be diagnosed, the name of a diagnostic function associated with the system to be diagnosed is obtained by loading the menu configuration file, and the dynamic generation of the diagnostic function menu is realized on the basis, so that the diagnostic equipment has more flexibility in use. It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
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 some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating an implementation of a menu generation method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a specific implementation of step 101 in a menu generation method provided in an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating a specific implementation of step 102 in the menu generating method according to the embodiment of the present application;
fig. 4 is a block diagram of a menu generating apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a diagnostic apparatus provided in 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 traditional diagnosis software executes related diagnosis functions by setting a fixed system menu, and the diagnosis process comprises the following steps: on a diagnosis interface, firstly, selecting the vehicle type of a vehicle to be diagnosed by a user; then, a user selects a specific electronic system, such as an engine system, an instrument system or an air bag system; after entering the diagnosis function menu page of the electronic system selected by the user, the corresponding diagnosis function is executed based on the selection of the user. Generally speaking, the page displays a fixed menu, and a developer needs to configure a corresponding menu for each electronic system below the page in advance according to a vehicle type protocol; that is, the diagnostic function that can be executed through the page is written in the code, which results in a rigid diagnostic manner and difficulty in flexibly adapting to changes in the external environment. Based on this, the embodiment of the application provides a menu generation method, a menu generation device, a diagnostic device and a computer readable storage medium, which can realize dynamic generation of a diagnostic function menu and enable the diagnostic device to be more flexible in use. In order to explain the technical solutions proposed in the embodiments of the present application, the following description will be given by way of specific examples.
A menu generation method provided in an embodiment of the present application is described below. Referring to fig. 1, the menu generating method includes:
step 101, loading a source file corresponding to a vehicle type according to the vehicle type of a vehicle to be diagnosed;
in the embodiment of the application, after the diagnostic device is connected with the vehicle to be diagnosed, the vehicle type of the vehicle to be diagnosed can be determined. The method includes the steps that a vehicle type selection interface is displayed on diagnosis equipment, and after a vehicle type selection instruction input by a user is received, a vehicle type pointed by the vehicle type selection instruction is determined as a vehicle type of a vehicle to be diagnosed; alternatively, after the Vehicle Identification Number (VIN) of the Vehicle to be diagnosed is read, the Vehicle type of the Vehicle to be diagnosed may be determined based on the VIN code. After the vehicle type of the vehicle to be diagnosed is determined, a source file corresponding to the vehicle type can be loaded. Illustratively, the source file may be in OTX format, provided by the vehicle manufacturer; the source file name includes the name and function type of the corresponding electronic system, and is connected with a _ ". Otx, wherein "EMS" denotes engine system and "Learning" denotes self-Learning function.
Specifically, considering that there may be a plurality of diagnostic functions in one system of the vehicle, each diagnostic function uniquely corresponds to one source file, and the source files corresponding to different diagnostic functions are different, the step 101 may include:
step 1011, according to the vehicle type of the vehicle to be diagnosed, obtaining a preset vehicle type system configuration file and a source file corresponding to each system under the vehicle type;
for each vehicle type, a vehicle type system configuration file may be created in advance, and the vehicle type system configuration file includes names of all systems of the vehicle type. After the vehicle type of the vehicle to be diagnosed is determined, a corresponding vehicle type system configuration file can be obtained according to the vehicle type; meanwhile, the source file corresponding to each system under the vehicle type provided by the corresponding vehicle manufacturer can be obtained according to the vehicle type.
Step 1012, detecting whether each source file is correct or not based on the vehicle model system configuration file;
in order to ensure that the source files corresponding to each system are correct and avoid the situations of more source files, less source files or non-correspondence of the source files and the systems, whether each source file acquired by the diagnostic equipment is correct or not can be detected based on the vehicle type system configuration file. Specifically, considering that a common vehicle manufacturer uses a system name as a file name of a source file, for each source file to be detected, the file name of the source file may be obtained first, and the file name of the source file is compared with a name of an electronic system configured in a vehicle type system configuration file of the vehicle type, that is, whether the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file is detected; if the system name in the vehicle type system configuration file is the same as the file name of the source file, namely, if the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file, determining that the source file is correct; otherwise, if the name of any system in the vehicle type system configuration file is not the same as the file name of the source file, that is, if the name of the electronic system corresponding to the source file does not exist in the vehicle type system configuration file, it is determined that the source file is incorrect.
Step 1013, if all the source files are correct, loading all the source files.
When all the source files acquired by the diagnostic equipment aiming at the vehicle type of the vehicle to be diagnosed are determined to be correct, the source files can be loaded to prepare for subsequent diagnosis operation; otherwise, when any source file is determined to be incorrect in the source files acquired by the diagnostic equipment according to the vehicle type of the vehicle to be diagnosed, an error prompt can be output to remind that the source file content acquired by the current diagnostic equipment is wrong.
In some embodiments, a package attribute may be set inside the source file, the value of the package attribute being consistent with the original file name of the source file, taking into account that the file name of the source file may be altered. An example of a source file is given below:
the file name of the source file ACU _ activationfunctino _ Check is the previous part of ". otx", that is, ACU _ activationfunctino _ Check. The source file comprises the following contents:
otx package=”ACU_ActivitationFunction_Check”
wherein, the "otx package" is the package attribute of the source file, and the specific package attribute value is "ACU _ actionationfailure _ Check". Since the content of the source file is rarely changed, the file name of the source file can be acquired by reading the package attribute of the source file, which increases the accuracy of information acquisition to a certain extent.
102, generating a dynamic link library based on the source files, wherein each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
in the embodiment of the application, after all the source files corresponding to the vehicle type of the vehicle to be diagnosed are loaded, the dynamic link library can be generated based on the source files. Specifically, the step 102 may include:
step 1021, converting the content of the source file into a code for each source file corresponding to the vehicle type to obtain a corresponding code file;
the diagnostic device may convert the source file into a code according to the flow logic of the source file, wherein the code is in a preset programming language, such as C or C + +, and the like, which is not limited herein. The resulting code file may be an h file or, alternatively, a cpp file, without limitation.
At step 1022, all the obtained code files are compiled into a dynamic link library.
The diagnostic device may compile all code files resulting from the conversion into a dynamically linked library. Wherein, considering that there may exist a plurality of functions based on the content of the corresponding code file converted from one source file, but among the plurality of functions, there may exist only one entry function; thus, each code file may export its own entry function as an interface to the dynamically linked library. It should be noted that the resulting naming rule of the entry function (i.e., interface) is: the package attribute value + "_ main". For example, the name of the entry function (i.e., interface) of the ACU _ activationcomplete _ Check source file in the above illustrated example may be: ACU _ activationcomplete _ Check _ main.
103, generating a menu configuration file based on the source file and the dynamic link library;
in the embodiment of the application, after all required source files are loaded and the dynamic link library is generated, the diagnostic device can continue to generate the menu configuration file based on the dynamic link library. Wherein, the menu configuration file comprises a plurality of "FUNCTION" nodes, namely diagnosis FUNCTION nodes; each "FUNCTION" node contains a NAME attribute "ECU-NAME" of a system, the NAME attribute value being obtained by a package attribute of a source file; moreover, each "FUNCTION" node also contains the name of a diagnostic FUNCTION, and the name of the diagnostic FUNCTION can be displayed as a menu item on a diagnostic FUNCTION menu page; in addition, each "FUNCTION" node also includes a source file corresponding to the diagnostic FUNCTION and a name of an interface derived based on the source file. An example of the file content of the menu profile is given below:
<FUNCTION ID=”ACU_ActivitationFunction_Check”Is-OTX=”ture”ECU-NAME=”ACU”>
< SHORT-NAME > Security check >
< LONG-NAME TI ═ a27e495-6309-4939-b929-1b9b742af4b "> swipe security check </LONG-NAME >
<OTXFile>ACU_ActivitationFunction_Check.otx</OTXFile>
<OTXFunc>ACU_ActivitationFunction_Check_main</OTXFunc>
</FUNCTION>
Wherein, the SHORT-NAME is a SHORT NAME of the diagnostic function, although the SHORT-NAME is a Chinese "security check" in the above example, it should be an English in practice in the application, and it is consistent with the function type of the corresponding source file; the LONG-NAME is the NAME of the real diagnostic function, and is specifically identified by a numerical ID to adapt to multiple languages. The diagnostic device finally searches the text library for the text (i.e., menu item) to be displayed on the diagnostic function menu for the diagnostic function based on the numeric ID identified by the LONG-NAME.
And 104, after the system to be diagnosed is determined, loading the menu configuration file to obtain the name of the diagnosis function associated with the system to be diagnosed so as to generate a diagnosis function menu of the system to be diagnosed, wherein the system to be diagnosed is an electronic system of the vehicle to be diagnosed selected by the user.
In the embodiment of the application, the electronic system of the vehicle to be diagnosed selected by the user is an electronic system waiting for diagnosis, namely, a system to be diagnosed. The diagnostic device may load the menu configuration file obtained in step 103 after determining the system to be diagnosed. Because the menu configuration file comprises a plurality of diagnosis function nodes of each system, and each diagnosis function node comprises the name of a diagnosis function, the name of the diagnosis function associated with the system to be diagnosed can be obtained from the loaded menu configuration file, and the diagnosis function menu of the system to be diagnosed is generated. That is, the names of the respective diagnostic functions associated with the system to be diagnosed are finally displayed in the diagnostic function menu.
It should be noted that, the steps 101-103 are executed and completed after the model of the vehicle to be diagnosed is determined and before the user selects the system to be diagnosed; when the user selects the electronic system of the vehicle to be diagnosed, that is, after the system to be diagnosed is determined, step 104 may be executed, the menu configuration file is loaded, and according to the "ECU-NAME" attribute of the menu configuration file, all the diagnostic functions (that is, menu items) of the system to be diagnosed are obtained and displayed on the screen of the diagnostic device for the user to select.
After step 104, the menu generating method further includes:
determining a target diagnosis function according to a diagnosis function selection instruction input based on the diagnosis function menu;
and calling a target interface to execute the diagnosis operation of the target diagnosis function, wherein the target interface is an interface corresponding to the target diagnosis function in the dynamic link library.
In the embodiment of the application, a user can input a diagnosis function selection instruction on a diagnosis function menu displayed by the diagnosis equipment, and the diagnosis function pointed by the diagnosis function selection instruction is a target diagnosis function. After the target diagnosis function is determined, an interface corresponding to the target diagnosis function in the generated dynamic link library, that is, a target interface, may be called. By calling the target interface, various diagnostic operations required by the target diagnostic function can be executed. Specifically, the procedure of calling the target interface is as follows: firstly, in a menu configuration file, a function address of the target interface is found out according to the name of the target interface, and then, the target interface can be obtained at the function address and called. For example, in the above illustrated example, if the user selects the diagnostic function "safe flash" in the diagnostic function menu of the ACU system, the information of the interface read by the diagnostic device in the menu configuration file is as follows:
<OTXFunc>ACU_ActivitationFunction_Check_main</OTXFunc>
and the function address of the ACU _ activationeffect _ Check _ main interface can be obtained through the GetProcAddress function. Then, the diagnostic device can execute the code flow of the interface from the function address to realize the call of the interface.
It should be noted that the diagnostic function proposed in the embodiment of the present application may be a special diagnostic function, such as ECU flashing, writing data, and the like, and is not limited herein.
Therefore, according to the scheme of the application, the diagnosis function menu is not written in the codes, but after the user selects the vehicle type of the vehicle to be diagnosed and before the user selects the system to be diagnosed, the dynamic link library is generated according to the source file corresponding to the vehicle type, the menu configuration file is further generated, then the user selects the system to be diagnosed, the name of the diagnosis function related to the system to be diagnosed is obtained by loading the menu configuration file, and the dynamic generation of the diagnosis function menu is realized on the basis of the name, so that the use of the diagnosis equipment is more flexible.
Corresponding to the menu generating method provided above, the embodiment of the present application further provides a menu generating device. As shown in fig. 4, the menu generating apparatus 400 in the embodiment of the present application includes:
a first loading unit 401, configured to load a source file corresponding to a vehicle type to be diagnosed according to the vehicle type;
a first generating unit 402, configured to generate a dynamic link library based on the source file, where each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
a second generating unit 403, configured to generate a menu configuration file based on the source file and the dynamic link library;
a second loading unit 404, configured to load the menu configuration file after determining a system to be diagnosed of the vehicle to be diagnosed, obtain a name of a diagnostic function associated with the system to be diagnosed, so as to generate a diagnostic function menu of the system to be diagnosed, where the system to be diagnosed is an electronic system of the vehicle to be diagnosed selected by the user.
Optionally, the menu generating apparatus 400 further includes:
a function determination unit for determining a target diagnosis function according to a diagnosis function selection instruction input based on the diagnosis function menu;
and the interface calling unit is used for calling a target interface to execute the diagnosis operation of the target diagnosis function, wherein the target interface is an interface corresponding to the target diagnosis function in the dynamic link library.
Optionally, the interface invoking unit includes:
a function address searching subunit, configured to search, in the menu configuration file, a function address of the target interface according to the name of the target interface;
and the target interface calling subunit is used for calling the target interface through the function address.
Optionally, the first loading unit 401 includes:
a source file obtaining subunit, configured to obtain, according to the vehicle type of the vehicle to be diagnosed, a preset vehicle type system configuration file and a source file corresponding to each system under the vehicle type;
the source file detection subunit is used for detecting whether each source file is correct or not based on the vehicle type system configuration file;
and the source file loading subunit is used for loading each source file if the source files are correct.
Optionally, the source file detection subunit includes:
the name determining subunit is configured to determine, for each acquired source file, a name of an electronic system corresponding to the source file according to the file name of the source file;
a name detection subunit, configured to detect whether a name of an electronic system corresponding to the source file exists in the vehicle type system configuration file;
and the result determining subunit is used for determining that the source file is correct if the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file.
Optionally, the result determination subunit is further configured to output an error prompt to remind the source file that the content of the source file is incorrect, if more than one source file is incorrect.
Optionally, the first generating unit 402 includes:
a conversion subunit, configured to convert, for each source file corresponding to the vehicle type, content of the source file into a code to obtain a corresponding code file, where the code is in a preset programming language;
and the compiling subunit is used for compiling all the obtained code files into the dynamic link library.
Therefore, according to the scheme of the application, the diagnosis function menu is not written in the codes, but after the user selects the vehicle type of the vehicle to be diagnosed and before the user selects the system to be diagnosed, the dynamic link library is generated according to the source file corresponding to the vehicle type, the menu configuration file is further generated, then the user selects the system to be diagnosed, the name of the diagnosis function related to the system to be diagnosed is obtained by loading the menu configuration file, and the dynamic generation of the diagnosis function menu is realized on the basis of the name, so that the use of the diagnosis equipment is more flexible.
Corresponding to the menu generating method provided above, an embodiment of the present application further provides a diagnostic apparatus, please refer to fig. 5, where the diagnostic apparatus 5 in the embodiment of the present application includes: a memory 501, one or more processors 502 (only one shown in fig. 5), and a computer program stored on the memory 501 and executable on the processors. Wherein: the memory 501 is used for storing software programs and units, and the processor 502 executes various functional applications and menu generation by running the software programs and units stored in the memory 501, so as to obtain resources corresponding to the preset events. Specifically, the processor 502 realizes the following steps by running the above-mentioned computer program stored in the memory 501:
loading a source file corresponding to a vehicle type to be diagnosed according to the vehicle type of the vehicle;
generating a dynamic link library based on the source files, wherein each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
generating a menu configuration file based on the source file and the dynamic link library;
after a system to be diagnosed of the vehicle to be diagnosed is determined, the menu configuration file is loaded, the name of a diagnosis function associated with the system to be diagnosed is obtained, and a diagnosis function menu of the system to be diagnosed is generated, wherein the system to be diagnosed is an electronic system of the vehicle to be diagnosed selected by a user.
Assuming that the above is the first possible implementation manner, in a second possible implementation manner provided on the basis of the first possible implementation manner, after the diagnostic function menu of the system to be diagnosed is generated, the processor 502 further implements the following steps when executing the computer program stored in the memory 501:
determining a target diagnosis function according to a diagnosis function selection instruction input based on the diagnosis function menu;
and calling a target interface to execute the diagnosis operation of the target diagnosis function, wherein the target interface is an interface corresponding to the target diagnosis function in the dynamic link library.
In a third possible implementation manner provided on the basis of the second possible implementation manner, the invocation target interface includes:
searching a function address of the target interface in the menu configuration file according to the name of the target interface;
and calling the target interface through the function address.
In a fourth possible embodiment based on the first possible embodiment, the second possible embodiment, or the third possible embodiment, the loading a source file corresponding to the vehicle type according to the vehicle type of the vehicle to be diagnosed includes:
according to the type of the vehicle to be diagnosed, obtaining a preset vehicle type system configuration file and a source file corresponding to each system under the vehicle type;
detecting whether each source file is correct or not based on the vehicle type system configuration file;
and if all the source files are correct, loading all the source files.
In a fifth possible implementation manner provided as a basis for the fourth possible implementation manner, the detecting whether each source file is correct based on the vehicle model system configuration file includes:
determining the name of an electronic system corresponding to each acquired source file according to the file name of the source file;
detecting whether the name of an electronic system corresponding to the source file exists in the vehicle type system configuration file;
and if the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file, determining that the source file is correct.
In a sixth possible implementation manner provided as a basis for the fourth possible implementation manner, after detecting whether each source file is correct based on the vehicle model system configuration file, the processor 502 further implements the following steps when executing the computer program stored in the memory 501:
if more than one source file is incorrect, an error prompt is output to remind that the source file is incorrect in content.
In a seventh possible implementation manner provided on the basis of the first possible implementation manner, the second possible implementation manner, or the third possible implementation manner, the generating a dynamic link library based on the source file includes:
converting the content of the source file into a code aiming at each source file corresponding to the vehicle type to obtain a corresponding code file, wherein the code adopts a preset programming language;
compiling all the obtained code files into a dynamic link library.
It should be understood that in the embodiments of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor may be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Memory 501 may include both read-only memory and random access memory and provides instructions and data to processor 502. Some or all of the memory 501 may also include non-volatile random access memory. For example, the memory 501 may also store device class information.
Therefore, according to the scheme of the application, the diagnosis function menu is not written in the codes, but after the user selects the vehicle type of the vehicle to be diagnosed and before the user selects the system to be diagnosed, the dynamic link library is generated according to the source file corresponding to the vehicle type, the menu configuration file is further generated, then the user selects the system to be diagnosed, the name of the diagnosis function related to the system to be diagnosed is obtained by loading the menu configuration file, and the dynamic generation of the diagnosis function menu is realized on the basis of the name, so that the use of the diagnosis equipment is more flexible.
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 system may refer to the 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 would 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 external device 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 system embodiments are merely illustrative, and for example, the division of the above-described modules or units is only one logical functional division, and in actual implementation, there may be another division, for example, multiple 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 embodiment.
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 can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. 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 storage medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer readable 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 storage medium may contain other contents which can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction, for example, in some jurisdictions, the computer readable storage medium does not include an electrical carrier signal and a telecommunication signal according to the legislation and the patent practice.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit 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 (10)

1. A menu generation method, comprising:
loading a source file corresponding to a vehicle type according to the vehicle type of a vehicle to be diagnosed;
generating a dynamic link library based on the source files, wherein each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
generating a menu configuration file based on the source file and the dynamic link library;
after a to-be-diagnosed system of the vehicle to be diagnosed is determined, the menu configuration file is loaded, the name of a diagnosis function associated with the to-be-diagnosed system is obtained, and a diagnosis function menu of the to-be-diagnosed system is generated, wherein the to-be-diagnosed system is an electronic system of the vehicle to be diagnosed selected by a user.
2. The menu generating method of claim 1, wherein after generating the diagnostic function menu of the system to be diagnosed, the menu generating method further comprises:
determining a target diagnostic function according to a diagnostic function selection instruction input based on the diagnostic function menu;
and calling a target interface to execute the diagnosis operation of the target diagnosis function, wherein the target interface is an interface corresponding to the target diagnosis function in the dynamic link library.
3. The menu generation method of claim 2, wherein the invoking a target interface comprises:
searching a function address of the target interface in the menu configuration file according to the name of the target interface;
and calling the target interface through the function address.
4. The menu generating method according to any one of claims 1 to 3, wherein the loading a source file corresponding to a vehicle type according to the vehicle type of the vehicle to be diagnosed includes:
according to the type of the vehicle to be diagnosed, obtaining a preset vehicle type system configuration file and a source file corresponding to each system under the vehicle type;
detecting whether each source file is correct or not based on the vehicle type system configuration file;
and if all the source files are correct, loading all the source files.
5. The menu generation method of claim 4, wherein the detecting whether each source file is correct based on the vehicle model system configuration file comprises:
determining the name of an electronic system corresponding to each acquired source file according to the file name of the source file;
detecting whether the name of an electronic system corresponding to the source file exists in the vehicle type system configuration file;
and if the name of the electronic system corresponding to the source file exists in the vehicle type system configuration file, determining that the source file is correct.
6. The menu generating method according to claim 4, wherein after said detecting whether each source file is correct based on the vehicle model system configuration file, the menu generating method further comprises:
if more than one source file is incorrect, an error prompt is output to remind that the source file is incorrect in content.
7. A menu generation method according to any one of claims 1 to 3, wherein the generating a dynamically linked library based on the source file comprises:
converting the content of the source file into a code aiming at each source file corresponding to the vehicle type to obtain a corresponding code file, wherein the code adopts a preset programming language;
compiling all the obtained code files into a dynamic link library.
8. A menu generating apparatus, comprising:
the system comprises a first loading unit, a second loading unit and a control unit, wherein the first loading unit is used for loading a source file corresponding to a vehicle type to be diagnosed according to the vehicle type of the vehicle;
the system comprises a first generation unit, a second generation unit and a third generation unit, wherein the first generation unit is used for generating a dynamic link library based on the source file, each source file uniquely corresponds to one interface of the dynamic link library, and each interface of the dynamic link library uniquely corresponds to one diagnostic function;
a second generating unit configured to generate a menu configuration file based on the source file and the dynamic link library;
and the second loading unit is used for loading the menu configuration file after a to-be-diagnosed system of the vehicle to be diagnosed is determined, obtaining the name of a diagnosis function associated with the to-be-diagnosed system, and generating a diagnosis function menu of the to-be-diagnosed system, wherein the to-be-diagnosed system is an electronic system of the vehicle to be diagnosed selected by a user.
9. A diagnostic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. 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 7.
CN202011022021.5A 2020-09-25 2020-09-25 Menu generation method, menu generation device and diagnosis equipment Pending CN112181411A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011022021.5A CN112181411A (en) 2020-09-25 2020-09-25 Menu generation method, menu generation device and diagnosis equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011022021.5A CN112181411A (en) 2020-09-25 2020-09-25 Menu generation method, menu generation device and diagnosis equipment

Publications (1)

Publication Number Publication Date
CN112181411A true CN112181411A (en) 2021-01-05

Family

ID=73943455

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011022021.5A Pending CN112181411A (en) 2020-09-25 2020-09-25 Menu generation method, menu generation device and diagnosis equipment

Country Status (1)

Country Link
CN (1) CN112181411A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110890A (en) * 2021-04-20 2021-07-13 上海华东汽车信息技术有限公司 Dynamic link library calling method and device, computer equipment and storage medium
CN113110994A (en) * 2021-04-19 2021-07-13 深圳市元征科技股份有限公司 Vehicle diagnosis method and device, electronic equipment and storage medium
CN113703868A (en) * 2021-08-30 2021-11-26 深圳市元征软件开发有限公司 Vehicle diagnostic software configuration method, electronic device and readable storage medium
CN113934198A (en) * 2021-10-19 2022-01-14 深圳市元征科技股份有限公司 Vehicle diagnosis method, vehicle diagnosis device, electronic device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5257376A (en) * 1990-09-04 1993-10-26 International Business Machines Corporation Method and apparatus for configuring a control program nucleus with a minimum impact on system availabiltiy
CN101408843A (en) * 2008-11-18 2009-04-15 广东威创视讯科技股份有限公司 Method and apparatus for generating program menu
CN102436473A (en) * 2011-09-29 2012-05-02 用友软件股份有限公司 Menu management device and menu management method
CN104932480A (en) * 2015-04-29 2015-09-23 深圳市元征软件开发有限公司 Automobile diagnostic system design method and apparatus
CN109814939A (en) * 2017-11-20 2019-05-28 华为技术有限公司 The production method and device of a kind of dynamic loading method, file destination
CN109933402A (en) * 2019-03-22 2019-06-25 深圳市元征科技股份有限公司 A kind of methods of exhibiting of function menu, system and relevant device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5257376A (en) * 1990-09-04 1993-10-26 International Business Machines Corporation Method and apparatus for configuring a control program nucleus with a minimum impact on system availabiltiy
CN101408843A (en) * 2008-11-18 2009-04-15 广东威创视讯科技股份有限公司 Method and apparatus for generating program menu
CN102436473A (en) * 2011-09-29 2012-05-02 用友软件股份有限公司 Menu management device and menu management method
CN104932480A (en) * 2015-04-29 2015-09-23 深圳市元征软件开发有限公司 Automobile diagnostic system design method and apparatus
CN109814939A (en) * 2017-11-20 2019-05-28 华为技术有限公司 The production method and device of a kind of dynamic loading method, file destination
CN109933402A (en) * 2019-03-22 2019-06-25 深圳市元征科技股份有限公司 A kind of methods of exhibiting of function menu, system and relevant device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
介石磊 等: "《新能源汽车与新技术》", 电子科技大学出版社, pages: 36 - 37 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113110994A (en) * 2021-04-19 2021-07-13 深圳市元征科技股份有限公司 Vehicle diagnosis method and device, electronic equipment and storage medium
CN113110890A (en) * 2021-04-20 2021-07-13 上海华东汽车信息技术有限公司 Dynamic link library calling method and device, computer equipment and storage medium
CN113703868A (en) * 2021-08-30 2021-11-26 深圳市元征软件开发有限公司 Vehicle diagnostic software configuration method, electronic device and readable storage medium
CN113934198A (en) * 2021-10-19 2022-01-14 深圳市元征科技股份有限公司 Vehicle diagnosis method, vehicle diagnosis device, electronic device, and storage medium

Similar Documents

Publication Publication Date Title
US10908925B2 (en) Dynamic loading method, and target file creation method and apparatus
CN112181411A (en) Menu generation method, menu generation device and diagnosis equipment
CN109976761B (en) Software development kit generation method and device and terminal equipment
US8418134B2 (en) Method for efficiently managing property types and constraints in a prototype based dynamic programming language
CN107506181A (en) Business processing, data processing method, device and electronic equipment
EP3143504A2 (en) Using an element in a first model to call a portion of a second model
CN112506492B (en) Visual point burying method supporting dynamic scene configuration
CN108170425B (en) Program code modification method and device and terminal equipment
CN115934346B (en) Operator automatic detection method and device, electronic equipment and medium
CN112147983B (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN110941655A (en) Data format conversion method and device
CN114168114A (en) Operator registration method, device and equipment
CN116737117A (en) Model development method based on Autosar architecture
CN111967269B (en) Business risk identification method and device and electronic equipment
CN112506503A (en) Programming method, device, terminal equipment and storage medium
CN109324838B (en) Execution method and execution device of single chip microcomputer program and terminal
CN114237557B (en) Method for debugging logic system design, electronic equipment and storage medium
CN113971019B (en) Data type creation method, device, server and medium
US9015681B1 (en) Creating and using array creation routines or a family of routines separate from algorithmic code
CN112181538B (en) Diagnostic flow execution method, device, equipment and storage medium
CN114443042A (en) Service arrangement execution method based on rule engine and related equipment
CN112052054A (en) Function calling method and device, electronic equipment and storage medium
US8135943B1 (en) Method, apparatus, and computer-readable medium for generating a dispatching function
CN110018828A (en) Source code inspection method, device and terminal device
CN113672490B (en) Function definition identification method, device and equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210105

RJ01 Rejection of invention patent application after publication