CN114329090A - Path reference searching method and device, electronic equipment and storage medium - Google Patents

Path reference searching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114329090A
CN114329090A CN202111648555.3A CN202111648555A CN114329090A CN 114329090 A CN114329090 A CN 114329090A CN 202111648555 A CN202111648555 A CN 202111648555A CN 114329090 A CN114329090 A CN 114329090A
Authority
CN
China
Prior art keywords
path
parameter
target
container object
determining
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
CN202111648555.3A
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 CN202111648555.3A priority Critical patent/CN114329090A/en
Publication of CN114329090A publication Critical patent/CN114329090A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The application is applicable to the technical field of automotive electronics, and provides a path reference searching method and device, electronic equipment and a storage medium. The method comprises the following steps: responding to a reference searching instruction in an OTX flow, and determining a target path and the layer number of the target path according to the reference searching instruction; determining a target container object in the plurality of first container objects according to the layer number; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter; and retrieving by using the target container object according to the target path to obtain a target parameter.

Description

Path reference searching method and device, electronic equipment and storage medium
Technical Field
The present application belongs to the field of automotive electronics technologies, and in particular, to a method and an apparatus for path parameter finding, an electronic device, and a storage medium.
Background
Open Test sequence eXchange (OTX) based is a standardized eXchange format for formally describing automated diagnostic sequences for target vehicles.
Test sequences are based on Extensible Markup Language (XML) and can be exchanged between process partners with different platforms and diagnostic testers. The diagnostic test sequence is used whenever an off-board test device diagnoses, tests, reprograms, or initializes a vehicle component or function having diagnostic capabilities.
When a test sequence of OTX is executed, especially when a request or response instruction is executed, because the number and the hierarchy of the involved Open Diagnostic interactive format (ODX) files are numerous, the reference relationship in the ODX file is complex, and the execution efficiency is low.
Disclosure of Invention
The embodiment of the application provides a method and a device for path reference finding, an electronic device and a storage medium, which can solve the problems.
In a first aspect, an embodiment of the present application provides a method for path referencing, including:
responding to a reference searching instruction in an OTX flow, and determining a target path and the layer number of the target path according to the reference searching instruction;
determining a target container object in the plurality of first container objects according to the layer number; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter;
and retrieving by using the target container object according to the target path to obtain a target parameter.
Optionally, determining a target path and the number of layers of the target path according to the reference finding instruction includes:
determining the path according to the short name in the layer name element in the parameter searching instruction;
and determining the number of layers according to the number of layer name elements in the parameter searching instruction.
Optionally, before responding to a reference finding instruction in an OTX flow and determining a target path and a layer number of the target path according to the reference finding instruction, the method includes:
acquiring the first container object; the first container object is a key-value pair container object, and the key-value pair is a key-value pair formed by a pointer of a parameter and a path matched with the parameter.
In a second aspect, an embodiment of the present application provides a method for path referencing, including:
acquiring a target data packet;
analyzing each parameter in the target data packet to obtain a path matched with each parameter and the layer number of the path;
for each parameter, according to the number of layers of the parameter matching path, storing a first corresponding relationship into a first container object with the corresponding number of layers, wherein the first corresponding relationship is the corresponding relationship between the parameter and the path matched with the parameter;
the first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
Optionally, the first container object is a key-value pair container object; saving the first corresponding relation to the first container object with the corresponding layer number, comprising:
saving a pointer to the parameter as a value of the first container object;
and saving the path matched with the parameter as the key of the first container object with the corresponding layer number.
Optionally, the obtaining the path matched with each parameter and the layer number of the path includes:
determining the path according to the short name reference relationship of the parameter;
and determining the layer number according to the jumping times quoted by the short name.
In a third aspect, an embodiment of the present application provides a path referencing apparatus, including:
the reference searching instruction response module is used for responding to a reference searching instruction in an OTX flow and determining a target path and the layer number of the target path according to the reference searching instruction;
a target container object determining module, configured to determine a target container object among the plurality of first container objects according to the number of layers; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter;
and the target parameter obtaining module is used for retrieving by using the target container object according to the target path to obtain a target parameter.
Optionally, the reference finding instruction response module includes:
a path determining module, configured to determine the path according to a short name in a layer name element in the parameter finding instruction;
and the path layer number determining module is used for determining the layer number according to the number of the layer name elements in the parameter searching instruction.
Optionally, the apparatus further comprises:
a first container object obtaining module, configured to obtain the first container object; the first container object is a key-value pair container object, and the key-value pair is a key-value pair formed by a pointer of a parameter and a path matched with the parameter.
In a fourth aspect, an embodiment of the present application provides a path referencing apparatus, including:
the target data packet acquisition module is used for acquiring a target data packet;
the parameter analysis module is used for analyzing each parameter in the target data packet to obtain a path matched with each parameter and the layer number of the path;
a matching relation storage module, configured to store, for each parameter, a first corresponding relation, which is a corresponding relation between the parameter and a path matched with the parameter, in a first container object with a corresponding number of layers according to the number of layers of the parameter matching path; the first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
Optionally, the first container object is a key-value pair container object; the matching relation storage module comprises:
a container object value saving module, configured to save the pointer of the parameter as the value of the first container object;
and the container object key storage module is used for storing the path matched with the parameters as the key of the first container object with the corresponding layer number.
Optionally, the parameter parsing module includes:
a reference relation determining path module, configured to determine the path according to the short name reference relation of the parameter;
and the number-of-layers-of-jump-time determining module is used for determining the number of layers according to the number of jumps quoted by the short name.
In a fifth aspect, an embodiment of the present application provides an electronic device, including:
a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the method steps of the first aspect and its optional embodiments and the method steps of the second aspect and its optional embodiments.
In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including: the computer readable storage medium stores a computer program which, when executed by a processor, performs the method steps of the first aspect and its optional embodiments described above, and the method steps of the second aspect and its optional embodiments described above.
In a seventh aspect, this application provides a computer program product, which when run on an electronic device, causes the electronic device to perform the method steps of the first aspect and its optional embodiments, and the method steps of the second aspect and its optional embodiments.
It should be understood that by determining the target container based on the number of layers of the path and retrieving the target parameter in the target container according to the path, each container object corresponds to the number of layers of the path, and the container object contains the parameter and the path corresponding relationship, the target parameter is prevented from being queried in the ODX file with a large number of files and layers through the reference relationship, and the query efficiency is improved.
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 based on these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a path referencing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a path referencing method according to another embodiment of the present application;
FIG. 3 is a flow chart illustrating a method of data processing according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a method for path referencing according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a path referencing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device 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.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to" determining "or" in response to detecting ". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Before describing the path-finding method provided by the embodiment of the present application, for convenience of understanding of the embodiment of the present application, the following describes a principle of the path-finding method provided by the embodiment of the present application and related concepts involved in the embodiment of the present application.
Container (container): and the class template is used for storing data. Data structures such as variable-length arrays, linked lists, balanced binary trees, etc. are all implemented as containers in the STL. When a programmer uses a container, i.e., instantiates a container class template as a container class, it will indicate what type of element is stored in the container. The container can store variables of basic types and objects.
map, an associative array in computer science, is an abstract data structure that contains non-repeating ordered pairs similar to (keys, values), ordered by key, keys being unique. For example, map < string, int > MyObject2TypeMap, where a series of pair < string, int > objects are stored.
Extensible Markup Language (XML), a subset of standard universal Markup Language. XML is a markup language for marking electronic documents to be structured. It can be used to mark data, define data types, and is a source language that allows a user to define his or her own markup language. XML is a common data exchange format.
The Open diagnostic data exchange (ODX) is a data file used by a standard architecture diagnostic instrument (MVCI) established by the Association for standardization of Automation and measurement Systems (ASAM). The ODX is a diagnostic file with a standardized format, and when different vehicles or different ECUs are diagnosed, only the ODX file matched with the vehicle type or the ECU needs to be loaded, and the diagnostic instrument does not need to be changed. The ODX unifies the format of the diagnostic file, so that format conversion is not needed when the diagnostic file is exchanged in research and development, test, production, after-sale departments and the like.
The SHORT NAME (SHORT-NAME) identifies an ODX object. Its length is limited to 128 characters. A short name consists of letters, numbers and a _ "character. The following expression describes the syntax of the short name [ a-zA-Zo-9] +. In all cases of possible reuse of objects, these objects are connected to other objects by references (links odx-link in XML). Since these links should sometimes be created interactively using editor tools, the set of characteristic properties of the object can be reused by reference: SHORT NAME SHORT-NAME (unique identifier for this particular object class).
The Open Test sequence eXchange format (OTX) is a standardized eXchange format, standardized in ISO 13209, for formally describing automated diagnostic sequences, such as system testing or directed debugging.
The diagnostic sequences are XML based and can be exchanged between process partners with different platforms and diagnostic testers. The diagnostic test sequence is used whenever an off-board test device diagnoses, tests, reprograms, or initializes a vehicle component or function having diagnostic capabilities.
The test order in the diagnostic sequence defines the order of interaction between the user (i.e., the plant or assembly line worker), the diagnostic application (test device) and the vehicle communication interface, as well as any calculations and decisions that must be performed. These test sequences are like a flow composed of a series of nodes in a flow chart in a certain order.
When a test sequence of OTX is executed, especially when a request or response instruction is executed, the reference relationship in an ODX file is complicated because the number and the hierarchy of the involved Open Diagnostic eXchange (ODX) files are numerous.
When a request or response instruction of the test sequence of the OTX is executed, the ODX file needs to be traversed, and the parameters corresponding to the path of the request or response instruction are acquired by stepwise querying according to the path of the request or response instruction. The parameters are also called diagnosis parameters and are used for analyzing the request command or analyzing the data returned by the ECU in the response command. Each time a request or response instruction is executed, the parameters corresponding to the path of the request or response instruction are acquired by querying step by step according to the path of the request or response instruction, and because the number and the layers of the ODX files are numerous, the reference relationship in the ODX files is complex, and the execution efficiency is low.
In order to solve the above problem, an embodiment of the present application provides a path referencing method. In order to explain the technical solution proposed in the present application, the following description will be given by way of specific examples.
The following describes a path reference method proposed in the embodiments of the present application. The path searching method is applied to electronic equipment, and the electronic equipment can be vehicle diagnosis equipment, vehicle control equipment, or computing equipment such as a desktop computer, a notebook computer, a palm computer, a smart phone, a cloud server and the like with an ECU communication interface of a vehicle.
Fig. 1 illustrates a path referencing method provided in an embodiment of the present application, which is applied to the electronic device described above and can be implemented by software and/or hardware of the electronic device. As shown in fig. 1, the method includes steps S110 to S130. The specific realization principle of each step is as follows:
s110, responding to a reference searching instruction in an OTX flow, and determining a target path and the layer number of the target path according to the reference searching instruction.
In some embodiments, the reference instruction may be a request instruction or a corresponding instruction in an OTX flow. When the electronic device executes the OTX process, if the OTX process is executed to a node requesting or responding to the instruction, the target path and the number of layers of the target path are determined according to the layer name elements aggregated in the node of the reference finding instruction. The layer name element is typically the element named "stepByName".
In some specific examples, determining a target path and a number of layers of the target path according to the reference finding instruction includes: determining the path according to the short name in the layer name element in the parameter searching instruction; and determining the number of layers according to the number of layer name elements in the parameter searching instruction.
See, for example, the following code fragments for OTX response instructions:
<diag:responseParameters>
<diag:name value=“dummy”xsi:type=“StringLiteral”/>
<diag:responseParam>
<diag:target name=“DIDF187Output”xsi:type=“StringVariable”>
<diag:path>
<stepByName value=”DataRacord”xsi:type=“StringVariable”/>
<stepByName value=”DIDF187_SparePartNamber_ASCII_80_bits”xsi:type=“StringVariable”/>
</diag:path>
</diag:responseParam>
</diag:responseParameters>
and when the OTX flow is executed to the < diag: responseParameters > node, processing a parameter searching instruction corresponding to the node, and determining the layer number according to the number of < stepByName > nodes in the < diag: path > node aggregated by the response instruction. The value in the < stepByName > node corresponds to a short name for indexing a corresponding parameter, and the value is combined in a preset order to form a path for indexing the corresponding parameter. The preset order may be an OTX order.
And S120, determining a target container object in the plurality of first container objects according to the layer number.
In some embodiments, an electronic device obtains a plurality of first container objects in advance, where each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter.
In some embodiments, the electronic device determines the target container object at the plurality of first container objects according to a number of layers of the path. For example, the electronic device obtains 3 first container objects in advance, where the first container object corresponds to a parameter with only one layer of path, the second first container object corresponds to a parameter with two layers of paths, and the third first container object corresponds to a parameter with three layers of paths. Referring to the above code segment, when the OTX flow is executed to the < diag: responseParameters > node, the parameter searching instruction corresponding to the node is processed, and the number of layers is determined according to the number of < stepByName > nodes in the < diag: path > node aggregated by the response instruction. And if the layer number is two, taking the second first container object as the target container object.
For example, three different layer number map container objects are defined separately:
map < otxSTRING, otxParameter > m _ sndirecty 2Param is used to store the short name of a request command (request) or a response command (response) and the corresponding parameter pointer.
map < otxSTRING, otxParameter > > m _ snindelect 2Param is used to store parameters (parameters) of a request command (request) or a response command (response) linked to the connection path of the last level parameter and the specific parameter pointer addressed by a table key (tablekey), if the table row (tablerow) is linked to not a structure (structure) type algorithm but a DOP (DATA-OBJECT-PROP) type algorithm, the key of map is the short name of DOP.
map < otxSTRING, otxParameter > > m _ SNHardly2Param is used to store the connection path of the parameter of the request or response to the parameter linked to by the primary structure algorithm via tablerow and the specific parameter pointer addressed, such as the global negative response.
In the above example, the number of parameter layers of the response command involved in the code of the OTX response instruction is two, and the target container object is a map < otxSTRING, an otxpparameter > > m _ SNIndirectly2Param object.
And S130, retrieving by using the target container object according to the target path to obtain a target parameter.
In some embodiments, the electronic device performs retrieval by using the target container object according to the target path to obtain a target parameter.
In some embodiments, the first container object is a key-value pair container object, the key-value pair being a key-value pair formed by a path whose pointer to a parameter matches the parameter. Specifically, the path is used as a key, and the pointer of the parameter is used as a value. For example, map container object: map < otxSTRING, otxParameter >.
Referring to the above code fragment, "value" in the < stepByName > node corresponds to a short name of the index corresponding parameter, and combining "value" in a predetermined order constitutes a path of the index corresponding parameter. And searching in the target container object by using the path to obtain a pointer of the target parameter, and further obtaining the target parameter through the pointer of the target parameter.
Take container object map < otxSTRING, otxParameter > > m _ snlndicirectly 2Param as an example. When the request command in the code of the OTX response instruction is responded, the pointer of the target parameter is obtained through the 'value' step-by-step index in the two < stepByName > nodes, and then the target parameter is obtained. Specifically, in a path parameter-finding interface called by the OTX process, according to an incoming parameter path level, a find function of a map container object of a corresponding level is called, and an incoming parameter path is searched to obtain a correct target parameter object.
It should be understood that by determining the target container based on the number of layers of the path and retrieving the target parameter in the target container according to the path, each container object corresponds to the number of layers of the path, and the container object contains the parameter and the path corresponding relationship, the target parameter is prevented from being queried in the ODX file with a large number of files and layers through the reference relationship, and the query efficiency is improved.
On the basis of the above embodiment of the path reference finding method shown in fig. 1, before responding to a reference finding instruction in an OTX flow and determining a target path and a layer number of the target path according to the reference finding instruction, as shown in fig. 2, the method further includes step S010:
s010, acquiring the first container object; the first container object is a key-value pair container object, and the key-value pair is a key-value pair formed by a pointer of a parameter and a path matched with the parameter.
In some embodiments, the electronic device has previously acquired a plurality of first container objects.
In some specific examples, the electronic device has previously obtained a plurality of first container objects by parsing the PDX file package.
In other specific examples, an automobile vendor provides a server, or a third party service provider provides a computing device, and the server or computing device pre-generates the plurality of first container objects by parsing the PDX file package. The electronic device obtains the first container object from a server or computing device via a wired and/or wireless network connection.
In order to generate the first container object required by the above embodiment, the present application provides a data processing method, and the data processing method may be applied to the electronic device, a server provided by an automobile manufacturer, and a computing device provided by a third party. May be implemented by software and/or hardware of an electronic device, server, or computing device.
Fig. 3 illustrates a method for path referencing according to an embodiment of the present application, where the method includes steps S310 to S330. The specific realization principle of each step is as follows:
s310, acquiring a target data packet.
In some embodiments, the destination data packet is a switched data format data packet, such as an XML data packet. The target data packet may be a diagnostic data packet of the target vehicle. The target vehicle is a vehicle that needs to be diagnosed. The diagnostic data packet may be an ODX protocol-based data file, and may specifically be a PDX file packet.
In some embodiments, an electronic device, such as a vehicle diagnostic device, obtains a target data packet from a server of an automobile manufacturer. In other embodiments, the server of the automobile manufacturer retrieves the target data packet from a memory communicatively coupled thereto. In still other embodiments, a computing device provided by a third party obtains the target data package from a server of the automobile manufacturer.
S320, analyzing each parameter in the target data packet, and acquiring a path matched with each parameter and the layer number of the path.
In some embodiments, the parameter lists of the request command and the response command in the target data packet are traversed, and the path with the matched parameters and the layer number of the path are obtained.
In some specific examples, obtaining the path with the matched parameters and the number of layers of the path includes: determining the path according to the short name reference relationship of the parameter; and determining the layer number according to the jumping times quoted by the short name.
It should be understood that the short name references for parameters are referenced level-by-level, and the number of levels may be determined by referencing the short name to a level pointing to a particular parameter in the ODX file for a request command or a response command. And combining the short names layer by layer to form a short name path. The short names can be combined layer by layer in a nested mode or in a series mode.
S330, aiming at each parameter, according to the number of layers of the parameter matching path, storing a first corresponding relationship into a first container object with the corresponding number of layers, wherein the first corresponding relationship is the corresponding relationship between the parameter and the path matched with the parameter. The first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
In some embodiments, the first container object is a key-value pair container object, such as a map object. Saving the first corresponding relation to the first container object with the corresponding layer number, comprising: saving a pointer to the parameter as a value of the first container object; and saving the path matched with the parameter as the key of the first container object with the corresponding layer number. E.g., a map container object, an otxSTRING for map < otxSTRING, otxParameter > for holding paths that match the parameters, and an otxParameter for holding pointers to parameters.
In some embodiments, the main body for executing the steps of the embodiment shown in fig. 3 is the electronic device, such as a vehicle diagnostic apparatus.
The diagnostic data types for the request command and the response command defined in the code of the electronic device parsing the ODX protocol, and the three map container objects defined in the diagnostic data types for the request command and the response command, respectively, may be defined:
map < otxSTRING, otxParameter > m _ SNDirectly2Param is used to store the short name otxSTRING and the corresponding parameter pointer otxParameter of the request command (request) or the response command (response).
map < otxSTRING, otxParameter > > m _ snindelect 2Param is used to store parameters (parameters) of a request command (request) or a response command (response) linked to the connection path of the last level parameter and the specific parameter pointer addressed by a table key (tablekey), if the table row (tablerow) is linked to not a structure (structure) type algorithm but a DOP (DATA-OBJECT-PROP) type algorithm, the key of map is the short name of DOP.
map < otxSTRING, otxParameter > > m _ SNHardly2Param is used to store the connection path of the parameter of the request or response to the parameter linked to by the primary structure algorithm via tablerow and the specific parameter pointer addressed, such as the global negative response.
In the link of analyzing a PDX automobile source file provided by an automobile manufacturer, the automobile diagnostic instrument stores parameter lists of the analyzed request command and the analyzed response command into corresponding map containers respectively according to the index levels of the parameters. When the path is required to be searched, the container object of the corresponding layer is called, the target parameter can be rapidly obtained, repeated searching in an ODX file is not required, and the running efficiency of the vehicle diagnostic apparatus is improved.
In other embodiments, the execution subject for executing the steps of the embodiment shown in fig. 3 is the above-mentioned server or third-party device. In which case the electronic device obtains the first container object from a server or a third party device. Referring to the above embodiment, the server or the third-party device parses the PDX file, stores the parameters in the parsed diagnosis parameter list into the map container object of the corresponding hierarchy according to the parameter path hierarchy, and stores the parameters in a form that can be acquired by the electronic device. For example, map container objects of different hierarchies are stored in the form of data tables.
It is noted that this example takes a 3-layer path as an example. It should be understood that the actual path hierarchy may be more or less, and may be increased or decreased according to the actual situation.
It will be appreciated that the various examples described above may be combined or augmented in logic. By way of example, and not limitation, the present application provides a specific example as shown in fig. 4 to better understand the implementation of the embodiments of the present application.
The process flow in this example is generally divided into two phases.
The first stage is the process of parsing the package of files based on the ODX diagnostic protocol to obtain the first container object.
Wherein, the first stage can be implemented by an electronic device, a server or a third-party device, and for convenience of description, the following description takes the implementation of the electronic device as an example.
The second stage is a process of calling a path reference searching interface in the OTX process and obtaining the target parameters by utilizing the first container object. The second stage may be implemented by an electronic device, such as a vehicle diagnostic device.
In the first stage, three map container objects may be defined in the diagnostic data types of the request command and the response command defined in the code of the parsing ODX protocol, and in the diagnostic data types of the request command and the response command, respectively. Map1, map2 and map3 in me correspond to simple to complex path hierarchies and mapping relations thereof capable of indexing to specific parameter objects, respectively.
Specifically, map1 is map < otxSTRING, otxParameter > m _ sndirecty 2Param for storing short name otxSTRING and corresponding parameter pointer otxParameter of request command (request) or response command (response).
map2 is map < otxSTRING, otxParameter > m _ snlndicopty 2Param for storing parameters (parameter) of request command (request) or response command (response) linked to the connection path of the last level parameter and the specific parameter pointer addressed by table key (tablekey), if table row (tablerow) is linked to not structure (structure) type algorithm but to DOP (DATA-OBJECT-PROP) type algorithm, key of map is short name of DOP.
map3 is map < otxSTRING, otxParameter > > > m _ SNHardly2Param for storing the connection path of the parameter of request or response to the parameter linked to by the primary structure algorithm via tablow and the specific parameter pointer addressed, such as a global negative response.
The electronic device obtains the PDX data packet from a server from the automobile manufacturer. And analyzing the PDX data packet. And providing a parsing interface for requesting commands and responding commands in a parsing program of the electronic equipment, and traversing the parsed parameter list. In the analysis process, determining the path of the parameter according to the short name reference relationship of the parameter; and determining the layer number of the path according to the jumping times referenced by the short name.
If the number of the parameter path layers is 1, storing the parameter pointer and the parameter path into map 1; if the number of the parameter path layers is 2, the parameter pointer and the parameter path are stored in map 2; if the number of parameter path layers is 3, the parameter pointer and the parameter path are saved in the map 3.
In the second stage, when the electronic device executes the OTX process, the parameter searching instruction, such as a request instruction or a response instruction, is executed, and the parameter needs to be obtained according to the parameter path. The program of the electronic device may provide a path reference interface for OTX flow call. The input of the interface is a parameter path, and the output is a target parameter. In the interface, the number of layers of the incoming parameter path is determined. If the parameter path layer number is 1, taking map1 as a target container object; if the parameter path layer number is 2, taking map2 as a target container object; if the parameter path layer number is 3, map3 is set as the target container object. And calling a find function of the map container object of the corresponding level, and searching an incoming parameter path to obtain a correct parameter object.
According to the ODX protocol, three map container objects are added in the types of the request command and the response command, and respectively correspond to three mappings from simple to complex diagnostic parameter path hierarchies to corresponding diagnostic parameter objects. In the path parameter searching interface called by the OTX process, the find function of the map container object of the corresponding level is called according to the incoming parameter path level to search the incoming parameter path to obtain the correct parameter object, and the efficiency is higher than that of directly traversing the parameter list to match each parameter.
The invention respectively stores the parameters in the analyzed diagnosis parameter list in the ODX analysis interfaces of the request command and the response command in advance into the map container object of the corresponding layer according to the parameter path layer, and processes the parameters in the map container object in comparison with the parameters extended to the path reference interface called by the OTX process, thereby occupying less response time and having better user experience.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Corresponding to the above-mentioned path referencing method shown in fig. 1, fig. 5 shows a path referencing apparatus M100 according to an embodiment of the present application, including:
a reference finding instruction response module M110, configured to respond to a reference finding instruction in an OTX flow, and determine a target path and a layer number of the target path according to the reference finding instruction;
a target container object determining module M120, configured to determine a target container object among the plurality of first container objects according to the layer number; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter;
and a target parameter obtaining module M130, configured to perform retrieval by using the target container object according to the target path to obtain a target parameter.
Optionally, the reference finding instruction response module includes:
a path determining module, configured to determine the path according to a short name in a layer name element in the parameter finding instruction;
and the path layer number determining module is used for determining the layer number according to the number of the layer name elements in the parameter searching instruction.
Optionally, the apparatus further comprises:
a first container object obtaining module, configured to obtain the first container object; the first container object is a key-value pair container object, and the key-value pair is a key-value pair formed by a pointer of a parameter and a path matched with the parameter.
It is understood that various embodiments and combinations of the embodiments in the above embodiments and their advantages are also applicable to this embodiment, and are not described herein again.
Corresponding to the above-mentioned path referencing method shown in fig. 3, fig. 6 shows a data processing apparatus M200 according to an embodiment of the present application, including:
a target data packet obtaining module M210, configured to obtain a target data packet;
a parameter analyzing module M220, configured to analyze each parameter in the target data packet, and obtain a path matched with each parameter and a layer number of the path;
a matching relationship storage module M230, configured to, for each parameter, store a first corresponding relationship into a first container object with a corresponding number of layers according to the number of layers of the parameter matching path, where the first corresponding relationship is a corresponding relationship between the parameter and a path matched with the parameter; the first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
Optionally, the first container object is a key-value pair container object; the matching relation storage module comprises:
a container object value saving module, configured to save the pointer of the parameter as the value of the first container object;
and the container object key storage module is used for storing the path matched with the parameters as the key of the first container object with the corresponding layer number.
Optionally, the parameter parsing module includes:
a reference relation determining path module, configured to determine the path according to the short name reference relation of the parameter;
and the number-of-layers-of-jump-time determining module is used for determining the number of layers according to the number of jumps quoted by the short name.
It is understood that various embodiments and combinations of the embodiments in the above embodiments and their advantages are also applicable to this embodiment, and are not described herein again.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device is used for implementing the electronic device, the server or the computing device provided by the third party in the above embodiments. As shown in fig. 7, the electronic device D10 of this embodiment includes: at least one processor D100 (only one is shown in fig. 7), a memory D101, and a computer program D102 stored in the memory D101 and operable on the at least one processor D100, wherein the processor D100 implements the steps of any of the method embodiments described above when executing the computer program D102.
In some embodiments, the processor D100, when executing the computer program D102, performs the following steps: responding to a reference searching instruction in an OTX flow, and determining a target path and the layer number of the target path according to the reference searching instruction;
determining a target container object in the plurality of first container objects according to the layer number; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter;
and retrieving by using the target container object according to the target path to obtain a target parameter.
Optionally, when the processor D100 executes the computer program D102 to implement the step of determining the target path and the layer number of the target path according to the reference finding instruction, the following steps are specifically implemented:
determining the path according to the short name in the layer name element in the parameter searching instruction;
and determining the number of layers according to the number of layer name elements in the parameter searching instruction.
Optionally, the processor D100 executes the computer program D102 to implement, before the step of determining, in response to a reference finding instruction in an OTX flow, a target path and a layer number of the target path according to the reference finding instruction, the following steps are further implemented:
acquiring the first container object; the first container object is a key-value pair container object, and the key-value pair is a key-value pair formed by a pointer of a parameter and a path matched with the parameter.
In some embodiments, the processor D100, when executing the computer program D102, performs the following steps: acquiring a target data packet;
analyzing each parameter in the target data packet to obtain a path matched with each parameter and the layer number of the path;
for each parameter, according to the number of layers of the parameter matching path, storing a first corresponding relationship into a first container object with the corresponding number of layers, wherein the first corresponding relationship is the corresponding relationship between the parameter and the path matched with the parameter;
the first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
Optionally, the first container object is a key-value pair container object; when the processor D100 executes the computer program D102 to implement the step of storing the first corresponding relationship into the first container object with the corresponding number of layers, the following steps are specifically implemented:
saving a pointer to the parameter as a value of the first container object;
and saving the path matched with the parameter as the key of the first container object with the corresponding layer number.
Optionally, when the processor D100 executes the computer program D102 to implement the steps of obtaining the paths matched with the parameters and the number of layers of the paths, the following steps are specifically implemented:
determining the path according to the short name reference relationship of the parameter;
and determining the layer number according to the jumping times quoted by the short name.
The electronic device D10 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The electronic device may include, but is not limited to, a processor D100, a memory D101. Those skilled in the art will appreciate that fig. 7 is merely an example of the electronic device D10 and does not constitute a limitation of the electronic device D10, and may include more or fewer components than those shown, or some components in combination, or different components, such as input output devices, network access devices, etc.
Processor D100 may be a Central Processing Unit (CPU), and Processor D100 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage D101 may be an internal storage unit of the electronic device D10 in some embodiments, such as a hard disk or a memory of the electronic device D10. In other embodiments, the memory D101 may also be an external storage device of the electronic device D10, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device D10. Further, the memory D101 may also include both an internal storage unit and an external storage device of the electronic device D10. The memory D101 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer programs. The memory D101 may also be used to temporarily store data that has been output or is to be output.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
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 function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform 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.
The embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments may be implemented.
Embodiments of the present application provide a computer program product, which when executed on an electronic device, enables the electronic device to implement the steps in the above method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium and can implement the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, and software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
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/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. 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 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 (10)

1. A method for path referencing, comprising:
responding to a reference searching instruction in an OTX flow, and determining a target path and the layer number of the target path according to the reference searching instruction;
determining a target container object in the plurality of first container objects according to the layer number; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter;
and retrieving by using the target container object according to the target path to obtain a target parameter.
2. The method of claim 1, wherein determining a target path and a number of layers for the target path based on the reference finding instruction comprises:
determining the path according to the short name in the layer name element in the parameter searching instruction;
and determining the number of layers according to the number of layer name elements in the parameter searching instruction.
3. The method of claim 1, wherein before determining a target path and a number of layers of the target path according to a reference finding instruction in response to the reference finding instruction in the OTX flow, the method comprises:
acquiring the first container object; the first container object is a key-value pair container object, and the key-value pair is a key-value pair formed by a pointer of a parameter and a path matched with the parameter.
4. A method of data processing, comprising:
acquiring a target data packet;
analyzing each parameter in the target data packet to obtain a path matched with each parameter and the layer number of the path;
for each parameter, according to the number of layers of the parameter matching path, storing a first corresponding relationship into a first container object with the corresponding number of layers, wherein the first corresponding relationship is the corresponding relationship between the parameter and the path matched with the parameter;
the first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
5. The method of claim 4, wherein the first container object is a key-value pair container object; saving the first corresponding relation to the first container object with the corresponding layer number, comprising:
saving a pointer to the parameter as a value of the first container object;
and saving the path matched with the parameter as the key of the first container object with the corresponding layer number.
6. The method of claim 4, wherein obtaining the path for which the parameters match and the number of layers of the path comprises:
determining the path according to the short name reference relationship of the parameter;
and determining the layer number according to the jumping times quoted by the short name.
7. A path referencing apparatus, comprising:
the reference searching instruction response module is used for responding to a reference searching instruction in an OTX flow and determining a target path and the layer number of the target path according to the reference searching instruction;
a target container object determining module, configured to determine a target container object among the plurality of first container objects according to the number of layers; each first container object corresponds to one path layer number; the first container object is used for storing a first corresponding relation, and the first corresponding relation is a corresponding relation between a parameter and a path matched with the parameter;
and the target parameter obtaining module is used for retrieving by using the target container object according to the target path to obtain a target parameter.
8. An apparatus for data processing, comprising:
the target data packet acquisition module is used for acquiring a target data packet;
the parameter analysis module is used for analyzing each parameter in the target data packet to obtain a path matched with each parameter and the layer number of the path;
a matching relation storage module, configured to store, for each parameter, a first corresponding relation, which is a corresponding relation between the parameter and a path matched with the parameter, in a first container object with a corresponding number of layers according to the number of layers of the parameter matching path; the first container object is used for determining a target container object according to the layer number of a target path, the target container object is used for retrieving the target path to obtain a target parameter, and the target path and the layer number are determined based on a reference finding instruction in an OTX flow.
9. 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 3 or 4 to 6 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 3 or 4 to 6.
CN202111648555.3A 2021-12-29 2021-12-29 Path reference searching method and device, electronic equipment and storage medium Pending CN114329090A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111648555.3A CN114329090A (en) 2021-12-29 2021-12-29 Path reference searching method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111648555.3A CN114329090A (en) 2021-12-29 2021-12-29 Path reference searching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114329090A true CN114329090A (en) 2022-04-12

Family

ID=81018284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111648555.3A Pending CN114329090A (en) 2021-12-29 2021-12-29 Path reference searching method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114329090A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116954872A (en) * 2023-09-20 2023-10-27 北京世冠金洋科技发展有限公司 Global parameter calling method and device and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116954872A (en) * 2023-09-20 2023-10-27 北京世冠金洋科技发展有限公司 Global parameter calling method and device and readable storage medium
CN116954872B (en) * 2023-09-20 2023-12-29 北京世冠金洋科技发展有限公司 Global parameter calling method and device and readable storage medium

Similar Documents

Publication Publication Date Title
US11158143B2 (en) Vehicle diagnostic method and device, and computer readable storage medium
CN112714134B (en) CAN message analysis method, adaptation method, device, equipment and medium
CN111552267B (en) Vehicle diagnosis method and device and vehicle diagnosis equipment
CN110968509B (en) Method and system for batch customizing of variables
CN112751810B (en) CAN message analysis method, device and terminal
CN112104664A (en) Protocol conversion method, device and equipment for data of Internet of things
CN106020848A (en) Function calling route generating method oriented to C#
CN112147983B (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN104320312A (en) Network application safety test tool and fuzz test case generation method and system
CN114329090A (en) Path reference searching method and device, electronic equipment and storage medium
CN113111227A (en) Data processing method and device, electronic equipment and storage medium
CN116502273A (en) Dynamic data desensitization method, device and equipment based on data blood edges
CN112181924A (en) File conversion method, device, equipment and medium
CN112181430A (en) Code change statistical method and device, electronic equipment and storage medium
CN111078948A (en) Automobile diagnosis data analysis method and system and storage medium
CN116432185B (en) Abnormality detection method and device, readable storage medium and electronic equipment
CN114356685A (en) Path reference searching method and device, electronic equipment and storage medium
RU2393536C2 (en) Method of unified semantic processing of information, which provides for, within limits of single formal model, presentation, control of semantic accuracy, search and identification of objects description
CN115390852A (en) Method and device for generating uniform abstract syntax tree and program analysis
CN114625106A (en) Vehicle diagnosis method and device, electronic equipment and storage medium
CN112445797B (en) Vehicle diagnosis data reference method, device, terminal equipment and storage medium
CN112433943A (en) Method, device, equipment and medium for detecting environment variable based on abstract syntax tree
CN111930097A (en) Vehicle diagnostic data analysis method, device, equipment and storage medium
CN107861725B (en) iOS data reverse automatic analysis strategy
CN114326674A (en) ECU (electronic control Unit) flashing method and device, electronic 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