Data search method, data search device and storage medium

By constructing a Bloom filter tree structure and using hash operations and OR operations, the problem of low data search efficiency in the tree structure is solved, and efficient data retrieval and synchronization is achieved in the case of large-scale nodes and sub-nodes.

CN118656529AInactive Publication Date: 2024-09-17E SURFING VISION TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411135612.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-09-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, the data search efficiency in the tree structure is low, which makes it difficult to guarantee the retrieval performance in the case of large-scale nodes and sub-nodes, and the synchronization process is time-consuming and cannot ensure the timeliness of the data.

Method used

Using the pre-built Bloom filter tree structure, by performing hash operation and OR operation on the device identification information, a Bloom filter tree of the target tree structure is constructed, and search is performed based on the Bloom filter tree to improve data search efficiency.

Benefits of technology

Through the use of Bloom filter tree structure, the data search efficiency is significantly improved, the search time is reduced, the timeliness of data synchronization is ensured, and it is suitable for data retrieval in large-scale tree structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656529A
    Figure CN118656529A
Patent Text Reader

Abstract

The invention relates to a data search method, a data search device and a storage medium, and the data search method comprises the steps: obtaining equipment identification information associated with each bottom layer node in a pre-constructed target tree structure; according to a preset Bloom filter digit and a hash function, performing hash operation on the equipment identification information to obtain node vectors corresponding to the bottom layer nodes respectively; taking the node vector of each bottom layer node as an operation starting point, sequentially performing OR operation on the node vectors of all nodes with the common father node in each hierarchy according to the hierarchical relationship of the target tree structure, and taking the OR operation result as the node vector of the common father node until the node vector of the root node of the target tree structure is obtained, constructing to obtain a Bloom filter tree of a target tree structure; on the basis of the Bloom filter tree, the node corresponding to the target device identification information is obtained through searching, and the data searching efficiency is improved through the data searching method and device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data search method, a data search device and a storage medium. Background Art

[0002] With the development of visual networking, more and more cameras are entering thousands of households. At the same time, a large number of scenario-based industry applications derived from cameras have also been born, such as smart homes, smart cities, telemedicine, etc. The common characteristics of these industry applications are: the data collected by cameras in all industry application scenarios has a tree-like hierarchical structure, and the entire business scenario involves multiple camera devices. In the tree structure, each node manages multiple sub-nodes, forming a complex hierarchical relationship. In a tree structure, when it is necessary to search and query the device list information under it, the latest device data must first be synchronized to the node of the tree structure, and then retrieved according to the latest synchronized tree structure. However, in the existing technology, it is necessary to manually collect data and synchronize it to the tree hierarchical structure, and the timeliness of data synchronization cannot be ensured. In addition, when searching, it is necessary to establish an index based on the relationship between each node and node in the tree structure, and traverse each node and sub-node in the tree structure according to the index. The conventional tree hierarchical structure takes a long time to search due to the large number of nodes and sub-nodes, and is obviously not applicable. At the same time, search and synchronization require independent computing resources. When the amount of data is large, the retrieval performance is difficult to guarantee.

[0003] There is currently no effective solution to the problem of low data search efficiency in related technologies. Summary of the invention

[0004] In this embodiment, a data search method, a data search device and a storage medium are provided to solve the problem of low data search efficiency in the related art.

[0005] In a first aspect, a data search method is provided in this embodiment, including: Obtaining device identification information associated with each bottom-level node in a pre-built target tree structure; wherein the target tree structure is a storage structure for storing associated device data; According to the preset Bloom filter bit number and hash function, the device identification information is hashed to obtain the node vectors corresponding to each bottom-level node; Taking the node vector of each bottom node as the operation starting point, according to the hierarchical relationship of the target tree structure, the node vectors of all nodes with a common parent node in each level are sequentially ORed, and the result of the ORed operation is used as the node vector of the common parent node until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; Based on the Bloom filter tree, a node corresponding to the target device identification information is searched and obtained.

[0006] In some of the embodiments, the device identification information includes a device name and a device code.

[0007] In some of the embodiments, a hash operation is performed on the device identification information according to a preset number of Bloom filter bits and a hash function to obtain a node vector corresponding to each underlying node, including: Segment the device name to obtain the segmented device name; Perform hash operation on the device name after word segmentation to obtain the device name node vector of each underlying node; Perform hash operation on the device code to obtain the device code node vector of each underlying node.

[0008] In some of the embodiments, searching for a node corresponding to the target device identification information based on the Bloom filter tree includes: Performing a hash operation on the target device identification information to obtain a target hash value of the target device identification information; Traverse the Bloom filter tree from top to bottom according to the target hash value: If the current node in the Bloom filter tree has the target hash value, determine whether the current node has a child node; If so, the child node of the current node is used as the new current node, and the target hash value is continued to be detected in the current node; until the current node has no child node or the child node of the current node does not have the target hash value, the last traversed current node is determined as the node position where the target hash value is located.

[0009] In some of the embodiments, if the target hash value does not exist in the current node in the Bloom filter tree traversal, the next node of the Bloom filter tree layer where the current node is located is traversed and the next node is used as the new current node.

[0010] In some embodiments, if all nodes in the current Bloom filter tree layer that have been traversed do not have the target hash value, the last determined node that has the target hash value is determined as the node position where the target hash value is located.

[0011] In some of the embodiments, the Bloom filter tree is traversed from top to bottom according to the target hash value of the target device identification information; If the target hash value does not exist in all nodes in the Bloom filter tree after traversing, the target data search result is no search content.

[0012] In some of the embodiments, all target vectors in the Bloom filter tree are obtained by traversing nodes of each layer and vectors in each node in the Bloom filter tree from bottom to top; According to all target vectors, determine from top to bottom whether each node in the tree structure to be updated synchronously has a target vector; wherein the Bloom filter tree is a part of the tree structure to be updated synchronously; If not, the target vector is added to the corresponding node position in the tree structure to be updated synchronously.

[0013] In a second aspect, a data search device is provided in this embodiment, comprising: an acquisition module, a hash operation module, a construction module and a search module, wherein: An acquisition module is used to acquire device identification information associated with each bottom-level node in a pre-built target tree structure; wherein the target tree structure is a storage structure for storing associated device data; A hash operation module is used to perform a hash operation on the device identification information according to a preset number of Bloom filter bits and a hash function to obtain a node vector corresponding to each underlying node; A construction module is used to use the node vectors of each bottom node as the operation starting point, and according to the hierarchical relationship of the target tree structure, sequentially perform an OR operation on the node vectors of all nodes with a common parent node in each level, and use the OR operation result as the node vector of the common parent node until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; The search module is used to search for nodes corresponding to the target device identification information based on the Bloom filter tree.

[0014] According to a third aspect, a storage medium is provided in this embodiment, on which a computer program is stored, and when the program is executed by a processor, the data search method described in the first aspect is implemented.

[0015] Compared with the related art, the data search method provided in the present embodiment obtains the device identification information respectively associated with each bottom-level node in a pre-constructed target tree structure; wherein the target tree structure is a storage structure for storing associated device data; according to a preset Bloom filter bit number and a hash function, a hash operation is performed on the device identification information to obtain a node vector corresponding to each bottom-level node; with the node vector of each bottom-level node as the starting point of the operation, according to the hierarchical relationship of the target tree structure, an OR operation is performed on the node vectors of all nodes with a common parent node in each level in turn, and the OR operation result is used as the node vector of the common parent node until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; based on the Bloom filter tree, a node corresponding to the target device identification information is searched for, thereby solving the problem of low data search efficiency and improving data search efficiency.

[0016] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 It is a hardware structure block diagram of the terminal of the data search method of this embodiment.

[0018] Figure 2 is a flow chart of the data search method of this embodiment.

[0019] Figure 3 Schematic diagram of the tree structure of this embodiment.

[0020] Figure 4 is a flow chart of another data search method of this embodiment.

[0021] Figure 5 It is a structural block diagram of the data search device of this embodiment. DETAILED DESCRIPTION

[0022] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0023] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0024] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the data search method of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0025] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data search method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0026] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0027] In this embodiment, a data search method is provided. Figure 2 is a flow chart of the data search method of this embodiment. Figure 2 As shown, the process includes the following steps: Step S201, obtaining device identification information associated with each bottom-level node in a pre-constructed target tree structure; wherein the target tree structure is a storage structure for storing associated device data.

[0028] In data storage, a tree structure refers to a tree-shaped data structure, which consists of nodes, each of which has zero or more child nodes, but only one parent node (except the root node, which has no parent node). A node is the basic unit of data storage and can contain data and connections to other nodes. The root node is the starting point of the tree and has no parent node. A child node is a node directly connected to a node and becomes a child of the node, which is called a parent node. A tree structure can be applied to data storage of file systems, data storage of databases, data storage of search engines, and data storage of network communications, etc. In this application, data is stored based on the business data under the current visual networking industry, and the regional location and equipment list data in the business data are stored as tree structure data to obtain a target tree structure. Among them, each bottom node in the target tree structure is associated with device identification information respectively. The target tree structure is improved, and the device identification information associated with each bottom node in the target tree structure is first obtained by a fuzzy search or a filtering search method. Among them, the device identification information includes: device ID, device code, network address, device name, device type, firmware version, software version, manufacturer information, permission information, energy consumption information, etc. This application mainly improves the target tree structure based on the device name and device code.

[0029] Step S202: performing a hash operation on the device identification information according to a preset Bloom filter bit number and a hash function to obtain a node vector corresponding to each bottom-level node.

[0030] Specifically, the filtering effect error rate of the node of the target tree structure is first set according to the needs. It can be set to one ten-thousandth with higher precision, or it can be set to one percent with coarse precision. The precision can be set according to actual needs, and this application does not make specific restrictions on this. According to the set filtering effect error rate of the tree node, the number of bits and hash function of the Bloom filter of the node is determined. If it is set to a filtering effect error rate of one ten-thousandth with high precision, the number of bits of the Bloom filter needs to be set to several thousand bits. If it is set to a filtering effect error rate of one percent with coarse precision, the number of bits of the Bloom filter can be set to hundreds of bits. The specific number of bits of the Bloom filter depends on the actual set filtering effect error rate. The selection of the hash function for the Bloom filter is also based on the preset filtering effect error rate, and is directly selected from the existing hash functions, such as MD5 (Message Digest Algorithm 5), SHA-1 (Secure Hash Algorithm 1), SHA-2, SHA-3, RIPEMD (RACE Integrity Primitives Evaluation Message Digest), etc. According to the selected hash function, a hash operation is performed on the device identification information of each bottom-level node obtained from the target tree structure. Through the hash operation, the device identification information is converted into a hash value to obtain a node vector corresponding to each bottom-level node.

[0031] Step S203, taking the node vector of each bottom node as the starting point of the operation, according to the hierarchical relationship of the target tree structure, the node vectors of all nodes with a common parent node in each level are ORed in turn, and the ORed result is used as the node vector of the common parent node, until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure.

[0032] Specifically, Figure 3 is a schematic diagram of the tree structure of this embodiment, such as Figure 3 As shown, 31 is the root node of the tree structure, 321 and 322 are the child nodes of the root node 31, and 33, 34, and 35 are parent nodes, 331 and 332 are the child nodes under the parent node 33, 341, 342, and 343 are the child nodes under the parent node 34, and 351 and 352 are the child nodes under the parent node 35; each node stores a vector of a preset number of bits corresponding to the device identification information, starting from the node vector of each bottom node of the tree structure as the starting point of the operation, first perform a bitwise OR operation on the node vectors of the bottom-level nodes under the same parent node, and obtain the OR operation result, which is used as the node vector of the parent node. The specific operation rule is 0|1=1. If at least one of the two corresponding bits is 1, the result bit is 1; if both bits are 0, the result bit is 0. As Figure 3 As shown, the vector in the bottom-level child node 331 is 00000001, and the vector in the child node 332 is 00000010. The two are bitwise ORed to obtain the vector of the parent node 00000011. The parent node is then used as a new operation node, and so on, the node vectors with a common parent node in each layer are bitwise ORed until the node vector of the root node of the target tree structure is calculated. All the node vectors after the calculation constitute a new tree structure, and the Bloom filter tree of the target tree structure is obtained. Figure 3 The tree structure shown is only an example and does not constitute a specific limitation on the tree structure of this embodiment.

[0033] Step S204: Based on the Bloom filter tree, search and obtain a node corresponding to the target device identification information.

[0034] Specifically, the target device identification information to be searched is input into the newly constructed Bloom filter tree, the Bloom filter tree is searched from top to bottom to obtain the node position where the target device identification information is located, and the device list of the target device is extracted according to the node position.

[0035] Through the above steps S201 to S204, the device identification information associated with each bottom-level node in the pre-constructed target tree structure is obtained; wherein the target tree structure is a storage structure for storing associated device data; according to the preset Bloom filter bit number and hash function, the device identification information is hashed to obtain the node vector corresponding to each bottom-level node; with the node vector of each bottom-level node as the starting point of the operation, according to the hierarchical relationship of the target tree structure, the node vectors of all nodes with a common parent node in each level are sequentially ORed, and the ORed result is used as the node vector of the common parent node until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; based on the Bloom filter tree, the node corresponding to the target device identification information is searched for. Compared with the prior art which directly searches for target devices through an unprocessed target tree structure, the present application sets a Bloom filter for each node in the target tree structure through a preset filtering effect error rate, and first performs a hash operation on the device identification information of the bottom-level node through the Bloom filter to obtain a node vector, and then performs a bitwise OR operation on the node vectors with a common parent node to obtain a node vector of the parent node, and in this way, until the node vector of the root node of the target tree structure is obtained, the vector conversion of the device identification information of the node is completed through the Bloom filter, and then the node vectors under the same parent node are merged through a bitwise OR operation, thereby completing the construction of the Bloom filter tree, reducing the storage amount of the device identification information in the original target tree structure, and improving the efficiency of data search.

[0036] In some embodiments, the device identification information includes a device name and a device code. According to a preset Bloom filter bit number and a hash function, a hash operation is performed on the device identification information to obtain a node vector corresponding to each underlying node, including: The device name is segmented to obtain the segmented device name; a hash operation is performed on the segmented device name to obtain the device name node vector of each bottom node; Perform hash operation on the device code to obtain the device code node vector of each underlying node.

[0037] Specifically, the device identification information includes: device ID, device code, network address, device name, device type, firmware version, software version, manufacturer information, permission information, energy consumption information, etc. In this embodiment, the device name and device code are mainly used to improve the target tree structure.

[0038] Among them, when the device name is used for hash operation, the device name often contains other information. For example, for the camera in the upper right corner of the playground, the device name is first segmented and divided into: playground, upper right corner, camera; then the three words after segmentation are hashed through a hash function to obtain the corresponding device name node vector, and the device name node vectors of the child nodes with a common parent node are bitwise ORed to obtain the device name node vector of the parent node, until the device name node vector of the root node of the target tree structure is obtained.

[0039] If the device code is used for hash operation, the device code is directly hashed to obtain a device code node vector, and the device code node vectors of the child nodes with a common parent node are bitwise ORed to obtain the device code node vector of the parent node, until the device code node vector of the root node of the target tree structure is obtained.

[0040] In another embodiment, searching for a node corresponding to the target device identification information based on the Bloom filter tree includes: Performing a hash operation on the target device identification information to obtain a target hash value of the target device identification information; Traverse the Bloom filter tree from top to bottom according to the target hash value: If the current node in the Bloom filter tree has the target hash value, determine whether the current node has a child node; If so, the child node of the current node is used as the new current node, and the target hash value is continued to be detected in the current node; until the current node has no child node or the child node of the current node does not have the target hash value, the last traversed current node is determined as the node position where the target hash value is located.

[0041] Specifically, since the data stored in the Bloom filter tree is a node vector after a hash operation and a bitwise OR operation, the target device identification information is first hashed based on a set hash function to obtain a target hash value of the target device identification information; Input the target hash value into the Bloom filter tree, and traverse each tree node from top to bottom according to the result of the Bloom filter tree; determine whether the corresponding target hash value exists in the currently traversed tree node, and if so, continue to determine whether there are any child nodes under the node. If the current node still has child nodes, continue to determine whether the target hash value exists in the child nodes, and so on, until the currently traversed node has no child nodes, then the last traversed current node is used as the node position where the target hash value is located, that is, the node corresponding to the target device identification information is searched, and the corresponding device list is extracted from the node.

[0042] In some embodiments, if the target hash value does not exist at the current node in the Bloom filter tree traversal, the next node of the Bloom filter tree layer where the current node is located is traversed and the next node is used as the new current node.

[0043] Specifically, when the target hash value does not exist in the current node in the Bloom filter tree, continue to traverse the next node of the Bloom filter tree at the same level as the node, and determine whether the corresponding target hash value exists in the tree node currently traversed. If so, continue to determine whether there are any child nodes under the node. If the current node still has child nodes, continue to determine whether the target hash value exists in the child nodes, and so on, until the currently traversed node does not have child nodes, then the last traversed current node is used as the node position where the target hash value is located, that is, the node corresponding to the target device information is searched and the corresponding device list is extracted from the node.

[0044] In another embodiment, if all nodes in the current Bloom filter tree layer that have been traversed do not have the target hash value, the last determined node that has the target hash value is determined as the node position where the target hash value is located.

[0045] Specifically, if the target hash value does not exist in all nodes in the current Bloom filter tree layer after traversing, the node where the target hash value exists in the previous layer is used as the target node position for searching, and the corresponding device list is extracted from the node position.

[0046] In some embodiments, the Bloom filter tree is traversed from top to bottom according to the hash value of the target device identification information; if no hash value exists in all nodes in the Bloom filter tree after traversing, the target data search result is no search content.

[0047] The target hash value of the target device identification information is input into the Bloom filter tree for traversal search from top to bottom. If the target hash value does not exist after traversing all nodes in the Bloom filter tree, it is determined that the target device identification information does not exist in the Bloom filter tree, and the search result is output as no search content, ending the search.

[0048] In another embodiment, each layer of nodes and the vectors in each node in the Bloom filter tree are traversed from bottom to top to obtain all target vectors in the Bloom filter tree; based on all target vectors, it is determined from top to bottom whether there is a target vector for each node in the tree structure to be updated synchronously; wherein the Bloom filter tree is part of the tree structure to be updated synchronously; if not, the target vector is added to the corresponding node position in the tree structure to be updated synchronously.

[0049] Specifically, in this embodiment, the target tree structure is a part of the entire tree structure to be synchronized and updated. After the Bloom filter tree is constructed for the target tree structure, if the Bloom filter tree has updated device identification information, the tree structure to be synchronized and updated is detected and updated. The specific process is as follows: Traverse each node of each layer of the Bloom filter tree from bottom to top, obtain the node vector in each node, obtain all node vectors of the Bloom filter tree, and use all node vectors as target vectors.

[0050] Input the target vector into the tree structure to be synchronized and updated, traverse each node in the tree structure to be synchronized and updated from top to bottom, and determine whether the target vector exists in the current node. If not, add the target vector to the current node to complete the synchronization of the target vector. If the target vector exists in the current node, it does not need to be synchronized.

[0051] This embodiment also provides a data search method. Figure 4 is a flow chart of another data search method of this embodiment. Figure 4 As shown, the process includes the following steps: Step S401, obtaining device identification information associated with each bottom-level node in the pre-built target tree structure; the device identification information includes a device name and a device code; Step S402, segmenting the device name to obtain the segmented device name; performing a hash operation on the segmented device name to obtain a device name node vector of each bottom-level node; performing a hash operation on the device code to obtain a device code node vector of each bottom-level node; Step S403, using the device name node vector and the device code node vector of each bottom node as the operation starting point, according to the hierarchical relationship of the target tree structure, sequentially performing an OR operation on the node vectors of all nodes with a common parent node in each hierarchy, and using the OR operation result as the node vector of the common parent node, until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; Step S404, performing a hash operation on the target device identification information to obtain a target hash value of the target device identification information; Step S405, traverse the Bloom filter tree from top to bottom according to the target hash value; Step S406, determine whether the current node in the traversed Bloom filter tree has the target hash value, if so, execute step S407, otherwise, execute step S409; Step S407, determine whether the current node has a child node, if yes, execute step S308, otherwise, execute step S411; Step S408, taking the child node of the current node as the new current node, and returning to step S406; Step S409, determining whether there is a next node in the Bloom filter tree layer where the currently traversed node is located, if so, executing step S410, otherwise, executing step S412; Step S410, taking the next node as the new current node, and returning to step S306; Step S411, determining the current node as the node position where the target hash value is located; Step S412: output the search result as no search content.

[0052] Through the above steps S401 to S412, a Bloom filter is constructed in each node in the target tree structure, and the device identification information in each node is hashed and bitwise ORed, thereby reducing the storage amount of the device identification information of each node. A Bloom filter tree is constructed, and the target device identification information is searched based on the Bloom filter tree, thereby improving the efficiency of data search.

[0053] In this embodiment, a data search device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceivable.

[0054] Figure 5 is a structural block diagram of the data search device of this embodiment, such as Figure 5As shown, the data search device 50 includes: an acquisition module 51, a hash operation module 52, a construction module 53 and a search module 54, wherein: The acquisition module 51 is used to acquire the device identification information associated with each bottom node in the pre-built target tree structure; wherein the target tree structure is a storage structure for storing associated device data; A hash operation module 52 is used to perform a hash operation on the device identification information according to a preset number of Bloom filter bits and a hash function to obtain a node vector corresponding to each bottom-level node; A construction module 53 is used to use the node vectors of each bottom node as the operation starting point, and according to the hierarchical relationship of the target tree structure, sequentially perform an OR operation on the node vectors of all nodes with a common parent node in each hierarchy, and use the OR operation result as the node vector of the common parent node, until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; The search module 54 is used to search for a node corresponding to the target device identification information based on the Bloom filter tree.

[0055] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0056] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0057] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0058] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program: S1, obtaining device identification information associated with each bottom-level node in a pre-constructed target tree structure; wherein the target tree structure is a storage structure for storing associated device data; S2, performing a hash operation on the device identification information according to the preset Bloom filter bit number and hash function to obtain the node vectors corresponding to each bottom-level node; S3, taking the node vector of each bottom node as the operation starting point, according to the hierarchical relationship of the target tree structure, sequentially performing an OR operation on the node vectors of all nodes with a common parent node in each level, and using the OR operation result as the node vector of the common parent node, until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; S4, based on the Bloom filter tree, search and obtain a node corresponding to the target device identification information.

[0059] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0060] In addition, in combination with the data search method provided in the above embodiment, a storage medium can also be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any one of the data search methods in the above embodiment is implemented.

[0061] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0062] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0063] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0064] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0065] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0066] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A data search method, characterized in that: include: Obtaining device identification information associated with each bottom-level node in a pre-constructed target tree structure; wherein the target tree structure is a storage structure for storing associated device data; According to a preset number of Bloom filter bits and a hash function, a hash operation is performed on the device identification information to obtain a node vector corresponding to each of the bottom-level nodes; Taking the node vector of each bottom node as the operation starting point, according to the hierarchical relationship of the target tree structure, sequentially performing an OR operation on the node vectors of all nodes having a common parent node in each hierarchy, and using the OR operation result as the node vector of the common parent node, until the node vector of the root node of the target tree structure is obtained, thereby constructing a Bloom filter tree of the target tree structure; Based on the Bloom filter tree, the node corresponding to the target device identification information is searched and obtained.

2. The data search method according to claim 1, characterized in that: The device identification information includes a device name and a device code.

3. The data search method according to claim 2, characterized in that: The method of performing a hash operation on the device identification information according to a preset number of Bloom filter bits and a hash function to obtain a node vector corresponding to each of the bottom-level nodes includes: Segmenting the device name to obtain a segmented device name; Performing a hash operation on the segmented device name to obtain a node vector of the device name of each bottom-level node; A hash operation is performed on the device code to obtain the device code node vector of each of the bottom-level nodes.

4. The data search method according to claim 1, characterized in that: The searching for the node corresponding to the target device identification information based on the Bloom filter tree includes: Performing a hash operation on the target device identification information to obtain a target hash value of the target device identification information; Traverse the Bloom filter tree from top to bottom according to the target hash value: If the target hash value exists in the current node in the Bloom filter tree, determining whether the current node has a child node; If so, the child node of the current node is used as the new current node, and the target hash value is continued to be detected in the current node; until the current node has no child node or the child node of the current node does not have the target hash value, the current node that was traversed last is determined as the node position where the target hash value is located.

5. The data search method according to claim 4, characterized in that: The method further comprises: If the target hash value does not exist in the current node in the Bloom filter tree when traversing the current node, traverse the next node of the Bloom filter tree layer where the current node is located, and use the next node as a new current node.

6. The data search method according to claim 5, characterized in that: The method further comprises: If none of the nodes in the current Bloom filter tree layer traversed have the target Hash value, the last determined node having the target Hash value is determined as the node position where the target Hash value is located.

7. The data search method according to claim 4, characterized in that: The method further comprises: Traversing the Bloom filter tree from top to bottom according to the target hash value of the target device identification information; If the target hash value does not exist in all nodes in the Bloom filter tree after traversing, the target data search result is no search content.

8. The data search method according to claim 1, characterized in that: The method further comprises: Traverse the nodes of each layer and the vectors in each node in the Bloom filter tree from bottom to top to obtain all target vectors in the Bloom filter tree; According to all the target vectors, judging from top to bottom whether each node in the tree structure to be updated synchronously has the target vector; wherein the Bloom filter tree is a part of the tree structure to be updated synchronously; If not, the target vector is added to the corresponding node position in the tree structure to be synchronously updated.

9. A data search device, characterized in that: include: Acquisition module, hash operation module, construction module and search module, among which, The acquisition module is used to acquire device identification information associated with each bottom-level node in a pre-constructed target tree structure; wherein the target tree structure is a storage structure for storing associated device data; The hash operation module is used to perform a hash operation on the device identification information according to a preset number of Bloom filter bits and a hash function to obtain a node vector corresponding to each of the bottom-level nodes; The construction module is used to use the node vector of each bottom node as the operation starting point, and according to the hierarchical relationship of the target tree structure, sequentially perform an OR operation on the node vectors of all nodes with a common parent node in each hierarchy, and use the OR operation result as the node vector of the common parent node, until the node vector of the root node of the target tree structure is obtained, so as to construct a Bloom filter tree of the target tree structure; The search module is used to search for the node corresponding to the target device identification information based on the Bloom filter tree.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data search method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Node address determining method and device in Internet of things

    CN106850541A

  • Block chain-based data storage method, electronic integral processing method and system

    CN112035491A

  • DEVICE SEARCH SYSTEM AND DEVICE SEARCH METHOD OF IoT SERVICE

    JP2018132943A

  • Data updating method and apparatus

    KR102000627B1

  • System, method, and service for organizing data for fast retrieval

    US20060218176A1