A method, device and storage medium for retrieving characteristic data

By using dimensionality reduction feature data and distributed storage instances in the field of artificial intelligence to find target object feature data in massive feature databases, the problem of retrieval efficiency and hardware cost of massive feature databases is solved, and efficient feature data retrieval is achieved.

CN110795432BActive Publication Date: 2024-08-30TENCENT CLOUD COMPUTING (BEIJING) CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN201911037803.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-29
Publication Date
2024-08-30
Estimated Expiration
2040-08-17

AI Technical Summary

Technical Problem

In the field of artificial intelligence, when faced with massive feature databases, existing technology requires high-performance hardware for data retrieval, resulting in increased hardware costs, and reducing hardware costs will affect retrieval efficiency.

Method used

By receiving the dimensionality reduction feature data in the retrieval request of the target object, find the correspondence between the data fragments and the retrieval instance, determine the response instance, and find and respond to the original feature data of the target object through the retrieval instance of distributed storage, using hashing processing and blockchain networks for data storage and retrieval.

Benefits of technology

It improves the efficiency of feature data retrieval while reducing hardware costs, and is suitable for non-high-performance computing servers to complete high-performance feature data retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110795432B
    Figure CN110795432B
Patent Text Reader

Abstract

The present invention provides a method, device and storage medium for retrieving feature data. The method includes: receiving a retrieval request for a target object, the retrieval request carrying reduced-dimensional feature data corresponding to the original feature data representing the target object; based on the reduced-dimensional feature data, searching for the correspondence between the data slices of the reduced-dimensional feature data and the retrieval instance, and determining the retrieval instance for responding to the retrieval request; sending the retrieval request to the determined retrieval instance, so that the retrieval instance responds to the retrieval request, searches for the original feature data corresponding to the target object based on the reduced-dimensional feature data; and responds to the retrieval request based on the original feature data corresponding to the target object. Through the present invention, the retrieval efficiency of the original feature data corresponding to the target object can be improved while reducing the hardware cost required for the data retrieval process in a massive feature library.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to big data processing technology in the field of artificial intelligence (AI), and in particular to a method, device and storage medium for retrieving feature data. Background Art

[0002] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Artificial intelligence technology has now developed rapidly and is widely used in various industries, such as retrieval applications of high-dimensional feature data.

[0003] At present, in related artificial intelligence technologies, when faced with the problem of data retrieval in massive feature databases, hardware with relatively high performance requirements is generally used to complete data retrieval. For example, when the magnitude of the feature database reaches the million level, it is generally processed with the help of graphics processing unit (GPU) hardware acceleration. It can be seen that related technologies need to use hardware with better performance to achieve the retrieval of massive high-dimensional data, which brings about the problem of rising hardware costs. However, if the hardware cost is reduced, it will seriously affect the retrieval efficiency of high-dimensional feature data. Summary of the invention

[0004] The embodiments of the present invention provide a method, device and storage medium for retrieving feature data, which can reduce the hardware cost required for the data retrieval process in a massive feature library while improving the retrieval efficiency of the original feature data corresponding to the target object.

[0005] The technical solution of the embodiment of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a method for retrieving feature data, the method comprising:

[0007] Receiving a search request for a target object, wherein the search request carries reduced-dimensional feature data corresponding to original feature data representing the target object;

[0008] Based on the reduced dimension feature data, searching for a corresponding relationship between a data slice of the reduced dimension feature data and a search instance, and determining a search instance for responding to the search request;

[0009] Send the search request to the determined search instance so that

[0010] The retrieval instance searches for original feature data corresponding to the target object based on the reduced dimension feature data in response to the retrieval request;

[0011] The search request is responded to based on the original feature data corresponding to the target object.

[0012] The embodiment of the present invention further provides a device for retrieving feature data, the device comprising:

[0013] A receiving unit, configured to receive a search request for a target object, wherein the search request carries reduced-dimensional feature data corresponding to original feature data representing the target object;

[0014] A determination unit, configured to search for a correspondence between a data slice of the dimensionality reduction feature data and a retrieval instance based on the dimensionality reduction feature data, and determine a retrieval instance for responding to the retrieval request;

[0015] A retrieval unit, configured to send the retrieval request to the determined retrieval instance, so that the retrieval instance responds to the retrieval request and searches for original feature data corresponding to the target object based on the reduced dimension feature data;

[0016] The search request is responded to based on the original feature data corresponding to the target object.

[0017] In the above solution, the receiving unit is further used for:

[0018] Calling the search access interface for the search client;

[0019] A search request for the target object is received through the search access interface.

[0020] In the above solution, the determining unit is further used for:

[0021] Determine the data shard to which the dimension reduction feature data belongs;

[0022] Based on the correspondence between the data slices of the dimensionality reduction feature data and the retrieval instance, searching for the retrieval instance corresponding to the data slice to which the dimensionality reduction feature data belongs;

[0023] The found retrieval instance is used as the retrieval instance for responding to the retrieval request.

[0024] In the above solution, the retrieval unit is also used for:

[0025] Performing hash processing on the reduced-dimensionality feature data to obtain a hash value corresponding to the reduced-dimensionality feature data;

[0026] Determine an identifier of a hash bucket to which the hash value is mapped;

[0027] The original feature data corresponding to the target object is searched from the hash bucket corresponding to the identifier of the hash bucket.

[0028] In the above solution, the retrieval unit is also used for:

[0029] Based on the dimension reduction feature data, searching for a correspondence between an identifier of a search instance and an identifier of a feature database in a routing table, and determining a feature database corresponding to the identifier of the search instance;

[0030] The original feature data corresponding to the target object is searched from the determined feature database.

[0031] In the above solution, the feature data retrieval device further includes:

[0032] The receiving unit is further used to receive original feature data in the first space;

[0033] A dimensionality reduction processing unit, used for performing dimensionality reduction processing on the original feature data to obtain reduced-dimensionality feature data corresponding to the original feature data in a second space, wherein the dimension of the first space is greater than the dimension of the second space, and the reduced-dimensionality feature data in the second space is distributedly stored in a plurality of retrieval instances;

[0034] A storage unit is used to store the original feature data and the corresponding reduced-dimensional feature data in a hash table.

[0035] In the above solution, the dimension reduction processing unit is further used for:

[0036] Obtaining a dimension reduction vector for reducing the dimension of feature data;

[0037] Determine the positional relationship between each value in the dimension reduction vector and the data points corresponding to the original feature data;

[0038] Based on the positional relationship, determining a binary code value of a data point corresponding to the original feature data;

[0039] Based on the combination of the binary code values, the dimension-reduced feature data corresponding to the original feature data in the second space is obtained.

[0040] In the above solution, the feature data retrieval device further includes:

[0041] A sending unit is used to send the target object and the corresponding original feature data to the blockchain network so that

[0042] The nodes of the blockchain network fill the target object and the corresponding original feature data into a new block, and when a consensus is reached on the new block, the new block is appended to the end of the blockchain.

[0043] An embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0044] A memory for storing executable instructions;

[0045] The processor is used to implement the feature data retrieval method provided by the embodiment of the present invention when executing the executable instructions stored in the memory.

[0046] The embodiment of the present invention further provides a storage medium storing executable instructions, which, when executed, are used to implement the feature data retrieval method provided by the embodiment of the present invention.

[0047] The application of the above embodiments of the present invention has the following beneficial effects:

[0048] The feature data retrieval method, device and storage medium provided in the embodiments of the present invention are used to determine the retrieval instance that responds to the retrieval request through the reduced-dimensional feature data corresponding to the original feature data of the target object. The distributed stored retrieval instance is responsible for responding to the retrieval request and searching for the original feature data corresponding to the target object based on the reduced-dimensional feature data. Since the retrieval instance runs in a distributed manner on the computing server, it can independently respond to the retrieval request to share the load and complete high-performance feature data retrieval. In this way, the technical solution of the embodiments of the present invention is not limited by hardware costs and is suitable for non-high-performance computing servers. It can reduce the hardware cost required for the data retrieval process in the massive feature library while improving the retrieval efficiency of the original feature data corresponding to the target object. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A schematic diagram of an optional architecture of a feature data retrieval system 10 provided in an embodiment of the present invention;

[0050] Figure 2A A schematic diagram of an optional hardware structure of an electronic device 40 provided in an embodiment of the present invention;

[0051] Figure 2B A schematic diagram of an optional structure of a feature data retrieval device 455 provided in an embodiment of the present invention;

[0052] FIG. 3A to FIG. 3E An optional flowchart of a method for retrieving feature data provided by an embodiment of the present invention;

[0053] Figure 4 A schematic diagram showing the comparative effects of using a general hash algorithm and a local sensitive hash algorithm for data dimensionality reduction provided in an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of the architecture of a feature data retrieval device 455 provided in an embodiment of the present invention;

[0055] Figure 6 An optional structural diagram of a blockchain in the blockchain network 81 provided in an embodiment of the present invention;

[0056] Figure 7 A schematic diagram of the functional architecture of the blockchain network 81 provided in an embodiment of the present invention;

[0057] Figure 8 An optional schematic diagram of the principle structure of a method for retrieving feature data provided in an embodiment of the present invention;

[0058] Fig. 9 A schematic diagram of the implementation principle of data dimensionality reduction provided by an embodiment of the present invention;

[0059] Fig.10 A schematic diagram of a process of data dimensionality reduction using local sensitive hashing provided in an embodiment of the present invention;

[0060] FIG. 11A to FIG. 11C A probability distribution diagram of any two data points in the same bucket provided by an embodiment of the present invention;

[0061] Fig.12 A schematic diagram of searching for original feature data corresponding to a target object provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.

[0063] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments. However, it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments, and the various technical solutions recorded in the embodiments of the present invention may be combined with each other without conflict.

[0064] In the following description, the terms "first", "second", etc. are only used to distinguish similar objects and do not represent a specific order or sequence for the objects. It can be understood that "first", "second", etc. can be interchanged with the specific order or sequence where permitted, so that the embodiments of the present invention described here can be implemented in an order other than that shown or described.

[0065] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meanings as those commonly understood by those skilled in the art of the technical field of the embodiments of the present invention. The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0066] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described first. The nouns and terms involved in the embodiments of the present invention are subject to the following explanations.

[0067] 1) Feature data, represented as a high-dimensional feature vector. In the field of artificial intelligence, the target object is usually represented as a high-dimensional feature vector through a nonlinear system for numerical calculation.

[0068] 2) Dimensionality reduction (Embedding), which is used to represent the process of converting high-dimensional feature vectors into low-dimensional feature vectors, thereby reducing the complexity of data calculation.

[0069] 3) Hash is used to represent the process of converting an input of arbitrary length into an output of fixed length through a hash algorithm. The fixed-length output is the hash value. This conversion is actually a compression mapping, that is, the space of hash values ​​is usually much smaller than the space of inputs. Different inputs may hash to the same output, so it is impossible to determine the unique input value from the hash value.

[0070] 4) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.

[0071] 5) Transaction, which is equivalent to the computer term "transaction". Transaction includes operations that need to be submitted to the blockchain network for execution, and does not refer only to transactions in a business context. In view of the conventional use of the term "transaction" in blockchain technology, the embodiments of the present invention follow this convention.

[0072] For example, the Deploy transaction is used to install the specified smart contract to the nodes in the blockchain network and prepare it to be called; the Invoke transaction is used to append transaction records to the blockchain by calling the smart contract and perform operations on the blockchain's state database, including update operations (including adding, deleting, and modifying key-value pairs in the state database) and query operations (i.e. querying key-value pairs in the state database).

[0073] 6) Blockchain is an encrypted, chained transaction storage structure formed by blocks.

[0074] For example, the header of each block can include the hash value of all transactions in the block as well as the hash value of all transactions in the previous block, thereby achieving tamper-proof and anti-forgery of transactions in the block based on the hash value; newly generated transactions are filled into the block and after consensus among nodes in the blockchain network, they will be appended to the end of the blockchain to form a chain-like growth.

[0075] 7) Blockchain Network: A collection of nodes that incorporate new blocks into the blockchain through consensus.

[0076] 8) Ledger is a general term for blockchain (also called ledger data) and the status database synchronized with the blockchain.

[0077] Among them, the blockchain records transactions in the form of files in the file system; the state database records transactions in the blockchain in the form of different types of key (Key) value (Value) pairs to support fast queries on transactions in the blockchain.

[0078] 9) Smart Contracts, also known as chain code or application code, are programs deployed in the nodes of the blockchain network. The program is triggered and executed according to conditions. The node executes the smart contract called in the received transaction to update or query the key-value data of the state database.

[0079] 10) Consensus is a process in the blockchain network used to reach agreement on transactions in a block among multiple nodes involved. The agreed blocks will be appended to the end of the blockchain. The mechanisms for achieving consensus include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.

[0080] The feature data retrieval method provided in the embodiment of the present invention relates to the big data processing technology in the field of artificial intelligence. The big data processing technology can be realized by machine learning technology. The machine learning technology is described below. Machine learning (ML) is a multi-field cross-disciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or realize human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all fields of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning and inductive learning. The embodiment of the present invention can retrieve the original feature data corresponding to the target object from a massive feature database through machine learning technology, which has a very high application value in the retrieval application of massive high-dimensional data.

[0081] The following describes an exemplary application of an electronic device that implements the feature data retrieval method of an embodiment of the present invention. The electronic device provided by the embodiment of the present invention can be implemented as various types of terminal devices such as laptops, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), and can also be implemented in collaboration between a terminal device and a server, wherein the server can be a cloud server, but the embodiments of the present invention are not limited to cloud servers.

[0082] The following uses the collaborative implementation of a terminal device and a server as an example to illustrate an exemplary application of the feature data retrieval system of an embodiment of the present invention with reference to the accompanying drawings. Figure 1 , Figure 1An optional architecture diagram of a feature data retrieval system 10 provided in an embodiment of the present invention. To implement an exemplary application supported, a terminal 100 (exemplarily showing terminal 100-1 and terminal 100-2) initiates a retrieval request for a target object to a server 300 through a network 200. The server 300 receives the retrieval request by calling a retrieval access interface for all retrieval clients in the terminal 100 (such as a client for image retrieval, a client for music retrieval, etc.), and calls a retrieval function for massive high-dimensional data provided by the server 300 to execute the feature data retrieval method provided in an embodiment of the present invention. Specifically, after obtaining a retrieval request for a target object, first, based on the reduced dimension feature data corresponding to the original feature data for representing the target object carried in the retrieval request, the corresponding relationship between the data slice of the reduced dimension feature data and the retrieval instance is searched, and a retrieval instance for responding to the retrieval request is determined, wherein the retrieval instance runs in a distributed manner in the server 300, and then a retrieval request is sent to the determined retrieval instance, so that the retrieval instance responds to the retrieval request, searches for the original feature data corresponding to the target object based on the reduced dimension feature data, and returns the search result of the original feature data corresponding to the target object to the terminal 100.

[0083] It should be noted that the terminal 100 can be connected to the server 300 through the network 200 based on various wireless communication methods or wired communication methods. The network 200 can be a wide area network or a local area network, or a combination of the two, using a wireless link to achieve data transmission.

[0084] Terminal 100 can display various intermediate results and final results in the retrieval process of feature data in the graphical interface 110 (for example, graphical interface 110-1 of terminal 100-1 and graphical interface 110-2 of terminal 100-2), for example, displaying the identifier of a determined retrieval instance, or displaying the original feature data corresponding to the found target object.

[0085] Next, the hardware structure of the electronic device implementing the feature data retrieval method of the embodiment of the present invention is described. The electronic device can be implemented as a terminal device, and can also be the above Figure 1 The collaborative implementation of the terminal device and the server is shown.

[0086] See also Figure 2A , Figure 2A This is an optional hardware structure diagram of an electronic device 40 provided in an embodiment of the present invention. It can be understood that: Figure 2A Only exemplary structures of electronic devices are shown, not all structures, and may be implemented as needed. Figure 2AThe electronic device 40 provided in the embodiment of the present invention includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the electronic device 40 are coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 2A Various buses are labeled as bus system 440 .

[0087] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0088] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0089] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0090] The memory 450 includes a volatile memory or a nonvolatile memory, and may also include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiment of the present invention is intended to include any suitable type of memory.

[0091] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0092] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0093] A network communication module 452, for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);

[0094] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);

[0095] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0096] In some embodiments, the feature data retrieval device provided in the embodiments of the present invention can be implemented in software. Figure 2A The retrieval device 455 of the characteristic data stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including a series of software modules, see Figure 2B , Figure 2B A schematic diagram of an optional structure of a feature data retrieval device 455 provided in an embodiment of the present invention, for example, the feature data retrieval device 455 includes a receiving unit 4551, a determining unit 4552 and a retrieval unit 4553. The functions of these units are logical, and therefore, they can be arbitrarily combined or further split according to the functions implemented by each software module. Here, it should be noted that for Figure 2B The specific functions of the various units in the feature data retrieval device 455 provided by the embodiment of the present invention will be described below.

[0097] In other embodiments, the feature data retrieval device 455 provided in the embodiment of the present invention can be implemented in hardware. As an example, the feature data retrieval device 455 provided in the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the feature data retrieval method provided in the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0098] The following will describe the implementation of the feature data retrieval method provided by the embodiment of the present invention in conjunction with the exemplary application and implementation of the electronic device provided by the embodiment of the present invention. The feature data retrieval method provided by the embodiment of the present invention can be used for online data retrieval applications.

[0099] See also Figure 3A , Figure 3A This is an optional flow chart of the feature data retrieval method provided in the embodiment of the present invention. It can be understood from the above that the feature data retrieval method provided in the embodiment of the present invention can be implemented by the terminal device and the server (such as a cloud server) in collaboration, or by the terminal device alone. Figure 3A The steps shown are explained.

[0100] Step 301: The terminal device initiates a search request for a target object to a cloud server.

[0101] In an embodiment of the present invention, the target object may be represented as a high-dimensional feature vector. For example, the target object may be represented as a high-dimensional feature vector of a news webpage, article, or image, etc., which is not limited here.

[0102] Step 302: The cloud server receives a search request for a target object, where the search request carries reduced-dimensional feature data corresponding to original feature data representing the target object.

[0103] In an embodiment of the present invention, the original feature data of the target object is the feature data in the high-dimensional space, and the reduced-dimensional feature data corresponding to the original feature data of the target object is the feature data in the low-dimensional space, that is, the original feature data of the target object in the high-dimensional space can be processed by reducing the dimension to obtain the corresponding reduced-dimensional feature data in the low-dimensional space, thereby reducing the complexity of data calculation. It should be noted that the process of reducing the dimension of the original feature data of the target object in the embodiment of the present invention must meet the conditions of Locality Sensitive Hashing (LSH), that is, the similarity between the original feature data and the similarity between the reduced-dimensional feature data obtained after the dimensionality reduction process should be consistent. The application of local sensitive hashing in the process of data dimensionality reduction will be explained below.

[0104] In some embodiments, see Figure 3B , Figure 3B An optional flow chart of a method for retrieving feature data provided in an embodiment of the present invention, based on Figure 3A In the above step 302, the cloud server receives the search request for the target object, which can be achieved through the following steps 3021 and 3022, which will be explained in combination with each step below.

[0105] Step 3021, calling the search access interface for the search client.

[0106] Step 3022: Receive a search request for the target object through the search access interface.

[0107] Specifically, a retrieval client is provided in the terminal device, for example, a client for retrieving images. The cloud server receives a retrieval request for a target object initiated by the retrieval client through a retrieval access interface. The retrieval access interface is open to all retrieval clients. That is to say, all retrieval clients in the terminal device can request access to the cloud server through the retrieval access interface to determine the retrieval instance that responds to the retrieval request. It can be seen that the retrieval access interface in the embodiment of the present invention is consistent.

[0108] Step 303: The cloud server searches for the corresponding relationship between the data slices of the dimensionality reduction feature data and the retrieval instance based on the dimensionality reduction feature data, and determines the retrieval instance for responding to the retrieval request.

[0109] In some embodiments, see Figure 3C , Figure 3C An optional flow chart of a method for retrieving feature data provided in an embodiment of the present invention, based on Figure 3AIn the above step 303, the cloud server searches for the correspondence between the data slices of the dimensionality reduction feature data and the retrieval instance based on the dimensionality reduction feature data, and determines the retrieval instance used to respond to the retrieval request. This can be achieved by the following steps 3031 and 3032, which will be explained in combination with each step below.

[0110] Step 3031, determine the data shard to which the dimension reduction feature data belongs.

[0111] Step 3032, based on the correspondence between the data slices of the dimensionality reduction feature data and the retrieval instances, search for the retrieval instances corresponding to the data slices to which the dimensionality reduction feature data belongs, and use the searched retrieval instances as the retrieval instances for responding to the retrieval request.

[0112] In an embodiment of the present invention, the correspondence between the data sharding of the dimension reduction feature data and the retrieval instance is pre-set according to actual needs, and the dimension reduction feature data is dispersedly stored in the retrieval instance according to the correspondence, and each retrieval instance is responsible for responding to the retrieval request corresponding to the maintained dimension reduction feature data. Each retrieval instance will run on one or more machines, and can respond to the retrieval request independently, thereby sharing the load, or multiple retrieval instances can respond to the retrieval request in parallel, thereby improving the efficiency of data retrieval.

[0113] Step 304, sends a retrieval request to the determined retrieval instance, so that the retrieval instance responds to the retrieval request, searches for the original feature data corresponding to the target object based on the dimensionality reduction feature data, and responds to the retrieval request based on the original feature data corresponding to the target object, so as to return the found original feature data corresponding to the target object to the terminal device.

[0114] In some embodiments, see Figure 3D , 3D is an optional flow chart of a method for retrieving feature data provided by an embodiment of the present invention, based on Figure 3A In the above step 304, the cloud server searches for the original feature data corresponding to the target object based on the dimension reduction feature data, which can be achieved by following the steps 3041 to 3043, which will be explained in combination with each step below.

[0115] Step 3041, hashing the reduced dimension feature data to obtain a hash value corresponding to the reduced dimension feature data.

[0116] Step 3042, determine the identifier of the hash bucket to which the hash value is mapped.

[0117] Step 3043: search the hash bucket corresponding to the identifier of the hash bucket for the original feature data corresponding to the target object.

[0118] In an embodiment of the present invention, the cloud server may use a hash algorithm, such as a remainder division method, a direct addressing method, etc., to perform hash processing on the reduced dimension feature data to obtain a hash value corresponding to the reduced dimension feature data, and then, according to a mapping relationship between a preset hash value and a hash bucket identifier, search for the identifier of the hash bucket mapped to the determined hash value, and then narrow the search range, that is, search for the original feature data corresponding to the target object from the hash bucket corresponding to the hash bucket identifier, wherein the mapping relationship between the hash value and the hash bucket identifier can be stored in a hash routing table. It can be seen that the embodiment of the present invention calculates the hash value corresponding to the reduced dimension feature data, and then uses a hash routing table to realize the search for the original feature data corresponding to the target object. This search method is generally suitable for application scenarios where the number of feature databases is large and the capacity of a single feature database is small.

[0119] In other embodiments, see Figure 3E , Figure 3E An optional flow chart of a method for retrieving feature data provided in an embodiment of the present invention, based on Figure 3A In the above step 304, the cloud server searches for the original feature data corresponding to the target object based on the reduced dimension feature data, which can also be achieved through the following steps 3044 and 3045, which will be explained in combination with each step below.

[0120] Step 3044: Based on the dimension reduction feature data, find the correspondence between the identifier of the retrieval instance in the routing table and the identifier of the feature database, and determine the feature database corresponding to the identifier of the retrieval instance.

[0121] Step 3045: search the determined feature database for the original feature data corresponding to the target object.

[0122] In the embodiment of the present invention, the cloud server can pre-set the corresponding relationship between the identifier of the retrieval instance and the identifier of the feature database in a routing table according to actual needs, and can search the original feature data corresponding to the target object from the feature database corresponding to the reduced dimension feature data through the query of the routing table. This search method is generally suitable for application scenarios with a small number of feature databases and a large capacity of a single feature database.

[0123] In some embodiments, before the process of retrieving feature data is implemented, offline pre-storage processing of feature data is required. In the embodiments of the present invention, a large amount of feature data in a massive feature database is distributedly stored to reduce the performance requirements of the storage component, thereby realizing the storage of massive feature data in a high-performance distributed storage manner, while reducing the cost of the storage component, and improving the storage speed of massive feature data. The storage process of massive feature data is described below. Before the process of retrieving feature data is implemented, the feature data retrieval method may also include: receiving original feature data in a first space; performing dimensionality reduction processing on the original feature data to obtain reduced dimensionality feature data corresponding to the original feature data in a second space, the dimension of the first space is more than the dimension of the second space, and the reduced dimensionality feature data in the second space is distributedly stored in multiple retrieval instances; storing the original feature data and the corresponding reduced dimensionality feature data in a hash table.

[0124] In actual implementation, the original feature data is subjected to dimensionality reduction processing to obtain the reduced-dimensional feature data corresponding to the original feature data in the second space. This can be achieved in the following manner: obtaining a reduced-dimensionality vector for reducing the dimensionality of the feature data; determining the positional relationship between each value in the reduced-dimensionality vector and the data points corresponding to the original feature data; based on the positional relationship, determining the binary coding value of the data point corresponding to the original feature data; based on the combination of the binary coding values, obtaining the reduced-dimensional feature data corresponding to the original feature data in the second space.

[0125] It should be noted that the embodiment of the present invention encodes the data points corresponding to the original feature data to reduce the dimensionality of the original feature data by moving the data points distributed in the high-dimensional space into the low-dimensional space. The process of reducing the dimensionality of the original feature data in the embodiment of the present invention must meet the conditions of Locality Sensitive Hashing (LSH), that is, the similarity between the original feature data and the similarity between the reduced dimensional feature data obtained after the dimensionality reduction process should remain consistent.

[0126] The principle of local sensitive hashing is explained below. The basic idea of ​​local sensitive hashing is similar to a spatial domain conversion idea. For example, if two texts are similar in the original data space, then after being converted by the hash function, they also have a high degree of similarity; on the contrary, if the two texts are not similar in the original data space, then they still have no similarity after being converted by the hash function. In other words, local sensitive hashing can maintain the maximum possible similarity of data during the dimensionality reduction process of feature data. This is because the higher the dimension corresponding to the feature data, the greater the amount of information. If the feature data is reduced in dimension, the information reflected by the reduced dimension feature data will inevitably be lost. The above-mentioned local sensitive hashing algorithm is used to reduce the dimension of the original feature data, that is, the similarity between the original feature data and the similarity between the reduced dimension feature data obtained after the dimensionality reduction process are kept consistent, which can avoid the problem of information loss to the greatest extent.

[0127] For example, see Figure 4 , Figure 4 A schematic diagram of the comparative effect of using a general hash algorithm and a local sensitive hash algorithm for data dimensionality reduction provided in an embodiment of the present invention, assuming that a, b, c, and d are four data points in a high-dimensional space, where a and b are "neighbor" data points in the high-dimensional space, that is, the similarity between a and b is relatively high (the similarity between data points can be characterized by calculating the distance between data points a and b, such as the Hamming distance, the Euclidean distance, etc.), and the similarity between c and d is relatively high, such as Figure 4 As shown in the left figure, if the universal hash algorithm is used for data dimensionality reduction, after a, b, c, and d are converted by the universal hash algorithm through the hash function, the data points a and b with high similarity fall into two hash buckets A1 and A6 in the low-dimensional space, and the data points c and d with high similarity fall into two hash buckets A4 and A3 in the low-dimensional space. Obviously, the two data points with high similarity fall into different hash buckets after the ordinary hash transformation, but in fact, only the data points that fall into the same hash bucket have a greater probability of being similar. Figure 4 As shown in the right figure, if the locally sensitive hashing algorithm is used for data dimensionality reduction, after a, b, c, and d are hashed through the locally sensitive hash function, the data points a and b with high similarity themselves fall into the same hash bucket A1 in the low-dimensional space, and the data points c and d with high similarity themselves fall into the same hash bucket A4 in the low-dimensional space. Obviously, the embodiment of the present invention uses the locally sensitive hashing algorithm for data dimensionality reduction, which can enable the data to maintain the maximum possible similarity before and after dimensionality reduction, and reduce the degree of loss of target object information expressed by the dimensionality reduction feature data.

[0128] In some examples, the locality-sensitive hashing function needs to satisfy the following two conditions simultaneously: 1) If d(x, y) ≤ d1, the probability that h(x) = h(y) is at least p1; 2) If d(x, y) ≥ d2, the probability that h(x) = h(y) is at most p2; where d(x, y) represents the distance between data points x and y, d1 and d2 represent distance thresholds respectively, and d1 < d2, and h(x) and h(y) represent the hash values obtained by performing hash transformation on data points x and y respectively.

[0129] To facilitate the storage and query of the target object and the corresponding original feature data, in some embodiments, the retrieval method of the feature data further includes: sending the target object and the corresponding original feature data to the blockchain network, so that the nodes of the blockchain network fill the target object and the corresponding original feature data into a new block, and when consensus is reached on the new block, append the new block to the tail of the blockchain.

[0130] See Figure 5 , Figure 5 FIG. 455 is a schematic structural diagram of a retrieval device for feature data provided by an embodiment of the present invention, including a blockchain network 81 (exemplarily showing consensus nodes 810-1 to 810-3), an authentication center 82, a service entity 83, and a service entity 84, which will be described separately below.

[0131] The type of the blockchain network 81 is flexible and diverse. For example, it can be any one of a public chain, a private chain, or a consortium chain. Taking the public chain as an example, the electronic devices of any service entity, such as user terminals and servers (such as cloud servers), can access the blockchain network 81 without authorization; taking the consortium chain as an example, the electronic devices (such as terminals / servers) under the jurisdiction of a service entity can access the blockchain network 81 after obtaining authorization, and at this time, become a client node in the blockchain network 81.

[0132] In some embodiments, the client node can only be an observer of the blockchain network 81, that is, provide functions to support service entities to initiate transactions (for example, for storing data on the chain or querying data on the chain). For the functions of the consensus nodes 810 in the blockchain network 81, such as sorting functions, consensus services, and ledger functions, etc., the client node can be default or selectively (for example, depending on the specific business requirements of the service entity) implemented. Thus, the data and business processing logic of the service entity can be migrated to the blockchain network 81 to the greatest extent, and the credibility and traceability of the data and business processing process can be achieved through the blockchain network 81.

[0133] The consensus nodes in the blockchain network 81 receive from different service entities (such as Figure 583 and business subject 84) shown in the client node (for example, Figure 5 The client node 410 belonging to the business subject 83 and the client node 510 belonging to the business subject 84 shown in the figure) submit transactions, execute transactions to update the ledger or query the ledger, and various intermediate results or final results of the transaction can be returned to the client node of the business subject for display.

[0134] For example, the client node 410 / 510 can subscribe to events of interest in the blockchain network 81, such as transactions occurring in a specific organization / channel in the blockchain network 81, and the consensus node 810 pushes the corresponding transaction notification to the client node 410 / 510, thereby triggering the corresponding business logic in the client node 410 / 510.

[0135] The following uses the example of multiple business entities accessing the blockchain network to manage target objects and corresponding original feature data to illustrate the exemplary application of the blockchain network. Figure 5 , multiple business entities involved in the management link, such as business entity 83, which can be the client corresponding to the feature data retrieval device, and business entity 84, which can be a display system with a playback and display function, register with the authentication center 82 to obtain their respective digital certificates. The digital certificate includes the public key of the business entity and the digital signature signed by the authentication center 82 on the public key and identity information of the business entity, which is used to attach to the transaction together with the digital signature of the business entity for the transaction, and is sent to the blockchain network, so that the blockchain network can take out the digital certificate and signature from the transaction, verify the reliability of the message (i.e., whether it has not been tampered with) and the identity information of the business entity that sent the message. The blockchain network 81 will verify according to the identity, such as whether it has the authority to initiate a transaction. The client running on the electronic device (such as a terminal or server) under the jurisdiction of the business entity can request access to the blockchain network 81 and become a client node.

[0136] The client node 410 of the business entity 83 is used to receive a retrieval request for a target object, wherein the retrieval request carries the reduced dimension feature data corresponding to the original feature data representing the target object; based on the reduced dimension feature data, the correspondence between the data slices of the reduced dimension feature data and the retrieval instance is searched to determine the retrieval instance for responding to the retrieval request; the retrieval request is sent to the determined retrieval instance so that the retrieval instance responds to the retrieval request and searches for the original feature data corresponding to the target object based on the reduced dimension feature data; the retrieval request is responded to based on the original feature data corresponding to the target object, so as to send the target object and the corresponding original feature data to the blockchain network 81.

[0137] Among them, the target object and the corresponding original feature data are sent to the blockchain network 81. The business logic can be set in advance in the client node 410. When the original feature data corresponding to the target object is found, the client node 410 automatically sends the target object and the corresponding original feature data to the blockchain network 81. The business personnel of the business entity 83 can also log in to the client node 410, manually pack the target object and the corresponding original feature data, and send them to the blockchain network 81. When sending, the client node 410 generates a transaction corresponding to the update operation according to the target object and the corresponding original feature data. The transaction specifies the smart contract to be called to implement the update operation and the parameters passed to the smart contract. The transaction also carries the digital certificate of the client node 410 and the signed digital signature (for example, the summary of the transaction is encrypted using the private key in the digital certificate of the client node 410), and the transaction is broadcast to the consensus node 810 in the blockchain network 81.

[0138] When the consensus node 810 in the blockchain network 81 receives the transaction, it verifies the digital certificate and digital signature carried in the transaction. After successful verification, it confirms whether the business subject 83 has the transaction authority based on the identity of the business subject 83 carried in the transaction. Any verification judgment in the digital signature and authority verification will cause the transaction to fail. After successful verification, the node 810 signs its own digital signature (for example, using the private key of node 810-1 to encrypt the summary of the transaction) and continues to broadcast in the blockchain network 81.

[0139] After receiving the successfully verified transaction, the consensus node 810 in the blockchain network 81 fills the transaction into a new block and broadcasts it. When the consensus node 810 in the blockchain network 81 broadcasts a new block, it will perform a consensus process on the new block. If the consensus is successful, the new block will be appended to the end of the blockchain stored by itself, and the state database will be updated according to the result of the transaction, and the transaction in the new block will be executed: for transactions that submit updates to the target object and the corresponding original feature data, a key-value pair including the target object and the corresponding original feature data will be added to the state database.

[0140] The business personnel of the business entity 84 log in to the client node 510 and input a query request for the target object and the corresponding original feature data. The client node 510 generates a transaction corresponding to the update operation / query operation based on the query request for the target object and the corresponding original feature data. The transaction specifies the smart contract to be called to implement the update operation / query operation and the parameters to be passed to the smart contract. The transaction also carries the digital certificate of the client node 510 and the signed digital signature (for example, the transaction summary is encrypted using the private key in the digital certificate of the client node 510), and broadcasts the transaction to the consensus node 810 in the blockchain network 81.

[0141] The consensus node 810 in the blockchain network 81 receives the transaction, verifies the transaction, fills the block, and reaches consensus, then appends the filled new block to the end of the blockchain stored in itself, updates the status database according to the transaction results, and executes the transaction in the new block: for transactions submitted to update the original feature data corresponding to a target object, the key-value pair corresponding to the target object in the status database is updated according to the original feature data corresponding to the target object; for transactions submitted to query the original feature data corresponding to a target object, the key-value pair corresponding to the original feature data of the target object is queried from the status database, and the transaction result is returned.

[0142] It is worth noting that in Figure 5 The process of directly uploading the target object and the corresponding original feature data to the chain is exemplarily shown in FIG. 4 , but in other embodiments, when the target object has a large amount of data, the client node 410 may upload the hash of the target object and the hash of the corresponding original feature data to the chain in pairs, and store the original target object and the corresponding original feature data in a distributed file system or database. After the client node 510 obtains the target object and the corresponding original feature data from the distributed file system or database, it may be verified in combination with the corresponding hash in the blockchain network 81, thereby reducing the workload of the uploading operation.

[0143] As an example of blockchain, see Figure 6 , Figure 6 An optional structural diagram of a blockchain in a blockchain network 81 provided for an embodiment of the present invention, wherein the header of each block may include both the hash values ​​of all transactions in the block and the hash values ​​of all transactions in the previous block. The newly generated transaction records are filled into the block and, after consensus among the nodes in the blockchain network, will be appended to the end of the blockchain to form a chain growth. The chain structure between blocks based on hash values ​​ensures the tamper-proof and anti-counterfeiting of transactions in the block.

[0144] The following describes an exemplary functional architecture of a blockchain network provided by an embodiment of the present invention. Figure 7 , Figure 7 The functional architecture diagram of the blockchain network 81 provided for an embodiment of the present invention includes an application layer 201, a consensus layer 202, a network layer 203, a data layer 204 and a resource layer 205, which are described below respectively.

[0145] The resource layer 205 encapsulates the computing resources, storage resources, and communication resources of each node 810 in the blockchain network 81.

[0146] The data layer 204 encapsulates various data structures for implementing the ledger, including the blockchain implemented as files in the file system, a key-value state database, and existence proof (such as a hash tree of transactions in a block).

[0147] The network layer 203 encapsulates the functions of point-to-point (P2P) network protocol, data transmission mechanism and data verification mechanism, access authentication mechanism and business subject identity management.

[0148] Among them, the P2P network protocol realizes the communication between nodes 810 in the blockchain network 81, the data propagation mechanism ensures the propagation of transactions in the blockchain network 81, and the data verification mechanism is used to realize the reliability of data transmission between nodes 810 based on cryptographic methods (such as digital certificates, digital signatures, public / private key pairs); the access authentication mechanism is used to authenticate the identity of the business subject joining the blockchain network 81 according to the actual business scenario, and grant the business subject the right to access the blockchain network 81 when the authentication is passed; the business subject identity management is used to store the identity of the business subject allowed to access the blockchain network 81, and the authority (such as the type of transaction that can be initiated).

[0149] The consensus layer 202 encapsulates the mechanism (i.e., consensus mechanism) for the nodes 810 in the blockchain network 81 to reach consensus on blocks, transaction management, and account management functions. The consensus mechanism includes consensus algorithms such as POS, POW, and DPOS, and supports pluggable consensus algorithms.

[0150] Transaction management is used to verify the digital signature carried in the transaction received by node 810, verify the identity information of the business subject, and determine whether it has the authority to conduct transactions based on the identity information (read relevant information from the business subject identity management); for business subjects that have obtained authorization to access the blockchain network 81, they all have digital certificates issued by the certification center. The business subject uses the private key in its own digital certificate to sign the submitted transaction, thereby declaring its legal identity.

[0151] Ledger management is used to maintain the blockchain and state database. For the blocks that have reached consensus, they are appended to the end of the blockchain; the transactions in the blocks that have reached consensus are executed, and when the transaction includes an update operation, the key-value pairs in the state database are updated; when the transaction includes a query operation, the key-value pairs in the state database are queried and the query results are returned to the client node of the business subject. Supports query operations on the state database in multiple dimensions, including: querying blocks based on block vector numbers (such as the hash value of transactions); querying blocks based on block hash values; querying blocks based on transaction vector numbers; querying transactions based on transaction vector numbers; querying business subject account data based on business subject accounts (vector numbers); querying blockchains in channels based on channel names.

[0152] The application layer 201 encapsulates various services that can be implemented in the blockchain network, including transaction traceability, evidence storage, and verification.

[0153] By adopting the technical solution provided by the embodiment of the present invention, the retrieval instance that responds to the retrieval request is determined by the reduced dimensionality feature data corresponding to the original feature data of the target object. The distributed stored retrieval instance is responsible for responding to the retrieval request and searching for the original feature data corresponding to the target object based on the reduced dimensionality feature data. Since the retrieval instance runs in a distributed manner on the computing server, it can independently respond to the retrieval request to share the load and complete high-performance feature data retrieval. In this way, the technical solution of the embodiment of the present invention is not limited by hardware costs and is suitable for non-high-performance computing servers. It can reduce the hardware cost required for the data retrieval process in the massive feature library while improving the retrieval efficiency of the original feature data corresponding to the target object.

[0154] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario.

[0155] See also Figure 8 , Figure 8An optional principle structure diagram of a feature data retrieval method provided in an embodiment of the present invention, first, in the lowest data dimensionality reduction layer, the original feature data in the massive feature database is subjected to dimensionality reduction operation to obtain dimensionality reduction feature data corresponding to the original feature data, and then the corresponding relationship between the original feature data and the dimensionality reduction feature data is stored in a hash table, and the data shards corresponding to the dimensionality reduction feature data, such as shard0, shard1, shard2, and shard3, are respectively stored in corresponding retrieval instances (such as retrieval instance 0, retrieval instance 1, retrieval instance 2, and retrieval instance 3) for caching, and The corresponding relationship between the retrieval instance and the data shard is synchronized to the retrieval access layer above, wherein a retrieval access interface is provided in the retrieval access layer, through which a retrieval request for a target object initiated by an external entity, namely a retrieval client, can be received. After that, the retrieval access layer will determine which data shard the target object to be retrieved belongs to based on the reduced dimension feature data corresponding to the original feature data representing the target object carried in the retrieval request, and then determine the corresponding retrieval instance, and send the retrieval request to the determined retrieval instance, and then the determined retrieval instance realizes the retrieval of the original feature data corresponding to the small-scale target object based on the reduced dimension feature data. The feature data retrieval scheme provided in the embodiment of the present invention is not limited by hardware cost, and the feature data retrieval in a massive feature library can be completed at a relatively low cost, thereby reducing the hardware cost required for the data retrieval process in the massive feature library while improving the retrieval efficiency of the original feature data corresponding to the target object.

[0156] It should be noted that the multiple of retrieval performance improvement depends on the number of data shards. Of course, in actual implementation, the number of data shards cannot be too many, because too many data shards will directly affect the overall recall rate of the retrieval.

[0157] The process of data dimensionality reduction is explained below with reference to the accompanying drawings.

[0158] In the field of artificial intelligence, a feature is usually a high-dimensional vector. The so-called data dimensionality reduction is actually the process of converting a high-dimensional vector into a low-dimensional vector through computational transformation to obtain the dimensionality reduction feature data (also called signature) corresponding to the feature. Fig. 9 , Fig. 9 The schematic diagram of the implementation principle of data dimensionality reduction provided by the embodiment of the present invention, assuming that P0 and P1 are two data points in a two-dimensional space, the process of data dimensionality reduction for these two data points is as follows: through a set of vectors [M0, M1] (in Fig. 9The two dotted lines in the figure represent the elements of the vector respectively) calculate the positional relationship between the two data points P0 and P1 in the two-dimensional space and the vector [M0, M1] respectively, and encode the data points P0 and P1 into two-dimensional vectors according to the positional relationship according to the encoding strategy. In the embodiment of the present invention, the encoding strategy can be set to: a first-dimensional vector, if the data point is on M0, it is encoded as 1, and if the data point is below M0, it is encoded as 0; a second-dimensional vector, if the data point is on M1, it is encoded as 1, and if the data point is below M1, it is encoded as 0.

[0159] For example, data point P0 is "above" M0, so the encoding value is 1 ( Fig. 9 In the example above, the data point P0 is above M1, so the code value is 1. In this way, the data point P0 can be converted into a binary code value "11". Similarly, the data point P1 is below M0, and the corresponding code value is 0 ( Fig. 9 In the example above, the data point P1 is "above" M1, and the corresponding code value is 1. In this way, the data point P1 can be converted into a binary code value "01". It can be seen that the data points distributed in a two-dimensional space will fall into a one-dimensional space, thereby achieving the purpose of dimensionality reduction of high-dimensional data. Similarly, higher-dimensional data can also be processed by similar data dimensionality reduction. Although the features are high-dimensional vectors, the high-dimensional feature data can be quickly reduced to a low-dimensional space.

[0160] It should be noted that the above data dimensionality reduction process must meet the conditions of local sensitive hashing. Only through local sensitive hashing can the "neighbor" data points in the high-dimensional space be placed in a hash bucket as much as possible. That is, the similarity between the original feature data and the similarity between the reduced feature data should be consistent, so that the data maintains the maximum possible similarity before and after dimensionality reduction, thereby reducing the loss of target object information expressed by the reduced feature data. Fig.10 , Fig.10 A schematic diagram of the process of using local sensitive hashing for data dimensionality reduction provided in an embodiment of the present invention, if two feature data have high similarity among the m+1 n+1 dimensional features in the massive feature database, then the encoding results obtained after dimensionality reduction of these two feature data will also show this consistent degree of similarity, and vice versa.

[0161] See also Fig.11A , Fig.11AThe probability distribution diagram of any two data points in the high-dimensional space being in the same bucket in theory provided by the embodiment of the present invention. If there is only one hash table, that is, only one set of Embedding vectors, then theoretically the probability of any two data points in the high-dimensional space being in the same bucket will be very small. The above figure is not the actual value, but the theoretical value. However, there must be two very similar data points that are hashed into two different buckets. At this time, for a certain set of Embedding vectors, there is always a certain probability that the two similar data points will be divided into two different buckets during the conversion process. Ideally, the probability distribution of any two data points in the same bucket is as follows: Fig. 11B In order to ensure that the "neighbor" data points in the high-dimensional space are placed in a hash bucket with the highest probability, multiple sets of embedding vectors can be selected, that is, multiple hash tables can be established to divide the full feature data into multiple groups. The local sensitive hashing algorithm is applied to each group for encoding, so that each group can form a hash table. The hash table stores the mapping relationship between the feature data and the corresponding encoding results. Fig. 11C In the figure, there are b hash tables. When the length of the hash key (i.e., the encoding result) is r, the probability distribution of any two data points in the same bucket is as follows: Fig. 11C shown.

[0162] After the high-dimensional feature data in the massive feature library is processed by data dimensionality reduction, each feature data has a (group) hash key corresponding to it, and the storage scheme of the high-dimensional feature data also needs to be considered. In practical applications, even after being divided into buckets, the scheme of randomly assigning signatures (i.e., reduced-dimensional feature data) cannot be adopted, which will affect the overall retrieval efficiency. The correlation between feature data can also be measured between signatures. The embodiment of the present invention uses the Hamming distance (HammingDistance) to represent the similarity between signatures. When storing, similar bucket data can be hashed to the same storage node according to the Hamming distance. Data storage usually adopts a two-level architecture, namely a persistence layer and a cache. Among them, the persistence layer can select a distributed storage system, such as a database, or even a local disk, depending on the project's requirements for the reliability of feature data; caching is necessary. Since the embodiment of the present invention is aimed at a massive distributed feature library, a routing algorithm needs to be designed when caching feature data. Hash routing or table lookup routing can be used for storage. In this way, the original feature data corresponding to the target object can be found based on the reduced-dimensional feature data with the help of hash routing or table lookup routing. See Fig.12The schematic diagram of searching for the original feature data corresponding to the target object provided by the embodiment of the present invention shown is, specifically, the correspondence between the identifier of the retrieval instance and the identifier of the feature database can be pre-set in a routing table according to actual needs, and the original feature data corresponding to the target object can be searched from the feature database corresponding to the reduced-dimensional feature data by querying the routing table. This search method is generally suitable for application scenarios with a small number of feature databases and a large capacity of a single feature database; alternatively, by calculating the hash value corresponding to the reduced-dimensional feature data, the original feature data corresponding to the target object can be searched through a hash routing table. This search method is generally suitable for application scenarios with a large number of feature databases and a small capacity of a single feature database.

[0163] In artificial intelligence applications, the storage and retrieval of massive feature libraries is an important issue. The embodiments of the present invention can solve this issue and maximize the storage and retrieval capabilities of massive feature libraries, especially when the magnitude of a single feature library reaches billions, high-performance data retrieval can also be completed. In addition, the feature data retrieval solution of the embodiment of the present invention is essentially also applicable to non-high-performance computing servers, controlling hardware costs and having good cost adaptability.

[0164] Next, the software implementation of the feature data retrieval device 455 provided in the embodiment of the present invention is described. The software modules included in the memory 450 in the electronic device 40 implementing the feature data retrieval method of the embodiment of the present invention are described as an example. For the details not covered in the following functional description of the modules, the above description can be referred to for understanding.

[0165] The receiving unit 4551 is used to receive a retrieval request for a target object, wherein the retrieval request carries reduced-dimensionality feature data corresponding to original feature data representing the target object; the determining unit 4552 is used to search for the correspondence between data slices of the reduced-dimensionality feature data and retrieval instances based on the reduced-dimensionality feature data, and determine a retrieval instance for responding to the retrieval request; the retrieval unit 4553 is used to send the retrieval request to the determined retrieval instance, so that the retrieval instance responds to the retrieval request, searches for the original feature data corresponding to the target object based on the reduced-dimensionality feature data; and responds to the retrieval request based on the original feature data corresponding to the target object.

[0166] In some embodiments, the receiving unit may receive a search request for a target object by the following means: calling a search access interface for a search client; and receiving a search request for the target object through the search access interface.

[0167] In some embodiments, the determining unit searches for the correspondence between the data slices of the dimensionality reduction feature data and the retrieval instance based on the dimensionality reduction feature data to determine the retrieval instance for responding to the retrieval request, which can be implemented in the following manner:

[0168] Determine the data slice to which the dimensionality reduction feature data belongs; based on the correspondence between the data slice of the dimensionality reduction feature data and the retrieval instance, find the retrieval instance corresponding to the data slice to which the dimensionality reduction feature data belongs; use the found retrieval instance as the retrieval instance for responding to the retrieval request.

[0169] In some embodiments, the retrieval unit searches for the original feature data corresponding to the target object based on the reduced dimension feature data, which can be implemented in the following manner:

[0170] The reduced dimension feature data is hashed to obtain a hash value corresponding to the reduced dimension feature data; an identifier of a hash bucket mapped to the hash value is determined; and original feature data corresponding to the target object is searched from a hash bucket corresponding to the identifier of the hash bucket.

[0171] In some embodiments, the retrieval unit searches for the original feature data corresponding to the target object based on the reduced dimension feature data, which can also be implemented in the following manner:

[0172] Based on the reduced dimension feature data, the corresponding relationship between the identifier of the retrieval instance and the identifier of the feature database in the routing table is searched to determine the feature database corresponding to the identifier of the retrieval instance; and the original feature data corresponding to the target object is searched from the determined feature database.

[0173] In some embodiments, the feature data retrieval device further comprises:

[0174] The receiving unit is further used to receive original feature data in the first space;

[0175] A dimensionality reduction processing unit, used for performing dimensionality reduction processing on the original feature data to obtain reduced-dimensionality feature data corresponding to the original feature data in a second space, wherein the dimension of the first space is greater than the dimension of the second space, and the reduced-dimensionality feature data in the second space is distributedly stored in a plurality of retrieval instances;

[0176] A storage unit is used to store the original feature data and the corresponding reduced-dimensional feature data in a hash table.

[0177] In some embodiments, the dimensionality reduction processing unit performs dimensionality reduction processing on the original feature data to obtain the dimensionality reduction feature data corresponding to the original feature data in the second space, which can be implemented in the following manner:

[0178] Obtain a dimension reduction vector for reducing the dimension of feature data; determine the positional relationship between each value in the dimension reduction vector and the data points corresponding to the original feature data; based on the positional relationship, determine the binary code value of the data point corresponding to the original feature data; based on the combination of the binary code values, obtain the dimension reduction feature data corresponding to the original feature data in the second space.

[0179] In some embodiments, the feature data retrieval device further comprises:

[0180] The sending unit is used to send the target object and the corresponding original feature data to the blockchain network, so that the nodes of the blockchain network fill the target object and the corresponding original feature data into a new block, and when a consensus is reached on the new block, the new block is appended to the end of the blockchain.

[0181] The embodiment of the present invention further provides a storage medium storing executable instructions, which, when executed, are used to implement the feature data retrieval method provided by the embodiment of the present invention, for example, FIG. 3A to FIG. 3E , Figure 8 The method shown.

[0182] In some embodiments, the storage medium may specifically be a computer-readable storage medium, such as a ferroelectric random access memory (FRAM), ROM, PROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disk or compact disc read-only memory (CD-ROM), etc.; it may also be various devices including one or any combination of the above memories.

[0183] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0184] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0185] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0186] In summary, the technical solution of the embodiment of the present invention has the following beneficial effects:

[0187] The retrieval instance that responds to the retrieval request is determined by the reduced-dimensional feature data corresponding to the original feature data of the target object. The distributed stored retrieval instance is responsible for responding to the retrieval request and searching for the original feature data corresponding to the target object based on the reduced-dimensional feature data. Since the retrieval instance runs in a distributed manner on the computing server, it can independently respond to the retrieval request to share the load and complete high-performance feature data retrieval. In this way, the technical solution of the embodiment of the present invention is not limited by hardware costs and is suitable for non-high-performance computing servers. It can reduce the hardware cost required for the data retrieval process in the massive feature library while improving the retrieval efficiency of the original feature data corresponding to the target object.

[0188] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for retrieving feature data, characterized in that: The method comprises: Receiving a search request for a target object, wherein the search request carries reduced-dimensionality feature data corresponding to original feature data representing the target object, and the degree of similarity between the original feature data is consistent with the degree of similarity between the reduced-dimensionality feature data; Determine the data shard to which the dimension reduction feature data belongs; Based on the correspondence between the data slices of the dimensionality reduction feature data and the retrieval instance, searching for the retrieval instance corresponding to the data slice to which the dimensionality reduction feature data belongs; Using the found retrieval instance as a retrieval instance for responding to the retrieval request; Send the search request to the search instance so that The retrieval instance searches for original feature data corresponding to the target object based on the reduced dimension feature data in response to the retrieval request; The search request is responded to based on the original feature data corresponding to the target object.

2. The method according to claim 1, characterized in that The receiving a search request for a target object includes: Calling the search access interface for the search client; A search request for the target object is received through the search access interface.

3. The method according to claim 1, characterized in that The searching for original feature data corresponding to the target object based on the dimension-reduced feature data includes: Performing hash processing on the reduced-dimensionality feature data to obtain a hash value corresponding to the reduced-dimensionality feature data; Determine an identifier of a hash bucket to which the hash value is mapped; The original feature data corresponding to the target object is searched from the hash bucket corresponding to the identifier of the hash bucket.

4. The method according to claim 1, characterized in that The searching for original feature data corresponding to the target object based on the dimension-reduced feature data includes: Based on the dimension reduction feature data, searching for a correspondence between an identifier of a search instance and an identifier of a feature database in a routing table, and determining a feature database corresponding to the identifier of the search instance; The original feature data corresponding to the target object is searched from the determined feature database.

5. The method according to claim 1, characterized in that The method further comprises: Receiving original feature data in the first space; Performing dimensionality reduction processing on the original feature data to obtain dimensionality reduction feature data corresponding to the original feature data in a second space, wherein the dimension of the first space is greater than the dimension of the second space, and the dimensionality reduction feature data in the second space is distributedly stored in a plurality of retrieval instances; The original feature data and the corresponding reduced-dimensional feature data are stored in a hash table.

6. The method according to claim 5, characterized in that The step of performing dimensionality reduction processing on the original feature data to obtain dimensionality reduction feature data corresponding to the original feature data in the second space includes: Obtaining a dimension reduction vector for reducing the dimension of feature data; Determine the positional relationship between each value in the dimension reduction vector and the data points corresponding to the original feature data; Based on the positional relationship, determining a binary code value of a data point corresponding to the original feature data; Based on the combination of the binary code values, the dimension-reduced feature data corresponding to the original feature data in the second space is obtained.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The target object and the corresponding original feature data are sent to the blockchain network, so that the nodes of the blockchain network fill the target object and the corresponding original feature data into a new block, and when a consensus is reached on the new block, the new block is appended to the end of the blockchain.

8. A feature data retrieval device, characterized in that: The device comprises: A receiving unit, configured to receive a search request for a target object, wherein the search request carries reduced-dimensionality feature data corresponding to original feature data representing the target object, and the degree of similarity between the original feature data is consistent with the degree of similarity between the reduced-dimensionality feature data; A determination unit, configured to determine the data slice to which the dimension reduction feature data belongs; based on the correspondence between the data slice of the dimension reduction feature data and the retrieval instance, search for the retrieval instance corresponding to the data slice to which the dimension reduction feature data belongs; and use the searched retrieval instance as the retrieval instance for responding to the retrieval request; A retrieval unit, configured to send the retrieval request to the retrieval instance, so that the retrieval instance responds to the retrieval request and searches for original feature data corresponding to the target object based on the reduced dimension feature data; The search request is responded to based on the original feature data corresponding to the target object.

9. An electronic device, characterized in that: include: A memory for storing executable instructions; A processor, configured to implement the feature data retrieval method according to any one of claims 1 to 7 when executing the executable instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: Executable instructions are stored, and when the executable instructions are executed, they are used to implement the feature data retrieval method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Text searching method and device

    CN101140583A

  • High-dimensional approximate image retrieval method based on inverted LSH in cloud computing environment

    CN105760469A

  • Block chain metadata storage system, and storage method and retrieval method thereof

    CN106534273A

  • Ultra low complexity image retrieval method based on sequence preserving hashing

    CN106777038A

  • Feature retrieval method and device, storage medium and computer device

    CN109271545A