Image processing method, device and storage medium
The image metadata is filtered through the Bloom filter, combined with the second- and third-stage data models, the problem of low image data retrieval efficiency in the existing technology is solved, and fast and efficient image retrieval is achieved.
Patent Information
- Application Number
- CN202110002948.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-04
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-01-04
AI Technical Summary
Existing distributed storage systems are less efficient when processing large amounts of image data retrieval, especially when processing unstructured and text data.
The metadata filter is used to filter. After determining the encrypted information, the target metadata information is found from the second-stage data model, and the target picture is retrieved through the third-stage data model and feedback it to the client.
By filtering invalid requests, quickly searching target images, significantly improving the efficiency of image data retrieval.
Smart Images

Figure CN114722302B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of data storage and retrieval technology, and in particular to a picture processing method and device, and a storage medium. Background Art
[0002] With the continuous development of e-commerce platforms and social networks, the number of images used for product display or social sharing has exploded, and massive image retrieval has become a difficult problem that needs to be solved urgently.
[0003] There are two main solutions for non-primary key retrieval methods in distributed storage systems. Solution 1 uses the idea of inverted index for retrieval, and Solution 2 uses a linear retrieval method. These two methods have good effects when processing spatial data, but are not ideal for processing text data. Image data is mainly unstructured data and text data, so there is a technical problem of low efficiency when retrieving a large amount of image data through the existing distributed storage system. Summary of the invention
[0004] The present invention is intended to provide a picture processing method and device, and a storage medium, which can improve the retrieval efficiency when retrieving a large amount of picture data.
[0005] The technical solution of the present invention is achieved in this way:
[0006] The disclosed embodiment of the present invention provides a method for processing an image, comprising:
[0007] receiving an initial search request, wherein the initial search request carries metadata information to be searched;
[0008] In response to the initial search request, the metadata information to be searched is filtered based on a Bloom filter to obtain a filtering result;
[0009] If the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter, determining first encryption information according to the metadata information to be retrieved;
[0010] Based on the first encrypted information, searching for target metadata information corresponding to the metadata information to be retrieved from a two-stage data model; the two-stage data model represents a mapping relationship between the encrypted information and the metadata information;
[0011] Based on the target metadata information, a target image is retrieved from a three-stage data model, and the target image is fed back to the client; the three-stage data model is used to store images corresponding to the metadata information.
[0012] In the above solution, in response to the initial search request, filtering the metadata information to be searched based on a Bloom filter to obtain a filtering result includes:
[0013] In response to the initial search request, the metadata information to be searched carried by the initial search request is input into the Bloom filter, a Bloom calculation is performed on the metadata information to be searched, and second encrypted information corresponding to the metadata information to be searched is determined;
[0014] If the encrypted information identical to the second encrypted information exists in the Bloom filter, then determining the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter.
[0015] In the above solution, searching the target metadata information corresponding to the metadata information to be retrieved from the two-stage data model based on the first encrypted information includes:
[0016] Based on the first encrypted information, searching for second target encrypted information corresponding to the first encrypted information from the second-stage data model;
[0017] Based on mapping data of at least one metadata information and the corresponding second target encrypted information, the target metadata information corresponding to the metadata information to be retrieved is found from the two-stage data model.
[0018] In the above solution, based on the target metadata information, retrieving the target image from the three-stage data model and feeding the target image back to the client includes:
[0019] Retrieving the encoded string from the three-stage data model based on a mapping relationship between the second target encryption information corresponding to the target metadata information and the encoded string;
[0020] The encoded string is converted into the target image, and the target image is fed back to the client.
[0021] In the above scheme, in response to the initial search request, the metadata information to be searched carried by the initial search request is input into the Bloom filter, Bloom calculation is performed on the metadata information to be searched, and after determining the second encrypted information corresponding to the metadata information to be searched, the method further includes:
[0022] If the encryption information identical to the second encryption information does not exist in the Bloom filter, it is determined that the filtering result indicates that the metadata information to be retrieved does not exist in the Bloom filter, and the initial search request is rejected to the client.
[0023] The disclosed embodiment of the present invention also provides a method for processing an image, comprising:
[0024] Receiving a storage request, wherein the storage request carries at least one image and at least one metadata information;
[0025] Inputting the at least one metadata information into the Bloom filter for calculation, and determining the first target encryption information corresponding to the at least one metadata information;
[0026] storing the first target encrypted information in the Bloom filter;
[0027] Calculating the at least one metadata information respectively to determine the second target encryption information respectively corresponding to the at least one metadata information;
[0028] Based on the at least one metadata information and the second target encryption information, construct a mapping relationship between the encryption information and the metadata information included in the second-stage data model;
[0029] Based on the at least one metadata information, the at least one picture is stored in a target area of the three-stage data model corresponding to the metadata information.
[0030] In the above solution, before receiving the storage request, the method further includes:
[0031] Based on the field range corresponding to the second target encrypted information, the target area corresponding to different field intervals is divided in the three-stage data model.
[0032] In the above solution, after receiving the storage request, before inputting the at least one metadata information into the Bloom filter for calculation and determining the first target encryption information corresponding to the at least one metadata information, the method further includes:
[0033] Detect whether the at least one picture and the at least one metadata information match.
[0034] In the above solution, the step of inputting the at least one metadata information into the Bloom filter for calculation to determine the first target encryption information corresponding to the at least one metadata information includes:
[0035] When the at least one picture matches the at least one metadata information, the at least one metadata information is input into the Bloom filter for calculation to determine the first target encryption information corresponding to the at least one metadata information.
[0036] In the above solution, the calculating of the at least one metadata information respectively to determine the second target encryption information respectively corresponding to the at least one metadata information includes:
[0037] Hash calculations are performed on the at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information respectively.
[0038] In the above solution, the step of constructing a mapping relationship between the encryption information and the metadata information contained in the two-stage data model based on the at least one metadata information and the second target encryption information includes:
[0039] After mapping the at least one metadata information and the corresponding second target encrypted information, mapping data between the at least one metadata information and the corresponding second target encrypted information is obtained;
[0040] The mapping data is stored in the two-stage data model, thereby constructing a mapping relationship between the encryption information and the metadata information included in the two-stage data model.
[0041] In the above solution, based on the at least one metadata information, storing the at least one picture in a target area of the three-stage data model corresponding to the metadata information includes:
[0042] converting the at least one image into an encoded string;
[0043] After mapping the encoded string with the second target encrypted information, a mapping relationship between the encoded string and the second target encrypted information is obtained;
[0044] The encoded character string is stored in the target area of the three-stage data model according to the mapping relationship; the target area is an area divided in the three-stage data model corresponding to the field interval of the second target encrypted information.
[0045] In the above solution, after performing hash calculation on the at least one metadata information respectively to determine the second target encryption information respectively corresponding to the at least one metadata information, the method further includes:
[0046] If the second target encryption information is the same as the third target encryption information, the encoding string corresponding to the retained picture corresponding to the third target encryption information is replaced by the encoding string corresponding to the picture corresponding to the second target encryption information; the retained picture is a picture pre-existing in the three-stage data model, and the third target encryption information is the encryption information obtained by hashing the retained metadata information corresponding to the retained picture.
[0047] The disclosed embodiment of the present invention further provides a picture processing device, comprising:
[0048] A first information collection unit, configured to receive an initial search request, wherein the initial search request carries metadata information to be searched;
[0049] The first data processing unit, in response to the initial search request, filters the metadata information to be searched based on the Bloom filter to obtain a filtering result; if the filtering result indicates that the metadata information to be searched exists in the Bloom filter, determines the first encryption information according to the metadata information to be searched;
[0050] A retrieval unit is used to search for target metadata information corresponding to the metadata information to be retrieved from the two-stage data model based on the first encryption information; retrieve a target image from the three-stage data model based on the target metadata information, and feed the target image back to the client; the two-stage data model represents the mapping relationship between encryption information and metadata information; the three-stage data model is used to store images corresponding to the metadata information.
[0051] The disclosed embodiment of the present invention further provides a picture processing device, comprising:
[0052] A second information collection unit, configured to receive a storage request, wherein the storage request carries at least one image and at least one metadata information;
[0053] A second data processing unit is configured to input the at least one metadata information into the Bloom filter for calculation, and determine the first target encryption information corresponding to the at least one metadata information;
[0054] a first storage unit, configured to store the first target encrypted information in the Bloom filter;
[0055] A third data processing unit is used to calculate the at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information respectively;
[0056] a fourth data processing unit, configured to construct a mapping relationship between the encryption information and the metadata information included in the second-stage data model based on the at least one metadata information and the second target encryption information;
[0057] The second storage unit is used to store the at least one image in a target area of the three-stage data model corresponding to the metadata information based on the at least one metadata information.
[0058] The disclosed embodiment of the present invention further provides an image processing device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the steps in the above method when executing the program.
[0059] The disclosed embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.
[0060] The embodiment of the present invention receives an initial search request, responds to the initial search request, filters the metadata information to be searched based on the Bloom filter, and obtains a filtering result; if the filtering result indicates that the metadata information to be searched exists in the Bloom filter, the first encryption information is determined according to the metadata information to be searched; based on the first encryption information, the target metadata information corresponding to the metadata information to be searched is searched from the two-stage data model; based on the target metadata information, the target image is retrieved from the three-stage data model, and the target image is fed back to the client. First, a large number of useless search requests are filtered out by the Bloom filter, and then the target metadata information of the target image corresponding to the metadata information to be searched is found by the two-stage data model, and then the target image corresponding to the search request can be quickly retrieved, thereby improving the search efficiency when searching a large amount of image data. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 A process of an image processing method provided by an embodiment of the present invention Figure 1 ;
[0062] Figure 2 A schematic diagram of an application scenario of an image processing method provided by an embodiment of the present invention;
[0063] Figure 3 A schematic diagram of the effect of a picture provided by an embodiment of the present invention;
[0064] Figure 4 A process of an image processing method provided by an embodiment of the present invention Figure 2 ;
[0065] Figure 5 A process of an image processing method provided by an embodiment of the present invention Figure 3 ;
[0066] Figure 6 A process of an image processing method provided by an embodiment of the present invention Figure 4 ;
[0067] Figure 7 A process of an image processing method provided by an embodiment of the present invention Figure 5 ;
[0068] Figure 8 A process of an image processing method provided by an embodiment of the present invention Figure 6 ;
[0069] Fig. 9A process of an image processing method provided by an embodiment of the present invention Figure 7 ;
[0070] Fig.10 A schematic diagram of the structure of a picture processing device provided by an embodiment of the present invention;
[0071] Fig.11 A schematic diagram of the structure of a picture processing device provided by an embodiment of the present invention;
[0072] Fig.12 A schematic diagram of a physical image processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention are further elaborated in detail below in conjunction with the drawings and embodiments. 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.
[0074] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0075] If similar descriptions of "first / second" appear in the invention document, the following description is added. In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.
[0077] Figure 1 The present invention provides a picture processing method. Figure 1 , will combine Figure 1 The steps shown are explained.
[0078] S01, receiving an initial search request.
[0079] In the disclosed embodiment of the present invention, the client establishes a communication line with the server in advance, and when the client needs a target image, the client sends an initial search request to the server. The client may be a mobile phone, a computer, a smart terminal, a car computer, etc. The initial search request may be a coded string or a voice message or a picture message or a text message. The initial search request carries metadata information to be searched, and the metadata information to be searched may include metadata information of the target image required by the client.
[0080] Combination Figure 2 , the server 200 establishes a communication line 201 with the client 1 and the client 2 in advance. The client 1 is a mobile terminal, and the client 2 is a computer. The client 1 or the client 2 can send an initial search request to the server 200 through the pre-established communication line 201.
[0081] In the disclosed embodiment of the present invention, the server integrates a Bloom filter, a two-stage data model and a three-stage data model. Among them, the two-stage data model may include one or more relational databases. The three-stage data model may include an image database. The Bloom filter is used to filter the metadata information to be retrieved to obtain a filtering result. Among them, the filtering result can represent that the metadata information to be retrieved exists in the Bloom filter or that the metadata information to be retrieved does not exist in the Bloom filter. The two-stage data model represents the mapping relationship between the encryption information and the metadata information. The three-stage data model is used to store images corresponding to the metadata information.
[0082] In the disclosed embodiment of the present invention, the metadata information to be retrieved may include name information of the target image, generation time information of the target image, shooting location information of the target image, identification information of the target image, size information of the target image, content information of the target image, etc.
[0083] In the disclosed embodiment of the present invention, Figure 3 , the target image retrieved by the client is Figure 3 The client sends to the server metadata information to be retrieved of the target image 1. The metadata information to be retrieved may be text information "high-end smart 5G black mobile phone, number 123456", wherein the number in the metadata information to be retrieved is identification information of the target image 1.
[0084] S02, responding to the initial search request, filtering the metadata information to be searched based on the Bloom filter to obtain a filtering result.
[0085] In the disclosed embodiment of the present invention, after receiving the metadata information to be retrieved carried in the initial search request, the server first inputs the metadata information to be retrieved into the Bloom filter. The server filters the metadata information to be retrieved through the Bloom filter and can determine the filtering result. The filtering result can indicate that the metadata information to be retrieved exists in the Bloom filter or that the metadata information to be retrieved does not exist in the Bloom filter.
[0086] In the disclosed embodiment of the present invention, the server inputs the metadata information to be retrieved into the Bloom filter to calculate a second encrypted information. Since the target image passes through the Bloom filter when it is stored on the server, the Bloom filter will calculate and generate a first target encrypted information for the target metadata information corresponding to the target image. And the first target encrypted information is stored in the database of the Bloom filter. The server needs to determine whether the second encrypted information corresponding to the metadata information to be retrieved matches or is the same as the first target encrypted information. If the second encrypted information corresponding to the metadata information to be retrieved matches or is the same as the first target encrypted information, the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter. If the second encrypted information corresponding to the metadata information to be retrieved does not match or is not the same as the first target encrypted information, the filtering result indicates that the metadata information to be retrieved does not exist in the Bloom filter.
[0087] In the disclosed embodiment of the present invention, the server inputs the metadata information to be retrieved "high-end smart 5G black mobile phone, number 123456" into the Bloom filter. The number in the metadata information to be retrieved is an identification information of the target image. The Bloom filter performs calculations on the metadata information to be retrieved "high-end smart 5G black mobile phone, number 123456", and can obtain the second encrypted information 010 corresponding to the metadata information to be retrieved. Based on the second encrypted information 010, the server searches the database of the Bloom filter to see whether the second encrypted information 010 is the same as or matches the first target encrypted information pre-stored in the database. Exemplarily, the first target encrypted information may also be 010.
[0088] S03: If the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter, first encryption information is determined according to the metadata information to be retrieved.
[0089] In the disclosed embodiment of the present invention, the server detects that the second encrypted information is the same as or matches the first target encrypted information in the Bloom filter. The filtering result indicates that the metadata information to be retrieved exists in the Bloom filter. The server performs encryption calculation on the metadata information to be retrieved, and can obtain the first encrypted information corresponding to the metadata information to be retrieved.
[0090] In the disclosed embodiment of the present invention, the server may perform a hash calculation on the metadata information to be retrieved to obtain first encrypted information corresponding to the metadata information to be retrieved, wherein the first encrypted information may be a character string corresponding to the metadata information to be retrieved.
[0091] S04: Based on the first encrypted information, search the second-stage data model for target metadata information corresponding to the metadata information to be retrieved.
[0092] In the disclosed embodiment of the present invention, the server inputs the first encrypted information into the two-stage data model, and finds the target metadata information of the second target encrypted information corresponding to the first encrypted information in the two-stage data model. Since the target metadata information of the target image will be calculated to generate a second target encrypted information when the target image is stored. The second target encrypted information and the first encrypted information are correspondingly matched. The server forms mapping data with the target metadata information and the second target encrypted information and then stores it in the two-stage data model. Therefore, the server can find the target metadata information corresponding to the metadata information to be retrieved based on the first encrypted information.
[0093] In the disclosed embodiment of the present invention, a Bloom filter may correspond to a plurality of two-stage data models. Each two-stage data model may store metadata information of different categories. The two-stage data model may determine the category of metadata information according to the metadata information. The categories of metadata information may be divided into automobiles, clothing, electronic products, and landscapes.
[0094] In the disclosed embodiment of the present invention, the target metadata information may include the name information of the target image, the generation time information of the target image, the geographic information of the target image, the identification information of the target image, the size information of the target image, and the content information of the target image. The target metadata information may be data information or text information. Exemplarily, the target metadata information may be "smart 5G mobile phone, number 123456", wherein the number in the target metadata information is the same as the number in the metadata information to be retrieved. The Bloom filter calculates the second encrypted information for the number 123456 in the metadata information to be retrieved. The Bloom filter calculates the first target encrypted information for the number 123456 in the target metadata information. The first target encrypted information of the target metadata information is the same as the second encrypted information of the metadata information to be retrieved.
[0095] S05, based on the target metadata information, retrieve the target image from the three-stage data model, and feed the target image back to the client.
[0096] In the disclosed embodiment of the present invention, the server finds an encrypted string corresponding to a target image in a three-stage data model based on the target metadata information found in the two-stage data model. The server converts the encrypted string into a target image and sends it to the client via a communication line pre-established with the client.
[0097] In the disclosed embodiment of the present invention, when the server stores the target image in the three-stage data model, the server performs encryption calculation according to the target metadata model of the target image to determine the second target encryption information corresponding to the target image. The server converts the target image into a series of coded strings, maps the coded strings and the second encryption information to obtain a mapping relationship between the coded strings and the second encryption information. The server stores the coded strings in the three-stage data model according to the mapping relationship between the coded strings and the second encryption information.
[0098] In the disclosed embodiment of the present invention, when retrieving a target image, the server finds the encryption string of the target image in the three-stage data model according to the mapping relationship between the second target encryption information corresponding to the target metadata information and the encoding string. The server converts the encryption string corresponding to the target image into the image data format of the target image. The server sends the target image to the client through a communication line pre-established with the client.
[0099] The disclosed embodiment of the present invention receives an initial search request, responds to the initial search request, filters the metadata information to be searched based on the Bloom filter, and obtains a filtering result; if the filtering result indicates that the metadata information to be searched exists in the Bloom filter, the first encryption information is determined according to the metadata information to be searched; based on the first encryption information, the target metadata information corresponding to the metadata information to be searched is searched from the two-stage data model; based on the target metadata information, the target image is retrieved from the three-stage data model, and the target image is fed back to the client. First, a large number of useless search requests are filtered out by the Bloom filter, and then the target metadata information of the target image corresponding to the metadata information to be searched is found by the two-stage data model, and then the target image corresponding to the search request can be quickly retrieved, thereby improving the search efficiency when searching a large amount of image data.
[0100] In some embodiments, see Figure 4 , Figure 4 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 1 The illustrated S02 can be implemented through S30 - S32 , which will be described in conjunction with each step.
[0101] S30, responding to the initial search request, inputting the metadata information to be searched carried in the initial search request into a Bloom filter, performing Bloom calculation on the metadata information to be searched, and determining the second encrypted information corresponding to the metadata information to be searched.
[0102] In the disclosed embodiment of the present invention, after the server obtains the metadata information to be retrieved in the initial search request, the server will input the metadata information to be retrieved into a Bloom filter, and the Bloom filter can calculate all the character information in the metadata information to be retrieved. The Bloom filter can also calculate the number information in the metadata information to be retrieved, and the Bloom filter can obtain the second encrypted information corresponding to the metadata information to be retrieved by calculating the metadata information to be retrieved.
[0103] In the disclosed embodiment of the present invention, the Bloom filter is a data model constructed based on the Bloom filter. In other embodiments, the Bloom filter may also be a data model constructed based on a hash function.
[0104] S31: If the encrypted information identical to the second encrypted information exists in the Bloom filter, determining that the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter.
[0105] In the disclosed embodiment of the present invention, after the server obtains the second encrypted information, the server searches the Bloom filter for the first target encrypted information that is identical or matches the second encrypted information. If the second encrypted information obtained by the server is identical to any first target encrypted information stored in the Bloom filter, the filtering result obtained by the Bloom filter indicates that the metadata information to be retrieved exists in the Bloom filter.
[0106] S32: If the encrypted information identical to the second encrypted information does not exist in the Bloom filter, determine that the filtering result indicates that the metadata information to be retrieved does not exist in the Bloom filter, and reject the initial search request to the client.
[0107] In the disclosed embodiment of the present invention, after the server obtains the second encrypted information, the server searches the Bloom filter for the first target encrypted information that is identical or matches the second encrypted information. If the second encrypted information obtained by the server is different from each of the first target encrypted information stored in the Bloom filter, the filtering result obtained by the Bloom filter is a characterization that the metadata information to be retrieved does not exist in the Bloom filter. And the server will reject the initial search request to the client. The server will explain in the rejection information that the reason for the rejection of this search request is that the target image requested for retrieval is not in this server.
[0108] The disclosed embodiment of the present invention receives an initial search request, responds to the initial search request, calculates the metadata information to be searched based on the Bloom filter, and obtains the second encrypted information; if there is encrypted information corresponding to the second encrypted information in the Bloom filter, it means that the metadata information to be searched exists in the Bloom filter, and then the first encrypted information is determined according to the metadata information to be searched; based on the first encrypted information, the target metadata information corresponding to the metadata information to be searched is searched from the two-stage data model; based on the target metadata information, the target image is retrieved from the three-stage data model, and the target image is fed back to the client. First, a large number of useless search requests are filtered out by the Bloom filter, and then the target metadata information of the target image corresponding to the metadata information to be searched is found through the two-stage data model, and then the target image corresponding to the search request can be quickly retrieved, thereby improving the search efficiency when searching a large amount of image data.
[0109] In some embodiments, see Figure 4 , Figure 4 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 1 The illustrated S04-S05 can be implemented through S33-S36, which will be described in conjunction with each step.
[0110] S33, based on the first encrypted information, searching the second target encrypted information corresponding to the first encrypted information from the second-stage data model.
[0111] In the disclosed embodiment of the present invention, the server calculates the metadata information to be retrieved, and can calculate the first encrypted information corresponding to the metadata information to be retrieved through the hash function. The server will find the second target encrypted information that is the same as or matches the first encrypted information in the two-stage data model based on the first encrypted information, thereby finding the target metadata information corresponding to the second target encrypted information, that is, the target metadata information corresponding to the metadata information to be retrieved.
[0112] S34, based on mapping data of at least one metadata information and corresponding second target encrypted information, searching for target metadata information corresponding to the metadata information to be retrieved from the two-stage data model.
[0113] In the disclosed embodiment of the present invention, the server will find the second target encryption information that is the same as or matches the first encryption information in the two-stage data model according to the first encryption information, and then find the target metadata information corresponding to the second target encryption information based on the mapping data of at least one metadata information and the corresponding second target encryption information, that is, the target metadata information corresponding to the metadata information to be retrieved. The server will establish the mapping data of at least one metadata information and the corresponding second target encryption information when storing the picture.
[0114] In the disclosed embodiment of the present invention, the server can also directly find the target metadata information corresponding to the metadata information to be retrieved in the two-stage data model based on the metadata information to be retrieved. Since the metadata information to be retrieved and the target metadata information correspond to the same target image at the same time, the metadata information to be retrieved and the target metadata information are the same or the numbers of the metadata information to be retrieved and the target metadata information are the same.
[0115] S35, based on the mapping relationship between the second target encryption information corresponding to the target metadata information and the encoded string, retrieve the encoded string from the three-stage data model.
[0116] In the disclosed embodiment of the present invention, after the server obtains the target metadata information, the server stores the encoded string corresponding to the target image in the three-stage data model according to the corresponding relationship with the second target encryption information, so the server can find the encoded string corresponding to the target image in the three-stage data model based on the second target encryption information corresponding to the target metadata information.
[0117] In the disclosed embodiment of the present invention, the server retrieves the encoding string corresponding to the target image in the three-stage data model based on the second target encryption information and according to the mapping relationship between the second target encryption information and the encoding string corresponding to the target image.
[0118] In the disclosed embodiment of the present invention, the second target encryption information may be 10001, and the encoding string corresponding to the target image may be 1110xxxx 10xxxxxx 10xxxxxx. The server searches out the encoding string 1110xxxx 10xxxxxx 10xxxxxx in the three-stage data model according to the mapping relationship between the second target encryption information 10001 and the encoding string 1110xxxx 10xxxxxx 10xxxxxx.
[0119] S36, converting the encoded string into a target image, and feeding back the target image to the client.
[0120] In the disclosed embodiment of the present invention, after the server obtains the coded string, the server converts the coded string into a target image according to a pre-set program, and sends the target image to the client through a communication line pre-established with the client.
[0121] In the disclosed embodiment of the present invention, the server may convert the encoded character string into a target image in GIF format, JPEG format, image format, or PNG format.
[0122] The disclosed embodiment of the present invention receives an initial search request, responds to the initial search request, calculates the metadata information to be searched based on the Bloom filter, and obtains the second encrypted information; if there is encrypted information corresponding to the second encrypted information in the Bloom filter, it means that the metadata information to be searched exists in the Bloom filter, and then the first encrypted information is determined according to the metadata information to be searched; based on the first encrypted information, the second target encrypted information corresponding to the first encrypted information is found from the two-stage data model; based on the mapping data of at least one metadata information and the corresponding second target encrypted information, the target metadata information corresponding to the metadata information to be searched is found from the two-stage data model, and based on the target metadata information, the encoding string of the target image is retrieved from the three-stage data model, and then the encoding string is merged to form the target image, and the target image is fed back to the client. First, a large number of useless search requests are filtered out by the Bloom filter, and then the target metadata information of the target image corresponding to the metadata information to be searched is found by the two-stage data model, and then the target image corresponding to the search request can be quickly retrieved, thereby improving the search efficiency when searching a large amount of image data.
[0123] In some embodiments, see Figure 5 , Figure 5 This is an optional flow chart of the method provided in an embodiment of the present invention, which will be described in conjunction with each step.
[0124] S11, receiving a storage request, where the storage request carries at least one picture and at least one metadata information.
[0125] In the disclosed embodiment of the present invention, before receiving an initial search request to search for a target image, the server needs to store the image. The client sends a storage request to the server through a pre-established communication line, and the storage request carries at least one image and at least one metadata information. The storage request may carry the target image and the target metadata information corresponding to the target image.
[0126] In the disclosed embodiment of the present invention, the picture may be a product picture, a landscape picture, a building picture, or a street view picture.
[0127] In the disclosed embodiment of the present invention, Figure 3 , the client sends a storage request including the image data of the target image 1 and the corresponding target metadata information to the server. The target metadata information can be text information compiled manually or text information formed by machine intelligent recognition of the target image 1. The client compresses the target image 1 and the target metadata information into a data packet to form a storage request and sends it to the server.
[0128] S12, inputting at least one metadata information into a Bloom filter for calculation, and determining first target encryption information corresponding to each of the at least one metadata information.
[0129] In the disclosed embodiment of the present invention, after receiving the storage request, the server inputs each metadata information into the Bloom filter, calculates each metadata information using the Bloom filter, and obtains the first target encrypted information corresponding to each metadata information. The server stores the obtained first target encrypted information in the database of the Bloom filter.
[0130] In the disclosed embodiment of the present invention, the first target encrypted information may be an encrypted string. The metadata information may be "smart 5G mobile phone, number 123456". The server inputs the metadata information "smart 5G mobile phone, number 123456" into the Bloom filter. Since in the disclosed embodiment of the present invention, the Bloom filter is a data model constructed based on the Bloom filter, the Bloom filter can calculate the metadata information to obtain the first target encrypted information corresponding to the metadata information, wherein the first target encrypted information may be 010. The server stores the first target encrypted information 010 in a database pre-set by the Bloom filter.
[0131] In the disclosed embodiment of the present invention, assuming that the number of images in a batch is 1 billion, the Bloom filter misjudgment rate constructed by the Bloom filter is no higher than 0.01%. The size m corresponding to the first target encryption information corresponding to the first batch of images can be calculated by formula (1). Formula (1) is:
[0132]
[0133] Where n is the number of images in a batch, p is the false positive rate of the Bloom filter, and m=19.17n is calculated by formula (1), where m is rounded to 20n, i.e., 20 billion bits. After conversion, the space size corresponding to the first target encryption information corresponding to a batch of images is 2.3G. For example, the storage space corresponding to the first target encryption information obtained by processing the same batch of images by the Bloom filter constructed by the hash function is 14G, which is much larger than the storage space 2.3G corresponding to the first target encryption information processed by the Bloom filter constructed by the Bloom filter. It can be seen that the Bloom filter constructed by the Bloom filter calculates and processes the image to obtain the first target encryption information for storage, which can save the storage space of the Bloom filter, that is, save the storage space of the server. Since the first target encryption information is stored in a smaller space, the server can more easily and quickly find the first target encryption information corresponding to the second encryption information of the metadata information to be retrieved when searching for the target image, thereby shortening the search time.
[0134] S13, storing the first target encrypted information in the Bloom filter.
[0135] In the disclosed embodiment of the present invention, after receiving the storage request, the server inputs the metadata information into the Bloom filter, calculates the metadata information using the Bloom filter, and obtains the first target encrypted information corresponding to the metadata information. The server stores the obtained first target encrypted information in the database of the Bloom filter.
[0136] In the disclosed embodiment of the present invention, the server may also store the acquired first target encrypted information in a database corresponding to the server.
[0137] S14, calculating the at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information respectively.
[0138] In the disclosed embodiment of the present invention, the server performs encryption calculation on each piece of metadata information to obtain second target encrypted information corresponding to each piece of metadata information.
[0139] In the disclosed embodiment of the present invention, a Bloom filter may correspond to a plurality of different two-stage data models. When the retrieval database of the server is constructed, a plurality of different categories of two-stage data models may be set according to the categories of metadata information. Exemplarily, the categories of metadata information may be divided into automobiles, clothing, electronic products, and landscapes. The corresponding server may divide the metadata information into four two-stage data models according to the categories of metadata information. Among them, the four two-stage data models may respectively store metadata information corresponding to the four categories of automobiles, clothing, electronic products, and landscapes.
[0140] In the disclosed embodiment of the present invention, the server may perform encryption calculation on each metadata information through a hash function.
[0141] S15, based on at least one metadata information and the second target encryption information, construct a mapping relationship between the encryption information and the metadata information included in the second-stage data model.
[0142] In the disclosed embodiment of the present invention, the server performs encryption calculation on each metadata information to obtain the second target encryption information corresponding to each metadata information. After the server maps each metadata and the second target encryption information, the mapping data of the second target encryption information and each metadata information is obtained. The mapping data of the second target encryption information and each metadata information is stored in the two-stage data model. Thus, a two-stage data model including the mapping relationship between encryption information and metadata information is constructed.
[0143] S16: Based on at least one metadata information, store at least one picture in a target area corresponding to the metadata information of the three-stage data model.
[0144] In the disclosed embodiment of the present invention, the server converts each picture corresponding to the metadata information into a coded string. After mapping a coded string with the second target encryption information corresponding to the metadata information corresponding to the coded string, the server stores the coded string in the target area corresponding to the three-stage data model.
[0145] In the disclosed embodiment of the present invention, the server may map the picture corresponding to each metadata information with the second target encryption information corresponding to the metadata information, and then directly store the picture in the target area corresponding to the three-stage data model.
[0146] In the disclosed embodiment of the present invention, by receiving a storage request, at least one metadata information in the storage request is input into a Bloom filter for calculation, and the first target encryption information corresponding to the at least one metadata information is determined; the first target encryption information is stored in the Bloom filter to form a first-level correspondence during retrieval; at least one metadata information is calculated respectively to determine the second target encryption information corresponding to the at least one metadata information; based on the at least one metadata information and the second target encryption information, a mapping relationship between the encryption information and the metadata information included in the two-stage data model is constructed; based on the at least one metadata information, at least one picture is stored in the target area corresponding to the metadata information in the three-stage data model. When the server retrieves the target picture, a large number of useless retrieval requests can be filtered out through the Bloom filter, and then the target metadata information of the target picture corresponding to the metadata information to be retrieved can be found through the two-stage data model, and then the target picture corresponding to the retrieval request can be quickly retrieved, which improves the efficiency of retrieving a large number of pictures.
[0147] In some embodiments, see Figure 6 , Figure 6 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 5 The step S11 shown may also include S17, which will be described in conjunction with each step.
[0148] S17, based on the field range corresponding to the second target encrypted information, divide the target areas corresponding to different field intervals in the three-stage data model.
[0149] In the disclosed embodiment of the present invention, in order to distinguish pictures, the server can calculate the field range of the second target encrypted information according to the metadata information when forming the three-stage data model, and the server divides the three-stage data model into multiple areas according to the field range of the second target encrypted information. Different target areas correspond to different field intervals of the second encrypted information.
[0150] In the disclosed embodiment of the present invention, the content of each metadata information is different, and the fields of the second target encrypted information generated by the server after calculating the metadata information through the hash function are also different. The fields corresponding to the second target encrypted information are long or short, but the field length of the second target encrypted information formed by the hash function calculating the metadata information will be within a fixed range. The server can divide the three-stage data model into multiple target areas according to the length range of the field corresponding to the second target encrypted information. Each target area stores the picture corresponding to the metadata information of the corresponding field length in this area.
[0151] In some embodiments, see Figure 7 , Figure 7 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 5 The step S18 may also be included before the step S12, and the description will be made in combination with each step.
[0152] S18, detecting whether at least one picture and at least one metadata information match.
[0153] In the disclosed embodiment of the present invention, since the metadata information sent by the client may not correspond to the picture, the server needs to detect whether the metadata information matches the picture after receiving the storage request. After the server detects the picture and the metadata information, the server will obtain a detection result of the picture and the metadata information.
[0154] In the disclosed embodiment of the present invention, after receiving the storage request, the server needs to perform adaptability detection on each image and each metadata information in the storage request. The server can detect the image to detect whether the image is illegal, whether the image contains bad information, and whether the format attributes of the image are correct. The server can also detect the metadata information to detect whether the description of the image by the metadata information is correct and whether the attributes of the metadata information are correct.
[0155] In the disclosed embodiment of the present invention, Figure 3 , server pair Figure 3 The server detects the image 1 in the image and finds that the data of the image 1 is normal. Then the server detects the metadata information "high-end smart white mobile phone" of the image 1. The server finds that the metadata information does not match the image through detection, and the server will form a detection result that the image and metadata information do not match.
[0156] In some embodiments, see Figure 7 , Figure 7 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 5 The illustrated S12 can also be implemented by S19, which will be described in conjunction with each step.
[0157] S19, when at least one picture matches at least one metadata information, input the at least one metadata information into a Bloom filter for calculation, and determine first target encryption information corresponding to the at least one metadata information.
[0158] In the disclosed embodiment of the present invention, the server obtains the detection result of each image and each metadata information by detecting each metadata information and each corresponding image. If the detection of each image and each metadata information indicates that each image and each metadata information match each other, the server will input each metadata information into the Bloom filter for calculation to obtain the first target encryption information corresponding to the metadata information. If the detection result of the image or metadata information is abnormal, the server will not input the metadata information or the metadata information corresponding to the image into the Bloom filter for calculation. At the same time, the server will feed back a detection information to the client, and the client will correct the image or the metadata information after receiving the detection information.
[0159] In the disclosed embodiment of the present invention, Figure 3 , the server detects the metadata information "high-end smart white phone" of picture 1. The server finds through detection that the metadata information does not match the corresponding picture, then the server will form a result that the picture and metadata information do not match. The storage of picture 1 is terminated. The server sends a detection message to the client. The client will correct the metadata information "high-end smart white phone" according to the detection information. After the client corrects the metadata information "high-end smart white phone", the client can send the corrected metadata information and picture 1 to the server again for picture storage.
[0160] In some embodiments, see Figure 8 , Figure 8 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 5 The illustrated S14-S15 can be implemented through S20-S25, which will be described in conjunction with each step.
[0161] S20, performing hash calculations on at least one metadata information respectively to determine second target encryption information corresponding to the at least one metadata information respectively.
[0162] In the disclosed embodiment of the present invention, the server calculates each metadata information through a hash function to obtain the second target encrypted information corresponding to each metadata information. The second target encrypted information can be a string corresponding to the metadata information.
[0163] In the disclosed embodiment of the present invention, the server may also calculate each metadata information by using a cryptographic hash function or an elliptic function, and thereby obtain the second target encrypted information corresponding to each metadata information.
[0164] In the disclosed embodiment of the present invention, the second target encrypted information is different from the first target encrypted information in that the first target encrypted information is obtained by calculating the metadata information through a Bloom filter, and the second target encrypted information is obtained by calculating the metadata information through a hash function.
[0165] S21, after mapping at least one metadata information and the corresponding second target encryption information, obtain mapping data of at least one metadata information and the corresponding second target encryption information.
[0166] In the disclosed embodiment of the present invention, the server maps each metadata information with the corresponding second target encrypted information, that is, forms mapping data of the metadata information and the second target encrypted information. The mapping data of the metadata information and the second target encrypted information includes the metadata information, the second encrypted information corresponding to the metadata information, and the mapping relationship between the metadata information and the second corresponding encrypted information.
[0167] S22, storing the mapping data in the second-stage data model, thereby constructing a mapping relationship between the encryption information and the metadata information included in the second-stage data model.
[0168] In the disclosed embodiment of the present invention, the server stores mapping data of each metadata information and the corresponding second target encryption information in a two-stage data model, forming a two-stage data model including the metadata information, the second encryption information corresponding to the metadata information, and the mapping relationship between the metadata information and the second corresponding encryption information.
[0169] S23, converting at least one picture into a coded string.
[0170] In the disclosed embodiment of the present invention, the server converts each image in the storage request into a coded string through a preset program.
[0171] In the disclosed embodiment of the present invention, the encoding string may consist of numbers and letters, or the encoding string may consist entirely of letters.
[0172] In the disclosed embodiment of the present invention, the server may convert the image into a coded string 1110xxxx 10xxxxxx 10xxxxxx using a preset program.
[0173] S24, after mapping the coded string with the second target encrypted information, a mapping relationship between the coded string and the second target encrypted information is obtained.
[0174] In the disclosed embodiment of the present invention, the server maps the encoding string formed by image conversion with the second target encryption information corresponding to the image, that is, forms a mapping relationship between the encoding string of the image and the corresponding second target encryption information.
[0175] In the disclosed embodiment of the present invention, the server may also form a table based on the encoded character string formed by image conversion and the second target encryption information corresponding to the image.
[0176] S25, storing the encoded character string in the target area of the three-stage data model according to the mapping relationship.
[0177] In the disclosed embodiment of the present invention, the server stores the encoded string of the picture in the corresponding target area in the three-stage data model according to the mapping relationship between the encoded string and the second target encryption information corresponding to the picture.
[0178] In the disclosed embodiment of the present invention, when establishing the three-stage data model, the server partitions the three-stage data model. The content of each metadata information is different, and the fields of the second target encrypted information generated by the server after calculating the metadata information through a hash function are also different. The fields corresponding to the second target encrypted information are long and short, but the field length of the second target encrypted information formed by the hash function calculating the metadata information will be within a fixed range. The server can divide the three-stage data model into multiple target areas according to the length range of the field corresponding to the second target encrypted information. Each target area stores the picture corresponding to the metadata information of the corresponding field length in this area.
[0179] In the disclosed embodiment of the present invention, the server stores the encoded string of the picture in the corresponding area within the three-stage data model. Among them, the three-stage data model is pre-divided into multiple different target areas according to the length range of the string of the second target encryption information. Exemplarily, the server divides the three-stage data model into three target areas, including a first target area, a second target area, and a third target area. Among them, the first target area is used to store pictures whose corresponding second target encryption information is within three characters, the second target area is used to store pictures whose corresponding second target encryption information is within three to five characters, and the third target area is used to store pictures whose corresponding second target encryption information is within five to seven characters. For example, in the disclosed embodiment of the present invention, if the second target encryption information 10001 corresponding to a picture is five characters, then the picture corresponding to the second target encryption information 10001 should be stored in the second target area.
[0180] In some embodiments, see Fig. 9 , Fig. 9 is an optional flow chart of the method provided in the embodiment of the present invention, Figure 8S20 shown in the figure further includes S26 , which will be described in conjunction with each step.
[0181] S26, if the second target encryption information is the same as the third target encryption information, the encoding string corresponding to the picture corresponding to the second target encryption information is used to replace the encoding string corresponding to the reserved picture corresponding to the third target encryption information.
[0182] In the disclosed embodiment of the present invention, after the server obtains the second target encryption information, the server searches the two-stage data model for whether there is third encryption information identical to the second target encryption information. If the server retrieves the third encryption information identical to the second target encryption information in the two-stage data model, the server replaces the encoding string of the reserved picture corresponding to the third encryption information with the encoding string of the picture corresponding to the second target encryption information.
[0183] In the disclosed embodiment of the present invention, the third encrypted information is the reserved metadata information corresponding to the reserved picture pre-stored in the server, which is calculated by a hash function. The reserved picture is a picture that has been stored in the three-stage data model before the server receives the storage request.
[0184] In the disclosed embodiment of the present invention, the picture corresponding to the second target encryption information can be the same picture as the retained picture. The picture corresponding to the second target encryption information can also be a supplementary picture or a corrected picture of the retained picture. For example, the retained picture is a top view of a mobile phone, and the picture corresponding to the second target encryption information is a front view of a mobile phone. The metadata information to be retrieved corresponding to the picture corresponding to the second target encryption information and the retained metadata information to be retrieved corresponding to the retained picture are the same, so the third encryption information corresponding to the retained picture is the same as the second target encryption information. After the server retrieves that the second target encryption information and the third encryption information are the same, the server stores the encoding string of the picture corresponding to the second target encryption information in the position corresponding to the encoding string of the retained picture, and deletes the encoding string of the retained picture. At the same time, the third target encryption information is replaced with the second target encryption information.
[0185] In the disclosed embodiment of the present invention, by receiving a storage request, at least one metadata information in the storage request is input into a Bloom filter for calculation, and the first target encryption information corresponding to the at least one metadata information is determined; the first target encryption information is stored in the Bloom filter to form a first-level correspondence during retrieval; at least one metadata information is calculated respectively to determine the second target encryption information corresponding to the at least one metadata information; based on the at least one metadata information and the second target encryption information, a mapping relationship between the encryption information and the metadata information included in the two-stage data model is constructed; based on the at least one metadata information, the encoded string of at least one picture is stored in the target area corresponding to the metadata information in the three-stage data model. When the server retrieves the target picture, a large number of useless retrieval requests can be filtered out through the Bloom filter, and then the target metadata information of the target picture corresponding to the metadata information to be retrieved can be found through the two-stage data model, and then the target picture corresponding to the retrieval request can be quickly retrieved, which improves the efficiency of retrieving a large number of pictures.
[0186] See also Fig.10 , is a structural diagram of an image processing device provided by an embodiment of the present invention.
[0187] The disclosed embodiment of the present invention further provides a picture processing device 800 , including: a first information acquisition unit 804 , a first data processing unit 805 and a retrieval unit 806 .
[0188] The first information collection unit 804 is used to receive an initial search request, where the initial search request carries metadata information to be searched;
[0189] The first data processing unit 805 is used to respond to the initial search request, filter the metadata information to be searched based on the Bloom filter, and obtain a filtering result; if the filtering result indicates that the metadata information to be searched exists in the Bloom filter, determine the first encryption information according to the metadata information to be searched;
[0190] The retrieval unit 806 is used to search the target metadata information corresponding to the metadata information to be retrieved from the two-stage data model based on the first encryption information; retrieve the target image from the three-stage data model based on the target metadata information, and feed the target image back to the client; the two-stage data model represents the mapping relationship between the encryption information and the metadata information; the three-stage data model is used to store the image corresponding to the metadata information.
[0191] In the disclosed embodiment of the present invention, when the image processing device 800 receives an initial search request, the first data processing unit 805 inputs the metadata information to be searched carried by the initial search request into the Bloom filter, performs Bloom calculation on the metadata information to be searched through the Bloom filter, and determines the second encryption information corresponding to the metadata information to be searched; if the second encryption information is the same as any one of the first target encryption information stored in the Bloom filter, the obtained filtering result indicates that the metadata information to be searched exists in the Bloom filter. If the second encryption information is different from any one of the first target encryption information stored in the Bloom filter, the obtained filtering result indicates that the metadata information to be searched does not exist in the Bloom filter, and the initial search request is rejected to the client.
[0192] In the disclosed embodiment of the present invention, the retrieval unit 806 of the image processing device 800 searches out the second target encryption information corresponding to the first encryption information from the two-stage data model based on the first encryption information, and searches out the target metadata information corresponding to the metadata information to be retrieved from the two-stage data model based on the mapping data between the second target encryption information and at least one metadata information. Based on the mapping relationship between the second target encryption information corresponding to the target metadata information and the encoding string, the encoding string is retrieved from the three-stage data model; the encoding string is converted into a target image, and the target image is fed back to the client.
[0193] In the disclosed embodiment of the present invention, the metadata information to be retrieved in the initial search request is received by the first information collection unit; the metadata information to be retrieved is filtered based on the Bloom filter to obtain the filtering result by the first data processing unit in response to the initial search request; if the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter, the first encryption information is determined according to the metadata information to be retrieved; the target metadata information corresponding to the metadata information to be retrieved is searched from the two-stage data model by the retrieval unit based on the first encryption information; the target image is retrieved from the three-stage data model based on the target metadata information, and the target image is fed back to the client. First, the metadata information to be retrieved is input into the Bloom filter by the data processing unit to filter out a large number of useless initial search requests, and then the target metadata information of the target image corresponding to the metadata information to be retrieved is found by the two-stage data model, so that the target image corresponding to the search request can be quickly retrieved, thereby improving the search efficiency when retrieving a large amount of image data.
[0194] See also Fig.11 , is a structural diagram of an image processing device provided by an embodiment of the present invention.
[0195] The disclosed embodiment of the present invention further provides a picture processing device 800 , including: a second information acquisition unit 807 , a second data processing unit 808 , and a first storage unit 809 , a third data processing unit 900 , a fourth data processing unit 901 and a second storage unit 902 .
[0196] The second information collection unit 807 is used to receive a storage request, where the storage request carries at least one picture and at least one metadata information;
[0197] The second data processing unit 808 is used to input the at least one metadata information into the Bloom filter for calculation, and determine the first target encryption information corresponding to the at least one metadata information;
[0198] A first storage unit 809, configured to store the first target encryption information in a Bloom filter;
[0199] The third data processing unit 900 is used to calculate the at least one metadata information respectively, and determine the second target encryption information corresponding to the at least one metadata information respectively;
[0200] The fourth data processing unit 901 is used to construct a mapping relationship between the encryption information and the metadata information included in the second-stage data model based on at least one metadata information and the second target encryption information;
[0201] The second storage unit 902 is used to store at least one picture in a target area corresponding to the metadata information of the three-stage data model based on at least one metadata information.
[0202] In the disclosed embodiment of the present invention, before obtaining a storage request, the image processing device 800 divides corresponding areas corresponding to different field intervals in the three-stage data model based on the field range corresponding to the second target encryption information.
[0203] In the disclosed embodiment of the present invention, the second data processing unit 808 of the image processing device 800 detects whether at least one image and at least one metadata information match, and obtains a detection result; when the detection result indicates that at least one image and at least one metadata information match, the at least one metadata information is input into the Bloom filter for calculation to determine the first target encryption information corresponding to the at least one metadata information.
[0204] In the disclosed embodiment of the present invention, the third data processing unit 900 of the image processing device 800 performs hash calculation on at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information; at the same time, the image processing device 800 will retrieve whether the second target encryption information is the same as the third target encryption information. If they are the same, the image corresponding to the second target encryption information replaces the reserved image corresponding to the third target encryption information; the reserved image is the image pre-existing in the three-stage data model, and the third target encryption information is the encryption information obtained by performing hash calculation on the reserved metadata information corresponding to the reserved image. If they are not the same, the image processing device 800 maps the at least one metadata information and the corresponding second target encryption information to obtain mapping data of the at least one metadata information and the corresponding second target encryption information; the mapping data is stored in the two-stage data model, and a mapping relationship between the encryption information and the metadata information contained in the two-stage data model is constructed.
[0205] In the disclosed embodiment of the present invention, the second storage unit 902 of the image processing device 800 converts at least one image into a coded string when storing the image; after mapping the coded string with the second target encryption information, a mapping relationship between the coded string and the second target encryption information is obtained; according to the mapping relationship, the coded string is stored in a corresponding area of the three-stage data model; the corresponding area is an area of the field interval corresponding to the second target encryption information divided in the three-stage data model.
[0206] In the disclosed embodiment of the present invention, the image processing device receives a storage request through a second information collection unit, and then inputs at least one metadata information in the storage request into a bloom filter for calculation through a second data processing unit to determine the first target encryption information corresponding to the at least one metadata information; the first storage unit of the image processing device stores the first target encryption information in the bloom filter to form a first-level correspondence during retrieval; the third data processing unit calculates the at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information; the fourth data processing unit constructs a mapping relationship between the encryption information and the metadata information included in the two-stage data model based on the at least one metadata information and the second target encryption information; the second storage unit of the image processing device stores at least one image in the target area corresponding to the metadata information in the three-stage data model based on the at least one metadata information. When the server retrieves the target image, a large number of useless retrieval requests can be filtered out through the bloom filter, and then the target metadata information of the target image corresponding to the metadata information to be retrieved can be found through the two-stage data model, and then the target image corresponding to the retrieval request can be quickly retrieved, thereby improving the efficiency of retrieving a large number of images.
[0207] It should be noted that, in the embodiment of the present invention, if the above-mentioned image processing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable the image processing device 800 (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present invention is not limited to any specific combination of hardware and software.
[0208] Correspondingly, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method are implemented.
[0209] Correspondingly, an embodiment of the present invention provides an image processing device 800, including a memory 803 and a processor 801, wherein the memory 803 stores a computer program that can be executed on the processor 801, and the processor 801 implements the steps in the above method when executing the program.
[0210] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of the present invention, please refer to the description of the method embodiments of the present invention for understanding.
[0211] It should be noted that Fig.12 A schematic diagram of a hardware entity of a picture processing device provided by an embodiment of the present invention, such as Fig.12 As shown, the hardware entity of the image processing device 800 includes: a processor 801, a communication interface 802 and a memory 803, wherein:
[0212] The processor 801 generally controls the overall operation of the image processing apparatus 800 .
[0213] The communication interface 802 enables the image processing device 800 to communicate with other clients through a network.
[0214] The memory 803 is configured to store instructions and applications executable by the processor 801, and can also cache data to be processed or processed by the processor 801 and each module in the image processing device 800 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0215] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present invention, the size of the serial number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. The serial numbers of the above-mentioned embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
[0216] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0217] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0218] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0219] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0220] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0221] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0222] The above is only an 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 processing an image, applied to a server, characterized in that: include: receiving an initial search request, wherein the initial search request carries metadata information to be searched; In response to the initial search request, the metadata information to be searched is filtered based on a Bloom filter to obtain a filtering result; If the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter, determining first encryption information according to the metadata information to be retrieved; Based on the first encrypted information, searching for target metadata information corresponding to the metadata information to be retrieved from the second-stage data model; The two-stage data model represents the mapping relationship between encryption information and metadata information; Based on the target metadata information, a target image is retrieved from the three-stage data model, and the target image is fed back to the client; The three-stage data model is used to store pictures corresponding to the metadata information.
2. The image processing method according to claim 1, characterized in that: The responding to the initial search request, filtering the metadata information to be searched based on the Bloom filter to obtain a filtering result, includes: In response to the initial search request, the metadata information to be searched carried by the initial search request is input into the Bloom filter, a Bloom calculation is performed on the metadata information to be searched, and second encrypted information corresponding to the metadata information to be searched is determined; If the encrypted information identical to the second encrypted information exists in the Bloom filter, then determining the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter.
3. The image processing method according to claim 2, characterized in that: The step of searching, based on the first encrypted information, target metadata information corresponding to the metadata information to be retrieved from the two-stage data model includes: Based on the first encrypted information, searching for second target encrypted information corresponding to the first encrypted information from the second-stage data model; Based on mapping data of at least one metadata information and the corresponding second target encrypted information, the target metadata information corresponding to the metadata information to be retrieved is found from the two-stage data model.
4. The image processing method according to claim 3, characterized in that: The step of retrieving a target image from the three-stage data model based on the target metadata information and feeding the target image back to the client includes: Retrieving the encoded string from the three-stage data model based on a mapping relationship between the second target encryption information corresponding to the target metadata information and the encoded string; The encoded string is converted into the target image, and the target image is fed back to the client.
5. The image processing method according to claim 2, characterized in that: In responding to the initial search request, inputting the metadata information to be searched carried by the initial search request into the Bloom filter, performing Bloom calculation on the metadata information to be searched, and determining the second encryption information corresponding to the metadata information to be searched, the method further includes: If the encryption information identical to the second encryption information does not exist in the Bloom filter, it is determined that the filtering result indicates that the metadata information to be retrieved does not exist in the Bloom filter, and the initial search request is rejected to the client.
6. A method for processing an image, characterized in that: include: Receiving a storage request, wherein the storage request carries at least one image and at least one metadata information; Inputting the at least one metadata information into a Bloom filter for calculation, and determining first target encryption information corresponding to the at least one metadata information; storing the first target encrypted information in the Bloom filter; Calculating the at least one metadata information respectively to determine the second target encryption information respectively corresponding to the at least one metadata information; Based on the at least one metadata information and the second target encryption information, construct a mapping relationship between the encryption information and the metadata information included in the second-stage data model; Based on the at least one metadata information, the at least one picture is stored in a target area of the three-stage data model corresponding to the metadata information.
7. The image processing method according to claim 6, characterized in that: Before receiving the storage request, the method further includes: Based on the field range corresponding to the second target encrypted information, the target area corresponding to different field intervals is divided in the three-stage data model.
8. The image processing method according to claim 6, characterized in that: After receiving the storage request, before inputting the at least one metadata information into the Bloom filter for calculation and determining the first target encryption information respectively corresponding to the at least one metadata information, the method further includes: Detect whether the at least one picture and the at least one metadata information match.
9. The image processing method according to claim 8, characterized in that: The step of inputting the at least one metadata information into the Bloom filter for calculation to determine the first target encryption information corresponding to the at least one metadata information includes: When the at least one picture matches the at least one metadata information, the at least one metadata information is input into the Bloom filter for calculation to determine the first target encryption information corresponding to the at least one metadata information.
10. The image processing method according to claim 7, characterized in that: The calculating the at least one metadata information respectively to determine the second target encryption information respectively corresponding to the at least one metadata information includes: Hash calculations are performed on the at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information respectively.
11. The image processing method according to claim 10, characterized in that: The constructing a mapping relationship between the encryption information and the metadata information contained in the two-stage data model based on the at least one metadata information and the second target encryption information includes: After mapping the at least one metadata information and the corresponding second target encrypted information, mapping data between the at least one metadata information and the corresponding second target encrypted information is obtained; The mapping data is stored in the two-stage data model, thereby constructing a mapping relationship between the encryption information and the metadata information included in the two-stage data model.
12. The image processing method according to claim 11, characterized in that: Based on the at least one metadata information, storing the at least one picture in a target area of the three-stage data model corresponding to the metadata information includes: converting the at least one image into an encoded string; After mapping the encoded string with the second target encrypted information, a mapping relationship between the encoded string and the second target encrypted information is obtained; The encoded character string is stored in the target area of the three-stage data model according to the mapping relationship; the target area is an area divided in the three-stage data model corresponding to the field interval of the second target encrypted information.
13. The image processing method according to claim 11, characterized in that: After performing hash calculations on the at least one metadata information respectively to determine the second target encryption information respectively corresponding to the at least one metadata information, the method further includes: If the second target encryption information is the same as the third target encryption information, the encoding string corresponding to the retained picture corresponding to the third target encryption information is replaced by the encoding string corresponding to the picture corresponding to the second target encryption information; the retained picture is a picture pre-existing in the three-stage data model, and the third target encryption information is the encryption information obtained by hashing the retained metadata information corresponding to the retained picture.
14. A picture processing device, characterized in that: include: A first information collection unit, configured to receive an initial search request, wherein the initial search request carries metadata information to be searched; A first data processing unit, in response to the initial search request, filters the metadata information to be searched based on a Bloom filter to obtain a filtering result; If the filtering result indicates that the metadata information to be retrieved exists in the Bloom filter, determining first encryption information according to the metadata information to be retrieved; A retrieval unit, configured to search the target metadata information corresponding to the metadata information to be retrieved from the two-stage data model based on the first encrypted information; Based on the target metadata information, a target image is retrieved from the three-stage data model, and the target image is fed back to the client; The two-stage data model represents the mapping relationship between encryption information and metadata information; the three-stage data model is used to store pictures corresponding to the metadata information.
15. A picture processing device, characterized in that: include: A second information collection unit, configured to receive a storage request, wherein the storage request carries at least one image and at least one metadata information; A second data processing unit is used to input the at least one metadata information into a Bloom filter for calculation, and determine the first target encryption information corresponding to the at least one metadata information; a first storage unit, configured to store the first target encrypted information in the Bloom filter; A third data processing unit is used to calculate the at least one metadata information respectively to determine the second target encryption information corresponding to the at least one metadata information respectively; a fourth data processing unit, configured to construct a mapping relationship between the encryption information and the metadata information included in the second-stage data model based on the at least one metadata information and the second target encryption information; The second storage unit is used to store the at least one image in a target area corresponding to the metadata information in the three-stage data model based on the at least one metadata information.
16. A picture processing device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the method according to any one of claims 1 to 5 or 6 to 13 are implemented.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 or 6 to 13 are implemented.
Citation Information
Patent Citations
Metadata distributed system
CN108829787A
Metadata Index Search in a File System
US20160063021A1