CN112035474A - Data searching method and device - Google Patents

Data searching method and device Download PDF

Info

Publication number
CN112035474A
CN112035474A CN202010892546.8A CN202010892546A CN112035474A CN 112035474 A CN112035474 A CN 112035474A CN 202010892546 A CN202010892546 A CN 202010892546A CN 112035474 A CN112035474 A CN 112035474A
Authority
CN
China
Prior art keywords
data
node
data node
searching
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.)
Granted
Application number
CN202010892546.8A
Other languages
Chinese (zh)
Other versions
CN112035474B (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 ODX data, and can quickly search a data object by searching an ID of a father node in an upward inheritance chain in an upward index map, searching an ID of a child node in a downward inheritance chain in a downward index map, and searching a value of the data object corresponding to the ID in a global map.

Description

Data searching method and device
Technical Field
The present application relates to the field of electronic information technologies, and in particular, to a data searching method and apparatus.
Background
The ODX (Open Diagnostic Data Exchange) Data stores all Data required for communication between the Diagnostic apparatus and the vehicle, and this Data is very large, so various Data are abstracted by a Data extraction hierarchical manner, and the purpose of Data reuse and redundancy avoidance is achieved. ODX divides the data into five layers, from bottom to top: ECU-VARIANT layer, BASE-VARIANT layer, FUNCTIONAL-GROUP layer, PROTOCOL layer, and ECU-SHARED-DATA layer. How to accurately and quickly search data in five layers of data is a problem to be solved urgently at present.
Disclosure of Invention
The application provides a data searching method and device, which can quickly and accurately search a target data object by upwards indexing a map, downwards indexing the map and a global map.
In one aspect, the present application provides a data searching method, including the steps of:
s101, according to the IDs of the father data node and the IDs of the subdata nodes in the upward index map and the downward index map of the data nodes, the IDs of other data nodes are searched on the inheritance chain of the data nodes, and the data object corresponding to the ID of the data node is searched according to the global map;
s102, judging whether the data object is a target data object, if so, finishing searching, and if not, continuing to execute the step S101.
In the embodiment of the application, according to the IDs of the parent node and the child node recorded in the upward index map and the downward index map of each data node in 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 a possible implementation manner of the data searching method, the step S101 specifically includes: according to the ID of the father data node and the ID of the child data node of the first data node in the upward index map (mapup) and the downward index map (mapdown) of the first data node, searching a data object corresponding to the ID of the father data node and the ID of the child data node of the first data node through a global map (GlobalMap);
the step S102 specifically includes: judging whether a target data object exists in the data objects corresponding to the ID of the father data node and the ID of the son data node of the first data node, if so, finishing searching, and if not, executing the step S101, wherein the global map (GlobalMap) stores the corresponding relation between the data node ID and the data object;
the step S101 further includes: and according to the ID of the parent data node of the next data node and the ID of the child data node in the upward index map (map) and the downward index map (mapdown) of the next data node in the inheritance chain of the first data node, searching for 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 (GlobalMap), wherein the step S102 further includes 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 next data node, if so, ending the search, and if not, continuing to search according to the step 101 according to the upward index map (map) and the downward index map (mapdown) of the next data node in the inheritance chain of the first data node.
In a 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, which are a first storage bit and a second storage bit, 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 itself.
In a possible implementation manner of the data search method, the upward index map includes a plurality of storage records, where first storage bits in the plurality of storage records are the same and record IDs of nodes themselves, and second storage bits respectively record IDs of parent nodes. In a possible implementation manner of the data searching method, 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 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 a possible implementation manner of the data search method, the downward index map includes a plurality of storage records, where first storage bits in the plurality of storage records are the same and record IDs of nodes themselves, and second storage bits respectively record IDs of respective child nodes.
In a possible implementation manner of the data lookup method, the global map (GlobalMap) includes at least two storage records, each storage record includes two storage bits, which are a first storage bit and a second storage bit, respectively, the first storage bit stores an ID of the 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 apparatus, which 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 node according to the IDs of the father data node and the IDs of the subdata nodes in the upward index map and the downward index map of the data node, and searching a data object corresponding to the ID of the data node according to the global map;
the determining step 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.
In one possible embodiment of the data lookup apparatus,
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 upward index map (mapup) and a downward 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 (GlobalMap);
the determining module is further configured to determine whether a target data object exists in 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, the search is ended, and if not, the searching module is further configured to search, according to the ID of the parent data node and the ID of the child data node of the next data node in an upward index map (mapup) and a downward index map (mapdown) of the next data node in 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 (GlobalMap), where a corresponding relationship between the ID of the data node and the data object is stored in the global map (GlobalMap);
the determining module is further configured to determine whether a target data object exists in the data objects corresponding to the parent data node ID and the child data node ID of the next data node found by the finding module, if so, the finding is ended, if not, the finding module continues to find according to an upward index map (mapup) and a downward index map (mapdown) of the next data node on the inheritance chain of the first data node, and the determining module further determines the target data object.
In a possible implementation manner of the data search device, the upward index map includes at least one storage record, each storage record includes two storage bits, which are a first storage bit and a second storage bit, 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 itself.
In a possible implementation manner of the data search apparatus, the upward index map includes a plurality of storage records, where first storage bits in the plurality of storage records are the same and record IDs of nodes themselves, and second storage bits respectively record IDs of parent nodes. In a possible implementation manner of the data searching method, 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 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 a possible implementation manner of the data search apparatus, the downward index map includes a plurality of storage records, where first storage bits in the plurality of storage records are the same and record IDs of nodes themselves, and second storage bits respectively record IDs of respective child nodes.
In a possible implementation manner of the data lookup apparatus, the global map (GlobalMap) includes at least two storage records, each storage record includes two storage bits, which are a first storage bit and a second storage bit, respectively, the first storage bit stores an ID of the data node, and the second storage bit stores a data object corresponding to the ID.
In a third aspect, the present application further provides a computer storage medium, where computer instructions are stored in the computer storage medium, and when the computer instructions are run on an electronic device, the instructions are used to enable the electronic device to perform relevant steps in the data search method in the second aspect.
In a fourth aspect, the present application further provides an electronic device, which may be specifically a chip or other integrated circuit, and which may include a processor and a memory connected to each other; the memory is configured to store computer executable instructions, and when the apparatus runs, the processor may execute the computer executable instructions stored in the memory, so as to enable the apparatus to perform the steps in the data search method embodiment in the first aspect.
Drawings
FIG. 1 is a schematic illustration of a diagnostic data hierarchy 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 specifically), and SD is the top layer (more abstract);
fig. 3 is an example of rule files of an ECU-variance node and a BASE-variance node in an embodiment of the present application;
FIG. 4 shows the manner in which mapdown and mapup are defined in an example of the present application;
FIG. 5 is a schematic diagram of an example of the present application in which ECU-VARIANT is abstracted into ODXEcuVariant class;
FIG. 6 is a diagram illustrating an example of abstracting a BASE-VARIANT node into ODXBaseVariant classes according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of the constituent elements of an ODX source file in an embodiment of the present application, wherein an "ODX-d" file refers to an ODX file, and opening a particular "ODX-d" file can reveal the data nodes contained in the ODX file;
FIG. 8 is a schematic diagram of recording a PARENT node ID in a PARTENT-REF of a child node in an embodiment of the present application, where a bottom layer inherits a PARENT layer through the PARTENT-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 the embodiment of the present application;
FIG. 10 is a flowchart illustrating a data search method according to an embodiment of the present application; and
fig. 11 is a schematic structural diagram of a data search apparatus in an embodiment of the present application.
Detailed Description
The present application will now be described in detail with reference to the drawings attached hereto.
Some terms in the present application are first explained to facilitate understanding by those skilled in the art.
An ECU: the Electronic control unit is a general computer and comprises an integrated circuit such as a processor, a memory, an input/output interface and the like, and the ECU is equivalent to the brain of a vehicle. The ECU has the functions of operation and control, can collect signals of all sensors, performs operation, converts the operation result into a control signal, and controls the work of a controlled object. The ECU generally has a fault self-diagnosis and protection function, and it automatically records a fault code in a memory when a system has a fault. In some medium and high-grade vehicles, the trace of the ECU may be found not only on the engine, but also on many other components. For example: the antilock brake system and the like are each provided with a respective ECU.
ODX: ODX may contain information needed for Diagnostic communication of a Diagnostic tester with a specific ECU or a 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), which are 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 to be similar to inheritance relationships among c + + classes. The more abstract (base class) the higher up, the more concrete (derived class) the lower down.
The ODX data of each diagnostic layer are related through a PARTENT-REF field to form an inheritance chain. For example, the ECU-VARIANT layer inherits the data of the BASE-VARIANT layer through PARENT-REF, the BASE-VARIANT layer inherits the data of the FUNCTIONAL-GROUP layer, and so on, and finally an inheritance chain is formed from bottom to top.
All data node types in an ODX file may be abstracted into classes according to the data structure type of the ODX file. For example, ECU-VARIANT is abstracted to ODXEcuVariant, and PARTENT-REF is abstracted to ODXParenRef. 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, can be abstracted into 5 classes. For the ECU-VARIANT, BASE-VARIANT, FUNCTIONAL-GROUP, PROTOCOL, ECU-SHARED-DATA, five diagnostic layers, they may all contain the same type of sub-nodes below them, e.g., both ECU-VARIANT and BASE-VARIANT may contain PARENT-REF nodes. That is, each diagnostic layer may have the same type of child node data.
The diagnostic data hierarchy is intended for redundancy and the diagnostic layers are related by PARENT-REF. For example: for data in a BV, the EV layer may own the data in the BV by associating the BV with a PARTENT-REF. For example, there is a DTC node named P000100 in a BV, it means that EVs that inherit the BV also have DTC node data named P000100. The EV layer may contain other DTC nodes as well, 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, such as: 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 an ODX diagnostic layer into c + + classes 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 files are shown in fig. 3. In FIG. 5, the ECU-VARIANT data node is shown abstracted to the ODXEcuVariant class, and in FIG. 6, the BASE-VARIANT data node is shown abstracted to the ODXBaseVariant class.
2. And loading an ODX XML file, and storing data into the constructed data model according to the node type.
The required data objects can be found from the inheritance relationship between abstract classes.
Generally speaking, in an ODX file, the types of data nodes included are the same, and a plurality of data nodes of the same type may be included, each data node being abstracted as a c + + object. Data nodes in one diagnostic layer may have a c + + class inheritance-like relationship with data nodes in another diagnostic layer. For example: the data nodes in one diagnosis layer have a plurality of data nodes in a parent layer or have a plurality of data nodes in a sub-layer. In other words, one data node may inherit or be inherited by multiple data nodes in another diagnostic layer.
As shown in fig. 8, the left ODX file includes one EV data node, and the ID of the node itself is described in "ECU-variance", which can be regarded as the data node of the ODX file.
As shown in fig. 8, a part-REF key, which can be regarded as one data member of the class object, is included in the child member of "ECU-VARIANT". For example, the ODX file shown in fig. 8 is abstracted as a member of a class because ECU-variable is abstracted as a class and part-REF is a child node of ECU-variable.
The ID of the data node in the PARENT layer is recorded in the PARENT-REF key, the inheritance relationship between the data node and the PARENT layer is indicated through the PARENT-REF key, and the ID of the data object in the PARENT layer is associated.
The right ODX file shown in FIG. 8 contains a BV data node, and the ID of the BV node itself is described in "BASE-VARIANT". The BV node ID is the same as the ID recorded in the PARTET-REF key in the EV node in the ODX file on the left, indicating that the right BV data node is the PARENT of the EV node on the left.
A data node may have multiple parents or multiple children. In the EV data node shown in fig. 9, the part-REF key part describes the IDs of three PARENT nodes, which are: ID-B node, ID-P node, and ID-SD node.
Starting from an ODX file of an EV layer serving as a bottom layer, finding out a father node of the BV layer according to the ID of the father node in the BV layer indicated by a PARTENT-REF keyword in the ODX file, finding out a data node of the FG layer according to the ID of the data node of the FG layer indicated by the PARTENT-REF keyword in the father node in the BV layer, finding out a data node in the upper layer according to the ID of the data node in the upper layer indicated by the PARTENT-REF keyword in the data node in the FG layer, and so on, sequentially finding out and finally obtaining a set of IDs of data nodes on a complete inheritance chain.
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, a data search method includes:
s101, according to the IDs of the father data node and the IDs of the subdata nodes in the upward index map and the downward index map of the data nodes, the IDs of other data nodes are searched on the inheritance chain of the data nodes, and the data object corresponding to the ID of the data node is searched according to the global map;
s102, judging whether the data object is a target data object, if so, finishing searching, and if not, continuing to execute the step S101.
In the embodiment of the application, according to the IDs of the parent node and the child node recorded in the upward index map and the downward index map of each data node in 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 an embodiment of the present application, the step S101 specifically includes: according to the ID of the father data node and the ID of the child data node of the first data node in the upward index map (mapup) and the downward index map (mapdown) of the first data node, searching a data object corresponding to the ID of the father data node and the ID of the child data node of the first data node through a global map (GlobalMap);
the step S102 specifically includes: judging whether a target data object exists in the data objects corresponding to the ID of the father data node and the ID of the son data node of the first data node, if so, finishing searching, and if not, executing the step 101, wherein the global map (GlobalMap) stores the corresponding relation between the data node ID and the data object;
the step S101 further includes searching, through a global map (GlobalMap), 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 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 (mapup) and the downward index map (mapdown) of the next data node in the inheritance chain of the first data node, and the step S102 further includes determining whether a 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 so, ending the search, and if not, continuing to search according to the step 101 according to the upward index map (mapup) and the downward index map (mapdown) of the next data node in the inheritance chain of the first data node.
The IDs of the data nodes positioned at other layers in the upward inheritance chain are recorded in the upward index map, the IDs of the data nodes positioned at other layers in the downward inheritance chain are recorded in the downward index map, and the IDs of the data nodes on the whole inheritance chain of one data node can be completely recorded by the upward index map and the downward index map. The global map (GlobalMap) stores a correspondence between data node IDs and data objects. From the ID of the data node, the value of the object corresponding to the ID can be retrieved in a global map (GlobalMap).
For each data node in the inheritance chain, two maps (maps) are defined, one map is an upward index map (mapUp) and the other map is a downward index map (mapDown), the two maps are global, and when the diagnosis 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 the source file data is loaded. In subsequent use, specific data objects can be accurately and quickly searched according to the mapup and the mapdown.
As shown in fig. 9, both the upward index map (map) and the downward index map (mapdown) are multimaps. The ID of one or more parent nodes of the local node may be recorded in an upward index map, the ID of one or more child nodes of the local node may be recorded in a downward index map, and the ID of the child node and the ID of the parent node of the local node may be found from the upward index map (map) and the downward index map (mapdown).
In an embodiment of the present application, the mapUp 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 may be referred to as first and the second storage bit may be referred to as second. The mapDOwn comprises at least one storage record, and each storage record comprises two storage bits, namely a first storage bit and a second storage bit, wherein the first storage bit can be called first, and the second storage bit can be called second.
In the mapUp, the ID of the node itself is stored in the first storage bit, and the ID of the data node located in the parent layer and having an inheritance relationship with the node itself is stored in the second storage bit. As shown in FIG. 9, if there are multiple parent nodes, then multiple storage records need to be stored in the mapUp. The first storage bits in the storage records are the same and record the ID of the node, and the second storage bits are different in content and respectively record the ID of each father node. 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 mapDOwn, the ID of the node itself is stored in a first storage bit, and the ID of a data node located in a sublayer and having an inheritance relationship with the node is stored in a second storage bit. As shown in fig. 9, if there are multiple child nodes, multiple storage records need to be stored in mapDown. The first storage bits in the plurality of storage records are the same and record the ID of the node, and the second storage bits are different in the recorded content and respectively record the ID of each child node. 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.
For a specific example, as shown in fig. 8, the right BV node is a parent node of the left EV node, map1 is a mapUp of the left EV node, and map2 is a mapDown of the right BV node, according to map1, the ID of the right BV node can be searched for by the ID of the left EV node, and by map2, the ID of the left EV node can be deduced back by the ID of the right BV node. The two searching directions of the upward searching and the downward searching are respectively stored in the two maps, so that the programming is more readable.
The first storage bit may store a Value referred to as Key and the second storage bit may store a Value referred to as Value. In mapUp, Key is the ID of the node itself, and Value is the ID of the parent node having an inheritance relationship with itself. In mapDOwn, Key is the ID of the node itself, and Value is the ID of the child node of the node. According to mapUp and mapDOwn, Value can be conveniently found from Key Value, and then the data object corresponding to Key and Value is retrieved through Globalmap. As shown in fig. 9, because both mapUp and mapDown may be multimap, that is, the mapUp may record the IDs of multiple parent nodes, and the mapDown may record the IDs of multiple child nodes. That is, keys in the Multimap can be duplicated, a plurality of Key-value pairs (also referred to as a plurality of storage records) can be stored in the storage records of the Multimap, and when one ECU-variable node inherits a plurality of parent nodes, the ID of the ECU-variable node can be used as a Key value to insert a plurality of parent node IDs. That is, the 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 of one data node in EV layer is IDE, ID of one data node in BV layer is IDB and ID of one data node in FG layer is IDFG, then stored in map of the data node in EV layer are: IDE Value IDB. Stored in the map of the data node in the EV layer are: key is IDB and Value is IDFG. First, IDB is searched through IDE, then IDFG is searched through IDB, and the data object corresponding to each ID can be searched in Globalmap.
A global map (GlobalMap) stores a map of the IDs and objects of all data nodes. The global map (GlobalMap) is used to store all ID-bearing objects in the diagnostic data.
Each data object has an ID attribute, which is unique. In a global map (GlobalMap), 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.
The global map (GlobalMap) includes at least two stored records, each stored record including two stored bits, a first stored bit and a second stored bit, the first stored bit may be referred to as first, and the second stored bit may be referred to as second. The First stores the ID of the data node, and the second stores the data object corresponding to the ID of the data node. The number of storage records stored in the global map may be unlimited, and objects with IDs may be stored in the global map according to whether data nodes in the ODX file have IDs.
It should be noted that, if the mapUp of a certain data node is empty, which indicates that the data node has no parent node, it is not necessary to continue searching to the upper layer along the inheritance chain. If mapDOwn of a data node is empty, it indicates that the data node has no child nodes, and then the search for the data node to the lower layer is not required to continue along the inheritance chain.
map and multimap are c + + common associative containers. Their elements are in the form of a binary of "key-value" pairs, with data being efficiently stored and read by keys (keys) and values representing the stored and read data.
As shown in FIG. 4, ODXEcuVariant, ODXBaseVariant, etc. all eventually have a common base class, ODXBase. The definition mode of the global map is as follows: map < string, ODXBase > GlobalMap.
Through the method and the steps, data objects in a parent layer and a sub-layer in an inheritance chain can be searched bidirectionally among diagnostic layers. The diagnostic data can be searched bidirectionally through the inheritance relationship between diagnostic layers, namely, the high-level diagnostic data can be searched through the bottom layer, and the bottom-layer data object can be simply obtained through the high-level data object, so that the relationship between the objects in the inheritance chain is more concise.
In embodiments of the present application, the IDs of data nodes in the ODX file are mapped to specific data objects. And by using the two maps, the mapping from the data node of each layer to the data node in the parent layer and the mapping from the data node in the parent layer to the data node in the sub-layer are respectively recorded, so that the bidirectional searching of the inheritance chain data is realized. The diagnostic data can be searched bidirectionally through the inheritance relationship between diagnostic layers, namely, a high-level diagnostic data object can be searched through the bottom layer, and a bottom-layer data object can be simply obtained 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 apparatus, where the data searching apparatus 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 a data node 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 node, and search a data object corresponding to the ID of the data node according to a global map;
the determining step module 102 is configured to determine whether the data object is a destination data object, if so, the search is ended, and if not, the search module 101 continues the search.
In an embodiment of the present application, the search 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 upward index map (map) and a downward 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 (GlobalMap);
the determining module is further configured to determine whether a target data object exists in 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, the search is ended, and if not, the searching module is further configured to search, according to the ID of the parent data node and the ID of the child data node of the next data node in an upward index map (mapup) and a downward index map (mapdown) of the next data node in 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 (GlobalMap), where a corresponding relationship between the ID of the data node and the data object is stored in the global map (GlobalMap);
the determining module is further configured to determine whether a target data object exists in the data objects corresponding to the parent data node ID and the child data node ID of the next data node found by the finding module, if so, the finding is ended, if not, the finding module continues to find according to an upward index map (mapup) and a downward index map (mapdown) of the next data node on the inheritance chain of the first data node, and the determining module further determines the target data object.
The "plurality" in the embodiments of the present application means two or more if not specifically stated. The meaning of the word "and/or" as used in the examples of this application can be understood as follows, for example: "a and/or b" means any of three conditions, which are, in each case, a alone, b alone, or a and b.
Embodiments of the present application also provide a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on an electronic device, the instructions are used to cause the electronic device to execute the relevant steps in the above method embodiments.
Embodiments of the present application further provide a computer program product, which when run on a computer, causes the computer to execute the relevant steps described above, so as to implement the relevant steps in the above method embodiments.
Embodiments of the present application also provide an electronic device, which may be embodied as a chip or other integrated circuit, and which may include a processor and a memory coupled together; wherein the memory is used for storing computer executable instructions, and when the device runs, the processor can execute the computer executable instructions stored in the memory, so as to make the device execute the steps in the above method embodiments.
The present application also provides a circuit comprising a plurality of interconnected electronic devices, which circuit is powered on for performing the steps of the above-described method embodiments. The circuit may be disposed on a circuit board.
The computer storage medium, the computer program product, the electronic device or the circuit provided in the embodiments of the present application are all used for executing the steps in the method embodiments, and the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method embodiments provided above, and are not described herein again.
Although the subject matter of the present application has been described in language specific to structural features/functional/methodological acts, the specific structural features/functional/methodological acts are merely examples of the claimed subject matter and are not intended to limit the scope of the present application, as any person skilled in the art can readily devise many variations or alterations within the scope of the present disclosure.

Claims (10)

1. A method for data retrieval, the method comprising:
searching, namely searching IDs of other data nodes on an inheritance chain of the data node according to the IDs of the father data node and the IDs of the subdata nodes in the upward index map and the downward index map of the data node, and searching a data object corresponding to the ID of the data node according to the global map;
and a determining step, namely judging whether the data object is a target data object, if so, finishing searching, and if not, continuing to execute the searching step.
2. The data lookup method as claimed in claim 1 wherein the lookup step comprises a first lookup step and a second lookup step, wherein
The first searching step comprises searching for data objects 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 according to the ID of the parent data node and the ID of the child data node in an upward index map and a downward index map of the first data node, and 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 so, finishing searching, and if not, executing the second searching step, wherein the global map stores the corresponding relation between the ID of the data node and the data object;
the second searching step includes searching for a data object corresponding to the ID of the parent data node of the next data node and the ID of the child data node through a global map according to the ID of the parent data node and the ID of the child 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, and the determining step further includes judging whether a target data object exists in the data object corresponding to the ID of the parent data node of the next data node and the ID of the child data node, if so, ending the searching, and if not, continuing to search and judge 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.
3. The data searching method according to claim 1, wherein the upward index map comprises at least one storage record, each storage record comprises 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 and having an inheritance relationship with the own ID.
4. The data searching method according to claim 3, wherein the upward index map comprises a plurality of storage records, a first storage bit in the plurality of storage records is the same and records the ID of the node, and a second storage bit respectively records the ID of each parent node.
5. 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 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.
6. The data searching method of claim 5, wherein the downward index map comprises a plurality of storage records, a first storage bit in the plurality of storage records is the same and records the ID of the node, and a second storage bit records the ID of each child node.
7. The data lookup method of claim 1 wherein the global map includes at least two stored records, each stored record including two stored bits, a first stored bit storing an ID of the data node and a second stored bit storing a data object corresponding to the ID.
8. A data searching device is characterized by comprising 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 node according to the IDs of the father data node and the IDs of the subdata nodes in the upward index map and the downward index map of the data node, and searching a data object corresponding to the ID of the data node according to the global map;
the determining step 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.
9. A computer-readable storage medium having stored thereon computer instructions for causing an electronic device to perform a data lookup method as claimed in any one of claims 1 to 7 when the computer instructions are run on the electronic device.
10. An electronic device, comprising a processor and a memory coupled together; wherein the memory is for storing computer executable instructions which, when run by the apparatus, the processor is operable to execute the computer executable instructions stored by the memory to cause the apparatus to perform a data lookup method as claimed in any one of claims 1 to 7.
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 true CN112035474A (en) 2020-12-04
CN112035474B 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的汽车故障诊断***的开发与应用", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 *

Also Published As

Publication number Publication date
CN112035474B (en) 2023-06-02

Similar Documents

Publication Publication Date Title
CA2434081C (en) Data structures utilizing objects and pointers in the form of a tree structure
US10740396B2 (en) Representing enterprise data in a knowledge graph
CN102138139B (en) Data logging in graph-based computations
US7430563B2 (en) System for storing and retrieving data
US7529744B1 (en) Search interface server and storage management
US5175696A (en) Rule structure in a procedure for synthesis of logic circuits
US10067941B2 (en) Extending file system namespace types
US20140351241A1 (en) Identifying and invoking applications based on data in a knowledge graph
CN104737154A (en) Associated information propagation system
US20100175055A1 (en) Method and system to identify gui objects for non-markup-language-presented applications
CN107025290B (en) Storage method and reading method of fault tree data
CN114265945A (en) Blood relationship extraction method and device and electronic equipment
US11113137B2 (en) Error incident fingerprinting with unique static identifiers
US20070255685A1 (en) Method and system for modelling data
CN103559189A (en) Power simulation training resource management system and method based on metadata integration model
CN116627972B (en) Structured data discrete storage system for covering index
CN112997200A (en) Hybrid machine learning model for code classification
JP4746698B2 (en) Modeling classification objects
CA2874357A1 (en) Methods and systems for resolving conflicts in hierarchically-referenced data
EP2019362A2 (en) Spatial data validation systems
CN116610383B (en) Method for partially loading target file
CN112035474A (en) Data searching method and device
US20060230034A1 (en) Requirements management semantics modeling
CN114329090A (en) Path reference searching method and device, electronic equipment and storage medium
KR20150099456A (en) Methods and systems for filtering components in hierarchically-referenced data

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