A method, apparatus, electronic device, and storage medium for image search
Through the combination of a full-text search engine and an image file server, the problems of low accuracy and low efficiency of image search in the existing technology are solved, efficient and accurate image search is achieved, and large data expansion and multi-dimensional search are supported, which improves the user experience.
Patent Information
- Application Number
- CN202110178924.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-09
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-02-09
AI Technical Summary
The existing image search methods have problems with low accuracy and low efficiency, especially in the case of large data volumes, and it is difficult to expand the capacity of relational databases, resulting in a decrease in search accuracy and efficiency.
Full-text search engines such as Solr and Elasticsearch are used to combine image file servers to process image search requests through full-text search technology, use the back-end service of the image library to process and parse data, generate new search requests, and store and retrieve image data in the full-text search engine, including word segmentation processing of labels and description data, to achieve multi-dimensional search priority and sorting.
It improves the accuracy and efficiency of image search, supports the scalability and modification of large data volume, meets the multi-dimensional search needs of different users, and improves the user experience.
Smart Images

Figure CN112860929B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technologies, and more particularly to intelligent search technologies. Background Art
[0002] Image search is a service that provides users with relevant image materials on the Internet or in an image storage database through a search program. The purpose of image search is to find specific images required by users, which belongs to an important branch of intelligent search technologies. Summary of the Invention
[0003] Embodiments of this application provide an image search method, apparatus, electronic device, and storage medium to improve the accuracy and efficiency of image search.
[0004] In a first aspect, an embodiment of this application provides an image search method applied to a full-text search engine, including:
[0005] Obtain an image search request;
[0006] Perform a full-text search according to the image search request to obtain target image engine stored data;
[0007] Obtain an image search result according to the target image engine stored data.
[0008] In a second aspect, an embodiment of this application provides an image search apparatus configured in a full-text search engine, including:
[0009] An image search request obtaining module, configured to obtain an image search request;
[0010] A full-text search module, configured to perform a full-text search according to the image search request to obtain target image engine stored data.
[0011] In a third aspect, an embodiment of this application provides an electronic device, including:
[0012] At least one processor; and
[0013] A memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is enabled to execute the image search method provided in the first aspect embodiment.
[0015] In a fourth aspect, an embodiment of this application further provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute the image search method provided in the first aspect embodiment.
[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program, which when executed by a processor, implements the picture search method provided in the embodiment of the first aspect.
[0017] After obtaining a picture search request through a full-text search engine in an embodiment of the present application, a full-text search is performed according to the obtained picture search request to obtain data stored in a target picture engine, and thus a picture search result is obtained according to the data stored in the target picture engine obtained by the search, solving problems such as low accuracy and low efficiency existing in the existing picture search method, thereby improving the accuracy and efficiency of picture search.
[0018] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings are used to better understand the solution and do not constitute a limitation to the present application. Among them:
[0020] Figure 1 is a flowchart of a picture search method provided by an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a terminal interface of a picture library provided by an embodiment of the present application;
[0022] Figure 3 is a flowchart of a picture search method provided by an embodiment of the present application;
[0023] Figure 4 is a schematic diagram of a process for obtaining data stored in a picture engine provided by an embodiment of the present application;
[0024] Figure 5 is a flowchart of a picture search method provided by an embodiment of the present application;
[0025] Figure 6 is a schematic diagram of a process of a picture search method provided by an embodiment of the present application;
[0026] Figure 7 is a flowchart of a picture search method provided by an embodiment of the present application;
[0027] Figure 8 is a structural diagram of a picture search device provided by an embodiment of the present application;
[0028] Figure 9 is a schematic diagram of the structure of an electronic device used to implement the picture search method of an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0029] The following describes exemplary embodiments of the present application with reference to the accompanying drawings. Various details of the embodiments of the present application are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0030] In one example, Figure 1 is a flowchart of a picture search method provided by an embodiment of the present application. This embodiment is applicable to the situation of implementing picture search using full-text search technology. This method can be executed by a picture search device, which can be implemented in software and / or hardware and is generally integrated in an electronic device. The electronic device can be a server device capable of providing a full-text search engine function. Correspondingly, as Figure 1 shown, the method includes the following operations:
[0031] S110. Obtain a picture search request.
[0032] Among them, the picture search request can be a search request submitted by a picture library to a full-text search engine for requesting the full-text search engine to search for pictures that meet the requirements.
[0033] Currently, general picture libraries use relational databases to store picture data information to provide picture data search functions. However, when the amount of data that needs to be stored in the picture library increases significantly, relational databases are prone to problems such as difficult capacity expansion and difficult data structure modification, thereby reducing the accuracy and efficiency of picture search.
[0034] In the embodiments of the present application, the picture library function can be implemented using technologies such as a picture file server and a full-text search engine. Among them, the full-text search engine can support the storage of picture data, thereby implementing picture search operations in the picture library. Optionally, the full-text search engine can be, for example, Solr (enterprise-level search application server) and Elasticsearch (search server based on Lucene), etc. The embodiments of the present application do not limit the type of the full-text search engine. The picture file server can save all pictures in the picture library (also known as stored pictures) for search users to search. Among them, the search user can be a user with a picture search need and can use the picture library to search for pictures that meet the requirements. It should be noted that all pictures stored in the picture file server have the right to use. That is, after the search user obtains the corresponding picture through the picture library search, the search user can have the right to use the searched picture and be allowed to use and spread it in writing or on the network, thereby avoiding corresponding legal issues.
[0035] Optionally, the image library can directly send the image search request submitted by the search user to the full-text search engine for image search. Or, to improve the search efficiency of the full-text search engine, after receiving the image search request submitted by the search user, the back-end service of the image library can also process the image search request, such as word segmentation processing, etc., to obtain a new image search request and send it to the full-text search engine for image search.
[0036] Figure 2 FIG. is a schematic diagram of the terminal interface of an image library provided by an embodiment of the present application. In a specific example, as Figure 2 shown, the image library can be presented to the search user in the form of a search interface on the terminal. In the search interface of the image library, there are function modules such as "Local Images", "Image Library Images", "Material Library", and "Network Disk Images", etc. It can be understood that the function modules of the image library can be extended according to business requirements, and the embodiments of the present application do not limit this. That is, the image library can summarize and organize images from different data sources, and can also open the image search function to the user side, and support the image search needs of the search user through a large number of images stored in the image file server.
[0037] Correspondingly, the search user can enter an image search request in the search interface. For example, the user can enter an image search request of "animal image". Correspondingly, the full-text search engine can directly obtain the image search request. Or, the back-end service processes the image search request of "animal image" to obtain "animal" to form a new image search request, and sends it to the full-text search engine.
[0038] S120. Perform a full-text search according to the image search request to obtain the target image engine storage data.
[0039] Among them, the target image engine storage data can be the search result obtained by the full-text search engine performing a full-text search on all image engine storage data for the image search request. This search result is the image engine storage data corresponding to the stored images that match the search needs of the search user in the full-text search engine. The image engine storage data can be the associated data corresponding to each stored image in the full-text search engine. This associated data can be the relevant data describing the associated information of the stored image. For example, the image engine storage data can include, but is not limited to, image links or image identifiers, image tags, image descriptions, and image listing times, etc., as long as it can reflect the relevant information of the stored image. The embodiments of the present application do not limit the specific data content of the image engine storage data.
[0040] A full-text search engine is a search engine tool that comprehensively retrieves the text content of website pages. Its prominent advantage is that the information is automatically updated quickly and the query is comprehensive and sufficient. In the embodiments of the present application, the picture library uses a full-text search engine to store data in the picture engines that store pictures in the picture file server, which can better support the expansion or modification scenarios of a large amount of data, improve the processing speed of the search sorting of picture data, thereby ensuring the accuracy and scalability of picture data, and further improving the accuracy and efficiency of picture search.
[0041] Correspondingly, when the full-text search engine receives a picture search request, it can perform a full-text search on all the stored picture engine storage data according to the picture search request to obtain target picture engine storage data that matches the picture search request. Optionally, the target picture engine storage data can be one or more pieces of picture engine storage data, and the embodiments of the present application do not limit the amount of data of the target picture engine storage data.
[0042] S130. Obtain a picture search result according to the target picture engine storage data.
[0043] Among them, the picture search result can be one or more stored pictures obtained from the picture file server according to the target picture engine storage data.
[0044] Correspondingly, after obtaining the target picture engine storage data, the full-text search engine can obtain the corresponding stored pictures from the picture file server according to the searched target picture engine storage data as the picture search result.
[0045] In an optional embodiment of the present application, the obtaining the picture search result according to the target picture engine storage data may include: downloading corresponding target search pictures from the picture file server according to each picture link in the target picture engine storage data.
[0046] Among them, the picture link can be the link where the stored picture is stored in the picture file server. The target search picture can be the stored picture corresponding to each picture link in the target picture engine storage data in the picture file server.
[0047] Optionally, if the target picture engine storage data includes the picture links of the stored pictures in the picture file server, the full-text search engine can download the corresponding target search pictures from the picture file server respectively according to each picture link in the target picture engine storage data, and use each target search picture as the picture search result.
[0048] Optionally, the data stored by the target image engine may further include the image identifier of the stored image in the image file server. Correspondingly, the full-text search engine may retrieve the corresponding target search images from the image file server according to each image identifier in the data stored by the target image engine, and use each target search image as the image search result.
[0049] Correspondingly, after the full-text search engine obtains the image search result that matches the image search request, it may display the obtained image search result to the search user to complete the image search process.
[0050] In the embodiment of the present application, after the full-text search engine obtains an image search request, it performs a full-text search according to the obtained image search request to obtain the data stored by the target image engine, and thus obtains an image search result according to the data stored by the target image engine obtained by the search, solving the problems such as low accuracy and low efficiency existing in the existing image search method, thereby improving the accuracy and efficiency of image search.
[0051] In one example, Figure 3 is a flowchart of an image search method provided by an embodiment of the present application. On the basis of the technical solutions of the above embodiments, the embodiment of the present application is optimized and improved, and a specific optional implementation manner for the full-text search engine to obtain the data stored by the image engine is given.
[0052] Correspondingly, as Figure 3 shown, an image search method includes:
[0053] S310. Obtain the to-be-updated image data calculated and generated by the backend service.
[0054] S320. Store the to-be-updated image data as the data stored by the image engine.
[0055] Among them, the to-be-updated image data is generated by the backend service using the image update data that has passed the legality check, and can be used to update the data stored by the image engine in the full-text search engine. The image update data may be data for updating the images stored in the image file server in the image library and the data stored by the image engine of the full-text search engine. Optionally, the update operation may include, but is not limited to, adding images or modifying images, etc. The embodiment of the present application does not limit the operation type of updating using the image update data.
[0056] Figure 4 is a schematic flowchart of a process for obtaining the data stored by the image engine provided by an embodiment of the present application. As Figure 4 shown, in the embodiment of the present application, the backend service of the image library may regularly access a third-party image provider (such as Figure 4 shown by the timing script) through a data acquisition script (such as Figure 4The provided picture data acquisition interfaces (such as Supplier 1 and Supplier 2) are used to regularly obtain picture update data. Herein, the data acquisition script is the script for obtaining picture update data. The picture data acquisition interface can be an interface provided by a third-party picture supplier for providing pictures with the right of use to the picture library. Optionally, the data acquisition period of the data acquisition script can be in days, and the embodiments of the present application do not limit this.
[0057] Correspondingly, after the data acquisition script accesses the picture data acquisition interface to obtain the picture update data, it can perform a legality check on the picture update data to avoid including unavailable update data in the picture update data. Optionally, the content of the legality check can include, but is not limited to, whether the picture can be normally displayed, whether the label and description information of the picture are meaningful, and whether the picture listing time is valid, etc. The embodiments of the present application do not limit the specific check content of the legality check. If it is determined that the picture update data passes the legality check, indicating that the picture update data is reasonable and normal data, at this time, the picture data to be updated can be obtained according to the picture update data. If it is determined that the picture update data does not pass the legality check, indicating that the picture update data is abnormal data, at this time, the abnormal picture update data can be deleted.
[0058] After the picture update data passes the legality check, in order to avoid data accumulation problems caused by excessive data volume or downstream service delays, the backend service can store the normal picture update data in the message queue for publishing through the message queue and consuming asynchronously. The backend service corresponding to the picture library can communicate with the message queue to update the data in the full-text search engine and the picture file server.
[0059] In an optional embodiment of the present application, the picture update data can include, but is not limited to, the original picture link, the picture listing time, the original label data, and the original description data.
[0060] Among them, the original picture link can be the link where the third-party picture supplier stores the original picture, and the picture listing time can be the time when the third-party picture supplier publishes the original picture. The original label data can be the label data of the original picture provided by the third-party picture supplier, and this label data can record the features in the picture. The original description data can be the description data of the original picture provided by the third-party picture supplier, and this description data can be a sentence explaining the picture and generally can include the context background of the picture. For example, the description data can be "The girl trains the dog to learn to pick up things."
[0061] In an alternative embodiment of the present application, the backend service is configured to: download the storage picture to be updated corresponding to the original picture according to the stored picture link; calculate the picture aesthetics and the picture pixel identifier based on the storage picture to be updated; generate main tag data and secondary tag data based on the original tag data; generate updated description data based on the original description data; generate the picture data to be updated based on the picture link, the picture listing time, the main tag data, the secondary tag data, the updated description data, the picture aesthetics, and the picture pixel identifier.
[0062] Among them, the stored picture link may be the link where the storage picture corresponding to the original picture is stored in the picture file server. The storage picture to be updated is also the picture stored corresponding to the original picture in the picture file server. The picture aesthetics may be the aesthetics score of the storage picture to be updated calculated using relevant aesthetics calculation methods. The picture pixel identifier may be the pixel feature of the storage picture to be updated, such as the variance of the average value of the pixel points in each row of the picture, etc., which is used to calculate the picture similarity. The main tag data and the secondary tag data may jointly form the updated tag data and be used as the tag data stored in the full-text search engine. The updated description data may be the description data recalculated for the storage picture to be updated.
[0063] Correspondingly, when the backend service discovers that there is picture update data to be processed in the message queue, it can obtain the picture update data from the message queue, download the original picture from the third-party picture supplier to the local according to the original picture link included in the picture update data, and then upload the original picture stored locally to the picture file server in the intranet for storage. The picture file server can preprocess the original picture according to its own picture storage requirements before storing it, generate a new picture link and the width and height data of the picture, etc., and obtain the storage picture corresponding to the original picture. The backend service can calculate the attributes of the storage picture based on the storage picture corresponding to the original picture generated by the picture file server and the relevant data of the storage picture.
[0064] Optionally, a database may also be used to replace the message queue to store the picture update data.
[0065] Specifically, the backend service can download the image corresponding to the original image in the data from the image file server according to the stored image link to update the stored image as the image to be updated. Further, the backend service can calculate the new main label data, secondary label data, update description data, etc. of the image to be updated according to the calculation method of image-text relevance. Among them, the main label data can describe the main features of the image to be updated, such as the main features of animals like "dog", and the secondary label data can describe the auxiliary features of the image to be updated, such as background features like "grassland", "running", and "baseball". At the same time, the backend service can also calculate the new description data corresponding to the image to be updated as the update description data. To further ensure the accuracy of full-text search, the backend service can also calculate the image beauty degree and image pixel identification corresponding to the image to be updated. Correspondingly, the backend service can generate image data to be updated according to the stored image link, image listing time, main label data, secondary label data, update description data, image beauty degree, and image pixel identification, and send the image data to be updated to the full-text search engine. Correspondingly, the full-text search engine can store the image data to be updated calculated and generated by the backend service as image engine storage data (such as Figure 4 the storage data shown). The above calculation methods of image-text relevance, as well as the calculation methods of image beauty degree and image pixel identification, all belong to the content of image feature services. The application of image feature services improves the AI (Artificial Intelligence) ability of the image library.
[0066] Optionally, the stored image link in the image data to be updated can also be replaced with an image identifier. For example, the backend service or the image file server generates a unique image identifier for the stored image, so that after the full-text search engine searches later, the stored image can be obtained from the image file server according to the image identifier in the obtained target image engine storage data.
[0067] It should be noted that in the prior art, the label data of the stored image in the image data stored in the relational database is described by a single sentence, and only supports image search according to keywords that match completely or partially, resulting in a low accuracy rate of image search.
[0068] S330. Obtain an image search request.
[0069] S340. Perform a full-text search according to the image search request to obtain target image engine storage data.
[0070] S350. Obtain an image search result according to the target image engine storage data, and display the image search result to the search user.
[0071] By adopting the above technical solution, the backend service of the picture library generates picture data to be updated according to the updated data of the picture, so that the full-text search engine stores the picture data to be updated as the stored data of the picture engine, which can improve the accuracy of the stored data of the picture engine and further improve the accuracy of picture search.
[0072] In one example, Figure 5 is a flowchart of a picture search method provided by an embodiment of the present application. Figure 6 is a schematic flowchart of a picture search method provided by an embodiment of the present application. On the basis of the technical solutions of the above embodiments, the embodiment of the present application is optimized and improved, and a specific optional implementation manner for picture search according to picture search keywords is given.
[0073] In the embodiment of the present application, optionally, the full-text search engine can obtain a search data parsing result obtained by parsing the picture search data submitted by the search user, and use the search data parsing result as the picture search request. Correspondingly, the full-text search engine can perform a full-text search according to the search data parsing result and the stored data of the picture engine storing the pictures.
[0074] Among them, the search data parsing result can be a result obtained by parsing the picture search data submitted by the search user. The picture search data can be keyword text data, picture data, etc. The embodiment of the present application does not limit the data type of the picture search data.
[0075] In the embodiment of the present application, the full-text search engine can obtain a search data parsing result obtained by parsing the picture search data submitted by the search user, and then use the search data parsing result as a picture search request to perform a full-text search on the stored data of the picture engine storing the pictures.
[0076] It should be noted that the operation of parsing the picture search data submitted by the search user can be performed by the full-text search engine or by the backend service of the picture library. The embodiment of the present application does not limit the execution entity for parsing the picture search data submitted by the search user.
[0077] Exemplarily, taking the operation of parsing the image search data submitted by the search user through the backend service as an example for illustration. The backend service can obtain the image search data submitted by the search user through the search interface. Correspondingly, the backend service can parse the image search data according to the type of the image search data. For example, performing natural language processing on the keyword text data, or parsing the image size of the image data, etc., to obtain the search data parsing result corresponding to the image search data, and sending the search data parsing result as an image search request to the full-text search engine. After receiving the search data parsing result sent by the backend service, the full-text search engine performs a full-text search on the image engine storage data storing images using the search data parsing result as an image search request.
[0078] Parsing the data of the image submitted by the search user through the backend service to obtain an image search request can avoid the process of the full-text search engine parsing the image search data, thereby improving the full-text search efficiency.
[0079] Correspondingly, if the operation of parsing the image search data submitted by the search user is performed by the full-text search engine, the full-text search engine can directly obtain the image search data submitted by the search user through the search interface, and perform subsequent parsing operations to obtain the search data parsing result corresponding to the image search data, and use the search data parsing result as an image search request to perform a full-text search on the image engine storage data storing images.
[0080] In an optional embodiment of the present application, the image search data may include an image search keyword. Correspondingly, as Figure 5 and Figure 6 shown in a kind of image search method, including:
[0081] S510. Obtain a set of search keywords obtained by performing natural language processing on the image search keyword.
[0082] Wherein, the set of search keywords is generated from the keyword segmentation result obtained by performing natural language processing such as word segmentation on the image search keyword. Optionally, the word segmentation processing of the image search keyword can be performed by the backend service or the full-text search engine, and the embodiments of the present application do not limit this.
[0083] Wherein, the image search keyword may be keyword text data. The keyword segmentation result may be one or more segmentation results obtained by performing word segmentation processing on the image search keyword.
[0084] In an embodiment of the present application, optionally, a search user may submit an image search keyword to a search interface as image search data. Exemplarily, the image search keyword may be, for example, "dog pictures" or "pictures of training dogs", etc. Optionally, when the backend service or the full-text search engine obtains the image search keyword submitted by the search user, it may perform word segmentation processing on the image search keyword to obtain multiple word segmentation results, that is, keyword word segmentation results. Correspondingly, when performing word segmentation processing through the backend service, the backend service may generate a search keyword set according to the keyword word segmentation results and send the search keyword set to the full-text search engine. When performing word segmentation processing through the full-text search engine, the full-text search engine may directly generate a search keyword set according to the keyword word segmentation results.
[0085] Specifically, after the backend service or the full-text search engine performs word segmentation processing on the image search keyword, it may calculate the word attributes of each segmented word according to the part-of-speech tagging method and filter out meaningless pronouns and auxiliary words, etc., so as to obtain a set of search keywords to form a search keyword set.
[0086] In an optional embodiment of the present application, in the step of obtaining a search data parsing result by parsing the image search data submitted by the search user, it may further include: obtaining a legality verification word list through the backend service or the full-text search engine; performing a matching verification on the image search keyword and the legality verification word list through the backend service or the full-text search engine.
[0087] Among them, the legality verification word list can be used to store illegal words, such as sensitive words or prohibited words, etc. The embodiments of the present application do not limit the specific word content stored in the legality verification word list.
[0088] In an embodiment of the present application, after obtaining the image search keyword, the backend service or the full-text search engine may obtain a legality verification word list to perform a matching verification on the image search keyword according to the legality verification word list to determine whether the image search keyword includes illegal words.
[0089] Exemplarily, taking the legal verification of the image search keyword by the backend service as an example: If the backend service determines that the image search keyword passes the matching verification, indicating that the image search keyword does not include illegal words, then the image search data can be further parsed to obtain the search data parsing result, so that the full-text search engine can quickly perform full-text search according to the search data parsing result, improving the full-text search efficiency. If the backend service determines that the image search keyword does not pass the matching verification, indicating that the image search keyword includes illegal words, then the parsing of the image search data can be refused. Correspondingly, the full-text search engine cannot obtain the image search request. The above method of verifying the legality of the image search keyword by the backend service can reduce the data processing load of the full-text search engine, enabling the full-text search engine to concentrate on processing the search function, thereby improving the search efficiency and search quality of the full-text search engine.
[0090] Correspondingly, if the legal verification of the image search keyword is performed by the full-text search engine, the full-text search engine can directly execute subsequent search operations according to the legal verification result.
[0091] It should be noted that, in order to reduce the workload of the full-text search engine and improve the search efficiency and search quality of the full-text search engine, the above parsing of the image search data submitted by the search user is preferably executed by the backend service, so as to generate an image search request that the full-text search engine can directly process without further parsing through the backend service.
[0092] In an alternative embodiment of the present application, the data stored in the image engine includes tag data and description data; the tag data includes main tag data and secondary tag data; obtaining the search keyword set obtained by performing natural language processing on the image search keyword may include: obtaining the tag keyword set obtained by performing word segmentation processing on the tag data according to a delimiter; obtaining the description keyword set obtained by performing word segmentation processing on the description data according to a unit semantic word segmentation strategy.
[0093] Among them, the delimiter can be used to perform segmentation processing on each feature word in the tag data. The tag keyword set can be a keyword set obtained by performing segmentation processing on the tag data using the delimiter. The unit semantic word segmentation strategy can adopt the minimum semantic word segmentation method. The description keyword set can be a keyword set obtained by performing word segmentation processing on the description data using the minimum semantic word segmentation method.
[0094] In the embodiments of the present application, it is possible to obtain search results in the manner of search priorities. Correspondingly, in order to support search priorities, the full-text search engine or the backend service can perform word segmentation processing on the tag data and the description data in the data stored in the image engine respectively, so that the full-text search engine can obtain different types of keyword sets according to the data stored in the image engine. Specifically, the full-text search engine can obtain a tag keyword set and a description keyword set. Among them, the tag keyword set is obtained by performing word segmentation processing on the main tag data and the secondary tag data according to a delimiter, and the description keyword set is obtained by performing word segmentation processing on the description data according to a unit semantic word segmentation strategy. Exemplarily, the tag keyword set can be "dog, grassland, running, baseball", and the description keyword set can be "a girl trains a dog to learn to pick up things".
[0095] It should be noted that the operation of performing word segmentation processing on the tag data and the description data can be executed after obtaining the data stored in the image engine, or can be executed in real time after receiving an image search request. The embodiments of the present application do not limit the timing of performing word segmentation processing on the tag data and the description data.
[0096] Through the above technical solution, by performing word segmentation processing on the tag data and the description data in the data stored in the image engine, it can be used as matching data for the search keyword set, thereby improving the data matching efficiency of the full-text search engine.
[0097] S520. Perform a full-text search according to the search keyword set and the data stored in the image engine to obtain a full-text search result.
[0098] Among them, the full-text search result can be the result obtained by the full-text search engine performing a full-text search according to the search data parsing result and the data stored in the image engine.
[0099] Optionally, the full-text search engine can perform a full-text search according to the search keyword set and the data stored in the image engine to obtain a form of full-text search result that matches the image search keyword.
[0100] In an optional embodiment of the present application, the performing a full-text search according to the search keyword set and the data stored in the image engine may include: matching the tag keyword set according to the search keyword set to obtain a first search image engine storage data; matching the description keyword set according to the search keyword set to obtain a second search image engine storage data; sorting the first search image engine storage data and the second search image engine storage data according to the search priority to obtain the full-text search result.
[0101] Among them, the storage data of the first search image engine can be the image engine storage data corresponding to the target tag data obtained by matching the search keyword set with the tag keyword set. The storage data of the second search image engine can be the image engine storage data corresponding to the target description data obtained by matching the search keyword set with the description keyword set. The search priority can be the sequential priority determined according to the tag data and the description data.
[0102] Specifically, when performing a full-text search, the full-text search engine can match the search keyword set with the tag keyword set and the description keyword set corresponding to the storage data of the image engine respectively, and then sort the obtained storage data of the first search image engine and the storage data of the second search image engine according to the search priority to obtain the final full-text search result. Optionally, the priority of the search result of the tag data can be set higher than the priority of the search result of the description data. That is, the priority of the storage data of the first search image engine can be higher than the priority of the storage data of the second search image engine.
[0103] It should be noted that in the prior art, when using a relational database for image search, only the tag data of the image can be searched. Since the tag data of the images stored in the existing relational database is in the form of a sentence and the image attribute data is in a simple form, which cannot reflect the complete attributes of the image, only image search based on completely or partially matched keywords is supported, resulting in a low accuracy of image search. Further, in the prior art, there is also a problem of a small number of images that can be obtained using the exact matching method of the relational database because it is required that the image tags must continuously contain the input keywords. And the partial matching method will further reduce the accuracy of image search because tags that may be contextually irrelevant can also hit the search results.
[0104] In the full-text search method based on tag data and description data in the embodiments of the present application, searching for stored images according to the priorities of different attributes of the images is realized. Since the tag data stores the features of the images and the description data stores the context background of the images, searching for stored images according to the priorities of different attributes of the images can cover the main features to the context background of the stored images, understand the search needs of the search user more comprehensively, and thus improve the search accuracy.
[0105] In an alternative embodiment of the present application, the tag keyword set includes a main tag keyword set and a secondary tag keyword set; the sorting according to the storage data of the first search image engine and the storage data of the second search image engine according to the search priority may include: obtaining the storage data of the first main search image engine corresponding to the main tag keyword set and the storage data of the first secondary search image engine corresponding to the secondary tag keyword set; sorting in the order of the storage data of the first main search image engine, the storage data of the first secondary search image engine, and the storage data of the second search image engine.
[0106] Among them, the main tag keyword set may be a keyword set obtained by performing word segmentation on the main tag data, and the secondary tag keyword set may be a keyword set obtained by performing word segmentation on the secondary tag data. The storage data of the first main search image engine may be a part of the storage data of the first search image engine obtained by matching the main tag keyword set according to the search keyword set. The storage data of the second main search image engine may be a part of the storage data of the first search image engine obtained by matching the secondary tag keyword set according to the search keyword set.
[0107] Since the storage data of the image engine includes main tag data and secondary tag data, when determining the tag keyword set according to the tag data, the main tag keyword set can be determined according to the main tag data, and the secondary tag keyword set can be determined according to the secondary tag data. Correspondingly, the full-text search engine can match the main tag keyword set according to the search keyword set to obtain the storage data of the first main search image engine, and match the secondary tag keyword set according to the search keyword set to obtain the storage data of the first secondary search image engine. Then the search priority may specifically be the storage data of the first main search image engine - the storage data of the first secondary search image engine - the storage data of the second search image engine.
[0108] That is, the full-text search engine can search the main tag data according to the set of search keywords. When the main tag data completely matches the set of search keywords, the first main search image engine storage data corresponding to the main tag data is obtained. Furthermore, the full-text search engine can search the secondary tag data according to the set of search keywords. When the secondary tag data completely matches the set of search keywords, the first secondary search image engine storage data corresponding to the secondary tag data is obtained. Finally, the full-text search engine can search the description data according to the set of search keywords. When the description data completely matches the set of search keywords, the first main search image engine storage data corresponding to the description data is obtained. In the embodiments of the present application, "complete match" can be understood as: a set proportion of keywords in the tag data or description data can match the set of search keywords. Among them, the set proportion can be, for example, 90% or 95%, etc., and can be specifically set according to actual needs. The embodiments of the present application do not limit the specific value of the set proportion, but the value of the set proportion needs to be close to 100% to avoid reducing the search accuracy rate.
[0109] It can be understood that when the storage data of a certain type of image engine is empty, the storage data of this type of image engine can be omitted. For example, if the storage data of the first main search image engine is empty, the full-text search result can only include the storage data of the first secondary search image engine and the storage data of the second search image engine.
[0110] The above technical solution determines the search priority by using the main tag keyword set, the secondary tag keyword set, and the description keyword set, and realizes the search sorting rules according to the main features, auxiliary features, and context background of the pictures, which can meet the search needs of search users and improve the search accuracy rate.
[0111] S530. Determine the target image engine storage data according to the full-text search result and the full-text search sorting strategy.
[0112] Among them, the full-text search sorting strategy can be a strategy for sorting the full-text search results.
[0113] In the embodiments of the present application, after the full-text search engine obtains the full-text search result by using the set of search keywords, it can also re-sort the storage data of each image engine in the full-text search result according to the full-text search sorting strategy, so as to determine the final target image engine storage data.
[0114] In an alternative embodiment of the present application, the picture search request may further include a picture search tag; the determining of the target picture engine stored data according to the full-text search result and the full-text search sorting strategy may include: determining the tag type of the picture search tag; wherein, the tag type includes a high-quality picture tag, a latest picture tag, and a low-frequency picture tag; calculating the sorting data of the stored data of each search picture engine in the full-text search result according to the tag type; sorting the stored data of each search picture engine according to the sorting data to obtain the target picture engine stored data.
[0115] Among them, the picture search tag may be a search tag selected by the search user on the search interface. The high-quality picture tag can be used to provide high-quality pictures for the search user. The latest picture tag can provide the search user with the latest pictures in terms of time. The low-frequency picture tag can provide the search user with pictures with a lower usage frequency. In the application embodiment, the stored data of the search picture engine may be the stored data of the first main search picture engine, the stored data of the first secondary search picture engine, and the stored data of the second search picture engine.
[0116] It can be understood that different search users have different search requirements. Different search users will have different sorting requirements when inputting the same picture search data. For example, search users who are worried about their articles being judged as duplicate want to add pictures with fewer usage times, current affairs search users want to use the latest news pictures, and search users who pursue the quality of articles will want to obtain more beautiful and high-quality pictures. Therefore, considering the search requirements of different search users, the picture library can also set picture search tags for the search users to select.
[0117] Therefore, in addition to submitting picture search data through the search interface, the search user can also select a picture search tag, that is, the picture search request can include both picture search data and a picture search tag. Among them, the picture search data is used to obtain the searched pictures, and the picture search tag can be used to sort the searched pictures. In the embodiment of the present application, the tag type of the picture search tag may include but is not limited to high-quality picture tags, latest picture tags, and low-frequency picture tags, etc. Exemplarily, the high-quality picture tag may be, for example, Figure 1 the "high-quality recommendation" option in, the latest picture tag may be, for example, Figure 1 the "latest news" option in, and the low-frequency picture tag may be, for example, Figure 1 the "rare good pictures" option in.
[0118] Specifically, after the full-text search engine obtains the full-text search results by using the set of search keywords, it can calculate the sorting data of the stored data of each search image engine in the full-text search results according to the tag type of the image search tags selected by the search user, and then re-sort all the stored data of the search image engines according to the sorting data. Optionally, the full-text search engine can sort the stored data of each search image engine according to the high-quality image tags in descending order of the value of the image beauty, or can sort the stored data of each search image engine according to the latest image tags in descending order of the image listing time, or can also sort the stored data of each search image engine according to the low-frequency image tags in ascending order of the value of the image usage frequency. Optionally, the image usage frequency can be determined according to the download frequency of the stored images.
[0119] It should be noted that when re-sorting all the stored data of the search image engines according to the sorting data, it can be sorted separately according to the search priorities in the full-text search results, that is, the search priorities of the full-text search results are not disrupted. Exemplarily, when the search user selects low-frequency image tags, the full-text search engine can sort the stored data of the first main search image engine in ascending order of the image usage frequency to obtain the first sorting data. And sort the stored data of the first secondary search image engine in ascending order of the image usage frequency to obtain the second sorting data. And sort the stored data of the second search image engine in ascending order of the image usage frequency to obtain the third sorting data. Finally, sort the stored data of the search image engines according to the first sorting data - the second sorting data - the third sorting data respectively to obtain the final target image engine stored data.
[0120] The above technical solution realizes a multi-dimensional sorting rule by sorting the full-text search results by using the full-text search sorting strategy, and can better improve the user experience.
[0121] S540. Obtain the image search results according to the stored data of the target image engine.
[0122] S550. Display the image search results to the search user.
[0123] In an optional embodiment of the present application, the displaying the image search results to the search user may include: adding a target watermark to each target search image in the image search results; and displaying the target search images with the target watermark to the search user.
[0124] Among them, the target watermark can be the watermark type and content determined according to the business requirements.
[0125] In the embodiments of the present application, in order to achieve copyright protection for stored pictures, before providing each target search picture to the search user, a target watermark can be added to each target search picture, and each target search picture with the target watermark can be displayed to the search user. It should be noted that the operation of adding the target watermark and the operation of displaying the target search picture can be performed either by the full-text search engine or by the back-end service, and the embodiments of the present application do not limit this.
[0126] In the above technical solution, by using the picture search keyword and the full-text search engine to perform a full-text search, a method of picture search according to keyword text data is realized. During the full-text search process, the full-text search results are sorted using the search priority, and the full-text search sorting strategy is used to sort the full-text search results again, realizing a multi-dimensional sorting rule, which can not only improve the search accuracy and search efficiency of picture search, but also enhance the user experience at the same time.
[0127] In one example, Figure 7 is a flowchart of a picture search method provided by the embodiments of the present application. Based on the technical solutions of the above embodiments, the embodiments of the present application are optimized and improved, and a specific optional implementation manner of picture search according to the reference search picture is given.
[0128] In an optional embodiment of the present application, the picture search data may include a reference search picture. Correspondingly, as Figure 6 and Figure 7 shown, a picture search method includes:
[0129] S710. Obtain a reference search picture obtained by parsing the reference search picture.
[0130] Among them, the reference search picture is generated by parsing the picture size data of the reference search picture. Optionally, the picture size data of the reference search picture can be parsed by the back-end service or the full-text search engine, and the embodiments of the present application do not limit this.
[0131] Among them, the reference search picture can be a picture provided by the search user through the search interface of the picture library. This picture can be a local picture or an online picture in Internet resources. As long as the search user has the right to use the picture, it can be used as the reference search picture. The embodiments of the present application do not limit the acquisition method of the reference search picture.
[0132] In an embodiment of the present application, optionally, a search user may submit a reference search picture to a search interface as picture search data. Exemplarily, the search user may select one of the pictures stored locally as the reference search picture. Optionally, when the backend service or the full-text search engine obtains the reference search picture submitted by the search user, the reference search picture may be parsed and processed according to the picture size data of the reference search picture to obtain a reference search picture. Correspondingly, when parsing the reference search picture through the backend service, the backend service may send the parsed reference search picture to the full-text search engine. When parsing the reference search picture through the full-text search engine, the full-text search engine may directly obtain the reference search picture.
[0133] It should be noted that, in order to reduce the workload of the full-text search engine and improve the search efficiency and search quality of the full-text search engine, the above parsing of the reference search picture submitted by the search user is preferably executed through the backend service, so as to generate a picture search request that the full-text search efficiency can directly process without further parsing through the backend service.
[0134] In an alternative embodiment of the present application, the obtaining of the reference search picture obtained by parsing the reference search picture may include: in a case where it is determined that the picture size data is greater than or equal to a preset size threshold, obtaining a target picture downloaded from a picture file server according to the picture search link of the reference search picture; using the target picture as the reference search picture; in a case where it is determined that the picture size data is less than the preset size threshold, using the reference search picture as the reference search picture.
[0135] Wherein, the preset size threshold may be a threshold determined according to the processing performance of the picture library by the present application embodiment does not limit the specific size value of the preset size threshold. The target picture may be the picture corresponding to the reference search picture stored in the picture file server.
[0136] In an embodiment of the present application, in order to avoid the impact of pictures with too large sizes on the computing performance or search performance of the picture library, after obtaining the reference search picture, it is possible to first determine whether the picture size data of the reference search picture is greater than or equal to a preset size threshold. If it is determined that the picture size data is greater than or equal to the preset size threshold, it indicates that the size of the reference search picture is too large. At this time, the reference search picture can be transferred and stored to the picture file server to reduce the picture size data of the reference search picture and obtain the corresponding target picture. Correspondingly, the full-text search engine can obtain the target picture downloaded from the picture file server according to the picture search link of the reference search picture as the reference search picture. If it is determined that the picture size data is less than the preset size threshold, it indicates that the size of the reference search picture does not exceed the processing requirements of the picture library. At this time, the reference search picture can be directly used as the reference search picture. Optionally, the reference search picture can be obtained by the full-text search engine or the backend service. For example, the full-text search engine or the backend service obtains the picture search link according to the reference search picture and downloads the target picture from the picture file server. If the target picture is downloaded through the backend service, the backend service needs to send the downloaded target picture to the full-text search engine. Or, the full-text search engine or the backend service directly uses the reference search picture as the reference search picture. If the reference search picture is directly used as the reference search picture through the backend service, the backend service needs to send the reference search picture to the full-text search engine.
[0137] S720. Perform a full-text search based on the reference search picture and the data stored in the picture engine to obtain a full-text search result.
[0138] Optionally, the full-text search engine can perform a full-text search based on the reference search picture and the data stored in the picture engine to obtain a full-text search result in another form that matches the reference search picture.
[0139] In an optional embodiment of the present application, the data stored in the picture engine includes picture pixel identifiers; the performing a full-text search based on the reference search picture and the data stored in the picture engine may include: obtaining the reference picture pixel identifier of the reference search picture; matching the picture pixel identifiers of the data stored in each picture engine according to the reference picture pixel identifier.
[0140] Among them, the reference picture pixel identifier may be the picture pixel identifier corresponding to the reference search picture, and the data stored in the third search picture engine may be the data stored in the picture engine corresponding to the target picture pixel identifier obtained by matching the picture pixel identifiers of the data stored in each picture engine according to the reference picture pixel identifier.
[0141] In the embodiments of the present application, the reference picture pixel identifier of the reference search picture can be calculated through a full-text search engine or a back-end service. Correspondingly, if the reference picture pixel identifier of the reference search picture is calculated through the back-end service, the back-end service needs to send the reference picture pixel identifier to the full-text search engine. If the reference picture pixel identifier of the reference search picture is calculated through the full-text search engine, the full-text search engine can directly obtain the reference picture pixel identifier. Correspondingly, after the full-text search engine obtains the reference picture pixel identifier, the image similarity calculation method can be used to match the reference picture pixel identifier with the picture pixel identifiers included in the stored data of each picture engine, so as to obtain the stored data of the third search picture engine. The process of calculating the picture pixel identifier by using the image similarity calculation method belongs to the process of picture feature service. The application of picture feature service improves the AI ability of the picture library.
[0142] In the above technical solution, the full-text search engine realizes the picture search method based on pictures by using the image similarity calculation method with the picture pixel identifier, enriches the picture search function, meets the search needs of search users, and improves the user experience.
[0143] It should be noted that all the operations that can be performed by either the full-text search engine or the back-end service above can preferably be performed by the back-end service to reduce the workload of the full-text search engine.
[0144] S730. Determine the stored data of the target picture engine according to the full-text search result and the full-text search sorting strategy.
[0145] In the embodiments of the present application, after the full-text search engine obtains the full-text search result by using the reference search picture, the stored data of each picture engine in the full-text search result can also be re-sorted according to the full-text search sorting strategy, so as to determine the final stored data of the target picture engine.
[0146] In an optional embodiment of the present application, the picture search request may further include a picture search tag; determining the stored data of the target picture engine according to the full-text search result and the full-text search sorting strategy may include: determining the tag type of the picture search tag; wherein the tag type includes a high-quality picture tag, a latest picture tag, and a low-frequency picture tag; calculating the sorting data of the stored data of each search picture engine in the full-text search result according to the tag type; sorting the stored data of each search picture engine according to the sorting data to obtain the stored data of the target picture engine.
[0147] In addition to submitting image search data through the search interface, search users can also select image search tags, that is, image search requests can include both image search data and image search tags. The image search data is used to obtain the searched images, and the image search tags can be used to sort the searched images. In the embodiment of the present application, the tag types of image search tags may include but are not limited to high-quality image tags, latest image tags, and low-frequency image tags. For example, a high-quality image tag can be Figure 1 In the "Quality Recommendation" option, the latest image label can be, for example, Figure 1 In the "Latest News" option, low-frequency image labels can be, for example, Figure 1 The "Unpopular Good Pictures" option in the search box.
[0148] Specifically, after the full-text search engine obtains the full-text search results using the reference search image, the sorting data of each third search image engine storage data in the full-text search results can be calculated according to the tag type of the image search tag selected by the search user, thereby re-sorting all the third search image engine storage data according to the sorting data. Optionally, the full-text search engine can sort the third search image engine storage data in the order of the value of the image beauty from high to low according to the high-quality image tag, and can also sort the third search image engine storage data in the order of the image listing time from recent to distant according to the latest image tag, and can also sort the third search image engine storage data in the order of the value of the image usage frequency from low to high according to the low-frequency image tag. Optionally, the image usage frequency can be determined based on the download frequency of the stored images.
[0149] The above technical solution, by using the full-text search sorting strategy to sort the full-text search results to obtain the target image engine storage data, realizes support for multi-dimensional sorting rules, which can better improve the user experience.
[0150] S740: Obtain image search results according to the target image engine storage data.
[0151] S750: Display the image search results to the search user.
[0152] In an optional embodiment of the present application, displaying the image search results to the search user may include: adding a target watermark to each target search image in the image search results; and displaying each target search image with the target watermark to the search user.
[0153] In an embodiment of the present application, in order to achieve copyright protection for stored pictures, before providing each target search picture to the search user, a target watermark can be added to each target search picture, and each target search picture with the target watermark can be displayed to the search user. It should be noted that the operation of adding the target watermark and the operation of displaying the target search pictures can be performed either by the full-text search engine or by the back-end service, and the embodiments of the present application do not limit this.
[0154] Through the above technical solution, by using the reference search pictures and the full-text search engine for full-text search, a way of picture search based on pictures is realized. During the full-text search process, the full-text search sorting strategy is used to sort the full-text search results, enriching the picture search function. It can not only improve the search accuracy and search efficiency of picture search, but also enhance the user experience at the same time.
[0155] In one example, Figure 8 is a structural diagram of a picture search device provided by an embodiment of the present application. The embodiment of the present application is applicable to the situation of realizing picture search by using full-text search technology. The device is implemented by software and / or hardware and is specifically configured in the full-text search engine.
[0156] As Figure 8 shown, a picture search device 800 includes: a picture search request acquisition module 810, a full-text search module 820, and a picture search result acquisition module 830. Among them,
[0157] The picture search request acquisition module 810 is used to acquire a picture search request;
[0158] The full-text search module 820 is used to perform full-text search according to the picture search request to obtain the data stored in the target picture engine;
[0159] The picture search result acquisition module 830 is used to acquire a picture search result according to the data stored in the target picture engine.
[0160] After acquiring the picture search request, the embodiment of the present application performs full-text search according to the acquired picture search request through the full-text search engine to obtain the data stored in the target picture engine, and thus acquires the picture search result according to the data stored in the target picture engine obtained by the search, solving the problems of low accuracy and low efficiency existing in the existing picture search methods, thereby improving the accuracy and efficiency of picture search.
[0161] Optionally, the image search request acquisition module 810 is specifically configured to: obtain a search data parsing result obtained by parsing the image search data submitted by the search user; use the search data parsing result as the image search request; the full-text search module 820 is specifically configured to: perform a full-text search according to the search data parsing result and the image engine storage data of the stored images.
[0162] Optionally, the image search data includes image search keywords; the image search request acquisition module 810 is specifically configured to: obtain a set of search keywords obtained by performing natural language processing on the image search keywords; wherein, the set of search keywords is generated from a keyword segmentation result obtained by performing a word segmentation process on the image search keywords; the full-text search module 820 is specifically configured to: perform a full-text search according to the set of search keywords and the image engine storage data to obtain a full-text search result; determine the target image engine storage data according to the full-text search result and the full-text search sorting strategy.
[0163] Optionally, the image engine storage data includes tag data and description data; the tag data includes main tag data and secondary tag data; the image search request acquisition module 810 is specifically configured to: obtain a set of tag keywords obtained by performing a word segmentation process on the tag data according to a delimiter; obtain a set of description keywords obtained by performing a word segmentation process on the description data according to a unit semantic word segmentation strategy.
[0164] Optionally, the full-text search module 820 is specifically configured to: match the set of search keywords with the set of tag keywords to obtain first search image engine storage data; match the set of search keywords with the set of description keywords to obtain second search image engine storage data; sort the first search image engine storage data and the second search image engine storage data according to a search priority to obtain the full-text search result.
[0165] Optionally, the set of tag keywords includes a set of main tag keywords and a set of secondary tag keywords; the full-text search module 820 is specifically configured to: obtain first main search image engine storage data corresponding to the set of main tag keywords and first secondary search image engine storage data corresponding to the set of secondary tag keywords; sort in the order of the first main search image engine storage data, the first secondary search image engine storage data, and the second search image engine storage data.
[0166] Optionally, the picture search data includes a reference search picture; the picture search request acquisition module 810 is specifically configured to: acquire a reference search picture obtained by parsing the reference search picture; wherein, the reference search picture is generated by parsing the picture size data of the reference search picture; the full-text search module 820 is specifically configured to: perform a full-text search based on the reference search picture and the picture engine stored data to obtain a full-text search result; determine the target picture engine stored data according to the full-text search result and the full-text search sorting strategy.
[0167] Optionally, the picture search request acquisition module 810 is specifically configured to: when it is determined that the picture size data is greater than or equal to a preset size threshold, acquire a target picture downloaded from a picture file server according to a picture search link of the reference search picture; use the target picture as the reference search picture; when it is determined that the picture size data is less than the preset size threshold, use the reference search picture as the reference search picture.
[0168] Optionally, the picture engine stored data includes a picture pixel identifier; the full-text search module 820 is specifically configured to: acquire a reference picture pixel identifier of the reference search picture; match the picture pixel identifiers of each picture engine stored data according to the reference picture pixel identifier to obtain a third search picture engine stored data.
[0169] Optionally, the picture search request further includes a picture search tag; the full-text search module 820 is specifically configured to: determine a tag type of the picture search tag; wherein, the tag type includes a high-quality picture tag, a latest picture tag, and a low-frequency picture tag; calculate sorting data of each search picture engine stored data in the full-text search result according to the tag type; sort each of the search picture engine stored data according to the sorting data to obtain the target picture engine stored data.
[0170] Optionally, the picture search result acquisition module 810 is specifically configured to: download corresponding target search pictures from a picture file server according to each picture link in the target picture engine stored data; the device further includes a target search picture display module, configured to add a target watermark to each of the target search pictures in the picture search result; display each of the target search pictures with the target watermark to the search user.
[0171] Optionally, the device further includes a to-be-updated picture data acquisition module, configured to acquire to-be-updated picture data calculated and generated by a backend service; a picture engine stored data storage module, configured to store the to-be-updated picture data as picture engine stored data; wherein, the to-be-updated picture data is generated by the backend service using picture update data that has passed a legality check.
[0172] Optionally, the picture update data includes an original picture link, a picture shelf time, original tag data, and original description data; the backend service is used to: download a to-be-updated stored picture corresponding to the original picture according to the stored picture link; calculate a picture beauty degree and a picture pixel identifier according to the to-be-updated stored picture; generate main tag data and secondary tag data according to the original tag data; generate updated description data according to the original description data; generate the to-be-updated picture data according to the stored picture link, the picture shelf time, the main tag data, the secondary tag data, the updated description data, the picture beauty degree, and the picture pixel identifier.
[0173] The above picture search device can execute the picture search method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in this embodiment, reference can be made to the picture search method provided in any embodiment of the present application.
[0174] Since the above-introduced picture search device is a device that can execute the picture search method in the embodiments of the present application, based on the picture search method introduced in the embodiments of the present application, those skilled in the art can understand the specific implementation manners and various variations of the picture search device in this embodiment. Therefore, the details of how the picture search device implements the picture search method in the embodiments of the present application will not be described in detail here. As long as the device adopted by those skilled in the art to implement the picture search method in the embodiments of the present application belongs to the scope protected by the present application.
[0175] In one example, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0176] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement the embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as, for example, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, for example, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0177] As Figure 9As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of device 900 can also be stored. The computing unit 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0178] Multiple components in device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, optical disc, etc.; and a communication unit 909, such as a network card, modem, wireless communication transceiver, etc. The communication unit 909 allows device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0179] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 executes the various methods and processes described above, such as the picture search method. For example, in some embodiments, the picture search method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the picture search method described above can be executed. Alternatively, in other embodiments, the computing unit 901 can be configured to execute the picture search method in any other appropriate way (e.g., by means of firmware).
[0180] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.
[0181] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.
[0182] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0183] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0184] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0185] A computer system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0186] After obtaining a picture search request through a full-text search engine in an embodiment of the present application, a full-text search is performed according to the obtained picture search request to obtain the data stored in the target picture engine, so as to obtain a picture search result according to the data stored in the target picture engine obtained by the search, solving the problems such as low accuracy and low efficiency existing in the existing picture search methods, thereby improving the accuracy and efficiency of picture search.
[0187] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitations are imposed herein.
[0188] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub - combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A picture search method applied to a full-text search engine, comprising: Obtaining a picture search request; Performing a full-text search according to the picture search request to obtain the data stored in the target picture engine; Obtaining a picture search result according to the data stored in the target picture engine; Among them, the performing a full-text search according to the picture search request includes: Performing a full-text search according to the search keyword set and the data stored in the picture engine to obtain a full-text search result; wherein, the data stored in the picture engine includes tag data and description data; the tag data includes main tag data and secondary tag data; the main tag data describes the main features of the picture to be updated and stored, the secondary tag data describes the auxiliary features of the picture to be updated and stored, and the description data stores the context background of the picture; Determining the data stored in the target picture engine according to the full-text search result and the full-text search sorting strategy; Among them, performing a full-text search according to the search keyword set and the data stored in the picture engine includes: Matching the search keyword set with the tag keyword set to obtain the first search picture engine stored data; Matching the search keyword set with the description keyword set to obtain the second search picture engine stored data; Sorting the first search picture engine stored data and the second search picture engine stored data according to the search priority to obtain the full-text search result; Among them, the priority of the first search picture engine stored data is higher than the priority of the second search picture engine stored data; Among them, the tag keyword set includes a main tag keyword set and a secondary tag keyword set; The sorting according to the search priority based on the first search picture engine stored data and the second search picture engine stored data includes: Obtaining the first main search picture engine stored data corresponding to the main tag keyword set and the first secondary search picture engine stored data corresponding to the secondary tag keyword set; Sorting in the order of the first main search picture engine stored data, the first secondary search picture engine stored data, and the second search picture engine stored data; The method further includes: Obtaining the picture data to be updated generated by the backend service calculation; Storing the picture data to be updated as the data stored in the picture engine; Among them, the picture data to be updated is generated by the backend service using the picture update data that has passed the legality verification; The picture update data includes the original picture link, the picture listing time, the original tag data, and the original description data; The backend service is used for: Downloading the picture to be updated and stored corresponding to the original picture according to the stored picture link; Calculating the picture beauty degree and the picture pixel identifier according to the picture to be updated and stored; Generating main tag data and secondary tag data according to the original tag data; Generating updated description data according to the original description data; Generating the picture data to be updated according to the stored picture link, the picture listing time, the main tag data, the secondary tag data, the updated description data, the picture beauty degree, and the picture pixel identifier; The backend service is further configured to: calculate the main tag data, the secondary tag data, and the update description data of the to-be-updated stored image according to the calculation method of the image-text relevance.
2. The method according to claim 1, wherein The obtaining of the image search request includes: obtaining a search data parsing result by parsing the image search data submitted by the search user; using the search data parsing result as the image search request.
3. The method according to claim 2, wherein, The image search data includes an image search keyword. The obtaining of the search data parsing result by parsing the image search data submitted by the search user includes: obtaining a set of search keywords obtained by performing natural language processing on the image search keyword; wherein, the set of search keywords is generated from the keyword segmentation result obtained by segmenting the image search keyword.
4. According to the method described in claim 3, the obtaining of the set of search keywords obtained by performing natural language processing on the image search keyword includes: obtaining a set of tag keywords obtained by segmenting the tag data according to a delimiter; obtaining a set of description keywords obtained by segmenting the description data according to a unit semantic segmentation strategy.
5. The method according to claim 2, wherein The image search data includes a reference search image. The obtaining of the search data parsing result by parsing the image search data submitted by the search user includes: obtaining a reference search image obtained by parsing the reference search image; wherein, the reference search image is generated by parsing the image size data of the reference search image. The full-text search according to the search data parsing result and the image engine storage data of the stored image includes: performing a full-text search according to the reference search image and the image engine storage data to obtain a full-text search result; determining the target image engine storage data according to the full-text search result and the full-text search sorting strategy.
6. The method according to claim 5, wherein, The obtaining of the reference search image obtained by parsing the reference search image includes: in the case where it is determined that the image size data is greater than or equal to a preset size threshold, obtaining a target image downloaded from a picture file server according to the image search link of the reference search image; using the target image as the reference search image; in the case where it is determined that the image size data is less than the preset size threshold, using the reference search image as the reference search image.
7. The method according to claim 5, wherein The image engine storage data includes an image pixel identifier. The full-text search according to the reference search image and the image engine storage data includes: obtaining the reference image pixel identifier of the reference search image; matching the image pixel identifiers of each image engine storage data according to the reference image pixel identifier to obtain the third search image engine storage data.
8. The method according to claim 1 or 5, wherein The image search request further includes an image search tag. The determining of the target image engine storage data according to the full-text search result and the full-text search sorting strategy includes: determining the tag type of the image search tag; wherein, the tag type includes a high-quality image tag, a latest image tag, and a low-frequency image tag. Calculate the sorting data of the stored data of each search image engine in the full-text search results according to the label type; Sort the stored data of each search image engine according to the sorting data to obtain the stored data of the target image engine.
9. The method according to claim 1, wherein The obtaining of the image search results according to the stored data of the target image engine includes: Download the corresponding target search images from the image file server according to each image link in the stored data of the target image engine; The method further includes: Add a target watermark to each target search image in the image search results; Display each target search image with the target watermark to the search user.
10. An image search device configured in a full-text search engine, including: An image search request acquisition module, configured to acquire an image search request; A full-text search module, configured to perform a full-text search according to the image search request to obtain the stored data of the target image engine; An image search result acquisition module, configured to obtain an image search result according to the stored data of the target image engine; Wherein, the full-text search module is specifically configured to: Perform a full-text search according to a set of search keywords and the stored data of the image engine to obtain full-text search results; wherein, the stored data of the image engine includes label data and description data; the label data includes main label data and secondary label data; the main label data describes the main features of the image to be updated and stored, and the secondary label data describes the auxiliary features of the image to be updated and stored, and the description data stores the context background of the image; Determine the stored data of the target image engine according to the full-text search results and the full-text search sorting strategy; Wherein, the full-text search module is specifically configured to: Match the set of search keywords with the set of label keywords to obtain the stored data of the first search image engine; Match the set of search keywords with the set of description keywords to obtain the stored data of the second search image engine; Sort the stored data of the first search image engine and the stored data of the second search image engine according to the search priority to obtain the full-text search results; Wherein, the priority of the stored data of the first search image engine is higher than the priority of the stored data of the second search image engine; Wherein, the set of label keywords includes a set of main label keywords and a set of secondary label keywords; the full-text search module is specifically configured to: Obtain the stored data of the first main search image engine corresponding to the set of main label keywords and the stored data of the first secondary search image engine corresponding to the set of secondary label keywords; Sort in the order of the stored data of the first main search image engine, the stored data of the first secondary search image engine, and the stored data of the second search image engine; A module for obtaining image data to be updated, configured to obtain image data to be updated calculated and generated by the backend service; A storage module for storing the image data to be updated as the stored data of the image engine; Wherein, the image data to be updated is generated by the backend service using the image update data that has passed the legality check; The picture update data includes the original picture link, the picture listing time, the original tag data, and the original description data; The backend service is used for: Downloading the storage picture to be updated corresponding to the original picture according to the stored picture link; Calculating the picture aesthetics and the picture pixel identifier based on the storage picture to be updated; Generating main tag data and secondary tag data based on the original tag data; Generating updated description data based on the original description data; Generating the picture data to be updated based on the stored picture link, the picture listing time, the main tag data, the secondary tag data, the updated description data, the picture aesthetics, and the picture pixel identifier.
11. The apparatus according to claim 10, wherein, The picture search request acquisition module is specifically used for: Obtaining a search data parsing result obtained by parsing the picture search data submitted by the search user; Using the search data parsing result as the picture search request.
12. The device according to claim 11, wherein, The picture search data includes picture search keywords; The picture search request acquisition module is specifically used for: obtaining a set of search keywords obtained by performing natural language processing on the picture search keywords; wherein, the set of search keywords is generated from the keyword segmentation result obtained by performing word segmentation processing on the picture search keywords.
13. The device according to claim 12, wherein, The picture search request acquisition module is specifically used for: Obtaining a set of tag keywords obtained by performing word segmentation processing on the tag data according to a delimiter; Obtaining a set of description keywords obtained by performing word segmentation processing on the description data according to a unit semantic word segmentation strategy.
14. The apparatus according to claim 11, wherein, The picture search data includes a reference search picture; The picture search request acquisition module is specifically used for: obtaining a reference search picture obtained by parsing the reference search picture; wherein, the reference search picture is generated by parsing the picture size data of the reference search picture. The full-text search module is specifically used for: performing full-text search according to the reference search picture and the picture engine storage data to obtain a full-text search result; Determining the target picture engine storage data according to the full-text search result and the full-text search sorting strategy.
15. The apparatus according to claim 14, wherein, The picture search request acquisition module is specifically used for: When it is determined that the picture size data is greater than or equal to a preset size threshold, obtaining a target picture downloaded from a picture file server according to the picture search link of the reference search picture; Using the target picture as the reference search picture; When it is determined that the picture size data is less than the preset size threshold, using the reference search picture as the reference search picture.
16. The apparatus according to claim 14, wherein, The picture engine storage data includes a picture pixel identifier; the full-text search module is specifically used for: Obtaining the reference picture pixel identifier of the reference search picture; Matching the picture pixel identifiers of each picture engine storage data according to the reference picture pixel identifier to obtain the third search picture engine storage data.
17. The device according to claim 10 or 14, wherein, The picture search request further includes a picture search tag; the full-text search module is specifically used for: Determining the tag type of the picture search tag; wherein, the tag type includes a high-quality picture tag, a latest picture tag, and a low-frequency picture tag; Calculate the sorting data of the stored data of each search image engine in the full-text search results according to the label type; Sort the stored data of each search image engine according to the sorting data to obtain the stored data of the target image engine.
18. The apparatus according to claim 10, wherein, The image search result acquisition module is specifically configured to: Download corresponding target search images from the image file server according to each image link in the stored data of the target image engine; The device further includes a target search image display module, configured to add a target watermark to each of the target search images in the image search results; Display each of the target search images with the target watermark to the search user.
19. An electronic device, comprising: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image search method according to any one of claims 1-9.
20. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the image search method according to any one of claims 1-9.
21. A computer program product, comprising a computer program which, when executed by a processor, implements the image search method according to any one of claims 1-9.
Citation Information
Patent Citations
Picture searching method, device and client
CN102411582A
Method and device for searching for watermark-free picture
CN103870597A
Picture searching method, terminal equipment and storage medium
CN107590291A