CN109829073B - Image searching method and device - Google Patents

Image searching method and device Download PDF

Info

Publication number
CN109829073B
CN109829073B CN201811640366.XA CN201811640366A CN109829073B CN 109829073 B CN109829073 B CN 109829073B CN 201811640366 A CN201811640366 A CN 201811640366A CN 109829073 B CN109829073 B CN 109829073B
Authority
CN
China
Prior art keywords
identifier
image
preset model
data
structured data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811640366.XA
Other languages
Chinese (zh)
Other versions
CN109829073A (en
Inventor
刘国伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Intellifusion Technologies Co Ltd
Original Assignee
Shenzhen Intellifusion Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Intellifusion Technologies Co Ltd filed Critical Shenzhen Intellifusion Technologies Co Ltd
Priority to CN201811640366.XA priority Critical patent/CN109829073B/en
Publication of CN109829073A publication Critical patent/CN109829073A/en
Priority to PCT/CN2019/121607 priority patent/WO2020134839A1/en
Application granted granted Critical
Publication of CN109829073B publication Critical patent/CN109829073B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an image searching method and device. The method comprises the following steps: receiving a query request of a user, wherein the query request comprises a target image and a screening condition; acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; determining a second identifier corresponding to the first identifier; inputting the second identification into a target server to obtain first structured data; screening the first structured data according to the screening condition to obtain second structured data; and obtaining a result image according to the third identifier and the preset model, and returning the result image to the user. By the technical scheme provided by the invention, the query efficiency is improved, and meanwhile, the storage space can be saved.

Description

Image searching method and device
Technical Field
The invention relates to the field of internet, in particular to a method and a device for searching images.
Background
With the development of scientific technology, human information has been increased explosively, and many search engine manufacturers have to add a large number of servers for data storage.
Correspondingly, as the data volume is larger and larger, the time for the user to hit the target file is longer and longer when the user searches, and the query efficiency is low.
Disclosure of Invention
The embodiment of the invention provides an image searching method and device, structured data and unstructured data of an image are separately stored by using the method provided by the invention, when image searching is carried out, a result image can be rapidly determined by similarity calculation of the unstructured data and screening of the structured data, and the storage space is saved while the query efficiency is improved.
The invention discloses a method for searching images in a first aspect, which comprises the following steps:
receiving a query request of a user, wherein the query request comprises a target image and a screening condition;
acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer;
determining a second identifier corresponding to the first identifier;
inputting the second identification into a target server to obtain first structured data;
screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
and obtaining a result image according to the third identification and the preset model, and returning the result image to the user.
Optionally, the obtaining a result image according to the third identifier and the preset model includes:
determining a fourth identifier corresponding to the third identifier, wherein the fourth identifier is part or all of the first identifier;
and inputting the fourth identification into the preset model to obtain a result image.
Optionally, before receiving the query request of the user, the method further includes:
when a request for increasing the images in batches is received, acquiring structured data and unstructured data of the images in batches;
storing the structured data of the batch of images in the target server; and
and storing the unstructured data of the batch of images into the preset model.
Optionally, the storing the unstructured data of the batch of image data into the preset model includes:
generating a target file according to the unstructured data of the batch of images;
and loading the target file by using the preset model.
Optionally, the determining a second identifier corresponding to the first identifier includes:
matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
The second aspect of the present invention discloses an apparatus for image search, the apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an inquiry request of a user, and the inquiry request comprises a target image and a screening condition;
an acquisition unit configured to acquire a feature value of the target image;
the input unit is used for inputting the characteristic value of the target image into a preset model to acquire a first identifier of data N before the similarity ranking; wherein N is a positive integer;
a determining unit, configured to determine a second identifier corresponding to the first identifier;
the input unit is used for inputting the second identification into a target server to acquire first structured data;
the screening unit is used for screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
the obtaining unit is used for obtaining a result image according to the third identifier and the preset model;
a returning unit for returning the result image to the user.
Optionally, the obtaining unit is specifically configured to determine a fourth identifier corresponding to the third identifier, where the fourth identifier is a part or all of the first identifier; and inputting the fourth identification into the preset model to obtain a result image.
Optionally, the apparatus further comprises a first storage unit and a second storage unit;
the acquisition unit is further used for acquiring structured data and unstructured data of the batch of images when a request for increasing the batch of images is received;
the first storage unit is used for storing the structured data of the batch of images into the target server;
the second storage unit is used for storing the unstructured data of the batch of images into the preset model.
Optionally, the second storage unit is configured to generate a target file according to the unstructured data of the batch of images; and loading the target file by using the preset model.
Optionally, the determining unit is specifically configured to match the first identifier with a pre-stored mapping table to obtain the second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
It can be seen that, in the solution of the embodiment of the present invention, an inquiry request of a user is received, where the inquiry request includes a target image and a screening condition; acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer; determining a second identifier corresponding to the first identifier; inputting the second identification into a target server to obtain first structured data; screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier; and obtaining a result image according to the third identification and the preset model, and returning the result image to the user. According to the technical scheme provided by the invention, the structured data and the unstructured data of the image are separately stored by using the method provided by the invention, and when image searching is carried out, the result image can be quickly determined by similarity calculation of the unstructured data and screening of the structured data, so that the query efficiency is improved, and meanwhile, the storage space is saved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of an image searching method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating another method for image searching according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating another image searching method according to an embodiment of the present invention;
FIG. 4 is a block diagram of an embodiment of an image search apparatus;
FIG. 5 is a block diagram of another embodiment of an image search apparatus;
FIG. 6 is a block diagram of another embodiment of an image search apparatus;
fig. 7 is a schematic physical structure diagram of an image searching apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood by those skilled in the art, the technical solutions in the embodiments of the present invention will be clearly described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The appearances of the phrases "first," "second," and "third," or the like, in the specification, claims, and figures are not necessarily all referring to the particular order in which they are presented. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Referring to fig. 1, fig. 1 is a flowchart illustrating an image searching method according to an embodiment of the present invention. As shown in fig. 1, an embodiment of the present invention provides an image searching method, where the method includes:
101. receiving a query request of a user, wherein the query request comprises a target image and a screening condition;
the execution subject of the invention can be a server, and the server has the function of a search engine. Specifically, the search engine system may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices with search engine functions, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and the like. The operating system related to the embodiment of the application is a software system which performs unified management on hardware resources and provides a service interface for a user.
It can be understood that the query request of the user may be a picture query request, or a text or voice query request.
For example, the target image is a face image, and the screening condition may be parameters such as age, gender, whether eyes are included, and time for storing the image.
In addition, it should be noted that before receiving the query request of the user, some data may be added in batches, and specifically, the method includes:
when a request for increasing images in batches is received, acquiring structured data and unstructured data of the images in the batches; storing the structured data of the batch of images in the target server; and storing unstructured data of the batch of images into the preset model. Wherein the storing the unstructured data of the batch of image data into the preset model comprises: generating a target file according to the unstructured data of the batch of images; and loading the target file by using the preset model. It can be understood that the target file is generated by the unstructured data of the batch of images, so that the unstructured data are not loaded one by one, and the processing efficiency is improved.
For example, the target server may be a solr server (a solr server), and the preset model may be a faiss model (a faiss model). The solr is an independent search application server, and a user can submit an XML (extensible markup language) file with a certain format to the search application server through an http request to generate an index; the search request can also be provided through Http Get (hypertext transfer protocol Get) operation, and the return result in XML format is obtained. The Faiss model is a framework that provides efficient similarity search and clustering for dense vectors. The Faiss model can provide a variety of searches and is fast.
Specifically, when adding images in batches, structured data and unstructured data of the images are added to different lists, wherein a first list stores the structured data and a second list stores the unstructured data. The structured data includes parameters such as the gender, age, and time of storage of the image of the person in the image. The unstructured data are characteristic value data of the face image. Adding the data in the first list to the solr in batches; the unstructured data in the second list and the identity of the image are added to hdf5(hdf5 is a file that can handle more objects, store larger files, support parallel I/O (input/output), thread, and other features required by modern operating systems and applications, and make the data model simpler and more generalized) files. hdf5 has only two basic structures, group (group) and dataset (dataset). A group contains 0 or more dataset files. When the hdf5 file is generated, in order to reduce the number of generated files and improve loading efficiency, a file is generated for data storage in an amount of 100 ten thousand notes. In addition, the generated hdf5 file is loaded by using a faiss model, and a pq code is generated for each record according to the process of generating a central point by two times of K-means (clustering algorithm) clustering analysis and is sorted based on the central point. For example, the first k-means is the center point of 1024 cluster calculations for the data, relative to the 1024 divisions of the data. The second K-means is to perform clustering operation again on 1024 data. It is understood that the second K-means divides each image feature value data into 4 segments, and generates 4 clustering points after K-means is performed, and each image feature value generates 4 character strings to form a pg code (i.e. a four-dimensional vector).
It will be appreciated that the storage of the identification of the image to hdf5 is for use in the lookup. The identity of the image is marked as a first identity. In addition, it should be noted that the solr adds a document id (file identifier) to each record, and the document id is marked as the second identifier. It is understood that the document id may be a sequence number.
102. Acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer;
it can be understood that, when data is searched, the central point is also quickly searched according to two times of K-means (the two searches are performed according to the sequence, that is, clustering is performed on the result of the first clustering, and then quick searching is performed according to the result of the second clustering) to obtain the first N data with the highest similarity, so that the query efficiency can be improved.
103. Determining a second identifier corresponding to the first identifier;
it should be noted that the determining the second identifier corresponding to the first identifier includes: matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relation between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
104. Inputting the second identification into a target server to obtain first structured data;
it is understood that the second identifier is input into the solr for obtaining the structured data corresponding to the second identifier, i.e. the first structured data.
105. Screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
for example, the first structured data is 100 pieces, the screening condition is male, and after the screening, the structured data (i.e., the second structured data) satisfying the condition is 50 pieces. Then the identifiers of the 50 pieces of structured data are the third identifiers (it is understood that the third identifiers are a set of identifiers, and the 50 pieces of identifiers are included therein).
106. And obtaining a result image according to the third identification and the preset model, and returning the result image to the user.
It is understood that the third identifier is an identifier recorded in the solr server (a serial number edited by the solr server for each piece of data), and needs to be converted into an image identifier so as to obtain an image corresponding to the image identifier from the faiss model (the serial number corresponding to each image is stored in the gossis model).
Specifically, the obtaining a result image according to the third identifier and the preset model includes:
determining a fourth identifier corresponding to the third identifier, wherein the fourth identifier is part or all of the first identifier; and inputting the fourth identification into the preset model to obtain a result image.
For example, since the images have their own identifiers (serial numbers), that is, each image in the model has its own serial number, when the data is stored in the solr server, an identifier (serial number) is set for each data. Specifically, assume that the first identifier (i.e., the serial number of the image in the model) is 1, 2, 3, and 4. According to the mapping relationship between the first identifier and the second identifier, for example, X is 10 × Y, Y is the first identifier, and X is the second identifier, then corresponding X is 10,20,30, and 40. If only two pieces of marked data meet the requirement after being screened according to the screening condition in the solr server, for example, the data numbered 10 and 20 meet the screening condition (i.e. 10 and 20 are the third marks), because 10 and 20 are the marks of the structured data in the solr server, the marks of the images in the model need to be obtained, and according to the mapping relationship, the marks of the images in the model are 1 and 2 (i.e. the fourth marks), then the hard images of the pairs of marks 1 and 2 in the model are obtained, and OK is obtained.
It can be seen that, in the solution of the embodiment of the present invention, an inquiry request of a user is received, where the inquiry request includes a target image and a screening condition; acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; determining a second identifier corresponding to the first identifier; inputting the second identification into a target server to obtain first structured data; screening the first structured data according to the screening condition to obtain second structured data; and obtaining a result image according to the third identifier and the preset model, and returning the result image to the user. According to the technical scheme provided by the invention, the structured data and the unstructured data of the image are separately stored, and when the image is searched, the result image can be quickly determined through similarity calculation of the unstructured data and screening of the structured data, so that the query efficiency is improved, and meanwhile, the storage space is saved.
Referring to fig. 2, fig. 2 is a flowchart illustrating another image searching method according to another embodiment of the present invention. Wherein, as shown in fig. 2, the method comprises:
201. when a request for increasing the images in batches is received, acquiring structured data and unstructured data of the images in batches;
202. storing the structured data of the batch of images in the target server; and storing unstructured data of the batch of images into the preset model.
Wherein the storing the unstructured data of the batch of image data into the preset model comprises: generating a target file according to the unstructured data of the batch of images; and loading the target file by using the preset model.
203. Receiving a query request of a user, wherein the query request comprises a target image and a screening condition;
204. acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer;
205. determining a second identifier corresponding to the first identifier;
wherein the determining a second identifier corresponding to the first identifier comprises: matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
206. Inputting the second identification into a target server to obtain first structured data;
207. screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
208. and obtaining a result image according to the third identification and the preset model, and returning the result image to the user.
Wherein, the obtaining a result image according to the third identifier and the preset model comprises:
determining a fourth identifier corresponding to the third identifier, wherein the fourth identifier is part or all of the first identifier; and inputting the fourth identification into the preset model to obtain a result image.
It should be noted that, the specific content of the embodiment described in fig. 2 can be explained with reference to the embodiment corresponding to fig. 1.
It can be seen that, in the scheme of this embodiment, structured data (solr storage) and unstructured data (faiss model storage) of images added in batches are stored respectively, and the faiss model is used to store the unstructured data, so that matching data of image feature data can be improved, and the solr storage of the structured data can improve the screening speed and save the storage space. By using the technical scheme provided by the embodiment of the invention, the query efficiency of the user is further ensured to be improved.
As shown in fig. 3, another embodiment of the present invention provides a flowchart of a method for searching an image. Wherein, as shown in fig. 3, the method comprises:
301. when a request for increasing images in batches is received, acquiring structured data and unstructured data of the images in the batches;
302. storing the structured data of the batch of images into the target server, and acquiring a first identifier of the structured data edited by the target service;
303. generating a target file according to the unstructured data of the batch of images; loading the target file by using the preset model, and acquiring a second identifier of the image;
304. and establishing a mapping relation between the first identifier and the second identifier.
305. Receiving a query request of a user, wherein the query request comprises a target image and a screening condition;
306. acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer;
307. determining a second identifier corresponding to the first identifier, and inputting the second identifier into a target server to obtain first structured data;
wherein the determining a second identifier corresponding to the first identifier comprises: matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
308. Screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
309. and obtaining a result image according to the third identification and the preset model, and returning the result image to the user.
Wherein, the obtaining a result image according to the third identifier and the preset model comprises:
determining a fourth identifier corresponding to the third identifier, wherein the fourth identifier is part or all of the first identifier; and inputting the fourth identification into the preset model to obtain a result image.
It should be noted that, the specific content of the embodiment described in fig. 3 can be explained with reference to the embodiment corresponding to fig. 1 or 2.
It can be seen that, in the scheme of this embodiment, when structured data and unstructured data of an image are stored respectively, a mapping relationship of identifiers of two storage systems is established, so that, during query, a matching degree of feature data values of the image and an association relationship of structured data screening can be established. By using the technical scheme provided by the embodiment of the invention, the query efficiency of the user is further ensured to be improved.
As shown in fig. 4, an embodiment of the present invention provides a data processing apparatus 400, where the apparatus 400 includes the following units:
a receiving unit 401, configured to receive an inquiry request of a user, where the inquiry request includes a target image and a screening condition;
an obtaining unit 402, configured to obtain a feature value of the target image;
an input unit 403, configured to input the feature value of the target image into a preset model to obtain a first identifier of data of N top of the similarity rank; wherein N is a positive integer;
a determining unit 404, configured to determine a second identifier corresponding to the first identifier;
an input unit 403, configured to input the second identifier into a target server to obtain first structured data;
a screening unit 405, configured to screen the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
an obtaining unit 406, configured to obtain a result image according to the third identifier and the preset model;
a returning unit 407, configured to return the result image to the user.
Optionally, the obtaining unit 406 is specifically configured to determine a fourth identifier corresponding to the third identifier, where the fourth identifier is a part or all of the first identifier; and inputting the fourth identification into the preset model to obtain a result image.
Optionally, the apparatus 400 further comprises a first storage unit 408 and a second storage unit 409;
an obtaining unit 406, configured to obtain structured data and unstructured data of the batch of images when a request for increasing the batch of images is received;
a first storage unit 408 for storing the structured data of the batch of images into the target server;
a second storage unit 409, configured to store the unstructured data of the batch of images into the preset model.
The second storage unit 409 is used for generating a target file according to the unstructured data of the batch of images; and loading the target file by using the preset model.
Optionally, the determining unit 404 is specifically configured to match the first identifier with a pre-stored mapping table to obtain the second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
The above-mentioned unit 401-409 can be used for executing the method described in step 101-106 in embodiment 1, and the detailed description is given in the description of the method in embodiment 1, and is not repeated herein.
As shown in fig. 5, an embodiment of the present invention provides a data processing apparatus 500, where the apparatus 500 includes the following units:
an obtaining unit 501, configured to obtain structured data and unstructured data of a batch of images when a request for increasing the batch of images is received;
a storage unit 502, configured to store the structured data of the batch of images into the target server; and storing unstructured data of the batch of images into the preset model.
Wherein the storing the unstructured data of the batch of image data into the preset model comprises: generating a target file according to the unstructured data of the batch of images; and loading the target file by using the preset model.
A receiving unit 503, configured to receive an inquiry request of a user, where the inquiry request includes a target image and a filtering condition;
an obtaining unit 504, configured to obtain a feature value of the target image;
an input unit 505, configured to input a feature value of the target image into a preset model to obtain a first identifier of data of N before similarity ranking; wherein N is a positive integer;
a determining unit 506, configured to determine a second identifier corresponding to the first identifier;
wherein the determining a second identifier corresponding to the first identifier comprises: matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
An input unit 505, configured to input the second identifier into the target server to obtain the first structured data;
a screening unit 507, configured to screen the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
an obtaining unit 501, configured to obtain a result image according to the third identifier and the preset model, and return the result image to the user.
The above-mentioned units 501-507 may be used to execute the method described in steps 201-208 in embodiment 2, and the detailed description is given in the description of the method in embodiment 2, and will not be described herein again.
As shown in fig. 6, an embodiment of the present invention provides a data processing apparatus 600, wherein the apparatus 600 includes the following units:
an obtaining unit 601, configured to obtain structured data and unstructured data of a batch of images when a request for increasing the batch of images is received;
a storage unit 602, configured to store the structured data of the batch of images into the target server;
an obtaining unit 601, configured to obtain a first identifier of the structured data edited by the target service;
a generating unit 603 configured to generate a target file according to unstructured data of the batch of images; loading the target file by using the preset model, and acquiring a second identifier of the image;
an establishing unit 604, configured to establish a mapping relationship between the first identifier and the second identifier.
A receiving unit 605, configured to receive an inquiry request of a user, where the inquiry request includes a target image and a screening condition;
an obtaining unit 601, configured to obtain a feature value of the target image;
an input unit 606, configured to input the feature value of the target image into a preset model to obtain a first identifier of data of N before the similarity ranking; wherein N is a positive integer;
a determining unit 607, configured to determine a second identifier corresponding to the first identifier, and input the second identifier into the target server to obtain the first structured data;
wherein the determining a second identifier corresponding to the first identifier comprises: matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
A screening unit 608, configured to screen the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
an obtaining unit 601, configured to obtain a result image according to the third identifier and the preset model, and return the result image to the user.
The above-mentioned units 601-608 may be used to execute the method described in steps 301-309 in embodiment 2, and the detailed description is given in embodiment 3 for the description of the method, which is not repeated herein.
Referring to fig. 7, in another embodiment of the present invention, a data processing apparatus 700 is provided. The apparatus 700 includes hardware such as a CPU 701, memory 702, bus 703, transceiver 704, and the like. The logic units shown in fig. 4-6 described above may be implemented by hardware devices shown in fig. 7.
The CPU 701 executes a server program pre-stored in the memory 702, and the execution process specifically includes:
receiving a query request of a user, wherein the query request comprises a target image and a screening condition;
acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer;
determining a second identifier corresponding to the first identifier;
inputting the second identification into a target server to obtain first structured data;
screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
and obtaining a result image according to the third identification and the preset model, and returning the result image to the user.
Optionally, the obtaining a result image according to the third identifier and the preset model includes:
determining a fourth identifier corresponding to the third identifier, wherein the fourth identifier is part or all of the first identifier;
and inputting the fourth identification into the preset model to obtain a result image.
Optionally, before receiving the query request of the user, the executing process further includes:
when a request for increasing images in batches is received, acquiring structured data and unstructured data of the images in the batches;
storing the structured data of the batch of images in the target server; and
and storing the unstructured data of the batch of images into the preset model.
Optionally, the storing the unstructured data of the batch of image data into the preset model includes:
generating a target file according to the unstructured data of the batch of images;
and loading the target file by using the preset model.
Optionally, the determining a second identifier corresponding to the first identifier includes:
matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores a mapping relationship between the first identifier and the second identifier, the first identifier is an identifier of an image stored in a preset model, and the second identifier is a sequence identifier of the image in the target server.
From the above, in the technical solution provided by the embodiment of the present invention, a query request of a user is received, where the query request includes a target image and a screening condition; acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; determining a second identifier corresponding to the first identifier; inputting the second identification into a target server to obtain first structured data; screening the first structured data according to the screening condition to obtain second structured data; and obtaining a result image according to the third identifier and the preset model, and returning the result image to the user. According to the technical scheme provided by the invention, the structured data and the unstructured data of the image are separately stored, and when the image is searched, the result image can be quickly determined through similarity calculation of the unstructured data and screening of the structured data, so that the query efficiency is improved, and meanwhile, the storage space is saved.
In another embodiment of the present invention, a computer program product is disclosed, the computer program product having program code embodied therein; the method of the preceding method embodiment is performed when the program code is executed.
In another embodiment of the present invention, a chip is disclosed, the chip comprising program code; the method of the preceding method embodiment is performed when the program code is executed.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (6)

1. A method of image searching, the method comprising:
receiving a query request of a user, wherein the query request comprises a target image and a screening condition;
acquiring a characteristic value of the target image, and inputting the characteristic value of the target image into a preset model to acquire a first identifier of data with N degrees of similarity before ranking; wherein N is a positive integer;
determining a second identifier corresponding to the first identifier; the first identification is an identification of an image stored in a preset model, and the second identification is a sequence identification of the image in the target server;
inputting the second identification into a target server to obtain first structured data;
screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
obtaining a result image according to the third identification and the preset model, and returning the result image to the user;
before the receiving the query request of the user, the method further comprises:
when a request for increasing the images in batches is received, acquiring structured data and unstructured data of the images in batches;
storing the structured data of the batch of images in the target server; and
storing unstructured data of the batch of images into the preset model;
the storing the unstructured data of the batch of image data into the preset model includes:
generating an hdf5 file according to the unstructured data of the batch of images;
loading the hdf5 file using the preset model;
the target server is a Soll server, and the preset model is a Fayi model.
2. The method according to claim 1, wherein the obtaining a result image according to the third identifier and the preset model comprises:
determining a fourth identifier corresponding to the third identifier, wherein the fourth identifier is part or all of the first identifier;
and inputting the fourth identification into the preset model to obtain a result image.
3. The method according to any one of claims 1 to 2, wherein the determining the second identifier corresponding to the first identifier comprises:
matching the first identifier with a pre-stored mapping table to acquire a second identifier corresponding to the first identifier; the mapping table stores the mapping relationship between the first identifier and the second identifier.
4. An apparatus for image search, the apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving an inquiry request of a user, and the inquiry request comprises a target image and a screening condition;
an acquisition unit configured to acquire a feature value of the target image;
the input unit is used for inputting the characteristic value of the target image into a preset model to acquire a first identifier of data N before the similarity ranking; wherein N is a positive integer;
a determining unit, configured to determine a second identifier corresponding to the first identifier; the first identification is an identification of an image stored in a preset model, and the second identification is a sequence identification of the image in the target server;
the input unit is used for inputting the second identification into a target server to acquire first structured data;
the screening unit is used for screening the first structured data according to the screening condition to obtain second structured data; the second structured data comprises a third identifier, and the third identifier is part or all of the second identifier;
the obtaining unit is used for obtaining a result image according to the third identifier and the preset model;
a return unit for returning the result image to the user;
the device further comprises a first storage unit and a second storage unit;
the acquisition unit is further used for acquiring structured data and unstructured data of the batch of images when a request for increasing the batch of images is received;
the first storage unit is used for storing the structured data of the batch of images into the target server;
the second storage unit is used for storing the unstructured data of the batch of images into the preset model;
the second storage unit is used for generating an hdf5 file according to the unstructured data of the batch of images; loading the hdf5 file using the preset model;
the target server is a Soll server, and the preset model is a Fayi model.
5. The apparatus according to claim 4, wherein the obtaining unit is specifically configured to determine a fourth identifier corresponding to the third identifier, where the fourth identifier is a part or all of the first identifier; and inputting the fourth identification into the preset model to obtain a result image.
6. The apparatus according to claim 4 or 5, wherein the determining unit is specifically configured to match the first identifier with a pre-stored mapping table to obtain the second identifier corresponding to the first identifier; and the mapping table stores the mapping relation between the first identifier and the second identifier.
CN201811640366.XA 2018-12-29 2018-12-29 Image searching method and device Active CN109829073B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811640366.XA CN109829073B (en) 2018-12-29 2018-12-29 Image searching method and device
PCT/CN2019/121607 WO2020134839A1 (en) 2018-12-29 2019-11-28 Image searching method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811640366.XA CN109829073B (en) 2018-12-29 2018-12-29 Image searching method and device

Publications (2)

Publication Number Publication Date
CN109829073A CN109829073A (en) 2019-05-31
CN109829073B true CN109829073B (en) 2020-11-24

Family

ID=66861411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811640366.XA Active CN109829073B (en) 2018-12-29 2018-12-29 Image searching method and device

Country Status (2)

Country Link
CN (1) CN109829073B (en)
WO (1) WO2020134839A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109829073B (en) * 2018-12-29 2020-11-24 深圳云天励飞技术有限公司 Image searching method and device
CN110287346B (en) * 2019-06-28 2021-11-30 深圳云天励飞技术有限公司 Data storage method, device, server and storage medium
CN111061888B (en) * 2019-11-20 2023-05-16 北京明略软件系统有限公司 Image acquisition method and system
CN111966629A (en) * 2020-06-28 2020-11-20 电子科技大学 Particle simulation data storage method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523304A (en) * 2011-12-29 2012-06-27 北京新媒传信科技有限公司 Application cloud platform and implementation method thereof
CN103116643A (en) * 2013-02-25 2013-05-22 江苏物联网研究发展中心 Hadoop-based intelligent medical data management method
CN103425780A (en) * 2013-08-19 2013-12-04 曙光信息产业股份有限公司 Data inquiry method and data inquiry device
CN106886553A (en) * 2016-12-27 2017-06-23 浙江宇视科技有限公司 A kind of image search method and server

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9575994B2 (en) * 2011-02-11 2017-02-21 Siemens Aktiengesellschaft Methods and devices for data retrieval
CN106503121B (en) * 2016-10-19 2019-12-06 公安部第三研究所 structured description method and system for X-ray security inspection image
CN107346435A (en) * 2017-06-15 2017-11-14 浙江捷尚视觉科技股份有限公司 A kind of suspicion fake-licensed car catching method based on vehicle characteristics storehouse
CN107729502A (en) * 2017-10-18 2018-02-23 公安部第三研究所 A kind of bayonet vehicle individualized feature intelligent retrieval system and method
CN107944017B (en) * 2017-12-11 2021-06-25 浙江捷尚视觉科技股份有限公司 Method for searching non-motor vehicle in video
CN109829073B (en) * 2018-12-29 2020-11-24 深圳云天励飞技术有限公司 Image searching method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523304A (en) * 2011-12-29 2012-06-27 北京新媒传信科技有限公司 Application cloud platform and implementation method thereof
CN103116643A (en) * 2013-02-25 2013-05-22 江苏物联网研究发展中心 Hadoop-based intelligent medical data management method
CN103425780A (en) * 2013-08-19 2013-12-04 曙光信息产业股份有限公司 Data inquiry method and data inquiry device
CN106886553A (en) * 2016-12-27 2017-06-23 浙江宇视科技有限公司 A kind of image search method and server

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"农业物联网数据存储管理系统的设计与实现";何龙;《万方》;20181130;论文正文第4章、第5章 *
"基于手机的分布式图片检索技术研究";冯喆;《中国优秀硕士学位论文全文数据库 信息科技辑》;20160315;论文正文第1章、第4章、第6章 *

Also Published As

Publication number Publication date
CN109829073A (en) 2019-05-31
WO2020134839A1 (en) 2020-07-02

Similar Documents

Publication Publication Date Title
CN109829073B (en) Image searching method and device
JP7343568B2 (en) Identifying and applying hyperparameters for machine learning
CN107436875B (en) Text classification method and device
US10210243B2 (en) Method and system for enhanced query term suggestion
CN106503006B (en) Sequencing method and device for sub-applications in application App
JP5449628B2 (en) Determining category information using multistage
CN103136228A (en) Image search method and image search device
CN105339933A (en) News results through query expansion
CN112364014B (en) Data query method, device, server and storage medium
US8750629B2 (en) Method for searching and ranking images clustered based upon similar content
CN112800197A (en) Method and device for determining target fault information
CN116383234A (en) Search statement generation method and device, computer equipment and storage medium
CN109783678B (en) Image searching method and device
CN109635072B (en) Public opinion data distributed storage method, public opinion data distributed storage device, storage medium and terminal equipment
CN103914479B (en) Resource request matching method and device
CN114490923A (en) Training method, device and equipment for similar text matching model and storage medium
CN106844406B (en) Search method and search device
CN112749258A (en) Data searching method and device, electronic equipment and storage medium
CN116758362A (en) Image processing method, device, computer equipment and storage medium
US10460018B1 (en) System for determining layouts of webpages
CN110781375A (en) User state identification determining method and device
WO2012127986A1 (en) Information search system, information search method, and information search programme
KR102375511B1 (en) Document storage management server for performing storage processing of document files received from a client terminal in conjunction with a plurality of document storage and operating method thereof
CN114840743A (en) Model recommendation method and device, electronic equipment and readable storage medium
CN108255888A (en) A kind of data processing method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant