Image search method and device, terminal device, storage medium and product

By establishing an information and index mapping relationship when the terminal device is idle, the problem of fast and accurate search when the terminal device stores a large number of images is solved, realizing efficient and accurate image search and improving user experience.

CN123178659APending Publication Date: 2026-11-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510695375.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

When terminal devices store a large number of images, it is difficult to quickly and accurately find the image that the user needs from multiple images. Existing neural network models have excessively long search times or low accuracy when computing power is limited.

Method used

When the terminal device is idle, information mapping and index mapping relationships are established through a large model to directly obtain the target image corresponding to the search information input by the user. The accuracy and speed of image search are improved by utilizing the information mapping and index mapping relationships.

Benefits of technology

It shortens image acquisition time, improves image search accuracy, and enables personalized image display, thus enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178659A_ABST
    Figure CN123178659A_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image search method and device, a terminal device, a storage medium and a product. The method comprises: obtaining target search information input by a user; determining a target image corresponding to the target search information in a local gallery based on a preset mapping relationship; the preset mapping relationship comprises an information mapping relationship and / or an index mapping relationship, the information mapping relationship comprises a mapping relationship between historical search information and images in the local gallery, and the index mapping relationship comprises a mapping relationship between a target index of an image in the local gallery and images in the local gallery; the information mapping relationship and the target index are determined by the terminal device based on a large model when the terminal device is in an idle state; and displaying the target image. The method of the present disclosure can not only shorten the acquisition time of the target image, but also improve the accuracy of the acquired target image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of electronic technology, and in particular to an image search method, apparatus, terminal device, storage medium, and product. Background Technology

[0002] As the storage space in terminal devices continues to increase, the number of images stored by users is also increasing, making it difficult for users to quickly find the image they need from multiple stored images.

[0003] Currently, it's possible to search for images based on user-input search terms using neural network models deployed on terminal devices. However, due to the limited computing power of terminal devices, if the deployed neural network model is large, the search process based on the user's input search terms will take a considerable amount of time, making it difficult to quickly display the desired image. If the deployed neural network model is small, the search accuracy will typically be low, failing to accurately find the image the user needs. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this disclosure provides an image search method, apparatus, terminal device, storage medium, and product, which can not only shorten the acquisition time of target images, but also improve the accuracy of the acquired target images.

[0005] According to a first aspect of the present disclosure, an image search method is provided, the method comprising: acquiring target search information input by a user; determining a target image corresponding to the target search information in a local map library based on a preset mapping relationship; the preset mapping relationship includes an information mapping relationship and / or an index mapping relationship, the information mapping relationship including a mapping relationship between historical search information and images in the local map library, the index mapping relationship including a mapping relationship between a target index of an image in the local map library and an image in the local map library, the information mapping relationship and the target index being determined by a terminal device based on a large model when the terminal device is in an idle state; and displaying the target image.

[0006] In this embodiment, an information mapping relationship and / or index mapping relationship are established using a large model when the terminal device is idle. The information mapping relationship includes the mapping relationship between historical search information and images in the local image library, and the index mapping relationship includes the mapping relationship between the target index and images in the local image library. Based on this, after obtaining the user's latest input target search information, the terminal device can directly obtain the target image corresponding to the target search information from the local image library based on the historical search information included in the information mapping relationship, and / or obtain the image with the target index indicated by the target search information from the local image library based on the target index included in the index mapping relationship. The target image corresponding to the target search information can be directly obtained based on the information mapping relationship without sequentially calculating the matching degree between the target search information and the images in the local image library, thus shortening the target image acquisition time. Furthermore, since both the information mapping relationship and the index mapping relationship are established based on a large model, determining the target image corresponding to the target search information in the local image library based on the information mapping relationship and / or the index mapping relationship can also improve the accuracy of the determined target image.

[0007] In some embodiments, the number of target images is multiple; displaying target images includes: determining the arrangement order of the multiple target images; displaying the multiple target images according to the determined arrangement order; wherein, the number of times the target image arranged in the first position on the screen has been viewed by the user in a historical time is greater than or equal to the number of times the target image arranged in the second position has been viewed by the user in a historical time, and the first position is located before the second position.

[0008] In this embodiment of the disclosure, it is considered that images viewed frequently by users over a historical period are generally the images that users need. Therefore, by arranging the images viewed most frequently by users among multiple target images in a more prominent position, it is easier for users to see the images they need, thereby improving the user experience.

[0009] In some embodiments, the mapping relationship between historical search information and images in the local map library includes the mapping relationship between historical search information and a first image, wherein the first image includes an image displayed on the screen and viewed by the user based on historical search information at a historical time, and / or an image whose relevance to historical search information is greater than or equal to a relevance threshold; determining the target image corresponding to the target search information in the local map library based on a preset mapping relationship includes: determining whether there is historical target search information identical to the target search information in the historical search information included in the information mapping relationship; in response to the existence of historical target search information in the historical search information included in the information mapping relationship, determining the first image corresponding to the historical target search information in the information mapping relationship as the target image.

[0010] In this embodiment, the information mapping relationship includes the mapping relationship between historical search information and images viewed by the user. Therefore, when a user enters the same search information as in the past, the terminal device will inevitably display the image that the user viewed in the past. Based on this, personalized display of the same search information entered by different users can be achieved, even when different users have different image viewing habits.

[0011] In some embodiments, determining the target image corresponding to the target search information in the local map library based on a preset mapping relationship further includes: in response to the absence of historical target search information in the historical search information included in the information mapping relationship, determining a first index based on the target search information; determining the image corresponding to the first index in the local map library based on the index mapping relationship; and determining the image corresponding to the first index in the local map library as the target image.

[0012] In this embodiment of the disclosure, when the historical search information included in the information mapping relationship does not contain historical target search information, the terminal device generates a first index based on the target search information and determines the image corresponding to the first index in the local map library based on the index mapping relationship. Since the index mapping relationship is also based on a large model, determining the image corresponding to the first index in the local map library based on the index mapping relationship can still improve the accuracy of the determined target image.

[0013] In some embodiments, the method further includes: when the terminal device is in an idle state, determining whether the initial index of the second image in the local image library is accurate based on a large model, wherein the initial index is determined based on a preset model, and the model size of the preset model is smaller than that of the large model; in response to the initial index of the second image being accurate, determining the initial index as the target index of the second image; in response to the initial index of the second image being inaccurate, determining the target index of the second image based on the large model; and establishing a mapping relationship between the second image and the target index of the second image to obtain an index mapping relationship.

[0014] In this embodiment of the disclosure, when the terminal device is in an idle state, it determines whether the initial index of the second image in the local image library is accurate based on a large model. If it determines that the initial index of the second image is inaccurate, it generates a target index for the second image or deletes the initial index of the second image using the large model. In this way, the accuracy of the index mapping relationship can be improved, thereby improving the accuracy of the target image determined based on the index mapping relationship.

[0015] In some embodiments, the target index of the second image includes at least one of the following: the target category index of the second image; the target content index of the second image.

[0016] In this embodiment of the disclosure, by establishing category mapping relationships and content mapping relationships for each image in the local image library, the terminal device can determine the target image from the local image library based on the target search terms in both the category and content dimensions. This improves the comprehensiveness of the target images determined from the local image library and reduces the probability of missing suitable images.

[0017] In some embodiments, the target index includes a feature vector, the index mapping relationship includes a vector mapping relationship, and the feature vector is obtained by extracting features from images in the local image library based on an image coding model; the method further includes: in response to the terminal device being in an idle state, obtaining a first feature vector of historical search information based on a text coding model; determining the image corresponding to the first feature vector in the vector mapping relationship; calculating a loss value based on the difference between the image corresponding to the first feature vector in the vector mapping relationship and the image corresponding to the historical search information in the information mapping relationship; and updating the text coding model based on the loss value.

[0018] In this embodiment, the terminal device determines which images in the local map library correspond to a search query based on a vector mapping relationship. This determination is made by the feature vector obtained by encoding the search query using an encoding model. The images corresponding to historical search queries in the information mapping relationship are those determined by a large model and those viewed by the user. Therefore, training the text encoding model based on historical search queries and their corresponding images in the information mapping relationship allows the feature vectors extracted from the search query to better match user needs. Consequently, the images determined from the local map library based on the feature vectors of the search query through the vector mapping relationship better meet user requirements.

[0019] In some embodiments, the method further includes: determining the target search information as new historical search information; when the terminal device is idle, determining a first image from the target image based on the new historical search information using a large model, the first image including images viewed during the display of the target image, and / or images in the target image whose relevance to the new historical search information is greater than or equal to a relevance threshold; and adding a mapping relationship between the new historical search information and the first image in the information mapping relationship.

[0020] In this embodiment of the disclosure, the terminal device updates the information mapping relationship based on the target search information and the target image corresponding to the target search information, which can make the information mapping relationship richer.

[0021] According to a second aspect of the present disclosure, an image search apparatus is provided, the apparatus comprising: a first acquisition module configured to acquire target search information input by a user; a first determination module configured to determine a target image corresponding to the target search information in a local map library based on a preset mapping relationship; the preset mapping relationship includes an information mapping relationship and / or an index mapping relationship, the information mapping relationship including a mapping relationship between historical search information and images in the local map library, the index mapping relationship including a mapping relationship between a target index of an image in the local map library and an image in the local map library, the information mapping relationship and the target index being determined by the terminal device based on a large model when the terminal device is in an idle state; and a display module configured to display the target image.

[0022] In some embodiments, the number of target images is multiple; the display module is configured to: determine the arrangement order of the multiple target images; display the multiple target images according to the determined arrangement order; wherein, the number of times the target image arranged in the first position on the screen has been viewed by the user in a historical time is greater than or equal to the number of times the target image arranged in the second position has been viewed by the user in a historical time, and the first position is located before the second position.

[0023] In some embodiments, the mapping relationship between historical search information and images in the local gallery includes the mapping relationship between historical search information and a first image, wherein the first image includes an image displayed on the screen and viewed by the user based on historical search information at a historical time, and / or an image whose relevance to historical search information is greater than or equal to a relevance threshold; the first determining module is configured to: determine whether there is historical target search information that is the same as the target search information in the historical search information included in the information mapping relationship; and, in response to the existence of historical target search information in the historical search information included in the information mapping relationship, determine the first image corresponding to the historical target search information in the information mapping relationship as the target image.

[0024] In some embodiments, the first determining module is further configured to: in response to the absence of historical target search information in the historical search information included in the information mapping relationship, determine a first index based on the target search information; determine the image corresponding to the first index in the local map library based on the index mapping relationship; and determine the image corresponding to the first index in the local map library as the target image.

[0025] In some embodiments, the apparatus further includes: a second determining module configured to determine, when the terminal device is in an idle state, whether the initial index of the second image in the local image library is accurate based on a large model, wherein the initial index is determined based on a preset model and the model size of the preset model is smaller than that of the large model; a third determining module configured to determine the initial index as the target index of the second image in response to the initial index of the second image being accurate; a fourth determining module configured to determine the target index of the second image based on a large model in response to the initial index of the second image being inaccurate; and an establishing module configured to establish a mapping relationship between the second image and the target index of the second image to obtain an index mapping relationship.

[0026] In some embodiments, the target index of the second image includes at least one of the following: the target category index of the second image; the target content index of the second image.

[0027] In some embodiments, the target index includes a feature vector, the index mapping relationship includes a vector mapping relationship, and the feature vector is obtained by extracting features from images in a local image library based on an image encoding model; the apparatus further includes: a second acquisition module configured to acquire a first feature vector of historical search information based on a text encoding model in response to the terminal device being in an idle state; a fifth determination module configured to determine the image corresponding to the first feature vector in the vector mapping relationship; a calculation module configured to calculate a loss value based on the difference between the image corresponding to the first feature vector in the vector mapping relationship and the image corresponding to the historical search information in the information mapping relationship; and an update module configured to update the text encoding model based on the loss value.

[0028] In some embodiments, the method further includes: a sixth determining module configured to determine the target search information as new historical search information; a seventh determining module configured to, when the terminal device is in an idle state, determine a first image from the target image based on the new historical search information using a large model, the first image including images viewed during the display of the target image, and / or images in the target image whose relevance to the new historical search information is greater than or equal to a relevance threshold; and an adding module configured to add a mapping relationship between the new historical search information and the first image in the information mapping relationship.

[0029] According to a third aspect of the present disclosure, a terminal device is provided, comprising: a processor; and a memory for storing computer programs or instructions; wherein the processor executes the computer programs or instructions to implement the steps of the method described above.

[0030] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which stores executable instructions or a computer program that, when executed by a processor, implements the steps of the method described above.

[0031] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the method described above.

[0032] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0033] In this disclosure, an information mapping relationship and / or an index mapping relationship are established using a large model when the terminal device is idle. The information mapping relationship includes the mapping relationship between historical search information and images in the local image library, and the index mapping relationship includes the mapping relationship between the target index and images in the local image library. Based on this, after obtaining the user's latest input target search information, the terminal device can directly obtain the target image corresponding to the target search information from the local image library based on the historical search information included in the information mapping relationship, and / or obtain the image with the target index indicated by the target search information from the local image library based on the target index included in the index mapping relationship. The target image corresponding to the target search information can be directly obtained based on the information mapping relationship without sequentially calculating the matching degree between the target search information and the images in the local image library, thus shortening the target image acquisition time. Furthermore, since both the information mapping relationship and the index mapping relationship are established based on a large model, determining the target image corresponding to the target search information in the local image library based on the information mapping relationship and / or the index mapping relationship can also improve the accuracy of the determined target image.

[0034] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0035] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0036] Figure 1 This is a schematic diagram illustrating a target image according to an exemplary embodiment.

[0037] Figure 2 This is a flowchart illustrating an image search method according to an exemplary embodiment.

[0038] Figure 3This is a schematic diagram illustrating a target image according to another exemplary embodiment.

[0039] Figure 4 This is a schematic diagram illustrating a target image according to another exemplary embodiment.

[0040] Figure 5 This is a schematic diagram illustrating the structure of a search framework according to an exemplary embodiment.

[0041] Figure 6 This is a schematic diagram illustrating the structure of a search framework according to another exemplary embodiment.

[0042] Figure 7 This is a block diagram illustrating an image search device according to an exemplary embodiment.

[0043] Figure 8 This is a structural block diagram of a terminal device according to an exemplary embodiment. Detailed Implementation

[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0045] As the storage space in terminal devices continues to increase, the number of images stored by users is also increasing, making it difficult for users to quickly find the image they need from multiple stored images.

[0046] Currently, it's possible to search for images based on user-input search terms using neural network models deployed on terminal devices. However, due to the limited computing power of terminal devices, if the deployed neural network model is large, the search process based on the user's input search terms will take a considerable amount of time, making it difficult to quickly display the desired image. If the deployed neural network model is small, the search accuracy will typically be low, failing to accurately find the image the user needs.

[0047] For example, Figure 1 This is a schematic diagram illustrating a target image according to an exemplary embodiment. For example... Figure 1 As shown, after a user enters the search term "puppy on the grass," the small model deployed on the terminal device can obtain... Figure 1 The target image shown. From Figure 1As can be seen, although images a, b, and c contain puppies, the puppies in images a, b, and c are not on the grass. This demonstrates the limited accuracy of the small model on the terminal device in acquiring images matching the user's search terms.

[0048] It should be noted that a small model can be understood as a neural network model with fewer than 10 million parameters.

[0049] To address the aforementioned problems, this disclosure provides an image search method. This method can be executed by a terminal device. Exemplarily, the terminal device executing the image search method provided in this disclosure can be a mobile terminal with a screen or a fixed terminal. The mobile terminal can include smartphones, tablets, laptops, digital cameras, and wearable electronic devices, etc. The fixed terminal can include desktop computers, all-in-one computers, etc.

[0050] refer to Figure 2 , Figure 2 This is a flowchart illustrating an image search method according to an exemplary embodiment. In the following text, a terminal device will be used as the execution subject, with reference to... Figure 2 The steps shown illustrate the image search method provided in this disclosure. This image search method mainly includes the following steps:

[0051] In step 201, the target search information input by the user is obtained.

[0052] Understandably, when a user needs to search for images from the local gallery on their device, they can enter search information. Based on this, the device can detect the user's search input and use it as the target search information.

[0053] In some embodiments, the target search information can be in any form, and this disclosure does not limit this.

[0054] For example, the target search information can be in the form of text search information, voice search information, etc.

[0055] For example, search terms could include: "puppy on the grass", "red flowers", "girl by the sea", etc.

[0056] In some embodiments, images in the local gallery may include images from a photo album application. Based on this, the target search information may include search information entered by the user in the search box of the photo album application.

[0057] In step 202, based on a preset mapping relationship, the target image corresponding to the target search information in this map library is determined.

[0058] Understandably, terminal devices can store preset mapping relationships established during idle time based on a large model. Based on this, after obtaining target search information, the terminal device can retrieve the image corresponding to the target search information from the preset mapping relationship and use that image as the target image.

[0059] In some embodiments, the preset mapping relationship includes an information mapping relationship and / or an index mapping relationship. The information mapping relationship includes a mapping between historical search information and images in the local map library. Historical search information can be understood as search information entered by the user at a historical time. Based on this, after obtaining the target search information, if the historical search information included in the information mapping relationship contains historical target search information identical to the target search information, the terminal device can determine the image corresponding to the historical target search information in the information mapping relationship as the target image corresponding to the target search information in the local map library.

[0060] In some embodiments, the index mapping relationship includes a mapping relationship between the target index of an image in the local map library and the image in the local map library. Based on this, after obtaining the target search information, the terminal device can generate a first index of the target image to be searched based on the target search information. Then, based on the index mapping relationship, the terminal device determines the image corresponding to the first index in the local map library and identifies the image corresponding to the first index in the local map library as the target image.

[0061] In some embodiments, the target index in the index mapping relationship is generated by the terminal device based on a large model when the terminal device is in an idle state.

[0062] In some embodiments, the preset mapping relationship is established based on a large model when the terminal device is in an idle state. That is, both the information mapping relationship and the index mapping relationship are established based on a large model when the terminal device is in an idle state.

[0063] In some embodiments, the terminal device being in an idle state includes at least one of the following: the terminal device is charging; the terminal device is in a screen-off state; the utilization rate of the central processing unit is lower than a preset threshold; or the number of applications running on the terminal device is less than or equal to a number threshold.

[0064] It should be noted that the size of the quantity threshold can be determined as needed, and this disclosure does not limit it.

[0065] For example, a quantity threshold can be determined based on the computing power of the terminal device, wherein the size of the quantity threshold is positively correlated with the computing power of the terminal device.

[0066] In some embodiments, large models include, but are not limited to, large language models (LLMs) and multimodal large models.

[0067] For example, multi-model large models include, but are not limited to: Vision-Language Models (VLMs), Multimodal Generative Models (MGMs), Multimodal Chat Models (MCMs), etc.

[0068] In some embodiments, the images in the local image library include, but are not limited to, at least one of the following: images captured by an image acquisition module on a terminal device, images downloaded from the network, images received from other terminal devices, etc.

[0069] In step 203, the target image is displayed.

[0070] Understandably, after the terminal device identifies the target image corresponding to the target search information from the local image library, it can display the target image.

[0071] In some embodiments, the terminal device may display the target image based on the application interface of the photo album application.

[0072] In some embodiments, the target image is displayed on the terminal device in one of the following ways: the terminal device displays the target image in the form of an image list; the terminal device displays the target image in the form of a thumbnail; the terminal device displays the target image in full screen.

[0073] In some embodiments, before displaying a target image, the terminal device may also obtain the number of target images and determine the display method of the target images based on the number of target images.

[0074] For example, when there are multiple target images, the terminal device can display the target images as an image list or thumbnails. When there is only one target image, the terminal device can display the target image in full screen.

[0075] In some embodiments, when a terminal device displays a target image in the form of a thumbnail, it can also determine the display size of the thumbnail based on the number of target images. The display size of the thumbnail is negatively correlated with the number of target images.

[0076] It should be noted that the above are merely examples of several ways to display target images and do not constitute a limitation on the way target images are displayed.

[0077] For example, Figure 3This is a schematic diagram illustrating a target image according to another exemplary embodiment. For example... Figure 3 As shown, after the user inputs the target search information "puppy on the grass", the terminal device can retrieve the image corresponding to the target search information "puppy on the grass" from the local image library based on a preset mapping relationship, and display it on the terminal device screen. Figure 3 The image shown. Figure 3 The puppies in the included images are all located on grass. This demonstrates that using the method provided in this embodiment for target indexing can improve the accuracy of the retrieved target images.

[0078] In this embodiment, an information mapping relationship and / or index mapping relationship are established using a large model when the terminal device is idle. The information mapping relationship includes the mapping relationship between historical search information and images in the local image library, and the index mapping relationship includes the mapping relationship between the target index and images in the local image library. Based on this, after obtaining the user's latest input target search information, the terminal device can directly obtain the target image corresponding to the target search information from the local image library based on the historical search information included in the information mapping relationship, and / or obtain the image with the image index indicated by the target search information from the local image library based on the target index included in the index mapping relationship. The target image corresponding to the target search information can be directly obtained based on the information mapping relationship without sequentially calculating the matching degree between the target search information and the images in the local image library, thus shortening the target image acquisition time. Furthermore, since both the information mapping relationship and the index mapping relationship are established based on a large model, determining the target image corresponding to the target search information in the local image library based on the information mapping relationship and / or the index mapping relationship can also improve the accuracy of the determined target image.

[0079] In some embodiments, the number of target images is multiple; displaying target images includes: determining the arrangement order of the multiple target images; displaying the multiple target images according to the determined arrangement order; wherein, the number of times the target image arranged in the first position has been viewed by the user in a historical time is greater than or equal to the number of times the target image arranged in the second position has been viewed by the user in a historical time, and the first position is located before the second position.

[0080] Understandably, the terminal device can identify multiple target images. Based on this, before displaying the target images, the terminal device can also determine the arrangement order of the multiple target images and display them according to the determined arrangement order.

[0081] In some embodiments, when the terminal device displays multiple target images in a determined arrangement order, the number of times the target image in the first position has been viewed by the user in a historical time is greater than or equal to the number of times the target image in the second position has been viewed by the user in a historical time.

[0082] In some embodiments, if the terminal device detects a user's click operation on the target image during the display of the target image in the historical time, it can determine that the target image clicked was viewed by the user in the historical time.

[0083] In some embodiments, when the terminal device is idle, it can determine the arrangement order of multiple images corresponding to each historical search information based on a large model, and generate an image list corresponding to each historical search information according to the determined arrangement order. In this case, the information mapping relationship includes the mapping relationship between historical search information and the image list. Based on this, before displaying the target image, the terminal device can query the image list corresponding to the target search information from the information mapping relationship and determine the image in the image list as the target image. Additionally, the terminal device can also determine the arrangement order of multiple target images based on the arrangement order of multiple images in the image list corresponding to the target search information.

[0084] In some embodiments, the first position preceding the second position includes: the first position being located to the left of the second position on the screen and / or the first position being located above the second position on the screen. The first position being above the second position on the screen can be understood as the first position being located further away from the Home button relative to the second position on the screen.

[0085] For example, Figure 4 This is a schematic diagram illustrating a target image according to yet another exemplary embodiment. Figure 3 If images d, e, and f are images that have been clicked by the user in the past, the terminal device can arrange images d, e, and f in a more prominent position when displaying the target image (e.g., ...). Figure 4 (The arrangement positions of images d, e, and f in the image).

[0086] In some embodiments, when the terminal device obtains multiple target images, it can also determine the arrangement order of the multiple target images according to their shooting time. For example, the terminal device can arrange the target image in the first position on the screen to be shot later than or equal to the shooting time of the target image in the second position, so that the user can more easily focus on the most recently captured image.

[0087] In some embodiments, when multiple target images are obtained, the terminal device can further calculate the similarity between the target search information and each target image, and determine the arrangement order of the multiple target images based on the similarity between each target image and the target search information. For example, the terminal device can make the similarity between the target image arranged in the first position on the screen and the target search information greater than or equal to the similarity between the target image arranged in the second position and the target search information, so that the user can more easily find the image they need most.

[0088] In some embodiments, the terminal device may obtain a first feature vector of the target search information and a third feature vector of the target image. Then, the terminal device may calculate the similarity between the first feature vector and the third feature vector of the target image, and use the obtained similarity as the similarity between the target search information and the target image.

[0089] In this embodiment of the disclosure, it is considered that images viewed frequently by users over a historical period are generally the images that users need. Therefore, by arranging the images viewed most frequently by users among multiple target images in a more prominent position, it is easier for users to see the images they need, thereby improving the user experience.

[0090] In some embodiments, the mapping relationship between historical search information and images in the local map library includes the mapping relationship between historical search information and a first image, wherein the first image includes an image displayed on the screen and viewed by the user based on historical search information at a historical time, and / or an image whose relevance to historical search information is greater than or equal to a relevance threshold; step 102 includes: determining whether there is historical target search information that is the same as the target search information in the historical search information included in the information mapping relationship; in response to the existence of historical target search information in the historical search information included in the information mapping relationship, determining the first image in the local map library corresponding to the historical target search information in the information mapping relationship as the target image.

[0091] Understandably, when the terminal device is idle, the information mapping relationship established based on the large model can include the mapping relationship between historical search information and the first image. The first image can be an image displayed on the screen and viewed by the user based on historical search information at a historical time, and / or an image with a relevance greater than or equal to a relevance threshold to the historical search information. After receiving the user's input target search information, the terminal device can determine whether there is historical target search information identical to the target search information in the historical search information included in the information mapping relationship. If historical target search information exists in the historical search information included in the information mapping relationship, the terminal device can use the first image corresponding to the historical target search information in the information mapping relationship as the target image corresponding to the target search information in this map library.

[0092] In some embodiments, the information mapping relationship may include a mapping relationship between historical search information and an image list, where the image list is a list of first images. Based on this, after determining that historical target search information exists in the historical search information included in the information mapping relationship, the terminal device can determine the target image list corresponding to the historical target search information based on the information mapping relationship, and determine the first image in the target image list as the target image.

[0093] In some embodiments, in the information mapping relationship, the first image corresponding to the historical search information may further include at least one of the following: an image determined by the terminal device from the local image library based on the historical search information using a large model; an image previously displayed on the screen by the terminal device based on the historical search information; an image previously displayed on the screen by the terminal device based on the historical search information and viewed by the user; and an image previously displayed on the screen by the terminal device based on the historical search information and whose relevance to the historical search information is greater than a relevance threshold.

[0094] For example, Figure 5 This is a schematic diagram illustrating the structure of a search framework according to an exemplary embodiment. For example... Figure 5 As shown, after obtaining the user's input search information "little girl by the sea," the terminal device can determine whether the historical search information stored in the historical search information database 504 includes historical search information identical to the target search information. That is, it determines whether the user has previously entered the search information "little girl by the sea." If the terminal device determines that the search information "little girl by the sea" exists in the historical search information database 504, it can use the first image corresponding to the search information "little girl by the sea" in the information mapping relationship as the target image 510.

[0095] In some embodiments, when idle, the terminal device can acquire historical search information and images displayed on the screen based on the historical search information at historical times, and mark the images viewed by the user. Then, the terminal device can input the intersection or union of the images displayed on the screen based on the historical search information and the viewed images into a large model, and instruct the large model to determine a first image from the input images using preset prompts. The first image is an image viewed by the user at a historical time and / or an image whose relevance to the historical search information is greater than a relevance threshold. After obtaining the historical search information and the corresponding first image, the terminal device can establish a mapping relationship between the historical search information and the first image to obtain the aforementioned information mapping relationship.

[0096] Continue to refer to Figure 5 Terminal devices can establish information mapping relationships based on the large model 508 when they are idle.

[0097] In this embodiment, the information mapping relationship includes the mapping relationship between historical search information and images viewed by the user. Therefore, when a user enters the same search information as in the past, the terminal device will inevitably display the image that the user viewed in the past. Based on this, personalized display of the same search information entered by different users can be achieved, even when different users have different image viewing habits.

[0098] For example, if the historical search query is "red hoodie," the terminal device will display an image of a red hoodie from its local image library on the screen. If user A wants to search for a bright red hoodie, user A will typically view the image of a bright red hoodie displayed on the screen. If user B wants to search for a pink hoodie, user B will typically view the image of a pink hoodie displayed on the screen. Based on this, the information mapping stored in user A's terminal device is a mapping between the historical search query "red hoodie" and the image of a bright red hoodie. Therefore, when user A enters the search query "red hoodie" again, the terminal device can determine the image of a bright red hoodie as the target image corresponding to the search query "red hoodie" based on the information mapping relationship and display that image. When user B enters the search query "red hoodie" again, the terminal device can determine the image of a pink hoodie as the target image corresponding to the search query "red hoodie" based on the information mapping relationship and display that image. In this way, personalized display of images searched by users can be achieved based on their viewing habits.

[0099] In some embodiments, step 102 further includes: in response to the absence of historical target search information in the historical search information, determining a first index based on the target search information; determining the image corresponding to the first index in the local map library based on the index mapping relationship; and determining the image corresponding to the first index in the local map library as the target image.

[0100] Understandably, if historical target search information is not present in the historical search information included in the information mapping relationship, the terminal device can determine the index of the target image to be searched based on the target search information, and use the determined index as the first index. Then, the terminal device can determine the image corresponding to the first index in the current map library based on the index mapping relationship, and identify the image corresponding to the first index in the current map library as the target image.

[0101] In some embodiments, the terminal device may calculate the similarity between the first index and the target indices included in the index mapping relationship, and determine the target indices included in the index mapping relationship whose similarity to the first index is greater than or equal to a similarity threshold as the second index. After obtaining the second index, the terminal device may use the image corresponding to the second index in the index mapping relationship as the target image.

[0102] In some embodiments, the target index includes a target category index, a target content index, and / or a feature vector. The index mapping relationship may include a category mapping relationship, a content mapping relationship, and / or a vector mapping relationship. The first index may include a first category index, a first content index, and / or a first feature vector. Based on this, if the obtained first index is a first category index, the terminal device can obtain an image with the first category index from the local image library based on the category mapping relationship, and use the image obtained from the local image library as the target image. If the obtained first index is a first content index, the terminal device can determine an image with the first content index from the local image library based on the content mapping relationship, and use the image with the first content index as the target image. Similarly, if the obtained first index is a first feature vector, the terminal device can calculate the similarity between the first feature vector and the feature vectors included in the vector mapping relationship to determine a second feature vector from the vector mapping relationship whose similarity to the first feature vector is greater than a similarity threshold. Then, the terminal device can use the image corresponding to the second feature vector in the local image library in the vector mapping relationship as the target image.

[0103] In some embodiments, the similarity threshold can be set as needed, and this disclosure does not limit this.

[0104] For example, the similarity threshold can be any value greater than or equal to 0.8.

[0105] In some embodiments, the terminal device may use the intersection or union of images determined based on category mapping, content mapping and vector mapping as the target image corresponding to the target search information.

[0106] For example, continue to refer to Figure 5The target index includes the target category index stored in the target category index library 501, the target content index in the target content index library 502, and the feature vectors in the feature vector library 503. Based on this, if the user inputs the target search information "little girl by the sea," and the target search information "little girl by the sea" does not exist in the historical search information library 504, the terminal device can determine the first category index of the target search information "little girl by the sea." Then, the terminal device can determine the image corresponding to the first category index in this map library based on the index mapping relationship stored in the target category index library 501, and use the image corresponding to the first category index in this map library as the target image 510. The terminal device can also determine the first content index of the target search information "little girl by the sea." Then, the terminal device can determine the image corresponding to the first content index in this map library based on the content mapping relationship stored in the target content index library 502, and use the image corresponding to the first content index in this map library as the target image 510. The terminal device can also extract the first feature vector of the target search information "little girl by the sea" based on a text encoding model. Then, the terminal device can determine the image corresponding to the first feature vector in the local map library based on the vector mapping relationship stored in the feature vector library 503, and use the image corresponding to the first feature vector in the local map library as the target image 510. In this way, the terminal device can determine the target image 510 corresponding to the target search information "little girl by the sea".

[0107] For example, the terminal device can extract keywords from the target search information and determine a first category index and / or a first content index based on the extracted keywords.

[0108] For example, if the target search information obtained by the terminal device is "puppy on the grass", then the terminal device can extract the keywords "grass" and "puppy" from the target search information "puppy on the grass", and determine the first category index as animal, pet, or dog based on the keyword "puppy". The terminal device can also determine the first content index of the target image to be searched as puppy and grass based on the keywords "grass" and "puppy".

[0109] In this embodiment of the disclosure, when the historical search information included in the information mapping relationship does not contain historical target search information, the terminal device generates a first index based on the target search information and determines the image corresponding to the first index in the local map library based on the index mapping relationship. Since the index mapping relationship is also based on a large model, determining the image corresponding to the first index in the local map library based on the index mapping relationship can still improve the accuracy of the determined target image.

[0110] In some embodiments, the method further includes: when the terminal device is in an idle state, determining whether the initial index of the second image in the local image library is accurate based on a large model, wherein the initial index is determined based on a preset model, and the model size of the preset model is smaller than that of the large model; in response to the initial index of the second image being accurate, determining the initial index as the target index of the second image; in response to the initial index of the second image being inaccurate, determining the target index of the second image based on the large model; and establishing a mapping relationship between the second image and the corresponding target index to obtain an index mapping relationship.

[0111] Understandably, for a second image in the local image library, the terminal device can first determine the initial index of the second image based on a preset model. Then, when the terminal device is idle, it can further determine the accuracy of the initial index using a larger model. If the initial index is accurate, it is used as the target index. If the initial index is inaccurate, the terminal device can determine the target index for the second image based on the larger model and replace the initial index with the target index. After obtaining the target index of the second image, the terminal device can establish a mapping relationship between the target index and the second image to obtain the aforementioned index mapping relationship.

[0112] In some embodiments, the second image may be a portion of the images in the local image library or all the images in the local image library; this disclosure does not limit this.

[0113] For example, the second image includes: an image newly added to the local gallery.

[0114] In some embodiments, when a new image is added to the map library (e.g., a new image is captured by a user through an image acquisition module), the terminal device, when in an idle state, can first determine the initial index of the new image based on a preset model. Then, when in an idle state, the terminal device can determine whether the initial index of the new image is accurate based on a larger model.

[0115] In some embodiments, the model size of the preset model is smaller than that of the large model, including but not limited to: the number of parameters of the preset model is less than that of the large model, and the number of network layers of the preset model is less than that of the large model.

[0116] For example, the number of parameters in a preset model can be less than or equal to 10 million, while the number of parameters in a large model can be greater than 10 million.

[0117] In some embodiments, after obtaining the second image and its initial index, the terminal device can input the second image and its initial index into a large model to instruct the large model via a prompt word to determine whether the initial index of the second image is accurate. Based on this, the terminal device can obtain the judgment result output by the large model and determine whether the initial index of the second image is accurate based on the judgment result output by the large model. If the terminal device determines that the initial index of the second image is inaccurate, it can instruct the large model to generate an index for the second image via a prompt word and use the index output by the large model as the target index to replace the initial index of the second image.

[0118] In some embodiments, after obtaining the second image and its initial index, the terminal device can further input the second image into a large model to instruct the large model to generate an index for the second image via a prompt. After obtaining the index output by the large model, the terminal device can determine whether the index output by the large model is the same as the initial index of the second image. If they are the same, the initial index of the second image is used as the target index; otherwise, the index output by the large model is used as the target index to replace the initial index of the second image.

[0119] In some embodiments, if the terminal device determines that the initial index of the second image is inaccurate, it may also delete the initial index of the second image to reduce the probability of establishing an incorrect index mapping relationship.

[0120] In this embodiment of the disclosure, when the terminal device is in an idle state, it determines whether the initial index of the second image in the local image library is accurate based on a large model. If it determines that the initial index of the second image is inaccurate, it generates a target index for the second image or deletes the initial index of the second image using the large model. In this way, the accuracy of the index mapping relationship can be improved, thereby improving the accuracy of the target image determined based on the index mapping relationship.

[0121] In some embodiments, the target index of the second image includes at least one of the following: the target category index of the second image; the target content index of the second image.

[0122] In some embodiments, the target category index of the second image is used to indicate the category of the second image. For example, the target category index of the second image is used to indicate that the second image is an image of an animal, an image of a plant, or an image of a building.

[0123] In some embodiments, the target content index of the second image is used to indicate the content of the second image. For example, the target content index of the second image is used to indicate whether the second image includes animals, trees, grass, faces, human bodies, etc.

[0124] In some embodiments, where the target index includes a target category index and a target content index, the initial index of the second image also includes an initial category index and an initial content index.

[0125] In some embodiments, when the initial index of the second image is an initial category index, the terminal device can determine whether the initial category index of the second image is accurate based on the large model. If the initial category index of the second image is determined to be inaccurate, the terminal device can determine the category index of the second image using the large model. Then, the terminal device can replace the initial category index of the second image with the category index output by the large model as the target category index. Alternatively, the terminal device can determine whether a category index output by the large model exists in the target category index library. If an image category index output by the large model exists in the target category index library, the initial category index of the second image is replaced with the category index output by the large model. If a category index output by the large model does not exist in the target category index library, the initial category index of the second image is deleted, and no target category index is generated for the second image.

[0126] In some embodiments, when the target index of the second image is the initial content index, the terminal device can determine whether the initial content index of the second image is accurate based on the large model, and if it is determined that the initial content index of the second image is inaccurate, the newly generated content index based on the large model can be used as the target content index of the second image.

[0127] For example, Figure 6 This is a schematic diagram illustrating the structure of a search framework according to another exemplary embodiment. For example... Figure 6 As shown, the initial index includes the initial category index stored in the initial category index library 601 and the initial content index stored in the initial content index library 602. The preset model may include a classification model 505 and a content generation model 506. Based on this, when a second image 603 is added to this map library, the terminal device, while in an idle state, can determine the initial category index of the second image 603 based on the classification model 505 and store the initial category index of the second image 603 in the initial category index library 601. The terminal device can also, while in an idle state, determine the initial content index of the second image 603 based on the content generation model 506 and store the initial content index of the second image 603 in the initial content index library 602.

[0128] In addition, the terminal device can also encode the second image 603 based on the image coding model 507 to obtain the feature vector of the second image, and store the feature vector of the second image 603 in the vector library 503.

[0129] After storing the initial category index of the second image 603 in the initial category index library 601 and the initial content index of the second image 603 in the initial content index library 602, the terminal device can, while in an idle state, determine, based on the large model 508, whether the initial category index and the initial content index of the second image 603 are accurate. If the initial category index of the second image 603 is accurate, the terminal device can store the initial category index of the second image 603 as the target category index of the second image in the target category index library 501. If the initial category index of the second image 603 is inaccurate, the terminal device can generate the target category index of the second image 603 based on the large model 508 and store it in the target category index library 501. Similarly, if the initial content index of the second image 603 is accurate, the terminal device can store the initial content index of the second image 603 as the target content index of the second image in the target content index library 502. If the initial content index of the second image 603 is inaccurate, the terminal device can generate a target content index of the second image 603 based on the large model 508 and store it in the target content index library 502.

[0130] In this embodiment of the disclosure, by establishing category mapping relationships and content mapping relationships for each image in the local image library, the terminal device can determine the target image from the local image library based on the target search terms in both the category and content dimensions. This improves the comprehensiveness of the target images determined from the local image library and reduces the probability of missing suitable images.

[0131] In some embodiments, the target index includes a feature vector, and the index mapping relationship includes a vector mapping relationship. The feature vector is obtained by extracting features from images in a local image library based on an image encoding model. The method further includes: in response to the terminal device being in an idle state, obtaining a first feature vector of historical search information based on a text encoding model; determining the image corresponding to the first feature vector in the vector mapping relationship; calculating a loss value based on the difference between the image corresponding to the first feature vector in the vector mapping relationship and the image corresponding to the historical search information in the information mapping relationship; and updating the text encoding model based on the loss value.

[0132] Understandably, the target index of an image in the local image library within the index mapping relationship can be a feature vector of that image. This feature vector is obtained by extracting features from the image in the local image library using an image encoding model. When the target index in the index mapping relationship includes a feature vector, the index mapping relationship can include a vector mapping relationship. A vector mapping relationship can be understood as a mapping relationship between a feature vector and an image in the local image library. Based on this, when the terminal device is idle, it can train a text encoding model based on historical search information included in the information mapping relationship and the corresponding images. The training process includes: the terminal device acquiring historical search information from the information mapping relationship and extracting features from the historical search information using a text encoding model to obtain a first feature vector. Then, the terminal device can determine the image corresponding to the first feature vector in the local image library based on the vector mapping relationship and acquire the image corresponding to the historical search information in the information mapping relationship. Finally, the terminal device can determine a loss value based on the difference between the image corresponding to the first feature vector in the vector mapping relationship and the image corresponding to the historical search information in the information mapping relationship. After obtaining the loss value, the terminal device can adjust the model parameters of the text encoding model based on the obtained loss value to update the text encoding model.

[0133] In some embodiments, reference Figure 5 and Figure 6 The terminal device determines the feature vectors of the images in the local image library based on the image coding model 507, and establishes a vector mapping relationship between the feature vectors and the corresponding images and stores it in the feature vector library 503.

[0134] In some embodiments, the image coding model belongs to one of the preset models described above.

[0135] For example, continue to refer to Figure 5 The text encoding model can include a text encoder 509 and an adaptive network module. Based on this, after obtaining the loss value, the terminal device can adjust the parameters of the adaptive network module.

[0136] In some embodiments, the structure of the adaptive network module includes, but is not limited to, a fully connected layer and / or a multi-layer perceptron layer.

[0137] It should be noted that the number of fully connected layers can be one or more, and this disclosure does not limit the number of layers.

[0138] In this embodiment, the terminal device determines which images in the local map library correspond to a search query based on a vector mapping relationship. This determination is made by the feature vector obtained by encoding the search query using an encoding model. The images corresponding to historical search queries in the information mapping relationship are those determined by a large model and those viewed by the user. Therefore, training the text encoding model based on historical search queries and their corresponding images in the information mapping relationship allows the feature vectors extracted from the search query to better match user needs. Consequently, the images determined from the local map library based on the feature vectors of the search query through the vector mapping relationship better meet user requirements.

[0139] In some embodiments, the method further includes: determining the target search information as new historical search information; when the terminal device is idle, determining a first image from the target image based on the new historical search information using a large model, the first image including images viewed during the display of the target image, and / or images in the target image whose relevance to the new historical search information is greater than a relevance threshold; and adding a mapping relationship between the new historical search information and the first image in the information mapping relationship.

[0140] Understandably, the terminal device can identify the target search information as new historical search information. Then, while idle, the terminal device can input the new historical search information and the target image into a large model to obtain the first image output by the large model. The first image output by the large model includes the target image viewed by the user during the target image display process, and / or images whose relevance to the new historical search information is greater than or equal to a relevance threshold. After obtaining the first image, the terminal device can establish a mapping relationship between the new historical search information and the first image, and add this mapping relationship to the information mapping relationship.

[0141] In some embodiments, if the target search information is not present in the historical search information included in the information mapping relationship, the terminal device may identify the target search information as new historical search information.

[0142] In some embodiments, adding a mapping relationship between new historical search information and a first image to the information mapping relationship includes: after obtaining the mapping relationship between the new historical search information and the first image, the terminal device can further determine whether there is any historical target search information in the historical search information included in the information mapping relationship that is the same as the target search information. If there is no target historical search information in the historical search information included in the information mapping relationship, the terminal device can add the mapping relationship between the new historical search information and the first image to the information mapping relationship. If there is target historical search information in the historical search information included in the information mapping relationship, the terminal device can update the image corresponding to the target historical search information in the information mapping relationship to the first image.

[0143] In some embodiments, the terminal device can also detect user viewing operations on the target image during the display of the target image. If the terminal device detects a user viewing operation on the first image in the target image, it can arrange the first image in a prominent position and mark the first image when inputting the target image into the large model.

[0144] For example, suppose the target images include n images [pic1, pic2, pic3, ..., pcn], and during the display of the target images, the user views target images pic2 and pic3. When the terminal device inputs the target images into the large model, the arrangement order of the multiple target images is [pic2, pic3, pic1, ..., pcn]. The arrangement order of the multiple target images input into the large model by the terminal device can also be [pic2, pic3, pic1, pic2, pic3, ..., pcn].

[0145] In this embodiment of the disclosure, the terminal device updates the information mapping relationship based on the target search information and the target image corresponding to the target search information, which can make the information mapping relationship richer.

[0146] The image search method provided in the above embodiments will be further described below with a specific example. The method includes:

[0147] The first step involves the terminal device, while in an idle state, determining the initial category index, initial content index, and feature vector for each image in the local image library based on a pre-defined model. This results in initial category mapping relationships, initial content mapping relationships, and initial vector mapping relationships, respectively. Since the number of parameters and the scale of the pre-defined model are smaller than those of a larger model, constructing the initial category mapping relationships, initial content mapping relationships, and initial vector mapping relationships based on the pre-defined model ensures that users can perform normal real-time search processes.

[0148] The second step is that, when the terminal device is in an idle state, it can use multimodal visual language models (VLM) to determine whether the initial category index of the images in the local image library in the initial category mapping relationship is accurate, and whether the initial content index of the images in the local image library in the initial content mapping relationship is accurate.

[0149] For example, taking a second image from the local image library as an example, regarding the initial category mapping relationship, when the terminal device is in an idle state, it can input the second image and its initial category index into the VLM, and encapsulate this input with the instruction prompt P1 so that the VLM can determine whether the initial category index of the second image is accurate. If accurate, the initial category index of the second image is used as the target category index; if inaccurate, the target category index of the second image is determined by the VLM, and it is checked whether the initial category index of the second image determined by the VLM exists in the category list (the category included in the category mapping relationship). If it exists, the initial category index of the second image is updated to the target category index output by the VLM; if it does not exist, the initial category index of the second image is deleted. Afterwards, the terminal device can establish a mapping relationship between the target category index and the image in the local image library.

[0150] For the initial content index, when the terminal device is in an idle state, it can input the second image and its initial content index into the VLM, and encapsulate it with the instruction prompt word P2 so that the VLM can determine whether the initial content index of the second image is correct. If it is correct, the initial content index of the second image is used as the target content index; if it is inaccurate, the target content index of the second image is determined based on the VLM, and a mapping relationship is established between the target content index and the image in the local image library.

[0151] The second step aims to correct the initial category index and initial content index of the second image determined based on the preset model using a large model (VLM). Because the large model's calculation results are significantly more accurate than the small model (preset model), this makes the category and content mapping relationships more accurate, thereby improving search accuracy. Since determining the target category and content indices of the second image using the large model is very time-consuming, establishing the category and content mapping relationships using the small model first ensures the correct operation of the image search function on the terminal device, and the subsequent correction using the large model guarantees more accurate search results.

[0152] Third, the terminal device records the search information entered by the user at a historical time (historical search information). For example, the terminal device can record the search query and a sequence list of images [pic1, pic2, pic3, ..., pcn] retrieved based on the search query. Additionally, the terminal device can record the user's clicks on images during the image display process. The index [clk1, clk2, ..., clkm] represents the first image clicked by the user. The terminal device can concatenate the user's click results with the search results. If clk and pic contain duplicate data, only the first occurrence is saved. The resulting initial information mapping relationship is the mapping relationship between the query and [clk1, clk2, ..., clkm, pic1, pic2, ..., pcn].

[0153] In the fourth step, when the terminal device is in an idle state, it inputs the Query and [clk1, clk2, ..., clkn, pic1, pic2, ..., picn] into the VLM and encapsulates them with the instruction prompt P3. At this point, the terminal device can obtain the first image [clk'1, clk'2, ..., clk't, pic'1, pic'2, ..., pic'k] input to the VLM. The instruction prompt P3 needs to guide the VLM to correct the current search result order, remove incorrect and useless search results, and update it with correct and ordered search results that also take into account the user's click selection. The search results corresponding to the Query in the initial mapping relationship are replaced with the new search results from the VLM to obtain the information mapping relationship.

[0154] The fifth step involves checking whether the terminal device's query information mapping relationship contains historical target search information that matches the user's input target search information Query1. If it does, the image (target image) corresponding to the historical target search information is displayed. This saves time on text-image matching in real-time search and allows for more accurate results after VLM correction.

[0155] The sixth step involves training an adaptive network module for the encoding model using historical search information and corresponding images from the information mapping relationship. This improves the model's performance and achieves better vector search. The adaptive network module can be a simple single-layer fully connected network or a multilayer perceptron (MLP). Its advantage lies in its ability to be trained on the edge without updating the parameters of the entire text encoder model. Furthermore, since the image encoder parameters of the vector encoding model remain unchanged, the vector library does not need to be updated, saving time and computational resources.

[0156] refer to Figure 7 , Figure 7 This is a block diagram illustrating an image search device according to an exemplary embodiment. Figure 7 As shown, the image search device 700 includes: a first acquisition module 701, configured to acquire target search information input by a user; a first determination module 702, configured to determine the target image corresponding to the target search information in the local map library based on a preset mapping relationship; the preset mapping relationship includes an information mapping relationship and / or an index mapping relationship, the information mapping relationship includes the mapping relationship between historical search information and images in the local map library, the index mapping relationship includes the mapping relationship between the target index of an image in the local map library and the image in the local map library, the information mapping relationship and the target index are determined by the terminal device based on a large model when it is in an idle state; and a display module 703, configured to display the target image.

[0157] In some embodiments, the number of target images is multiple; the display module 703 is configured to: determine the arrangement order of the multiple target images; display the multiple target images according to the determined arrangement order; wherein, the number of times the target image arranged in the first position on the screen has been viewed by the user in a historical time is greater than or equal to the number of times the target image arranged in the second position has been viewed by the user in a historical time, and the first position is located before the second position.

[0158] In some embodiments, the mapping relationship between historical search information and images in the local gallery includes the mapping relationship between historical search information and a first image, wherein the first image includes an image displayed on the screen and viewed by the user based on historical search information at a historical time, and / or an image whose relevance to historical search information is greater than or equal to a relevance threshold; the first determining module 702 is configured to: determine whether there is historical target search information that is the same as the target search information in the historical search information included in the information mapping relationship; in response to the existence of historical target search information in the historical search information included in the information mapping relationship, determine the first image corresponding to the historical target search information in the information mapping relationship as the target image.

[0159] In some embodiments, the first determining module 702 is further configured to: in response to the absence of historical target search information in the historical search information included in the information mapping relationship, determine a first index based on the target search information; determine the image corresponding to the first index in the local map library based on the index mapping relationship; and determine the image corresponding to the first index in the local map library as the target image.

[0160] In some embodiments, the apparatus further includes: a second determining module configured to determine, when the terminal device is in an idle state, whether the initial index of the second image in the local image library is accurate based on a large model, wherein the initial index is determined based on a preset model and the model size of the preset model is smaller than that of the large model; a third determining module configured to determine the initial index as the target index of the second image in response to the initial index of the second image being accurate; a fourth determining module configured to determine the target index of the second image based on a large model in response to the initial index of the second image being inaccurate; and an establishing module configured to establish a mapping relationship between the second image and the target index of the second image to obtain an index mapping relationship.

[0161] In some embodiments, the target index of the second image includes at least one of the following: the target category index of the second image; the target content index of the second image.

[0162] In some embodiments, the target index includes a feature vector, the index mapping relationship includes a vector mapping relationship, and the feature vector is obtained by extracting features from images in a local image library based on an image encoding model; the device further includes: a second acquisition module configured to acquire a first feature vector of historical search information based on a text encoding model in response to the terminal device being in an idle state; a fifth determination module configured to determine the image corresponding to the first feature vector in the vector mapping relationship; a calculation module configured to calculate a loss value based on the difference between the image corresponding to the first feature vector in the vector mapping relationship and the image corresponding to the historical search information in the information mapping relationship; and an update module configured to update the text encoding model based on the loss value.

[0163] In some embodiments, the apparatus further includes: a sixth determining module configured to determine the target search information as new historical search information; a seventh determining module configured to, when the terminal device is in an idle state, determine a first image from the target image based on the new historical search information using a large model, the first image including images viewed during the display of the target image, and / or images in the target image whose relevance to the new historical search information is greater than or equal to a relevance threshold; and an adding module configured to add a mapping relationship between the new historical search information and the first image in the information mapping relationship.

[0164] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0165] Figure 8This is a structural block diagram illustrating a terminal device 800 according to an exemplary embodiment. For example, the terminal device 800 may be a mobile phone, tablet computer, smartwatch, in-vehicle device, or other communication device.

[0166] Reference Figure 8 The terminal device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input / output (I / O) interface 812, sensor component 814, and communication component 816.

[0167] Processing component 802 typically controls the overall operation of terminal device 800, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0168] Memory 804 is configured to store various types of data to support operation on terminal device 800. Examples of such data include at least one of the following: instructions for any application or method operating on terminal device 800, contact data, phonebook data, messages, pictures, and videos. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0169] Power supply component 806 provides power to various components of terminal device 800. Power supply component 806 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to terminal device 800.

[0170] Multimedia component 808 includes a screen that provides an output interface between terminal device 800 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When terminal device 800 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0171] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when terminal device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0172] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0173] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of terminal device 800. For example, sensor assembly 814 can detect the on / off state of terminal device 800, the relative positioning of components such as the display and keypad of terminal device 800, changes in position of terminal device 800 or one of its components, the presence or absence of user contact with terminal device 800, orientation or acceleration / deceleration of terminal device 800, and temperature changes of terminal device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.

[0174] Communication component 816 is configured to facilitate wired or wireless communication between terminal device 800 and other devices. Terminal device 800 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.

[0175] In an exemplary embodiment, the terminal device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0176] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including executable instructions or a computer program, which can be executed by the processor 820 of the terminal device 800 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0177] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a terminal device, enables the terminal device to perform any of the image search methods described in the embodiments of this disclosure. For example, the method includes:

[0178] Obtain the target search information input by the user; determine the target image corresponding to the target search information in the local map library based on the preset mapping relationship; the preset mapping relationship includes information mapping relationship and / or index mapping relationship, the information mapping relationship includes the mapping relationship between historical search information and images in the local map library, the index mapping relationship includes the mapping relationship between the target index of the image in the local map library and the image in the local map library, the information mapping relationship and the target index are determined by the terminal device based on the large model when it is in an idle state; display the target image.

[0179] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the image search methods described in this disclosure.

[0180] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0181] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. An image search method, characterized in that, The method includes: Obtain the user's target search information; Based on a preset mapping relationship, the target image corresponding to the target search information in this map library is determined; the preset mapping relationship includes an information mapping relationship and / or an index mapping relationship, the information mapping relationship includes the mapping relationship between historical search information and images in the local map library, and the index mapping relationship includes the mapping relationship between the target index of the image in the local map library and the image in the local map library. The information mapping relationship and the target index are determined by the terminal device based on a large model when it is in an idle state. Display the target image.

2. The method according to claim 1, characterized in that, The number of target images is multiple; The display of the target image includes: Determine the arrangement order of multiple target images; The multiple target images are displayed in the determined arrangement order; The target image in the first position on the screen is viewed by the user more or less in the historical time than the target image in the second position is viewed by the user more or less in the historical time, and the first position is located before the second position.

3. The method according to claim 1, characterized in that, The mapping relationship between historical search information and images in the local image library includes the mapping relationship between historical search information and a first image, wherein the first image includes images that were displayed on the screen and viewed by the user based on the historical search information at a historical time, and / or images whose relevance to the historical search information is greater than or equal to a relevance threshold; The step of determining the target image corresponding to the target search information in this map database based on a preset mapping relationship includes: Determine whether there is any historical target search information that is identical to the target search information in the historical search information included in the information mapping relationship; In response to the existence of the historical target search information in the historical search information, the first image corresponding to the historical target search information in the information mapping relationship is determined as the target image.

4. The method according to claim 3, characterized in that, The step of determining the target image corresponding to the target search information in this map database based on a preset mapping relationship further includes: In response to the absence of the historical target search information in the historical search information, a first index is determined based on the target search information; Based on the index mapping relationship, determine the image corresponding to the first index in the local image library; The image corresponding to the first index in the local image library is determined as the target image.

5. The method according to claim 4, characterized in that, The method further includes: When the terminal device is in an idle state, the initial index of the second image in the local image library is determined based on the large model to determine whether it is accurate. The initial index is determined based on a preset model, and the model size of the preset model is smaller than that of the large model. In response to the accuracy of the initial index of the second image, the initial index is determined as the target index of the second image; In response to the inaccuracy of the initial index of the second image, the target index of the second image is determined based on the large model; Establish a mapping relationship between the second image and the target index of the second image to obtain the index mapping relationship.

6. The method according to claim 5, characterized in that, The target index of the second image includes at least one of the following: The target category index of the second image; The target content index of the second image.

7. The method according to any one of claims 1 to 6, characterized in that, The target index includes a feature vector, the index mapping relationship includes a vector mapping relationship, and the feature vector is obtained by extracting features from images in the local image library based on an image coding model. The method further includes: In response to the terminal device being in an idle state, the first feature vector of the historical search information is obtained based on a text encoding model; Determine the image corresponding to the first feature vector in the vector mapping relationship; The loss value is calculated based on the difference between the image corresponding to the first feature vector in the vector mapping relationship and the image corresponding to the historical search information in the information mapping relationship; The text encoding model is updated based on the loss value.

8. The method according to any one of claims 1 to 6, characterized in that, The method further includes: The target search information is identified as new historical search information; When the terminal device is idle, based on the new historical search information, a first image is determined from the target image using the large model. The first image includes images that have been viewed during the display of the target image, and / or images in the target image whose relevance to the new historical search information is greater than or equal to a relevance threshold. In the information mapping relationship, a mapping relationship between the new historical search information and the first image is added.

9. An image search device, characterized in that, The device includes: The first acquisition module is configured to acquire the target search information input by the user. The first determining module is configured to determine the target image corresponding to the target search information in the local map library based on a preset mapping relationship; the preset mapping relationship includes an information mapping relationship and / or an index mapping relationship, the information mapping relationship includes the mapping relationship between historical search information and images in the local map library, and the index mapping relationship includes the mapping relationship between the target index of the image in the local map library and the image in the local map library; the information mapping relationship and the target index are determined by the terminal device based on a large model when it is in an idle state. The display module is configured to display the target image.

10. The apparatus according to claim 9, characterized in that, The number of target images is multiple; The display module is configured as follows: Determine the arrangement order of multiple target images; The plurality of target images are displayed in the determined arrangement order; wherein the number of times the target image in the first position on the screen has been viewed by the user in the historical time is greater than or equal to the number of times the target image in the second position has been viewed by the user in the historical time, and the first position is located before the second position.

11. The apparatus according to claim 9, characterized in that, The mapping relationship between historical search information and images in the local image library includes the mapping relationship between historical search information and a first image, wherein the first image includes images that were displayed on the screen and viewed by the user based on the historical search information at a historical time, and / or images whose relevance to the historical search information is greater than or equal to a relevance threshold; The first determining module is configured as follows: Determine whether there is any historical target search information that is identical to the target search information in the historical search information included in the information mapping relationship; In response to the existence of the historical target search information in the historical search information included in the information mapping relationship, the first image corresponding to the historical target search information in the information mapping relationship is determined as the target image.

12. The apparatus according to claim 11, characterized in that, The first determining module is further configured to: In response to the absence of the historical target search information in the historical search information included in the information mapping relationship, a first index is determined based on the target search information; Based on the index mapping relationship, determine the image corresponding to the first index in the local image library; The image corresponding to the first index in the local image library is determined as the target image.

13. A terminal device, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 8.

14. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 8.