CN112035474B - Data searching method and device - Google Patents

Data searching method and device Download PDF

Info

Publication number
CN112035474B
CN112035474B CN202010892546.8A CN202010892546A CN112035474B CN 112035474 B CN112035474 B CN 112035474B CN 202010892546 A CN202010892546 A CN 202010892546A CN 112035474 B CN112035474 B CN 112035474B
Authority
CN
China
Prior art keywords
data
searching
data node
node
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010892546.8A
Other languages
Chinese (zh)
Other versions
CN112035474A (en
Inventor
刘均
李河金
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Launch Technology Co Ltd
Original Assignee
Shenzhen Launch Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Launch Technology Co Ltd filed Critical Shenzhen Launch Technology Co Ltd
Priority to CN202010892546.8A priority Critical patent/CN112035474B/en
Publication of CN112035474A publication Critical patent/CN112035474A/en
Application granted granted Critical
Publication of CN112035474B publication Critical patent/CN112035474B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data searching method which is applied to searching of ODX data, and can quickly search data objects by searching the ID of a parent node in an upward inheritance chain in an upward index map, searching the ID of a child node in a downward inheritance chain in a downward index map and searching the value of the data object corresponding to the ID in a global map.

Description

Data searching method and device
Technical Field
The present disclosure relates to the field of electronic information technologies, and in particular, to a data searching method and apparatus.
Background
ODX (Open Diagnostic Data Exchange ) data stores all data required by the communication between the diagnostic apparatus and the vehicle, and the data is huge, so various data are abstracted in a data extraction layering mode, and the purpose of avoiding redundancy by multiplexing the data is achieved. ODX divides data into five layers, respectively from bottom to top: an ECU-VARIANT layer, a BASE-VARIANT layer, a FUNCTIONAL-GROUP layer, a PROTOCOL layer, and an ECU-SHARED-DATA layer. How to accurately and rapidly search data in five layers of data is a problem to be solved at present.
Disclosure of Invention
The application provides a data searching method and device, which can quickly and accurately search a target data object through an upward index map, a downward index map and a global map.
In one aspect, the present application provides a data searching method, including the steps of:
s101, searching IDs of other data nodes on an inheritance chain of the data nodes according to IDs of parent data nodes and IDs of child data nodes in an upward index map and a downward index map of the data nodes, and searching data objects corresponding to the IDs of the data nodes according to a global map;
s102, judging whether the data object is a target data object, if so, ending the search, and if not, continuing to execute the step S101.
In the embodiment of the application, according to the IDs of the father node and the child node recorded in the upward index map and the downward index map of each data node on the inheritance chain of the data node and according to the global map, the data object corresponding to the ID is searched, so that the target data object can be quickly and accurately searched.
In one possible implementation manner of the data searching method, the step S101 specifically includes: searching a data object corresponding to the ID of a parent data node and the ID of a child data node of a first data node through a global map (Global map) according to the IDs of the parent data node and the child data node of the first data node in an upward index map (map) and a downward index map (mapdown) of the first data node;
the step S102 specifically includes: judging whether a target data object exists in the data objects corresponding to the ID of the parent data node and the ID of the child data node of the first data node, if so, ending the search, and if not, executing a step S101, wherein the global map (Global map) stores the corresponding relation between the data node ID and the data object;
the step S101 further includes: according to the ID of the parent data node and the ID of the child data node of the next data node in the upward index map (map) and the downward index map (mapdown) of the next data node on the inheritance chain of the first data node, searching the data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node through a global map (globalpap), wherein the step S102 further comprises judging whether the destination data object exists in the data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node, if yes, the searching is ended, and if not, the searching is continued according to the upward index map (map) and the downward index map (mapdown) of the next data node on the inheritance chain of the first data node in step 101.
In one possible implementation manner of the data searching method, the upward index map includes at least one storage record, each storage record includes two storage bits, namely a first storage bit and a second storage bit, where the first storage bit stores the ID of the data node itself, and the second storage bit stores the ID of the data node located in the parent layer and having an inheritance relationship with the data node itself.
In one possible implementation manner of the data searching method, the upward index map includes a plurality of storage records, wherein first storage bits in the plurality of storage records are identical, record IDs of nodes, and second storage bits record IDs of respective parent nodes. In one possible implementation manner of the data searching method, the downward index map includes at least one storage record, and each storage record includes two storage bits, namely a first storage bit and a second storage bit, where the first storage bit stores the ID of the node itself, and the second storage bit stores the ID of the data node located in the sub-layer and having an inheritance relationship with the node itself.
In one possible implementation manner of the data searching method, the downward index map includes a plurality of storage records, wherein first storage bits in the plurality of storage records are identical, record IDs of nodes, and second storage bits record IDs of respective child nodes.
In a possible implementation manner of the data searching method, the global map (globalpap) includes at least two storage records, each storage record includes two storage bits, namely a first storage bit and a second storage bit, wherein the first storage bit stores an ID of a data node, and the second storage bit stores a data object corresponding to the ID.
In a second aspect, the present application further provides a data searching device, where the device includes a searching module and a determining module,
the searching module is used for searching the IDs of other data nodes on the inheritance chain of the data nodes according to the IDs of the parent data nodes and the IDs of the child data nodes in the upward index map and the downward index map of the data nodes, and searching the data objects corresponding to the IDs of the data nodes according to the global map;
and the determining step module is used for judging whether the data object is a target data object, if so, ending the searching, and if not, continuing the searching by the searching module.
In a possible embodiment of the data finding device,
the searching module is further configured to search, according to an ID of a parent data node and an ID of a child data node of a first data node in an up index map (map) and a down index map (mapdown) of the first data node, a data object corresponding to the ID of the parent data node and the ID of the child data node of the first data node through a global map (globalpap);
the determining module is further configured to determine whether a destination data object exists in a data object corresponding to an ID of a parent data node and an ID of a child data node of the first data node, if yes, finish searching, if not, the searching module is further configured to search, according to an ID of a parent data node and an ID of a child data node of a next data node in an up index map (map) and a down index map (mapdown) of a next data node on an inheritance chain of the first data node, a data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node through a global map (globalpap), where a correspondence between the data node ID and the data object is stored in the global map (globalpap);
the determining module is further configured to determine whether a destination data object exists in the data objects corresponding to the ID of the parent data node and the ID of the child data node of the next data node found by the searching module, if yes, finish searching, if not, continue searching by the searching module according to an up index map (map) and a down index map (mapdown) of the next data node on the inheritance chain of the first data node, and further determine by the determining module.
In a possible implementation manner of the data searching device, the upward index map includes at least one storage record, each storage record includes two storage bits, namely a first storage bit and a second storage bit, where the first storage bit stores the ID of the data node itself, and the second storage bit stores the ID of the data node located in the parent layer and having an inheritance relationship with the data node itself.
In one possible implementation manner of the data searching device, the upward index map includes a plurality of storage records, wherein first storage bits in the plurality of storage records are identical, record IDs of nodes, and second storage bits record IDs of respective parent nodes. In one possible implementation manner of the data searching method, the downward index map includes at least one storage record, and each storage record includes two storage bits, namely a first storage bit and a second storage bit, where the first storage bit stores the ID of the node itself, and the second storage bit stores the ID of the data node located in the sub-layer and having an inheritance relationship with the node itself.
In one possible implementation manner of the data searching device, the downward index map includes a plurality of storage records, wherein first storage bits in the plurality of storage records are identical, record IDs of nodes, and second storage bits record IDs of the respective child nodes.
In a possible implementation manner of the data searching device, the global map (globalpap) includes at least two storage records, each storage record includes two storage bits, namely a first storage bit and a second storage bit, wherein the first storage bit stores an ID of a data node, and the second storage bit stores a data object corresponding to the ID.
In a third aspect, the present application also provides a computer storage medium having stored therein computer instructions for causing an electronic device to perform the relevant steps of the data searching method of the second aspect described above, when the computer instructions are run on the electronic device.
In a fourth aspect, the present application also provides an electronic device, which may be in particular a chip or other integrated circuit, which may include a processor and a memory connected; wherein the memory is configured to store computer-executable instructions that, when the apparatus is run, the processor is configured to cause the apparatus to perform the steps of the data lookup method embodiment of the first aspect described above.
Drawings
FIG. 1 is a schematic diagram of a diagnostic data layering model in an embodiment of the present application;
FIG. 2 is a schematic diagram of data inheritance relationships of diagnostic layers in an embodiment of the present application, where EV is the bottom layer (more specific), and SD is the top layer (more abstract);
FIG. 3 is an example of rule files for an ECU-VARIANT node and a BASE-VARIANT node in an embodiment of the present application;
FIG. 4 is a manner in which mapDown and mapup are defined in an embodiment of the present application;
FIG. 5 is a schematic diagram of the abstraction of ECU-VARIANT into an ODXEcuVariant class in an embodiment of the present application;
FIG. 6 is a schematic diagram of abstracting BASE-VARIANT nodes into ODXBASEVariant classes in an embodiment of the present application;
FIG. 7 is a schematic diagram of constituent elements of an ODX source file according to an embodiment of the present application, where a "ODX-d" file refers to an ODX file, and opening a specific "ODX-d" file may show a plurality of data nodes included in the ODX file;
FIG. 8 is a schematic diagram of recording a PARENT node ID in a part-REF of a child node in an embodiment of the present application, wherein a bottom layer inherits a PARENT layer through the part-REF and associates a PARENT layer object ID;
FIG. 9 is a schematic diagram of recording IDs of multiple PARENT nodes in part-REF in the case that a child node has multiple PARENT nodes in an embodiment of the present application;
FIG. 10 is a flow chart of a data search method in an embodiment of the present application; and
fig. 11 is a schematic structural diagram of a data searching device in an embodiment of the present application.
Detailed Description
The present application is described in detail below with reference to the drawings attached to the specification.
Some of the terms in this application are explained first to facilitate understanding by those skilled in the art.
And (3) ECU: the electronic control unit is Electronic control unit, and like a common computer, the electronic control unit comprises a processor, a memory, an input/output interface and other integrated circuits, and the ECU is equivalent to the brain of the vehicle. The ECU has the functions of operation and control, and can collect signals of all sensors, perform operation, convert the operation result into control signals and control the work of a controlled object. The ECU generally has fault self-diagnosis and protection functions, and when the system fails, it can automatically record fault codes in the memory. In some medium-high-grade vehicles, the ECU is not only applied to the engine, but also found on many other parts. For example: an antilock brake system and the like are each provided with a respective ECU.
ODX: the ODX may contain information required for diagnostic communications by a diagnostic tester with a particular ECU or group of ECUs.
As shown in fig. 1 and 2, the ODX data is divided into five layers (also referred to as 5 diagnostic layers), from bottom to top: an ECU-VARIANT layer (abbreviated as EV layer), a BASE-VARIANT layer (abbreviated as BV layer), a FUNCTIONAL-GROUP layer (abbreviated as FG layer), a PROTOCOL layer, and an ECU-SHARED-DATA layer (abbreviated as SD layer). The layers are associated in a value inheritance mode, and can be abstracted into inheritance relations similar to those between c++ classes. The more abstract (base class) is the more abstract the more concrete (derivative class) is the more abstract the more concrete is the lower.
ODX data of each diagnostic layer are associated through a part-REF field to form an inheritance chain. For example, the ECU-VARIANT layer inherits the data of the BASE-VARIANT layer through part-REF, while the BASE-VARIANT layer inherits the data of the FUNCTIONAL-GROUP layer, and so on, and finally forms an inheritance chain from bottom to top.
According to the data structure type of the ODX file, all data node types in the ODX file can be abstracted into classes. For example, ECU-VARIANT is abstracted to ODXEcuVariant, PARENT-REF and ODXParentRef. Each data node may be abstracted into a class. For example: five DATA nodes, ECU-VARIANT, BASE-VARIANT, FUNCTIONAL-GROUP, PROTOCOL, and ECU-SHARED-DATA, may be abstracted into 5 classes. For the ECU-VARIANT, BASE-VARIANT, FUNCTIONAL-GROUP, PROTOCOL, ECU-SHARED-DATA, all five diagnostic layers below may contain the same type of child node, e.g., ECU-VARIANT, BASE-VARIANT may contain a part-REF node. That is, each diagnostic layer may have the same type of child node data.
The purpose of the diagnostic data layering is to de-redundancy, and the diagnostic layers are correlated by part-REF. For example: for data in a BV, the EV layer can have the data in the BV by associating the BV through a part-REF. Such as a DTC node named P000100 in a BV, then this means that an EV inheriting the BV also has DTC node data named P000100. But the EV layer may also contain other DTC nodes, which is an extension to BV.
As shown in fig. 7, 1 or more ODX files are included in each type, and each ODX file includes 1 or more data nodes. As shown in fig. 7, each odx-d file may contain multiple data nodes of the same type, for example: the dlc_ev_bcm.odx-d file may contain a plurality of ECU-VARIANT type data nodes, and the dlc_bv_bcm.odx-d file may contain a plurality of BASE-VARIANT type data nodes.
The process of abstracting the ODX diagnostic layer into c++ class specifically includes:
1. and analyzing the ODX Schema file structure, and constructing a data model according to the Schema, namely, constructing a c++ class and a related inheritance relationship model thereof. The ECU-VARIANT data node and BASE-VARIANT data node rule file is shown in fig. 3. The abstraction of the ECU-VARIANT data node into the odxacuvariant class is shown in fig. 5, and the abstraction of the BASE-VARIANT data node into the ODXBaseVariant class is shown in fig. 6.
2. And loading an ODX XML file, and storing the data into the constructed data model according to the node type.
The required data objects may be looked up based on inheritance relationships between abstract classes.
Generally, in an ODX file, the types of data nodes contained are identical and may contain multiple data nodes of the same type, each data node being abstracted as a c++ object. The data nodes in one diagnostic layer may have a c++ class-like inherited relationship with the plurality of data in another diagnostic layer. For example: the data nodes in a diagnostic layer have multiple parent layer data nodes, or multiple child layer data nodes. In other words, one data node may inherit or be inherited by multiple data nodes in another diagnostic layer.
The left ODX file shown in fig. 8 contains one EV data node, and the ID of the node itself is described at "ECU-VARIANT" which can be regarded as the data node of the ODX file.
As shown in fig. 8, among the child members of the "ECU-VARIANT", a part-REF key is included, which can be regarded as one data member of the class object. Such as the ODX file shown in fig. 8, is abstracted into members of a class because ECU-VARIANT is abstracted into a class, and part-REF is a child node of ECU-VARIANT.
The part-REF key is recorded with the ID of the data node in the PARENT layer, the inheritance relation between the data node and the PARENT layer is indicated by the part-REF key, and the data object ID in the PARENT layer is associated.
The right ODX file shown in fig. 8 includes a BV data node, and the record of "BASE-variable" is the ID of the BV node itself. The ID of the BV node is the same as the record ID in the part-REF key in the EV node in the ODX file on the left, indicating that the BV data node on the right is the PARENT node of the EV node on the left.
A data node may have multiple parent nodes or multiple child nodes. In the EV data node shown in fig. 9, the IDs of three PARENT nodes are described in the part-REF key section, and are respectively: an ID-B node, an ID-P node, and an ID-SD node.
Starting from an ODX file of an EV layer serving as a bottom layer, searching a PARENT node of the BV layer according to an ID of a PARENT node in the BV layer indicated by a part-REF keyword in the ODX file, searching a data node of the FG layer according to an ID of a data node of the FG layer indicated by the part-REF keyword in the PARENT node in the BV layer, searching a data node in a further layer according to an ID of a data node in the further layer indicated by the part-REF keyword in the data node in the FG layer, and sequentially searching the same, so that a set of IDs of the data nodes on a complete inheritance chain can be finally obtained.
Based on the above description, the present application provides the following embodiments:
(1) Data searching method
As shown in fig. 10, in an embodiment of the present application, the data searching method includes:
s101, searching IDs of other data nodes on an inheritance chain of the data nodes according to IDs of parent data nodes and IDs of child data nodes in an upward index map and a downward index map of the data nodes, and searching data objects corresponding to the IDs of the data nodes according to a global map;
s102, judging whether the data object is a target data object, if so, ending the search, and if not, continuing to execute the step S101.
In the embodiment of the application, according to the IDs of the father node and the child node recorded in the upward index map and the downward index map of each data node on the inheritance chain of the data node and according to the global map, the data object corresponding to the ID is searched, so that the target data object can be quickly and accurately searched.
In the embodiment of the present application, the step S101 specifically includes: searching a data object corresponding to the ID of a parent data node and the ID of a child data node of a first data node through a global map (Global map) according to the IDs of the parent data node and the child data node of the first data node in an upward index map (map) and a downward index map (mapdown) of the first data node;
the step S102 specifically includes: judging whether a target data object exists in the data objects corresponding to the ID of the parent data node and the ID of the child data node of the first data node, if so, ending the search, and if not, executing step 101, wherein the global map (globalpap) stores the corresponding relation between the data node ID and the data object;
the step S101 further includes searching, according to the ID of the parent data node and the ID of the child data node of the next data node in the up index map (mapup) and the down index map (mapdown) of the next data node on the inheritance chain of the first data node, the data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node through the global map (globalpap), and the step S102 further includes determining whether the destination data object exists in the data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node, if yes, the searching is ended, and if not, the searching is continued according to the up index map (mapup) and the down index map (mapdown) of the next data node on the inheritance chain of the first data node according to the step S101.
The upward index map is recorded with the IDs of the data nodes located in other layers in the upward inheritance chain, the downward index map is recorded with the IDs of the data nodes located in other layers in the downward inheritance chain, and the upward index map and the downward index map can completely record the IDs of the data nodes on the whole inheritance chain of one data node. The global map (globalpap) stores a correspondence between data node IDs and data objects. The value of the object corresponding to the ID may be retrieved in a global map (globalpap) according to the ID of the data node.
For each data node in the inheritance chain, two maps (maps) are defined, one is an upward index map (mapUp) and the other is a downward index map (mapDown), the two maps are global, and when diagnostic data in the inheritance chain is loaded, the association mode of the data is recorded, so that query service is provided for other subsequent interfaces. The relationship between the data objects described in mapup and mapdown may be stored when source file data is loaded. In subsequent use, specific data objects can be precisely and quickly searched according to mapup and mapdown.
As shown in fig. 9, both the up index map (mapup) and the down index map (mapdown) are multimap. The IDs of one or more parent nodes of the present node may be recorded in the upward index map, the IDs of one or more child nodes of the present node may be recorded in the downward index map, and the IDs of the child nodes and the IDs of the parent nodes of the present node may be found through the upward index map (mapup) and the downward index map (mapdown).
In an embodiment of the present application, the map includes at least one storage record, where each storage record includes two storage bits, a first storage bit and a second storage bit, respectively, and the first storage bit may be referred to as first and the second storage bit may be referred to as second. The maprow includes at least one memory record, each memory record includes two memory bits, a first memory bit and a second memory bit, the first memory bit may be referred to as first, and the second memory bit may be referred to as second.
In the mapop, the first storage bit stores the own ID of the own node, and the second storage bit stores the ID of the data node located in the parent layer having an inheritance relationship with the own node. As shown in fig. 9, if there are multiple parent nodes, multiple storage records need to be stored in the mapop. The first storage bits in the plurality of storage records are identical, the IDs of the nodes are recorded, the contents recorded in the second storage bits are different, and the IDs of the father nodes are recorded. For example: the second storage bit of the first storage record records the ID of the first parent node, the second storage bit of the second storage record records the ID of the second parent node, and so on.
In maprow, the ID of the own node is stored in a first storage bit, and the ID of a data node at a sub-layer having an inheritance relationship with the own node is stored in a second storage bit. As shown in fig. 9, if there are multiple child nodes, then multiple storage records need to be stored in maprow. The first storage bits in the plurality of storage records are identical, the IDs of the nodes are recorded, the contents recorded in the second storage bits are different, and the IDs of the child nodes are recorded. For example: the second storage bit of the first storage record records the ID of the first child node, the second storage bit of the second storage record records the ID of the second child node, and so on.
Specifically, as shown in fig. 8, the right BV node is a parent node of the left EV node, map1 is a mappu of the left EV node, map2 is a maprow of the right BV node, and the ID of the right BV node can be found from the ID of the left EV node according to map1, and the ID of the left EV node can be reversely deduced from the ID of the right BV node by map 2. The two searching directions of upward searching and downward searching are respectively stored in two maps, so that programming is more readable.
The first storage bit may store a Value called Key and the second storage bit may store a Value. In mapop, key is the ID of the own node, and Value is the ID of the parent node having an inheritance relationship with itself. In maprow, key is the ID of the own node, and Value is the ID of the child node of the own node. According to mappu and mapdrop, value can be easily found from Key values, and then the data objects corresponding to Key and Value are retrieved by Globalmap. As shown in fig. 9, because both mapap and mapowns can be multi-map, that is, IDs of multiple parent nodes can be recorded in mapap, IDs of multiple child nodes can be recorded in mapowns. That is, the keys in the Multimap are repeatable, a plurality of Key value pairs (also called a plurality of storage records) can be stored in the storage records of the Multimap, and when one ECU-VARIANT node inherits a plurality of father nodes, a plurality of father node IDs can be inserted by taking the ID of the ECU-VARIANT as a Key value. That is, IDs of a plurality of parent nodes are recorded in a plurality of storage records.
Taking EV layer, BV layer and FG layer as an example, assuming that id=ide of one data node in EV layer, id=idb of one data node in BV layer, id=idfg of one data node in FG layer, stored in map of data node in EV layer is: key=ide value=idb. Stored in the map of the data node in the EV layer is: key=idb, value=idfg. The IDB is searched through the IDE, the IDFG is searched through the IDB, and the data object corresponding to each ID can be searched in the Globalmap.
A global map (globalpap) stores a mapping of IDs and objects of all data nodes. The global map (globalpap) is used to store all the objects with IDs in the diagnostic data.
Each data object has an ID attribute, which is unique. In global map (globalpap), the data object itself is stored, but since there are a plurality of objects of the same type (e.g., EV, BV, etc.), for quick indexing, an object ID having uniqueness is used as a key value.
A global map (globalpap) includes at least two memory records, each memory record including two memory bits, a first memory bit, which may be referred to as first, and a second memory bit, which may be referred to as second. Stored in First is the ID of the data node, and stored in second is the data object corresponding to the ID of the data node. The number of storage records in the global map storage may be determined according to whether the data nodes in the ODX file have IDs, and the objects with IDs are all stored in the global map.
It should be noted that if the mapap of a certain data node is empty, which indicates that the data node has no parent node, it is not necessary to continue to search the upper layer along the inheritance chain. If the maprow of a certain data node is empty, indicating that the data node has no child nodes, the data node does not need to continue to search down the inheritance chain.
map and multimap are commonly used association containers for c++. Their elements are in the form of a binary set of "key-value" pairs, with the data being efficiently stored and read by keys, and the values representing the stored and read data.
As shown in fig. 4, ODXEcuVariant, ODXBaseVariant and the like eventually have the common base class ODXBase. The global map is defined in the following way: map < string, ODXBase > globalpap.
Through the method and the steps, the data objects in the parent layer and the child layer in the inheritance chain can be searched in two directions between the diagnosis layers. Diagnostic data can be searched in two directions through inheritance relations among diagnostic layers, namely, high-level diagnostic data can be searched through the bottom layer, and the bottom-layer data object can be simply acquired through the high-level data object, so that the relations among objects in an inheritance chain are more concise.
In the embodiment of the application, the ID of the data node in the ODX file is mapped to a specific data object. And by using two maps, the mapping from the data node of each layer to the data node in the father layer and the mapping from the data node in the father layer to the data node in the child layer are recorded respectively, so that the bidirectional searching of the inheritance chain data is realized. Diagnostic data can be searched in two directions through inheritance relations between diagnostic layers, namely, a high-level diagnostic data object can be searched through a low-level layer, and the low-level data object can be simply acquired through the high-level data object.
(2) Data searching device
Corresponding to the foregoing data searching method, as shown in fig. 11, the present application further provides an embodiment of a data searching device, where the data searching device includes a searching module 101, and a determining module 102, where:
the searching module 101 is configured to search IDs of other data nodes on an inheritance chain of the data nodes according to IDs of parent data nodes and IDs of child data nodes in an upward index map and a downward index map of the data nodes, and search a data object corresponding to the IDs of the data nodes according to a global map;
the determining step module 102 is configured to determine whether the data object is a destination data object, if yes, end the search, and if not, continue the search by the searching module 101.
In the embodiment of the present application, the searching module 101 is further configured to search, according to an ID of a parent data node and an ID of a child data node of a first data node in an up index map (mapup) and a down index map (mapdown) of the first data node, a data object corresponding to the ID of the parent data node and the ID of the child data node of the first data node through a global map (globalpap);
the determining module is further configured to determine whether a destination data object exists in a data object corresponding to an ID of a parent data node and an ID of a child data node of the first data node, if yes, finish searching, if not, the searching module is further configured to search, according to an ID of a parent data node and an ID of a child data node of a next data node in an up index map (map) and a down index map (mapdown) of a next data node on an inheritance chain of the first data node, a data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node through a global map (globalpap), where a correspondence between the data node ID and the data object is stored in the global map (globalpap);
the determining module is further configured to determine whether a destination data object exists in the data objects corresponding to the ID of the parent data node and the ID of the child data node of the next data node found by the searching module, if yes, finish searching, if not, continue searching by the searching module according to an up index map (map) and a down index map (mapdown) of the next data node on the inheritance chain of the first data node, and further determine by the determining module.
The term "plurality" in the embodiments of the present application means two or more, unless specifically stated otherwise. The meaning of the words "and/or" as used in the embodiments of the present application may be understood as follows, for example: "a and/or b" means any of three cases, namely, a alone, b alone, or a and b.
Embodiments of the present application also provide a computer storage medium having stored therein computer instructions for causing an electronic device to perform the relevant steps of the method embodiments described above when the computer instructions are run on the electronic device.
Embodiments of the present application also provide a computer program product which, when run on a computer, causes the computer to perform the above-described relevant steps to implement the relevant steps in the above-described method embodiments.
Embodiments of the present application also provide an electronic device, which may be specifically a chip or other integrated circuit, that may include a processor and a memory coupled to each other; the memory is configured to store computer-executable instructions that, when executed by the apparatus, enable the apparatus to perform the steps of the method embodiments described above.
The present application also provides a circuit comprising a plurality of interconnected electronic devices, which circuit is adapted to perform the steps of the above-described method embodiments after being energized. The circuit may be disposed on a circuit board.
The foregoing computer storage medium, computer program product, electronic device or circuit provided in the embodiments of the present application are used to perform the steps in the method embodiments, and the advantages achieved by the foregoing method embodiments may refer to the advantages provided in the corresponding method embodiments, which are not described herein.
Although the subject matter of the present application has been described in language specific to structural features/functional/methodological acts, the scope of the present application is not limited to the embodiments of the subject matter defined in the claims, but is capable of modification and variation in detail in the subject matter described herein, and is intended to be included within the scope of the present application.

Claims (9)

1. The data searching method is characterized in that the method is applied to ODX data, the ODX data of each layer is associated through fields to form an inheritance chain, and the method comprises the following steps:
searching, namely searching IDs of other data nodes on an inheritance chain of the data nodes according to the IDs of the parent data nodes and the IDs of the child data nodes in the upward index map and the downward index map of the data nodes, and searching a data object corresponding to the IDs of the data nodes according to the global map;
determining, namely judging whether the data object is a target data object, if so, ending the searching, and if not, continuing to execute the searching;
the searching step comprises a first searching step and a second searching step, wherein
The first searching step comprises searching data objects corresponding to the ID of a parent data node and the ID of a child data node of a first data node through a global map according to the IDs of the parent data node and the ID of the child data node of the first data node in the upward index map and the downward index map of the first data node, the determining step specifically comprises judging whether a target data object exists in the data objects corresponding to the ID of the parent data node and the ID of the child data node of the first data node, if yes, the searching is ended, if not, the second searching step is executed, and the corresponding relation between the ID of the data node and the data object is stored in the global map;
the second searching step comprises searching data objects corresponding to the ID of a parent data node and the ID of a child data node of the next data node through a global map according to the ID of a parent data node and the ID of a child data node of the next data node in the upward index map and the downward index map of the next data node on the inheritance chain of the first data node, the determining step further comprises judging whether the data objects corresponding to the ID of the parent data node and the ID of the child data node of the next data node exist or not, if yes, the searching is ended, and if not, the searching is continued according to the upward index map and the downward index map of the next data node on the inheritance chain of the first data node according to the second searching step.
2. The data searching method according to claim 1, wherein the upward index map includes at least one storage record, each storage record includes two storage bits, namely a first storage bit and a second storage bit, the first storage bit stores the own ID of the data node, and the second storage bit stores the ID of the data node located in the parent layer having an inheritance relationship with the own data node.
3. The data searching method according to claim 2, wherein the upward index map includes a plurality of storage records, first storage bits in the plurality of storage records are identical, and record IDs of nodes themselves, and second storage bits record IDs of respective parent nodes.
4. The data searching method according to claim 1, wherein the downward index map includes at least one storage record, each storage record includes two storage bits, namely a first storage bit and a second storage bit, the first storage bit stores the own ID of the own node, and the second storage bit stores the ID of the data node located in the sub-layer having an inheritance relationship with the own node.
5. The method of claim 4, wherein the downward index map includes a plurality of storage records, wherein first storage bits of the plurality of storage records are identical, record IDs of nodes themselves, and second storage bits record IDs of respective child nodes.
6. The data lookup method as claimed in claim 1 wherein the global map comprises at least two memory records, each memory record comprising two memory bits, a first memory bit and a second memory bit, respectively, the first memory bit storing an ID of a data node and the second memory bit storing a data object corresponding to the ID.
7. A data searching device is characterized in that the device comprises a searching module and a determining module, the device is applied to searching ODX data, the ODX data of each layer is associated by fields to form an inheritance chain,
the searching module is used for searching the IDs of other data nodes on the inheritance chain of the data nodes according to the IDs of the parent data nodes and the IDs of the child data nodes in the upward index map and the downward index map of the data nodes, and searching the data objects corresponding to the IDs of the data nodes according to the global map;
the determining module is used for judging whether the data object is a target data object, if so, finishing searching, and if not, continuing searching by the searching module;
the searching module comprises a first searching sub-module and a second searching sub-module, wherein
The first searching sub-module is used for searching a data object corresponding to the ID of a parent data node and the ID of a child data node of a first data node through a global map according to the IDs of the parent data node and the ID of the child data node of the first data node in the upward index map and the downward index map of the first data node, and the determining module is specifically used for judging whether a target data object exists in the data object corresponding to the ID of the parent data node and the ID of the child data node of the first data node or not, if yes, the searching is ended, if not, the second searching sub-module is triggered, wherein the corresponding relation between the ID of the data node and the data object is stored in the global map;
the second searching sub-module is configured to search, according to an up index map and an ID of a parent data node and an ID of a child data node of a next data node in the up index map and the down index map of the next data node on the inheritance chain of the first data node, a data object corresponding to the ID of the parent data node and the ID of the child data node of the next data node through a global map, and the determining module is specifically configured to determine whether a destination data object exists in the data objects corresponding to the ID of the parent data node and the ID of the child data node of the next data node, if yes, the searching is ended, if not, the searching is continued according to the up index map and the down index map of the next data node on the inheritance chain of the first data node according to the second searching sub-module.
8. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein computer instructions for causing an electronic device to perform the data search method according to any of claims 1 to 6 when the computer instructions are run on the electronic device.
9. An electronic device comprising a processor and a memory coupled; wherein the memory is adapted to store computer executable instructions which, when the apparatus is run, the processor is adapted to execute the computer executable instructions stored in the memory to cause the apparatus to perform the data lookup method as claimed in any one of claims 1 to 6.
CN202010892546.8A 2020-08-28 2020-08-28 Data searching method and device Active CN112035474B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010892546.8A CN112035474B (en) 2020-08-28 2020-08-28 Data searching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010892546.8A CN112035474B (en) 2020-08-28 2020-08-28 Data searching method and device

Publications (2)

Publication Number Publication Date
CN112035474A CN112035474A (en) 2020-12-04
CN112035474B true CN112035474B (en) 2023-06-02

Family

ID=73587569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010892546.8A Active CN112035474B (en) 2020-08-28 2020-08-28 Data searching method and device

Country Status (1)

Country Link
CN (1) CN112035474B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201409237D0 (en) * 2014-05-23 2014-07-09 Daimler Ag Method and system for diagnosing faults of a component of a vehicle
CN109299200A (en) * 2018-10-31 2019-02-01 深圳市元征科技股份有限公司 It is the method, device and equipment of database by data model translation
CN110502667A (en) * 2018-05-16 2019-11-26 南京大学 The parsing of ODX document and generation technique based on DOM frame
CN110807092A (en) * 2019-10-24 2020-02-18 深圳市元征科技股份有限公司 Data processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB201409237D0 (en) * 2014-05-23 2014-07-09 Daimler Ag Method and system for diagnosing faults of a component of a vehicle
CN110502667A (en) * 2018-05-16 2019-11-26 南京大学 The parsing of ODX document and generation technique based on DOM frame
CN109299200A (en) * 2018-10-31 2019-02-01 深圳市元征科技股份有限公司 It is the method, device and equipment of database by data model translation
CN110807092A (en) * 2019-10-24 2020-02-18 深圳市元征科技股份有限公司 Data processing method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于ODX的汽车故障诊断系统的开发与应用;朱元新;《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》;20190715;全文 *

Also Published As

Publication number Publication date
CN112035474A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CA2434081C (en) Data structures utilizing objects and pointers in the form of a tree structure
US7430563B2 (en) System for storing and retrieving data
US8230121B2 (en) Method and apparatus for identifying a device handle in a computer system
US10740396B2 (en) Representing enterprise data in a knowledge graph
US8676788B2 (en) Structured large object (LOB) data
US20130311523A1 (en) Extending file system namespace types
US8527532B2 (en) Transforming function calls for interaction with hierarchical data structures
CN104737154A (en) Associated information propagation system
CN110168532A (en) Data-updating method and storage device
CN116627972B (en) Structured data discrete storage system for covering index
CN116302930A (en) Application testing method and device
CN112035474B (en) Data searching method and device
CN104679510A (en) Fault tree generation method for extended UML class diagram model of safety-critical system
CN116610383B (en) Method for partially loading target file
US11176022B2 (en) Health diagnostics and analytics for object repositories
CN116627973A (en) Data positioning system
US20060282437A1 (en) Apparatus, system, and method for ordered processing of a hierarchical data structure according to a data source
CN112445816B (en) Vehicle diagnosis data reference method, device, terminal equipment and storage medium
US20220078228A1 (en) Infrastructure imports for an information technology platform
CN112445797B (en) Vehicle diagnosis data reference method, device, terminal equipment and storage medium
CN109446219A (en) Right management method and device
US8639668B2 (en) Structured requirements management
CN114326674B (en) ECU (electronic control Unit) refreshing method and device, electronic equipment and storage medium
CN112445491B (en) File sequence processing method, device, terminal equipment and storage medium
CN116954872B (en) Global parameter calling method and device and readable storage medium

Legal Events

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