A data processing method and related apparatus

By obtaining image feature data and determining its similarity to multiple data blocks, the problem of low database search efficiency in the existing technology is solved. Linked list and preset data block generation strategies are adopted to achieve efficient feature data matching and search. .

CN112579809BActive Publication Date: 2024-10-01SHENZHEN INTELLIFUSION TECHNOLOGIES CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN201910931332.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-27
Publication Date
2024-10-01
Estimated Expiration
2039-09-27

AI Technical Summary

Technical Problem

In the existing face recognition and human body recognition technology, the image search efficiency in the database is low, mainly because the search data in SQLite requires one-to-one comparison, resulting in low efficiency.

Method used

By obtaining the feature data of the image, determine the similarity with multiple data blocks, and determine the target feature data from multiple data blocks based on the similarity, using the linked list data block structure and the preset data block generation strategy to improve search efficiency .

Benefits of technology

It realizes batch traversal and similarity determination of feature data in the database, improves search efficiency, avoids inefficiency caused by one-to-one comparison, and saves search time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112579809B_ABST
    Figure CN112579809B_ABST
Patent Text Reader

Abstract

The present application discloses a data processing method and a related device, the method comprising: acquiring feature data of an image; determining at least one similarity between the feature data and each of N data blocks, wherein the database comprises the N data blocks, each of which comprises at least one first feature data, and N is an integer greater than 1; determining target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks; and outputting the target feature data. Implementing the embodiments of the present invention is conducive to improving search efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data processing method and related devices. Background Art

[0002] With the rapid development of emerging technologies, face recognition technology, body recognition technology, etc. are becoming more and more mature. In daily life, people can use face recognition to open the door, and they can also use face recognition to pay. Of course, people can also apply body recognition technology to various public places. Therefore, face recognition technology, body recognition technology, etc. have brought great convenience to people's lives.

[0003] In the actual application of these technologies, the data search process is often involved. In the prior art, a lightweight database SQLite is often used to store images. When searching for data in SQLite, the search can only be performed by a one-to-one comparison method to determine whether the search target exists in the database. Therefore, this search method is inefficient. Summary of the invention

[0004] The embodiment of the present invention provides a data processing method and related devices. The implementation of the embodiment of the present invention is conducive to improving search efficiency.

[0005] A first aspect of the present invention provides a data processing method, comprising:

[0006] Obtain feature data of the image;

[0007] Determine at least one similarity between the feature data and each data block in N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1;

[0008] Determining target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks;

[0009] The target feature data is output.

[0010] In a first possible implementation manner, before determining at least one similarity between the feature data and each of the N data blocks, the method further includes:

[0011] Acquire first feature data corresponding to each first image in a plurality of first images to obtain a plurality of first feature data; generate the N data blocks including the plurality of first feature data according to a preset data block generation strategy, wherein the i-th data block in the N data blocks includes at least one first feature data in the plurality of first feature data, 1≤i≤N and i is an integer;

[0012] The N data blocks are stored in the database.

[0013] In a possible implementation manner, the N data blocks are linked via a linked list, and the method further includes:

[0014] Acquire at least one piece of second feature data corresponding to at least one second image, wherein a storage period of the at least one piece of second feature data in the database is less than a preset storage period;

[0015] Obtaining a first data block located at the tail end of the linked list among the N data blocks;

[0016] Determining whether the remaining storage space size of the first data block matches the storage space size required by the at least one second characteristic data;

[0017] If yes, inserting the at least one second characteristic data into the first data block;

[0018] If not, insert part of the second characteristic data in the at least one second characteristic data into the first data block, the storage space required for the part of the second characteristic data is the same as the remaining storage space of the first data block, and generate a second data block including the characteristic data in the at least one second characteristic data that is not inserted into the first data block.

[0019] In a possible implementation manner, the N data blocks are linked via a linked list, and the method further includes:

[0020] Acquire at least one second feature data corresponding to at least one second image, wherein the storage period of the at least one second feature data in the database is greater than or equal to the preset storage period;

[0021] generating a first data block including the at least one second characteristic data;

[0022] Insert the first data block into the head end of the linked list.

[0023] In a possible implementation, the method further includes:

[0024] When a data modification instruction carrying a modification identifier and second characteristic data is detected, determining the characteristic data to be modified corresponding to the modification identifier in the database;

[0025] The second characteristic data is replaced by the characteristic data to be modified.

[0026] In a possible implementation manner, the N data blocks are linked via a linked list, and the method further includes:

[0027] When a data deletion instruction carrying a deletion identifier is detected, determining the feature data to be deleted corresponding to the deletion identifier in the database;

[0028] Determine whether the characteristic data to be deleted is the second characteristic data, wherein the second characteristic data is the last characteristic data in the data block where the characteristic data to be deleted is located;

[0029] If yes, then the feature data to be deleted is deleted, and the data block where the feature data to be deleted is located is removed from the linked list;

[0030] If not, the second characteristic data is replaced by the characteristic data to be deleted.

[0031] In a possible implementation manner, determining target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks includes:

[0032] Determine N target similarities corresponding to the N data blocks one by one according to at least one similarity corresponding to each data block in the N data blocks, wherein the i-th target similarity among the N target similarities is the similarity with the greatest similarity among the at least one similarity corresponding to the i data blocks, the at least one similarity is determined according to the i-th matrix and the feature data, the i-th matrix includes the at least one first feature data included in the i-th data block;

[0033] Determine a first target similarity among the N target similarities that is greater than a similarity threshold;

[0034] Target feature data matching the feature data is determined from the N data blocks according to the first target similarity.

[0035] A second aspect of the present invention provides a data processing device, comprising:

[0036] An acquisition module, used for acquiring feature data of an image;

[0037] A first determination module, configured to determine at least one similarity between the feature data and each of N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1;

[0038] A second determination module, configured to determine target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks;

[0039] An output module is used to output the target feature data.

[0040] A third aspect of the present invention provides an electronic device for data processing, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and are generated to be executed by the processor to perform instructions for the steps of any one of a data processing method.

[0041] A fourth aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the stored computer program is executed by the processor to implement any method described in a data processing method.

[0042] It can be seen that in the above technical solution, the feature data of the image is obtained, so as to prepare for the subsequent determination of the similarity between the feature data and the feature data included in the multiple data blocks; at least one similarity corresponding to the feature data and each of the N data blocks is determined, wherein the database includes the N data blocks, and each data block includes at least one first feature data, so as to realize the traversal of all data blocks including the feature data in the database, and avoid the omission of data blocks resulting in the failure to search for the target feature data; according to the at least one similarity corresponding to each of the N data blocks, the target feature data matching the feature data is determined from the N data blocks, and the similarity between the feature data and the multiple data blocks is determined in batches, thereby improving the efficiency of similarity determination and laying a foundation for improving the subsequent search efficiency. At the same time, the search efficiency is improved by batch determining the similarity between the feature data and the multiple data blocks, avoiding the problem of inefficiency caused by one-to-one comparison and saving search time; finally, the target feature data is output, thereby quickly outputting the search results. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] in:

[0045] Figure 1A A flowchart of a data processing method provided by an embodiment of the present invention;

[0046] Figure 1B A schematic diagram of N data blocks provided by an embodiment of the present invention;

[0047] Figure 2A A schematic diagram of the structure of a communication system provided by an embodiment of the present invention;

[0048] Figure 2B A flowchart of another data processing method provided by an embodiment of the present invention;

[0049] Figure 3A A flowchart of another data processing method provided by an embodiment of the present invention;

[0050] Figure 3B A schematic diagram of adding characteristic data with a storage period less than a preset storage period provided in an embodiment of the present invention;

[0051] Figure 3C A schematic diagram of adding feature data with a storage period less than a preset storage period provided in another embodiment of the present invention;

[0052] Figure 4A A schematic diagram of the structure of another communication system provided by an embodiment of the present invention;

[0053] Figure 4B A flowchart of another data processing method provided by an embodiment of the present invention;

[0054] Figure 5 A schematic diagram of a data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The execution subject of the embodiment of the present application may be, for example, a server or a local data processing device. The server may be, for example, a tablet computer, a laptop computer, a PDA, a MID, a desktop computer or other server devices. This is not limited in the present application.

[0056] See also Figure 1A , Figure 1A A flowchart of a data processing method provided by an embodiment of the present invention is shown below. Figure 1A As shown, a data processing method provided by an embodiment of the present invention may include:

[0057] 101. Obtain feature data of the image;

[0058] The image may be an image including a face, an image including a vehicle, or an image including a human body. The image may also be a certain image frame among multiple image frames of a video, or a separate image or picture. Furthermore, the certain image frame may be an image frame including a face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0059] The feature data includes a feature vector with a dimension of d, and the modulus of the feature vector with a dimension of d is 1, wherein d can be, for example, a value such as 512 or 516.

[0060] For example, the characteristic data may be |a1 ... a d |. Among them, a1 to a d Therefore, the feature data includes a matrix of 1 row and 512 columns and the modulus of the matrix is ​​1.

[0061] Further, the processing the image to obtain feature data includes: calling a normalization function to process the image to obtain feature data, wherein the normalization function is used to normalize a feature vector with a dimension of d to obtain feature data with a modulus of 1. The feature data may include, for example, facial feature data, human body feature data, or vehicle feature data.

[0062] For example, the facial feature data of household owners are stored in the access control system that uses facial recognition to enter the community. When a household owner wants to enter the community, the access control system obtains the household owner's facial image, then extracts the facial feature data corresponding to the facial image, and compares the facial feature data with a large amount of facial feature data stored in the access control system to detect whether the facial feature data is in the access control system. If so, the household owner can enter the community.

[0063] 102. Determine at least one similarity between the feature data and each data block in N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1;

[0064] Here, N may include values ​​such as 2, 3, 4, 5, 7, 11, 20, etc.

[0065] For further information, see Figure 1B , Figure 1B A schematic diagram of N data blocks provided by an embodiment of the present invention, such as Figure 1BAs shown, N data blocks are linked by a linked list. Among them, a linked list is a non-continuous and non-sequential storage structure on a physical storage unit, and the logical order of data elements is realized by the pointer link order in the linked list. At the same time, the space size of each data block in the N data blocks may be the same or different, and there is no limitation in this application. For example, data block 1 may include 10 feature data, data block 2 may include 30 feature data, data block 3 may include 52 feature data, and data block 4 may include 30 feature data. For another example, data blocks 1 to data blocks N each include 30 feature data. Furthermore, each of the N data blocks stores data in a top-down order. For example, in data block 1, the first feature data is the first feature data 1, and the last feature data is the first feature data A.

[0066] Optionally, in a possible implementation, before determining at least one similarity between the feature data and each of the N data blocks, the method further includes: acquiring first feature data corresponding to each first image to obtain multiple first feature data; generating the N data blocks including the multiple first feature data according to a preset data block generation strategy, wherein the i-th data block among the N data blocks includes at least one first feature data among the multiple first feature data, 1≤i≤N and i is an integer; and storing the N data blocks in the database.

[0067] Among them, each first image in the multiple first images can be an image including a face, an image including a vehicle, or an image including a human body. Each first image in the multiple first images can also be an image frame among multiple image frames of a video, or a separate image or picture. Furthermore, the image frame can be an image frame including a face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0068] Here, i may include values ​​such as 1, 2, 3, 4, 5, 7, 11, 20, etc.

[0069] The plurality of first feature data are obtained by the server invoking a normalization function to process the plurality of first images.

[0070] The preset data block generation strategies include: an average feature data division strategy and a random feature data division strategy.

[0071] Optionally, the preset data block generation strategy includes a feature data average division strategy, and the step of generating the N data blocks including the plurality of first feature data according to the preset data block generation strategy includes:

[0072] According to the feature data average division strategy, the plurality of first feature data are evenly divided into N groups of feature data; and the N data blocks including the N groups of feature data are generated, wherein the N groups of feature data correspond one to one with the N data blocks. That is, each of the N data blocks includes the same amount of first feature data.

[0073] Optionally, the preset data block generation strategy includes a feature data random division strategy, and the generating of the N data blocks including the multiple first feature data according to the preset data block generation strategy includes: randomly dividing the multiple first feature data into N groups of feature data according to the feature data random division strategy, each of the N groups of feature data including at least one first feature data; generating the N data blocks including the N groups of feature data, wherein the N groups of feature data correspond one-to-one to the N data blocks. That is, each of the N data blocks includes a different number of first feature data.

[0074] In summary, the number of first characteristic data included in each of the N data blocks may be different or the same, which is not limited in the embodiment of the present application.

[0075] It can be seen that in the above technical solution, the first feature data corresponding to each of the multiple first images is obtained to obtain multiple first feature data, in preparation for the subsequent data search, and N data blocks including multiple first feature data are generated according to the preset data block generation strategy, wherein the i-th data block among the N data blocks includes at least one first feature data among the multiple first feature data, in preparation for the subsequent batch determination of the similarity between the first feature data and the multiple data blocks to improve the search efficiency. Finally, the N data blocks are stored in the database, so as to realize the storage of at least one first feature data in the form of data blocks.

[0076] Optionally, determining at least one similarity between the feature data and each of the N data blocks includes: calling a preset function to process the feature data and each of the N data blocks respectively to obtain at least one similarity between the feature data and each of the N data blocks.

[0077] The preset functions may include, for example:

[0078]

[0079] Among them, similarity represents similarity, For representing the characteristic data, is a matrix consisting of at least one feature data included in any one of the N data blocks. n is used to represent or Since all feature data have the same dimension, n is the same and can be 512 or 516, etc.

[0080] Further, optionally, determining at least one similarity between the feature data and each of the N data blocks includes: constructing N matrices corresponding to the N data blocks, the i-th matrix including the at least one first feature data included in the i-th data block; calling a preset function to process the feature data and each of the N matrices respectively to obtain at least one similarity between the feature data and each of the N matrices.

[0081] For example, the first data block is any one of the N data blocks, and the first data block includes 3 feature data. Then, when determining the similarity between the feature data and the 3 feature data included in the first data block, the server calls a preset function to process the feature data and the 3 feature data included in the first data block to obtain 3 similarities. For example, it can be |a1 … a 512 |, the matrix consisting of the three feature data included in the first data block For example, it can be Each row in corresponds to a feature data.

[0082] For another example, N data blocks include a first data block and a second data block, the first data block includes 5 feature data, and the second data block includes 4 feature data. Then, the server processes the feature data and the 5 feature data included in the first data block through a preset function to obtain 5 similarities, and the server processes the feature data and the 4 feature data included in the second data block through a preset function to obtain 4 similarities. For example, it can be |a1… a 516 |, the matrix consisting of 5 feature data included in the first data block For example, it can be The first data block corresponds to Each row in corresponds to one feature data, and there are five feature data in total. The matrix composed of the four feature data included in the second data block can be, for example, The second data block corresponds to Each row in corresponds to one feature data, a total of 4 feature data.

[0083] It can be seen that in the above scheme, by using a preset function to process the feature data and multiple matrices, multiple similarities can be quickly obtained, the retrieval data can be reduced, and the retrieval efficiency can be improved.

[0084] 103. Determine target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks;

[0085] 104. Output the target feature data.

[0086] It can be seen that in the above technical solution, the feature data of the image is obtained, so as to prepare for the subsequent determination of the similarity between the feature data and the feature data included in the multiple data blocks; at least one similarity corresponding to the feature data and each of the N data blocks is determined, wherein the database includes the N data blocks, and each data block includes at least one first feature data, so as to realize the traversal of all data blocks including the feature data in the database, and avoid the omission of data blocks resulting in the failure to search for the target feature data; according to the at least one similarity corresponding to each of the N data blocks, the target feature data matching the feature data is determined from the N data blocks, and the similarity between the feature data and the multiple data blocks is determined in batches, thereby improving the efficiency of similarity determination and laying a foundation for improving the subsequent search efficiency. At the same time, the search efficiency is improved by batch determining the similarity between the feature data and the multiple data blocks, avoiding the problem of inefficiency caused by one-to-one comparison and saving search time; finally, the target feature data is output, thereby quickly outputting the search results.

[0087] For example, in one possible implementation, see Figure 2A , Figure 2A A schematic diagram of the structure of a communication system provided for one embodiment of the present invention, the communication system may include a server 210 and a terminal 220 interconnected via a network. The server 210 can implement all the functions mentioned in the embodiment of the present invention, but is not limited to all the functions mentioned in the embodiment of the present invention. The terminal 220 can implement all the functions mentioned in the embodiment of the present invention, but is not limited to all the functions mentioned in the embodiment of the present invention. The terminal may be, for example, a mobile phone, a tablet computer, a laptop computer, a PDA, a MID or other terminal devices.

[0088] See also Figure 2B , Figure 2B A flowchart of another data processing method provided by an embodiment of the present invention is shown below. Figure 2B As shown, another data processing method provided by an embodiment of the present invention may include:

[0089] 201. A server receives a data search request sent by a terminal, wherein the data search request carries feature data of an image;

[0090] The image may be an image including a face, an image including a vehicle, or an image including a human body. The image may also be a certain image frame among multiple image frames of a video, or a separate image or picture. Furthermore, the certain image frame may be an image frame including a face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0091] The feature data includes a feature vector with a dimension of d, and the modulus of the feature vector with a dimension of d is 1, wherein d can be, for example, a value such as 512 or 516.

[0092] For example, the characteristic data may be |a1 ... a 512 |. Among them, a1 to a d Therefore, the feature data includes a matrix of 1 row and 512 columns and the modulus of the matrix is ​​1.

[0093] Furthermore, the feature data is obtained by the server calling a normalization function to process the image. The normalization function is used to normalize a feature vector with a dimension of d to obtain feature data with a modulus of 1.

[0094] The feature data may include, for example, facial feature data, body feature data or vehicle feature data.

[0095] 202. The server determines at least one similarity between the feature data and each of N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1;

[0096] Here, N may include values ​​such as 2, 3, 4, 5, 7, 11, 20, etc.

[0097] Among them, the space size of each data block in the N data blocks can be the same or different, and there is no limitation in this application.

[0098] Furthermore, the N data blocks are linked by a linked list, wherein a linked list is a non-continuous and non-sequential storage structure on a physical storage unit, and the logical order of data elements is realized by the link order of pointers in the linked list.

[0099] Optionally, determining at least one similarity between the feature data and each of the N data blocks includes:

[0100] The preset function is called to process the feature data and each of the N data blocks respectively to obtain at least one similarity corresponding to the feature data and each of the N data blocks. The preset function may include, for example:

[0101]

[0102] in, For representing the characteristic data, is a matrix consisting of at least one feature data included in any one of the N data blocks. n is used to represent or Since all feature data have the same dimension, n is the same and can be 512 or 516, etc.

[0103] Further, optionally, determining at least one similarity between the feature data and each of the N data blocks includes: constructing N matrices corresponding to the N data blocks, the i-th matrix including the at least one first feature data included in the i-th data block; calling a preset function to process the feature data and each of the N matrices respectively to obtain at least one similarity between the feature data and each of the N matrices.

[0104] For example, the first data block is any one of the N data blocks, and the first data block includes 3 feature data. Then, when determining the similarity between the feature data and the 3 feature data included in the first data block, the server calls a preset function to process the feature data and the 3 feature data included in the first data block to obtain 3 similarities. For example, it can be |a1 … a 512 |, the matrix consisting of the three feature data included in the first data block For example, it can be Each row in corresponds to a feature data.

[0105] For another example, N data blocks include a first data block and a second data block, the first data block includes 5 feature data, and the second data block includes 4 feature data. Then, the server processes the feature data and the 5 feature data included in the first data block through a preset function to obtain 5 similarities, and the server processes the feature data and the 4 feature data included in the second data block through a preset function to obtain 4 similarities. For example, it can be |a1… a 516 |, the matrix consisting of 5 feature data included in the first data block For example, it can be The first data block corresponds to Each row in corresponds to one feature data, and there are five feature data in total. The matrix composed of the four feature data included in the second data block can be, for example, The second data block corresponds to Each row in corresponds to one feature data, a total of 4 feature data.

[0106] It can be seen that in the above scheme, N matrices corresponding to the N data blocks are constructed, and the i-th matrix includes the at least one first feature data included in the i-th data block, preparing for the determination of the similarity between the subsequent feature data and the matrix; the preset function is called to process the feature data and each of the N matrices respectively to obtain at least one similarity corresponding to the feature data and each of the N matrices, so that multiple similarities can be quickly obtained, the retrieval data can be reduced, and the retrieval efficiency can be improved.

[0107] 203. The server determines, from the N data blocks, target feature data matching the feature data according to at least one similarity corresponding to each of the N data blocks;

[0108] 204. The server sends a data search response to the terminal, wherein the data search response carries the target feature data.

[0109] It can be seen that in the above technical solution, a data search request sent by a terminal is received, wherein the data search request carries the feature data of the image, thereby preparing for the subsequent determination of the similarity between the feature data and the feature data included in the multiple data blocks; at least one similarity corresponding to the feature data and each of the N data blocks is determined, wherein the database includes the N data blocks, and each data block includes at least one first feature data, thereby realizing traversal of all data blocks including feature data in the database, and avoiding the omission of data blocks resulting in failure to search for target feature data; according to at least one similarity corresponding to each of the N data blocks, target feature data matching the feature data is determined from the N data blocks, and batch determination of the similarity between the feature data and the multiple data blocks is realized, thereby improving the efficiency of similarity determination, and laying a foundation for improving the subsequent search efficiency. At the same time, the search efficiency is improved by batch determination of the similarity between the feature data and the multiple data blocks, thereby avoiding the problem of inefficiency caused by one-to-one comparison, and saving search time; finally, a data search response is sent to the terminal, wherein the data search response carries the target feature data, thereby quickly feeding back the search results to the terminal.

[0110] The following is an embodiment of determining target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks.

[0111] See also Figure 3A , Figure 3A A flowchart of a data processing method provided by another embodiment of the present invention is shown below. Figure 3A As shown, determining target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks may include:

[0112] 301. Determine N target similarities corresponding to the N data blocks one by one according to at least one similarity corresponding to each data block in the N data blocks, wherein an i-th target similarity among the N target similarities is a similarity with the greatest similarity among at least one similarity corresponding to the i data blocks, and the at least one similarity is determined according to an i-th matrix and the feature data, and the i-th matrix includes the at least one first feature data included in the i-th data block;

[0113] For example, N data blocks include a first data block and a second data block, the first data block includes 5 feature data, and the second data block includes 4 feature data. Then, the server processes the feature data and the 5 feature data included in the first data block through a preset function to obtain 5 similarities, and the server processes the feature data and the 4 feature data included in the second data block through a preset function to obtain 4 similarities. For example, it can be |a1… a 516 |, the matrix consisting of 5 feature data included in the first data block For example, it can be The first data block corresponds to Each row in corresponds to one feature data, and there are five feature data in total. The matrix composed of the four feature data included in the second data block can be, for example, The second data block corresponds to Each row in corresponds to one feature data, a total of 4 feature data.

[0114] Further, the similarity between the feature data and the five feature data included in the first data block can be, for example, |b1…b5|, and the target similarity corresponding to the first data block is assumed to be b3, that is, b3 is the maximum similarity between b1 and b5. The similarity between the feature data and the four feature data included in the second data block can be, for example, |c1…c4|, and the target similarity corresponding to the second data block is assumed to be c5, that is, c5 is the maximum similarity between c1 and c5.

[0115] 302. Determine a first target similarity among the N target similarities that is greater than a similarity threshold;

[0116] The similarity threshold can be set by an administrator or configured in a configuration file.

[0117] 303. Determine target feature data matching the feature data from the N data blocks according to the first target similarity.

[0118] It can be seen that in the above technical solution, N target similarities corresponding to the N data blocks are determined according to at least one similarity corresponding to each data block in the N data blocks, wherein the i-th target similarity among the N target similarities is the similarity with the greatest similarity among at least one similarity corresponding to the i data blocks, and the at least one similarity is determined according to the i-th matrix and the feature data, and the i-th matrix includes the at least one first feature data included in the i-th data block, and the maximum similarity is firstly screened out from each data block, thereby reducing the amount of data compared with the similarity threshold, speeding up the data comparison process, and thus improving the search efficiency; then, determining the first target similarity greater than the similarity threshold among the N target similarities, and screening out the first target similarity greater than the similarity threshold from the N target similarities, thereby improving the data comparison process; finally, determining the target feature data matching the feature data from the N data blocks according to the first target similarity, thereby realizing the traversal of multiple data blocks in the database and quickly obtaining the search results.

[0119] Optionally, in a possible implementation, the N data blocks are linked by a linked list, and the method further includes: obtaining at least one second feature data corresponding to at least one second image, the storage period of the at least one second feature data in the database being less than a preset storage period; obtaining a first data block located at the tail end of the linked list among the N data blocks; determining whether the remaining storage space size of the first data block matches the storage space size required for the at least one second feature data; if so, inserting the at least one second feature data into the first data block; if not, inserting part of the second feature data in the at least one second feature data into the first data block, the storage space size required for the part of the second feature data being the same as the remaining storage space size of the first data block; and generating a second data block including feature data in the at least one second feature data that is not inserted into the first data block.

[0120] The preset storage period can be set by an administrator or configured in a configuration file.

[0121] Each of the at least one second image may be an image including a face, an image including a vehicle, or an image including a human body. Each of the at least one second image may also be an image frame among multiple image frames of a video, or may be a separate image or picture. Furthermore, the image frame may be an image frame including a face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0122] For example, in a certain community, a facial recognition access control system is set up. If the household owner living in the community has relatives or friends who come to visit for a few days, they also need facial recognition to enter the community. Therefore, at this time, the characteristic data of relatives or friends needs to be temporarily stored in the database to facilitate subsequent facial recognition to enter and exit the community.

[0123] See also Figure 3B , Figure 3B A schematic diagram of adding characteristic data with a storage period less than a preset storage period is provided in one embodiment of the present invention. Figure 3B As shown, when the remaining storage space size of the first data block at the end of the linked list matches the storage space size required by at least one second characteristic data, the at least one second characteristic data is inserted into the first data block. The first data block is data block N. Further, the inserting of the at least one second characteristic data into the first data block includes: determining the last characteristic data pre-stored in the first data block; inserting the at least one second characteristic data after the last characteristic data. That is, when inserting the at least one second characteristic data, it is added after the last characteristic data pre-stored in the first data block.

[0124] See also Figure 3C , Figure 3C A schematic diagram of adding feature data with a storage period less than a preset storage period is provided in one embodiment of the present invention. Figure 3CAs shown, when the remaining storage space size of the first data block located at the tail end of the linked list does not match the storage space size required for at least one second characteristic data, part of the second characteristic data in the at least one second characteristic data is inserted into the first data block. The first data block is data block N. The inserting of at least one second characteristic data into the first data block includes: determining the last characteristic data pre-stored in the first data block; inserting the at least one second characteristic data after the last characteristic data. That is, when inserting at least one second characteristic data, it is added after the last characteristic data pre-stored in the first data block. Further, a second data block is generated that includes the second characteristic data in at least one second characteristic data that is not inserted into the first data block. The storage space size of the second data block can be the same as the storage space size required for the second characteristic data in at least one second characteristic data that is not inserted into the first data block, or it can be greater than the storage space size required for the characteristic data in at least one second characteristic data that is not inserted into the first data block, and there is no limitation here.

[0125] It can be seen that in the above technical solution, at least one second feature data corresponding to at least one second image is obtained, and the storage period of the at least one second feature data in the database is less than the preset storage period, and then, the first data block located at the tail end of the linked list among the N data blocks is obtained; it is determined whether the remaining storage space size of the first data block matches the storage space size required for the at least one second feature data; if so, the at least one second feature data is inserted into the first data block; if not, part of the second feature data in the at least one second feature data is inserted into the first data block, and the storage space size required for the part of the second feature data is the same as the remaining storage space size of the first data block, and a second data block including the feature data in the at least one second feature data that is not inserted into the first data block is generated, thereby realizing the insertion of the temporarily stored feature data into the tail end of the linked list, which is convenient for subsequent maintenance and reduces the difficulty of maintenance.

[0126] Optionally, in a possible implementation, the N data blocks are linked by a linked list, and the method further includes: obtaining at least one second feature data corresponding to at least one second image, the storage period of the at least one second feature data in the database being greater than or equal to the preset storage period; generating a first data block including the at least one second feature data; and inserting the first data block into the head end of the linked list.

[0127] Each of the at least one second image may be an image including a face, an image including a vehicle, or an image including a human body. Each of the at least one second image may also be an image frame among multiple image frames of a video, or may be a separate image or picture. Furthermore, the image frame may be an image frame including a face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0128] For example, in a certain community, a facial recognition access control system is set up. If a new householder moves into the community, the characteristic data of the householder and his family needs to be stored in the database first, so that they can enter and exit the community by face recognition. In this case, these characteristic data will be put at the head of the linked list for data management.

[0129] It can be seen that in the above technical solution, at least one second feature data corresponding to at least one second image is obtained, and the storage period of the at least one second feature data in the database is greater than or equal to the preset storage period; a first data block including the at least one second feature data is generated; and the first data block is inserted into the head end of the linked list, thereby realizing the insertion of multiple feature data with a storage period greater than or equal to the preset storage period into the head end of the linked list, which is convenient for subsequent maintenance.

[0130] Optionally, in a possible implementation, the method further includes: when a data modification instruction carrying a modification identifier and second characteristic data is detected, determining the characteristic data to be modified corresponding to the modification identifier in the database; and replacing the second characteristic data with the characteristic data to be modified.

[0131] For example, in a certain community, you need to obtain the vehicle number to enter the community. If a household owner in the community buys a new car and also configures a new vehicle, then the original feature data needs to be modified.

[0132] It can be seen that in the above technical solution, when a data modification instruction carrying a modification identifier and second characteristic data is detected, the characteristic data to be modified corresponding to the modification identifier in the database is determined; the second characteristic data is replaced with the characteristic data to be modified, and the characteristic data to be modified is determined through the characteristic identifier, which speeds up the query process of the characteristic data to be modified and saves query time; the first characteristic data is replaced with the characteristic data to be modified, thereby realizing the modification of the characteristic data in the database.

[0133] Among them, at least one first feature data included in each data block of the N data blocks corresponds to at least one feature identifier. Further, the first data block is any one of the N data blocks, and the first data block includes K first feature data, and the K first feature data correspond to K feature identifiers. The database also includes a data block with pre-stored feature identifiers, and the data block includes multiple feature identifiers, and all feature identifiers corresponding to the N data blocks are in the data block.

[0134] Optionally, determining the to-be-modified feature data corresponding to the modification identifier in the database includes: acquiring a feature identifier corresponding to the modification identifier from the database; and determining the to-be-modified feature data corresponding to the feature identifier.

[0135] For example, the database includes 3 data blocks, among which the first data block includes 5 feature data, the second data block includes 6 feature data, and the third data block includes 4 feature data. The first data block is located at the head of the linked list, and the third data block is located at the tail of the linked list. The feature identifier corresponding to the modification identifier is 10, then 5+6-10=1. In other words, the feature data to be modified with the feature identifier 10 is located in the second data block and is the first feature data in the second data block. If the feature identifier corresponding to the modification identifier is 4, then 5-4=1. In other words, the feature data to be modified with the feature identifier 4 is located in the first data block and is the 4th feature data in the first data block.

[0136] It can be seen that in the above technical solution, by obtaining the feature identifier corresponding to the modification identifier from the database; determining the feature data to be modified corresponding to the feature identifier, and determining the feature data to be modified through the feature identifier, the query process of the feature data to be modified is accelerated and the query time is saved.

[0137] Optionally, in a possible implementation, the N data blocks are linked by a linked list, and the method further includes: when a data deletion instruction carrying a deletion identifier is detected, determining the characteristic data to be deleted corresponding to the deletion identifier in the database; determining whether the characteristic data to be deleted is the second characteristic data, wherein the second characteristic data is the last characteristic data in the data block where the characteristic data to be deleted is located; if so, deleting the characteristic data to be deleted, and removing the data block where the characteristic data to be deleted is located from the linked list; if not, replacing the second characteristic data with the characteristic data to be deleted.

[0138] It can be understood that at least one first feature data included in each of the N data blocks corresponds to at least one feature identifier. Furthermore, the first data block is any one of the N data blocks, and the first data block includes K first feature data, and each of the K first feature data corresponds to a feature identifier. Therefore, when deleting the feature data to be deleted, if the feature data to be deleted is deleted directly, then the feature identifier corresponding to the feature data to be deleted also needs to be deleted. At the same time, after deleting the feature data to be deleted, the data block where the feature data to be deleted is located no longer maintains data continuity, thereby adding unnecessary complicated processes to the subsequent batch data search process.

[0139] It can be seen that in the above technical solution, when a data deletion instruction carrying a deletion mark is detected, the characteristic data to be deleted corresponding to the deletion mark in the database is determined; it is determined whether the characteristic data to be deleted is the second characteristic data, wherein the second characteristic data is the last characteristic data in the data block where the characteristic data to be deleted is located; if so, the characteristic data to be deleted is deleted, and the data block where the characteristic data to be deleted is removed from the linked list, so that when the last characteristic data is deleted, the data block where the characteristic data to be deleted is located is deleted, memory is released, and memory space is saved. If not, the second characteristic data is replaced with the characteristic data to be deleted, so that the last characteristic data in the data block where the characteristic data to be deleted is located is replaced with the deleted characteristic data, reducing the difficulty of data maintenance.

[0140] Optionally, in a possible implementation, the first data block is a data block having a remaining storage space size among the N data blocks, and the N data blocks are linked by a linked list, and the method further includes: determining the remaining storage space size of the first data block; obtaining a second data block located at the tail end of the linked list among the N data blocks; extracting at least one first feature data from the second data block according to a preset strategy, wherein the storage space size required for the at least one first feature data is the same as the remaining storage space size of the first data block; and inserting the at least one first feature data into the first data block.

[0141] For example, N data blocks are 5 data blocks, and the 5 data blocks are linked by a linked list. Then, the 5 data blocks can be traversed through the head pointer at the head of the linked list and the tail pointer at the tail of the linked list, so as to find the data block with the remaining storage space size among the 5 data blocks.

[0142] The preset strategy is a bottom-up order. That is, extracting at least one first feature data from the second data block according to the preset strategy includes: extracting at least one first feature data from the second data block according to a bottom-up order.

[0143] For example, the second data block includes L pieces of first characteristic data, the last piece of first characteristic data is firstly extracted from the L pieces of first characteristic data, and then the last piece of first characteristic data is extracted from the (L-1) pieces of first characteristic data.

[0144] Optionally, inserting the at least one first characteristic data into the first data block includes: obtaining a time sequence corresponding to extracting the at least one first characteristic data from the second data block; and inserting the at least one first characteristic data into the first data block according to the time sequence.

[0145] It can be seen that in the above technical solution, the remaining storage space size of the first data block is determined; the second data block located at the tail end of the linked list among the N data blocks is obtained; at least one first feature data is extracted from the second data block according to a preset strategy, wherein the storage space size required for the at least one first feature data matches the remaining storage space size of the first data block; and the at least one first feature data is inserted into the first data block, so that the feature data included in the data block located at the tail end of the linked list is filled to the data block with the remaining storage space size, thereby avoiding waste of data block space size and saving storage space.

[0146] For example, in one possible implementation, see Figure 4A , Figure 4A A structural diagram of a communication system provided for another embodiment of the present invention, the communication system may include a server 410 and a terminal 420 interconnected through a network. Among them, the terminal 420 includes M terminals, and M is an integer greater than 1. M can be equal to a value such as 2, 3, 4, 5, 11, 20, etc. The server 410 can implement all the functions mentioned in the embodiment of the present invention, but is not limited to all the functions mentioned in the embodiment of the present invention. The terminal 420 can implement all the functions mentioned in the embodiment of the present invention, but is not limited to all the functions mentioned in the embodiment of the present invention. Among them, the terminal can be, for example, a mobile phone, a tablet computer, a laptop computer, a PDA, a MID or other terminal devices.

[0147] See also Figure 4B , Figure 4B A flowchart of a data processing method provided by another embodiment of the present invention is shown below. Figure 4B As shown, a data processing method provided by an embodiment of the present invention may include:

[0148] 401. The server receives M data search requests sent by M terminals, wherein the M data search requests carry M feature data corresponding to M images, the M terminals correspond to the M data search requests one-to-one, and the j-th data search request among the M data search requests carries the j-th image among the M images, wherein 1≤j≤M and j is an integer;

[0149] Among them, any one of the M images may be an image including a human face, an image including a vehicle, or an image including a human body. Any one of the M images may also be an image frame among multiple image frames of a video, or may be a separate image or picture. Furthermore, the image frame may be an image frame including a human face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0150] Wherein, j can be equal to 1, 2, 3, 4, 5, 11, 20, etc.

[0151] Among them, any one of the M pieces of feature data includes a feature vector with a dimension of d, and the modulus of the feature vector with a dimension of d is 1, wherein d can be, for example, a value such as 512 or 516.

[0152] For example, the characteristic data may be |a1 ... a 512 |. Among them, a1 to a d Therefore, the feature data includes a matrix of 1 row and 512 columns and the modulus of the matrix is ​​1.

[0153] Furthermore, the feature data is obtained by the server calling a normalization function to process the image. The normalization function is used to normalize a feature vector with a dimension of d to obtain feature data with a modulus of 1.

[0154] The feature data may include, for example, facial feature data, body feature data or vehicle feature data.

[0155] 402. The server determines at least one similarity between each of the M pieces of feature data and each of the N data blocks, wherein the database includes the N data blocks, each of the data blocks includes at least one piece of first feature data, and N is an integer greater than 1.

[0156] Here, N may include values ​​such as 2, 3, 4, 5, 7, 11, 20, etc.

[0157] Among them, the storage space size of each data block in the N data blocks can be the same or different, and there is no limitation in this application.

[0158] Furthermore, the N data blocks are linked by a linked list, wherein a linked list is a non-continuous and non-sequential storage structure on a physical storage unit, and the logical order of data elements is realized by the link order of pointers in the linked list.

[0159] Optionally, determining at least one similarity between each of the M feature data and each of the N data blocks includes: constructing a first matrix including the M feature data; calling a preset function to process the first matrix and each of the N matrices respectively to obtain at least one similarity between each of the M feature data and each of the N data blocks, wherein the N matrices correspond to the N data blocks, and the i-th matrix includes the at least one first feature data included in the i-th data block.

[0160] The preset functions may include, for example:

[0161]

[0162] in, is a matrix consisting of the M feature data, is a matrix consisting of at least one feature data included in any one of the N data blocks. n is used to represent or Since all feature data have the same dimension, n is the same and can be 512 or 516, etc.

[0163] For example, the first data block is any one of the N data blocks, the first data block includes 3 feature data, and the M feature data are 3 feature data. Then, when determining the similarity between the 3 feature data and the 3 feature data included in the first data block, the server calls a preset function to process the first feature data and the 3 feature data included in the first data block to obtain 9 similarities. Among them, the matrix composed of the 3 feature data is For example, it can be The first data block includes a matrix consisting of three feature data For example, it can be Each row in corresponds to a feature data.

[0164] It can be seen that in the above technical solution, by constructing a first matrix including the M feature data, preparation is made for the subsequent determination of the similarity between matrices; the preset function is called to process the first matrix and each of the N matrices respectively to obtain at least one similarity corresponding to each of the M feature data and each of the N data blocks, wherein the N matrices correspond to the N data blocks, and the i-th matrix includes the at least one first feature data included in the i-th data block, thereby realizing the determination of the similarity between matrices, accelerating the similarity determination process, and thereby improving the retrieval efficiency.

[0165] 403. The server determines, from the N data blocks, M pieces of target feature data that match the M pieces of feature data according to at least one similarity between each piece of feature data in the M pieces of feature data and each piece of data in the N data blocks, where the M pieces of feature data correspond to the M pieces of target feature data;

[0166] 404. The server sends M data search responses to the M terminals, wherein the M data search responses carry the M pieces of target feature data, and the M terminals correspond one-to-one to the M data search responses.

[0167] Among them, the j-th data search response among the M data search responses carries the j-th target feature data.

[0168] Further, the server may send M data search responses to the M terminals in the order in which the M pieces of search information are generated, or may send the M data search responses to the M terminals simultaneously.

[0169] It can be seen that in the above technical solution, M data search requests sent by M terminals are received, wherein the M data search requests carry M feature data corresponding to M images, thereby preparing for the subsequent determination of the similarity between multiple feature data and feature data included in multiple data blocks; at least one similarity corresponding to each feature data in the M feature data and each data block in N data blocks is determined, wherein the database includes the N data blocks, and each data block includes at least one first feature data, thereby realizing the traversal of all data blocks in the database including feature data, avoiding the situation where the target feature data is not searched due to the omission of the data block; according to the similarity between each feature data in the M feature data and the N data blocks, At least one similarity corresponds to each data block in the data block, and M target feature data matching the M feature data are determined from the N data blocks. The M feature data correspond to the M target feature data, so as to realize batch determination of the similarities between multiple feature data and multiple data blocks, improve the efficiency of similarity determination, and lay a foundation for improving the subsequent search efficiency. At the same time, the search efficiency is improved by batch determination of the similarities between multiple feature data and multiple data blocks, avoiding the problem of inefficiency caused by one-to-one comparison and saving search time. Finally, M data search responses are sent to the M terminals, wherein the M data search responses carry M target feature data, so as to quickly feed back the search results to the terminals.

[0170] See also Figure 5 , Figure 5 A schematic diagram of a data processing device provided by an embodiment of the present invention. Figure 5 As shown, a data processing device 500 provided by an embodiment of the present invention may include:

[0171] An acquisition module 501 is used to acquire feature data of an image;

[0172] The image may be an image including a face, an image including a vehicle, or an image including a human body. The image may also be a certain image frame among multiple image frames of a video, or a separate image or picture. Furthermore, the certain image frame may be an image frame including a face, an image frame including a vehicle, or an image frame including a human body, which is not limited in the embodiments of the present application.

[0173] The feature data includes a feature vector with a dimension of d, and the modulus of the feature vector with a dimension of d is 1, wherein d can be, for example, a value such as 512 or 516.

[0174] For example, the characteristic data may be |a1 ... a 512 |. Among them, a1 to a dTherefore, the feature data includes a matrix of 1 row and 512 columns and the modulus of the matrix is ​​1.

[0175] Furthermore, the processing of the image to obtain feature data includes: calling a normalization function to process the image to obtain feature data, wherein the normalization function is used to normalize a feature vector with a dimension of d to obtain feature data with a modulus of 1.

[0176] The feature data may include, for example, facial feature data, body feature data or vehicle feature data.

[0177] A first determination module 502, configured to determine at least one similarity between the feature data and each of N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1;

[0178] Here, N may include values ​​such as 2, 3, 4, 5, 7, 11, 20, etc.

[0179] Among them, the space size of each data block in the N data blocks can be the same or different, and there is no limitation in this application.

[0180] Furthermore, the N data blocks are linked by a linked list, wherein a linked list is a non-continuous and non-sequential storage structure on a physical storage unit, and the logical order of data elements is realized by the link order of pointers in the linked list.

[0181] Optionally, before determining at least one similarity between the feature data and each of the N data blocks, the data processing device also includes a storage module, which is used to obtain first feature data corresponding to each of the multiple first images to obtain multiple first feature data; generate the N data blocks including the multiple first feature data according to a preset data block generation strategy, wherein the i-th data block among the N data blocks includes at least one first feature data among the multiple first feature data, 1≤i≤N and i is an integer; and store the N data blocks in the database.

[0182] Optionally, the N data blocks are linked by a linked list, and the storage module is also used to obtain at least one second feature data corresponding to at least one second image, and the storage period of the at least one second feature data in the database is less than a preset storage period; obtain the first data block located at the tail end of the linked list among the N data blocks; determine whether the remaining storage space size of the first data block matches the storage space size required for the at least one second feature data; if so, insert the at least one second feature data into the first data block; if not, insert part of the second feature data in the at least one second feature data into the first data block, and the storage space size required for the part of the second feature data is the same as the remaining storage space size of the first data block; and generate a second data block including the feature data of the at least one second feature data that is not inserted into the first data block.

[0183] Optionally, the N data blocks are linked by a linked list, and the storage module is also used to obtain at least one second feature data corresponding to at least one second image, and the storage period of the at least one second feature data in the database is greater than or equal to the preset storage period; generate a first data block including the at least one second feature data; and insert the first data block into the head end of the linked list.

[0184] Optionally, the data processing device also includes a replacement module, which is used to determine the feature data to be modified corresponding to the modification identifier in the database when a data modification instruction carrying the modification identifier and second feature data is detected; and replace the second feature data with the feature data to be modified.

[0185] Optionally, the N data blocks are linked by a linked list, and the deletion module is also used to determine the characteristic data to be deleted corresponding to the deletion identifier in the database when a data deletion instruction carrying a deletion identifier is detected; determine whether the characteristic data to be deleted is the second characteristic data, wherein the second characteristic data is the last characteristic data in the data block where the characteristic data to be deleted is located; if so, delete the characteristic data to be deleted and remove the data block where the characteristic data to be deleted is located from the linked list; if not, replace the second characteristic data with the characteristic data to be deleted.

[0186] A second determination module 503, configured to determine target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks;

[0187] Optionally, the second determination module is specifically used to determine N target similarities corresponding to the N data blocks one by one according to at least one similarity corresponding to each of the N data blocks, wherein the i-th target similarity among the N target similarities is the similarity with the greatest similarity among the at least one similarity corresponding to the i data blocks, and the at least one similarity is determined according to the i-th matrix and the feature data, the i-th matrix including the at least one first feature data included in the i-th data block; determine a first target similarity among the N target similarities that is greater than a similarity threshold; and determine target feature data that matches the feature data from the N data blocks according to the first target similarity.

[0188] Optionally, the second determination module 503 is specifically configured to call a preset function to process the feature data and each of the N data blocks respectively to obtain at least one similarity between the feature data and each of the N data blocks. The preset function may include, for example:

[0189]

[0190] in, For representing the characteristic data, is a matrix consisting of at least one feature data included in any one of the N data blocks. n is used to represent or Since all feature data have the same dimension, n is the same and is 512.

[0191] For example, N data blocks include a first data block and a second data block, the first data block includes 5 feature data, and the second data block includes 4 feature data. Then, the server processes the feature data and the 5 feature data included in the first data block through a preset function to obtain 5 similarities, and the server processes the feature data and the 4 feature data included in the second data block through a preset function to obtain 4 similarities. For example, it can be |a1… a 516 |, the matrix consisting of 5 feature data included in the first data block For example, it can be The first data block corresponds to Each row in corresponds to one feature data, and there are five feature data in total. The matrix composed of the four feature data included in the second data block can be, for example, The second data block corresponds to Each row in corresponds to one feature data, a total of 4 feature data.

[0192] Output module 504 is used to output the target feature data. It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.

[0193] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data processing method, characterized in that: include: Obtain feature data of the image; Determine at least one similarity between the feature data and each data block in N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1; Determining target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks; Outputting the target feature data; Before determining at least one similarity between the feature data and each of the N data blocks, the method further includes: Acquire first feature data corresponding to each first image in a plurality of first images to obtain a plurality of first feature data; generate the N data blocks including the plurality of first feature data according to a preset data block generation strategy, wherein the i-th data block in the N data blocks includes at least one first feature data in the plurality of first feature data, 1≤i≤N and i is an integer; Storing the N data blocks in the database; The N data blocks are linked by a linked list, and the method further comprises: Acquire at least one second feature data corresponding to at least one second image, wherein the storage period of the at least one second feature data in the database is less than a preset storage period; Obtaining a first data block located at the tail end of the linked list among the N data blocks; Determining whether the remaining storage space size of the first data block matches the storage space size required by the at least one second characteristic data; If yes, inserting the at least one second characteristic data into the first data block; If not, insert part of the second characteristic data in the at least one second characteristic data into the first data block, the storage space required for the part of the second characteristic data is the same as the remaining storage space of the first data block, and generate a second data block including the characteristic data in the at least one second characteristic data that is not inserted into the first data block.

2. The method according to claim 1, characterized in that The N data blocks are linked by a linked list, and the method further comprises: Acquire at least one second feature data corresponding to at least one second image, wherein the storage period of the at least one second feature data in the database is greater than or equal to the preset storage period; generating a first data block including the at least one second characteristic data; Insert the first data block into the head end of the linked list.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: When a data modification instruction carrying a modification identifier and second characteristic data is detected, determining the characteristic data to be modified corresponding to the modification identifier in the database; The second characteristic data is replaced by the characteristic data to be modified.

4. The method according to claim 1, characterized in that The N data blocks are linked by a linked list, and the method further comprises: When a data deletion instruction carrying a deletion identifier is detected, determining the characteristic data to be deleted corresponding to the deletion identifier in the database; Determine whether the characteristic data to be deleted is the second characteristic data, wherein the second characteristic data is the last characteristic data in the data block where the characteristic data to be deleted is located; If yes, then the feature data to be deleted is deleted, and the data block where the feature data to be deleted is located is removed from the linked list; If not, the second characteristic data is replaced by the characteristic data to be deleted.

5. The method according to claim 1 or 2, characterized in that: The determining, from the N data blocks according to at least one similarity corresponding to each of the N data blocks, target feature data matching the feature data comprises: Determine N target similarities corresponding to the N data blocks one by one according to at least one similarity corresponding to each data block in the N data blocks, wherein the i-th target similarity among the N target similarities is the similarity with the greatest similarity among the at least one similarity corresponding to the i data blocks, the at least one similarity is determined according to the i-th matrix and the feature data, the i-th matrix includes the at least one first feature data included in the i-th data block; Determine a first target similarity among the N target similarities that is greater than a similarity threshold; Target feature data matching the feature data is determined from the N data blocks according to the first target similarity.

6. A data processing device, characterized in that: include: An acquisition module, used for acquiring feature data of an image; A first determination module, configured to determine at least one similarity between the feature data and each of N data blocks, wherein the database includes the N data blocks, each data block includes at least one first feature data, and N is an integer greater than 1; A second determination module, configured to determine target feature data matching the feature data from the N data blocks according to at least one similarity corresponding to each of the N data blocks; An output module, used for outputting the target feature data; The N data blocks are linked by a linked list, the data processing device further comprises a storage module, the storage module is further used to obtain at least one second feature data corresponding to at least one second image, the storage period of the at least one second feature data in the database is greater than or equal to a preset storage period; generate a first data block including the at least one second feature data; insert the first data block into the head end of the linked list; The data processing device also includes a replacement module, which is used to determine the to-be-modified characteristic data corresponding to the modification identifier in the database when a data modification instruction carrying the modification identifier and second characteristic data is detected; and replace the second characteristic data with the to-be-modified characteristic data.

7. An electronic device for data processing, characterized in that: The method comprises a processor, a memory, a communication interface and one or more programs, wherein the one or more programs are stored in the memory and are generated so that the processor executes instructions in the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data de-duplication method

    CN102323958A

  • Face recognition system and method

    CN105488478A

  • Feature retrieval method and device and storage medium

    CN109165307A

  • Gene database retrieval system

    EP0646883A1

  • System and method for efficiently performing similarity searches of structural data

    US20060224562A1