A service processing method and device of a session message, an equipment and a storage medium

CN122964337APending Publication Date: 2026-10-23GUANGZHOU TENCENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510481337.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

这种实现方式虽能够提高图片搜索的适用范围,但在实际执行时存在有较大的性能开销,且容易出现索引重复或者遗漏的问题,导致针对图片类型的会话消息的搜索体验较差,应用成本较高

Benefits of technology

[0062]本申请实施例至少包括以下有益效果:本申请提供一种会话消息的业务处理方法、装置、设备及存储介质,本申请对目标会话中出现的第一图片进行图片识别进程的检测,如果确定图片识别进程的检测结果表征第一图片已进行过图片识别,则直接获取已有的第一图片对应的图片识别结果,无需再对其进行重复的图片识别,能够降低需要处理的数据量,减少计算资源的消耗和应用成本;根据图片识别结果中的内容信息,可以生成第一图片在目标会话中的检索索引,然后将检索索引存储到消息数据库中,并在检索索引存储成功后更新第一图片在目标会话中的索引状态标识,基于索引状态标识,可以准确地记录第一图片在目标会话中的检索索引是否顺利地完成建立,方便后续查缺补漏,降低检索索引重复建立或者遗漏的概率,有利于提高会话应用中图片搜索的实用性,改善会话应用的使用体验。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122964337A_ABST
    Figure CN122964337A_ABST
Patent Text Reader

Abstract

The application discloses a kind of service processing methods, devices and equipment of conversation message, apparatus and storage medium, the detection of the picture identification process of the first picture appearing in target conversation, if it is determined that the first picture has been identified, directly obtain the picture identification result corresponding to the existing first picture, without needing to repeat the picture identification, can reduce the data amount that needs to be handled, reduce the consumption of computing resources and application cost;According to the content information in the picture identification result, generate the search index of the first picture in the target conversation, then store the search index into the message database, and update the index state identifier of the first picture in the target conversation after the storage of search index is successful, facilitate subsequent missing link, reduce the probability of repeated establishment or omission of search index, it is favorable to improve the practicability of picture search in conversation application, improve the use experience of conversation application.The present application can be widely applied in the field of conversation application technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of session application technology, and in particular to a session message service processing method, apparatus, device and storage medium. Background Technology

[0002] With the rapid development of mobile internet and instant messaging (IM) technology, conversational applications have become important tools for daily communication and office work. Currently, most conversational applications support multiple message formats such as text, voice, images, and video. Based on these applications, efficient information transmission can be achieved through one-on-one chat or group communication. Image search is a specific requirement in conversational applications, primarily used to find relevant images in historical conversation records. Compared to traditional text content search, image search presents certain challenges. Most conversational applications only support searching based on image filenames, annotations, etc., severely limiting their use cases.

[0003] In related technologies, some session applications perform image recognition on images in session messages to extract text information and build image retrieval indexes based on this text information. While this approach can broaden the applicability of image search, it incurs significant performance overhead in practice and is prone to issues such as index duplication or omissions, resulting in a poor search experience for image-based session messages and high application costs. Summary of the Invention

[0004] This application provides a business processing method, apparatus, device, and storage medium for session messages, which can reduce the consumption of computing resources and application costs, and reduce the probability of duplicate or missing search indexes.

[0005] One aspect of this application provides a service processing method for session messages, the method comprising:

[0006] The image recognition process is detected for the first image appearing in the target session;

[0007] In response to the detection result of the image recognition process indicating that the first image has been recognized, the existing image recognition result corresponding to the first image is obtained; wherein, the image recognition result includes content information corresponding to the first image;

[0008] Based on the content information, a retrieval index for the first image in the target session is generated;

[0009] The retrieval index is stored in the message database, and the index status identifier of the first image in the target session is updated after the retrieval index is successfully stored; wherein, the index status identifier is used to characterize the completion status of the retrieval index of the first image in the target session.

[0010] On the other hand, embodiments of this application provide a session message service processing apparatus, the apparatus comprising:

[0011] The detection unit is used to detect the image recognition process of the first image appearing in the target session;

[0012] The acquisition unit is configured to, in response to the detection result of the image recognition process indicating that the first image has been recognized, acquire the existing image recognition result corresponding to the first image; wherein, the image recognition result includes content information corresponding to the first image;

[0013] The generation unit is configured to generate a retrieval index for the first image in the target session based on the content information.

[0014] An update unit is configured to store the retrieval index into a message database, and update the index status identifier of the first image in the target session after the retrieval index is successfully stored; wherein the index status identifier is used to characterize the completion status of the retrieval index of the first image in the target session.

[0015] Optionally, in some embodiments, the detection unit is specifically used for:

[0016] Detect the download status of the first image;

[0017] If the first image has been downloaded, the first image is matched in a pre-established recognition result database to obtain the detection result of the image recognition process; wherein, the recognition result database stores the image recognition results corresponding to the second image that appears in each session;

[0018] If the first image has not been completely downloaded, the detection result of the image recognition process is determined to be that no image recognition has been performed.

[0019] Optionally, in some embodiments, the detection unit is specifically used for:

[0020] Determine the first hash value of the first image and the second hash value of each of the second images;

[0021] The first hash value and each of the second hash values ​​are compared;

[0022] If any of the second hash values ​​is the same as the first hash value, the detection result of the image recognition process is determined to be that image recognition has been performed;

[0023] If all of the second hash values ​​are different from the first hash value, the detection result of the image recognition process is determined to be that no image recognition has been performed.

[0024] Optionally, in some embodiments, the detection unit is specifically used for:

[0025] In response to an object's viewing operation of the first image, a material image corresponding to the first image is displayed to the object in the target interface; wherein, the material image is a thumbnail of the first image or the original image of the first image;

[0026] The data volume and loading time of the source images are detected.

[0027] Calculate the ratio of the data volume to the loading time to obtain the display metric value;

[0028] If the displayed indicator value is greater than or equal to the first preset threshold, it is determined that the first image has been downloaded.

[0029] If the displayed indicator value is less than the first preset threshold, it is determined that the first image has not been completely downloaded.

[0030] Optionally, in some embodiments, the service processing apparatus further includes an identification unit, which is specifically used for:

[0031] In response to the detection result of the image recognition process indicating that the first image has not undergone image recognition, an asynchronous sub-thread is established;

[0032] The first image is recognized by the asynchronous sub-thread to obtain the image recognition result corresponding to the first image.

[0033] When the asynchronous sub-thread completes its task processing, it stores the image recognition result corresponding to the first image into a pre-established recognition result database.

[0034] Optionally, in some embodiments, the identification unit is specifically used for:

[0035] Edge detection is performed on the first image to determine the text regions within the first image;

[0036] The first image is cropped based on the text area to obtain the key image;

[0037] Optical character recognition is performed on the key image to obtain the image recognition result corresponding to the first image.

[0038] Optionally, in some embodiments, the service processing apparatus further includes a supplementary recording unit, which is specifically used for:

[0039] The index status identifiers stored in the recognition result database are queried to determine the target image; wherein, the target image is the image whose corresponding retrieval index is in an incomplete state;

[0040] The target images are divided into several batches of target image sets;

[0041] Based on the image recognition results stored in the recognition result database, the retrieval index is added sequentially for each of the target image sets.

[0042] Optionally, in some embodiments, the generation unit is specifically used for:

[0043] The content information is segmented into words to obtain several words;

[0044] Filter each of the aforementioned words to obtain a number of content words;

[0045] Based on each of the aforementioned content terms, a retrieval index for the first image in the target session is generated.

[0046] Optionally, in some embodiments, the service processing apparatus further includes a replacement unit, which is specifically used for:

[0047] The frequency of occurrence of each of the content words in the search index is detected, and the content words whose frequency of occurrence is greater than a second preset threshold are identified as target words;

[0048] Different identifier fields are assigned to each target word, and the association between the target word and the identifier field is stored; wherein the number of characters in the identifier field is less than the number of characters in the target word;

[0049] The target word is replaced by the identifier field to obtain the updated search index.

[0050] Optionally, in some embodiments, the service processing apparatus further includes a feedback unit, which is specifically used for:

[0051] In response to an object's search operation on an image in the target session, obtain the search information input by the object;

[0052] In the retrieval index corresponding to the target session, determine the target index that matches the search information;

[0053] Based on the image corresponding to the target index, the search results are returned to the object.

[0054] Optionally, in some embodiments, the feedback unit is specifically used for:

[0055] Determine the similarity between each of the retrieval indexes and the search information corresponding to the target session;

[0056] The search indexes with a similarity greater than a preset similarity threshold are identified as target indexes.

[0057] On the other hand, embodiments of this application provide an electronic device, including a processor and a memory;

[0058] The memory is used to store computer programs;

[0059] The processor executes the computer program to implement the aforementioned session message service processing method.

[0060] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program, which is executed by a processor to implement the aforementioned session message service processing method.

[0061] On the other hand, embodiments of this application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium. The processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform the aforementioned business processing method for implementing session messages.

[0062] The embodiments of this application include at least the following beneficial effects: This application provides a business processing method, apparatus, device, and storage medium for session messages. This application detects the image recognition process of a first image appearing in a target session. If it is determined that the detection result of the image recognition process indicates that the first image has already undergone image recognition, the existing image recognition result corresponding to the first image is directly obtained, eliminating the need for repeated image recognition. This reduces the amount of data to be processed, decreases the consumption of computing resources, and reduces application costs. Based on the content information in the image recognition result, a retrieval index of the first image in the target session can be generated. Then, the retrieval index is stored in the message database, and the index status identifier of the first image in the target session is updated after the retrieval index is successfully stored. Based on the index status identifier, it is possible to accurately record whether the retrieval index of the first image in the target session has been successfully established, facilitating subsequent review and correction, reducing the probability of repeated establishment or omission of the retrieval index, and improving the practicality of image search in session applications and enhancing the user experience of session applications. Attached Figure Description

[0063] The accompanying drawings are used to provide a further understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.

[0064] Figure 1 This is a schematic diagram of an embodiment provided in this application;

[0065] Figure 2 This is a schematic diagram of a terminal interface provided in this application embodiment when sending an image as a message to a session;

[0066] Figure 3 This is a system architecture diagram of a session message service processing method provided in the embodiments of this application.

[0067] Figure 4 This is a flowchart illustrating a session message service processing method provided in an embodiment of this application;

[0068] Figure 5 This is a schematic diagram of a receiving end displaying an image provided in an embodiment of this application;

[0069] Figure 6 This is a schematic diagram of a process for supplementing and retrieving an index provided in an embodiment of this application;

[0070] Figure 7 This is a schematic diagram illustrating a method for searching image messages in a target session, as provided in an embodiment of this application.

[0071] Figure 8 This is a schematic diagram illustrating the specific implementation flow of a session message service processing method provided in this application embodiment;

[0072] Figure 9 This is a storage representation of an identification result database provided in the embodiments of this application;

[0073] Figure 10 This is a timing flowchart of a session message service processing method provided in an embodiment of this application;

[0074] Figure 11 This is a timing flowchart of a supplementary retrieval index provided in an embodiment of this application;

[0075] Figure 12 This is a structural block diagram of a session message service processing device provided in the embodiments of this application;

[0076] Figure 13 This is a structural block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0077] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0078] It is understood that the terms “first,” “second,” etc., used in this application may be used to describe various concepts herein, but unless otherwise stated, these concepts are not limited by these terms. These terms are used only to distinguish one concept from another.

[0079] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.

[0080] With the rapid development of mobile internet and instant messaging (IM) technology, conversational applications have become an important tool for people's daily communication and office work. Currently, most conversational applications support multiple message formats such as text, voice, images, and video. Based on conversational applications, efficient information transmission can be achieved through one-on-one chat or group communication.

[0081] For example, in everyday social communication scenarios, people can send short text or voice messages using conversational applications, and easily take photos of food or scenery to send as image messages to friends. In internal corporate collaboration scenarios, departmental or project groups can be created within conversational applications, allowing relevant employees to join and facilitate centralized communication about task progress and sharing of project files. In customer service scenarios, intelligent chatbots can be built within conversational applications to handle common customer service questions (such as shoppers asking "What is the return process?") or to introduce product details and precautions to customers. In remote education scenarios, teachers can use conversational applications to conduct online lectures or answer questions, and to post important announcements (such as exam times). After lectures, students can discuss questions or submit assignments in the conversational application's chat groups. Of course, the application scenarios for conversational applications are not limited to the above types, and will not be elaborated upon here.

[0082] Understandably, current conversational applications, through diverse message formats and flexible communication methods, help people break through the limitations of time and space, enabling convenient real-time communication and improving the efficiency of information transmission.

[0083] As described earlier, in conversational applications, message types can be diverse; for example, there might be image messages. Please refer to... Figure 1 and Figure 2 , Figure 1 This illustration shows a schematic diagram provided in an embodiment of this application. Figure 2 This illustration shows a terminal interface diagram of sending an image as a message to a session, as provided in an embodiment of this application. Figure 2 In this context, the image sent to the session is... Figure 1 The image shown illustrates this process. Generally, the process from when an image is sent to when it is finally displayed in the session window on the terminal interface is as follows: After the sender clicks "send image," the image is transmitted to the server backend of the session application. Upon receiving the image, the server backend notifies the receiving client to download the corresponding image. The receiving client then downloads the image from the server backend and displays it in the session window on the terminal interface. Of course, the sender also displays the image in its local terminal interface's session window after sending it. This completes the display of image-type messages within the session.

[0084] Understandably, conversational applications send messages including image messages, often creating a need for image searches within the application's conversation history. Image search is a specific requirement, primarily used to find relevant images in historical conversation records. Compared to traditional text content search, image search faces inherent obstacles in content recognition and retrieval technologies. Unlike text data, image data is unstructured and does not inherently contain semantic information that can be directly retrieved. Traditional search engines rely on inverted indexes to quickly locate relevant content, a model that cannot be directly applied to image search. Most conversational applications currently only allow searches based on metadata such as image filename, sending time, and chat context. This reliance on external information has significant limitations. In practice, users may only remember the image's content but struggle to recall the filename or relevant context, leading to unsuccessful searches and significantly reducing the usability of the image search function, thus impacting the user experience of the conversational application.

[0085] For example, in a work group chat, when an employee needs to find a product design image sent by a colleague months ago, if the image wasn't explicitly named or described at the time, searching based solely on a vague memory of the timeframe could require manually sifting through hundreds of history records, causing considerable inconvenience. Similarly, in a friend's chat, someone might want to find a promotional photo of a tourist attraction sent during a travel plan discussion last year. However, due to the brevity of the relevant text information in the conversation, text-based search becomes completely ineffective. It's clear that current image search methods in chat applications have very limited use cases.

[0086] In related technologies, some conversational applications perform image recognition on images in conversation messages to extract text information and build an image retrieval index based on this text information. While this approach can broaden the applicability of image search, it incurs significant performance overhead in practice. This is because conversational applications serve a massive user base, generating a vast amount of conversation data. The number of image messages involved in daily conversations can reach hundreds of millions, requiring substantial computing resources for image recognition, resulting in high application costs. Furthermore, conversational applications run on terminal devices, and users may exit the application midway (e.g., due to power failure or other unforeseen circumstances). This can cause the image retrieval index building task to malfunction, leading to duplicate or missing indexes and a poor search experience for image-based conversation messages.

[0087] In view of this, this application provides a business processing method, apparatus, device, and storage medium for session messages. This application detects the image recognition process of a first image appearing in a target session. If the detection result indicates that the first image has already undergone image recognition, the existing image recognition result is directly obtained, eliminating the need for repeated image recognition. This reduces the amount of data to be processed, decreases computational resource consumption, and lowers application costs. Based on the content information in the image recognition result, a retrieval index for the first image in the target session can be generated. This retrieval index is then stored in a message database, and the index status identifier for the first image in the target session is updated after successful storage. Based on the index status identifier, the success of establishing the retrieval index for the first image in the target session can be accurately recorded, facilitating subsequent error correction and reducing the probability of duplicate or missing retrieval indexes. This improves the practicality of image search in session applications and enhances the user experience of session applications.

[0088] System architecture and scenario description used in the embodiments of this application

[0089] Please refer to Figure 3 , Figure 3 The diagram shows a system architecture diagram of a session message service processing method provided in an embodiment of this application, which includes a terminal device 340, an Internet 330, a gateway 320, a backend server 310, etc.

[0090] In this embodiment, the terminal device 340 may include various forms such as a desktop computer, laptop computer, PDA (personal digital assistant), mobile phone, vehicle terminal, home theater terminal, and dedicated terminal. Furthermore, it can be a single device or a collection of multiple devices. The terminal device 340 can communicate with the Internet 330 via wired or wireless means to exchange data.

[0091] A backend server 310 refers to a computer system that can provide certain services to terminal devices 340. Compared to ordinary terminal devices 340, backend servers 310 have higher requirements in terms of stability, security, and performance. A backend server 310 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines).

[0092] Gateway 320, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal device 340 to backend server 310 are forwarded to the corresponding backend server 310 via gateway 320. Messages sent from backend server 310 to terminal device 340 are also forwarded to the corresponding terminal device 340 via gateway 320.

[0093] The backend server 310 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0094] The session message service processing method provided in this application embodiment can be executed on the terminal device 340 side, or on the backend server 310 side, or the session message service processing can be implemented based on the data transmission between the terminal device 340 and the backend server 310. This application does not limit this.

[0095] Of course, it is understood that the implementation environment corresponding to the method in the embodiments of this application is not limited to that of the implementation environment. Figure 3 As shown, those skilled in the art can flexibly select the specific implementation environment according to actual needs, and this application does not impose any restrictions on this.

[0096] The session message service processing method provided in this application embodiment can be executed in various scenarios, and the following is an exemplary description of it.

[0097] (I) Corporate Office Scenarios

[0098] The method provided in this application embodiment can be applied in enterprise office scenarios.

[0099] In corporate office settings, conversational applications are frequently used. For example, daily internal meetings, project progress reports, and work summaries can be conducted through conversational applications, saving time and travel costs. Collaborative work between different departments, such as communication between marketing, sales, and R&D departments, can be accomplished through conversational applications, ensuring smooth information transmission. Moreover, when employees work from home or remotely, they can use conversational applications to maintain close contact with their teams and improve work efficiency.

[0100] The session message processing method provided in this embodiment can be applied in enterprise office scenarios. Using the method in this embodiment, image messages in session messages can be easily queried, which helps improve office efficiency and the convenience of information retrieval.

[0101] (II) Education and Training Scenarios

[0102] The method provided in this application embodiment can be applied in education and training scenarios.

[0103] In the education and training sector, conversational applications are gradually becoming an important medium for teacher-student interaction. Unlike traditional one-way teaching models, conversational applications build a more flexible knowledge transfer ecosystem through continuous asynchronous communication. Schools and training institutions use conversational applications to create dedicated learning spaces, where teachers can post teaching materials and assignment requirements at any time, and students can participate in discussions regardless of time or location. For example, when a teacher shares an interpretation of the imagery of a classical poem in an academic exchange group, students located in different regions can view it and express their opinions at any time, forming a deep dialogue that transcends classroom boundaries.

[0104] The business processing method for conversation messages provided in this application embodiment can be applied in education and training scenarios. By using the method in this application embodiment to perform structured indexing of images in conversation messages and transform them into precisely searchable knowledge nodes, the reuse efficiency of educational resources can be significantly improved.

[0105] Of course, it is understood that the methods in the embodiments of this application are not limited to the application scenarios given in the above examples. The methods in the embodiments of this application can also be applied in other scenarios, and this application does not impose any restrictions on them.

[0106] General Description of Embodiments in this Application

[0107] Please refer to Figure 4 , Figure 4 A flowchart illustrating a session message service processing method provided in an embodiment of this application is shown. Figure 4 As shown, a session message service processing method according to an embodiment of this application includes, but is not limited to, the following steps:

[0108] Step 410: Detect the image recognition process for the first image appearing in the target session;

[0109] Step 420: In response to the detection result of the image recognition process indicating that the first image has been recognized, obtain the existing image recognition result corresponding to the first image; wherein, the image recognition result contains the content information corresponding to the first image;

[0110] Step 430: Based on the content information, generate a retrieval index for the first image in the target session;

[0111] Step 440: Store the retrieval index in the message database, and update the index status identifier of the first image in the target session after the retrieval index is successfully stored; wherein, the index status identifier is used to characterize the completion status of the retrieval index of the first image in the target session.

[0112] This application provides a business processing method for conversational messages. This method can be applied to relevant conversational applications, and the specific type of conversational application is not limited in this application. For example, in some embodiments, the conversational application can be a social instant messaging software. These applications are generally centered around personal accounts, supporting one-on-one private chats and group communication. When processing conversational messages, they emphasize the real-time transmission of multimedia content and the fun of social interaction, such as supporting rich emoticons, short video sharing, and friend interaction. In some embodiments, the conversational application can be an enterprise-level collaborative office platform. These applications need to process a large number of professional messages deeply integrated with workflows, such as project task assignments, approval notifications, and schedule reminders. Their messaging system can be closely integrated with the enterprise's business system to achieve automated message routing and intelligent organization.

[0113] In some embodiments, conversational applications can also be embedded as sub-applications into other applications as components. For example, in a shopping application, a conversational sub-application can be integrated, which can float in the corner of the page when shoppers browse product pages. This allows shoppers to communicate directly with merchant customer service in real-time within the shopping application without needing to switch to a separate conversational application, improving communication efficiency and the shopping experience. Similarly, conversational sub-applications can be integrated into gaming applications. This allows players to communicate with teammates in real-time during gameplay, improving the accuracy and responsiveness of teamwork and enhancing the overall gaming experience.

[0114] It should be noted that the session message processing method in this application embodiment is mainly used to process session services related to image search. Therefore, for session applications using the method in this application embodiment, they need to at least have the function of sending and displaying image-type messages, and be able to provide the function of searching for image messages in the session record. For other functions, existing session applications can be referred to for implementation, and this application does not impose any restrictions on them.

[0115] In step 410, the image recognition process is detected for the first image appearing in the target session. Here, the target session refers to any session in the session application, which can be a one-to-one session, such as daily communication between two friends; or a multi-person session, such as a work group session within a company. Each target session corresponds to participating objects, which can be individuals, organizations, or intelligent robots, etc. In this embodiment, the number of objects involved in the target session is not limited; it can be any number of two or more. Any object in the target session can send session messages. Generally, these session messages are sorted according to the sending time to form session records, which are then displayed on the terminal devices used by each object.

[0116] Of course, it's understandable that due to the limited screen space of terminal devices, the displayed conversation history often only includes a portion of the conversation messages, and generally only the most recent ones. For past conversation messages, it may be necessary to search or browse the entire conversation history to find them. Therefore, in conversation applications, there is often a need to search for conversation messages.

[0117] In conversational messages, image messages frequently appear. Compared to text messages, images provide richer and more intuitive visual information. For example, product images sent by e-commerce customer service can effectively eliminate the information gap between buyers and sellers, significantly improving transaction efficiency; photos of injuries sent by injured individuals allow doctors to quickly understand the characteristics of the symptoms, which is more accurate and reliable than text descriptions. In this embodiment, an image appearing in the target conversation is designated as the first image. The first image can be any image in the target conversation, and this application does not limit the sending object or the specific image content. The business processing method for conversational messages in this embodiment mainly focuses on the search task of image messages in conversational messages, and related business optimizations have been performed. This embodiment uses the first image as an example for illustrative explanation. It is understood that similar processing logic can be used to process any image in the target conversation.

[0118] In step 410, the image recognition process of the first image is detected to determine whether the first image has already undergone image recognition. Image recognition here refers to identifying the content information based on an image. The detection result of the image recognition process can include two possibilities: either the first image has undergone image recognition, or the first image has not yet undergone image recognition.

[0119] In this embodiment, the image recognition result obtained by performing image recognition on the first image can subsequently help to retrieve the first image. However, if image recognition is performed every time the first image appears in each session, it will greatly increase the data processing volume of the session application, resulting in high costs. Considering that the various images transmitted in the session application may have the same characteristics, for example, a photo of a celebrity may be circulated in multiple fan group chats, and a product design drawing may be shared by multiple designers with relevant colleagues, this embodiment records the relevant information of the images that have appeared in each session after image recognition. For example, a recognition result database can be established to store the image recognition results and related information of each image.

[0120] For the first image in the target session, a database of recognition results can be used to match it against images that have already undergone image recognition. If an image that has already undergone image recognition is found to match the first image, it means that the first image has already been recognized. Otherwise, if no matching image is found, it means that the first image has not undergone image recognition.

[0121] It should be noted that in the embodiments of this application, the specific timing of detecting the image recognition process of the first image appearing in the target session can be flexibly set according to actual needs. For example, in some embodiments, the detection can begin at the time when the first image is sent to the target session; in some embodiments, the application may support the function of retraction, and the object can retract the first image after sending it to the target session within a certain period of time. The retracted first image will no longer be recorded in the session record, and there is no need to search for it. Therefore, for the first image, the detection can begin when its duration exceeds the retraction time after it has been sent to the target session.

[0122] In step 420, after obtaining the detection result of the image recognition process corresponding to the first image, the detection result can be analyzed. It is understandable that if the detection result of the image recognition process indicates that the first image has already undergone image recognition, it means that an image recognition result corresponding to the first image already exists. In this case, it is not necessary to repeat the additional image recognition operation on the first image; the existing image recognition result can be directly obtained and used.

[0123] In this embodiment, when it is detected that the first image has completed the image recognition process and there are available image recognition results, the existing results are directly reused instead of repeatedly executing the image recognition job. This avoids redundant recognition operations, reduces the load pressure on the server cluster, saves a significant amount of computing resources, and helps reduce the implementation cost of session applications. Obtaining existing image recognition results is more efficient than re-executing the image recognition task. Moreover, this effectively avoids the problem of recognition result drift (i.e., the results obtained from recognizing the same image may be inconsistent), and can effectively improve the business processing efficiency and consistency of session messages.

[0124] Specifically, in this embodiment of the application, the image recognition result may include content information corresponding to the image. Taking the first image as an example, for instance, in some scenarios, the first image may include text content, and the image recognition result may include information about the text content, such as... Figure 1As shown, if an image contains the text "Life is an attitude; only by daring to persevere can there be hope," then the image recognition result can be information about this text. In some scenarios, the image recognition result can be information describing or representing the content contained in the first image. For example, if the first image contains a coffee cup, a salesperson, a laptop, etc., the image recognition result could be information like "working in a coffee shop." Or, if the first image contains an image of an Eiffel Tower, the image recognition result could be the name of that tower. Of course, it is understood that the specific content of the image recognition result can be flexibly set according to actual needs, and this application does not impose any restrictions on this.

[0125] It should be noted that, in the embodiments of this application, the process of performing image recognition to obtain the corresponding image recognition result can select appropriate technical means according to the requirements for the image recognition result. For example, in some embodiments, optical character recognition technology can be used to perform image recognition, thereby extracting the text content in the image as the image recognition result. In some embodiments, machine learning models in the field of artificial intelligence (such as convolutional neural networks) can be used to perform image recognition to determine the scene information or main content information in the image and use them as the image recognition result.

[0126] In step 430, after obtaining the image recognition result corresponding to the first image, a retrieval index for the first image in the target session can be generated based on its content information. In this embodiment, the retrieval index is a structured data mapping established for image content, which transforms unstructured visual information (i.e., images) into a search entry point that can be efficiently queried. Thus, if there is a subsequent need to search for the first image, it can be quickly located in the target session based on the retrieval index.

[0127] In this embodiment, after obtaining the image recognition result corresponding to the first image, a specific indexing algorithm can be used to organize the content information in the image recognition result into a database structure that allows for rapid retrieval, thus obtaining a retrieval index. Generally, a retrieval index is an intermediate layer connecting the search intent (e.g., finding a photo of an invoice in a session) and the image content. Through pre-computation and optimized storage, it can optimize a linear search that originally required traversing all images into a near-instantaneous key-value query, thereby greatly reducing the time complexity of the search and facilitating quick location of the image to be found.

[0128] This application does not limit the specific implementation of the retrieval index, which can be flexibly established according to actual needs. For example, in some embodiments, an inverted index strategy can be used to generate the retrieval index. The inverted index establishes a mapping relationship between keywords and content, which can accurately match text content and is suitable for keyword search. In some embodiments, a vector index strategy can also be used to generate the retrieval index. For example, the content information can be encoded into a high-dimensional vector through a deep learning model, and semantic search can be achieved subsequently using vector similarity (such as cosine similarity). This application does not limit this approach.

[0129] In step 440, after obtaining the retrieval index of the first image in the target session, the retrieval index can be stored in the message database. In this embodiment, the message database can be a database for storing, managing, and retrieving session messages, and this application does not limit its specific implementation.

[0130] It should be noted that, in this embodiment of the application, the execution status of the task can be detected during the process of storing the retrieval index into the message database. Once the retrieval index is successfully stored, the index status identifier of the first image in the target session can be updated. In this embodiment, the index status identifier is used to characterize the completion status of the retrieval index for the first image. When the retrieval index is successfully generated and stored in the message database, it indicates that the retrieval index has been successfully established and is in a completed state; when the retrieval index is not generated normally or is not successfully stored in the message database, it indicates that the retrieval index has not been successfully established and is in an incomplete state.

[0131] In this application embodiment, the specific content of the index status identifier and its corresponding status category can be set according to actual needs. For example, in some embodiments, the index status identifier can be represented by a string, such as including two status categories: "true" and "false", where "true" indicates that the index retrieval is in a completed state and "false" indicates that the index retrieval is in an incomplete state; in some embodiments, the index status identifier can be represented by a numerical value, such as including two status categories: "1" and "0", where "1" indicates that the index retrieval is in a completed state and "0" indicates that the index retrieval is in an incomplete state. This application does not impose any restrictions on this.

[0132] It is understood that, in this embodiment of the application, recording the completion status of the retrieval index through the index status identifier can efficiently determine whether the retrieval index has been successfully established and can be used normally in subsequent image search tasks. Thus, when an error occurs in the execution of the task of establishing the image retrieval index, the relevant error information can be obtained based on the index status identifier, facilitating the identification and correction of any omissions.

[0133] Specifically, in this embodiment, for each image's retrieval index in the session, an index status identifier is established to indicate whether the retrieval index for the image has been successfully established and stored in the message database. Under normal circumstances, the retrieval index for the image can be successfully established and stored. Before successful storage in the message database, the index status identifier for the retrieval index is characterized as incomplete; after successful storage in the message database, the index status identifier for the retrieval index will be automatically updated to indicate a completed state. For example, taking the aforementioned case where the index status identifier is represented by 0 and 1, the index status identifier for the retrieval index can be updated from 0 to 1, indicating that the retrieval index has changed from an incomplete state to a completed state.

[0134] However, in certain special circumstances (such as a power outage on the terminal device or the user temporarily closing the application), the task of creating and storing the image retrieval index may malfunction, resulting in the retrieval index failing to be created or stored successfully in the message database. In this case, the index status identifier for that retrieval index will still be marked as incomplete, for example, the index status identifier will still be 0. This allows for subsequent checks of the index status identifiers for each retrieval index. If an index status identifier is found to be incomplete, the retrieval index creation and storage task can be re-executed, facilitating the filling of any missing indexes in the message database. For retrieval indexes whose corresponding index status identifiers are marked as complete, it can be clearly and accurately determined that they have been successfully stored in the message database, eliminating the need for reconstruction and reducing the probability of duplicate or missing indexes in the message database.

[0135] This application provides a business processing method for session messages. It detects the image recognition process of a first image appearing in a target session. If the detection result indicates that the first image has already undergone image recognition, the existing image recognition result is directly obtained, eliminating the need for repeated image recognition. This reduces the amount of data to be processed, decreases computational resource consumption, and lowers application costs. Based on the content information in the image recognition result, a retrieval index for the first image in the target session can be generated. This retrieval index is then stored in a message database. After successful storage, the index status identifier for the first image in the target session is updated. Based on the index status identifier, the success of establishing the retrieval index for the first image in the target session can be accurately recorded, facilitating subsequent error correction and reducing the probability of duplicate or missing index establishment. This improves the practicality of image search in session applications and enhances the user experience.

[0136] Specifically, in some embodiments, detecting the image recognition process of the first image appearing in the target session includes:

[0137] Check the download status of the first image;

[0138] If the first image has been downloaded, it is matched against a pre-established recognition result database to obtain the detection results of the image recognition process; the recognition result database stores the image recognition results corresponding to the second images that appear in each session;

[0139] If the first image is not downloaded completely, the detection result of the image recognition process is determined to be that no image recognition has been performed.

[0140] It should be noted that currently, in most conversational applications, when displaying images on the receiving end, the conventional practice is to quickly download a low-resolution thumbnail for immediate preview, rather than directly downloading the original image. For example, please refer to... Figure 5 , Figure 5 This illustration shows a schematic diagram of a receiving end displaying an image, as provided in an embodiment of this application. For example... Figure 5 As shown, suppose there are two session objects in a current session: session object 510 and session object 520. Session object 510 sends an image to session object 520. On the terminal device used by session object 520, a thumbnail of the image will be downloaded from the session application's backend server and then displayed in the local chat window. Figure 5 Image 530 in the example. In other words, the terminal device on the side of session object 520 does not initially display the original image sent by session object 510, but rather a low-resolution thumbnail. This implementation method enables rapid display of images on the receiving end, significantly improving the smoothness of information interaction.

[0141] If session object 520 wants to view the original image sent by session object 510, it can click on image 530 on the terminal device, such as... Figure 5 In this scenario, when session object 520 clicks on image 530, image 530 will be enlarged and displayed. A control 540, an icon button, is provided for viewing the original image of 530. Session object 520 can click on control 540 to trigger the full download and display of the original image. This on-demand loading mechanism saves data traffic and optimizes response speed, hence its widespread application.

[0142] In this embodiment, when it is necessary to detect the image recognition process of the first image, the download status of the first image can be detected first. The download status of the first image can specifically include two states: completed download and incomplete download. It is easy to understand that image recognition of the first image requires the original image. If the first image has not been completely downloaded, it can be determined that image recognition has not been performed. Therefore, if the first image is in an incomplete download state, the detection result of the image recognition process can be determined as no image recognition has been performed. Conversely, if the first image is in a completed download state, it can be matched against a pre-established recognition result database to obtain the detection result of the image recognition process.

[0143] Specifically, in some embodiments, detecting the download status of the first image includes:

[0144] In response to the object's viewing operation on the first image, display the corresponding material image to the object in the target interface; wherein, the material image is a thumbnail of the first image or the original image of the first image;

[0145] Detect whether a target control exists within the target interface; the target control is used to view the original image of the first image.

[0146] If the target control does not exist in the target interface, it is confirmed that the first image has been downloaded successfully.

[0147] If the target control exists within the target interface, it indicates that the first image has not been completely downloaded.

[0148] In some embodiments of this application, when detecting the download status of the first image, the determination can be made by combining the display status of the first image on the receiving end.

[0149] Specifically, if the first image has already been downloaded, the original image will be displayed directly on the receiving end. When the object clicks to view the first image, the original image will be displayed, and no control for viewing the original image will appear. Conversely, if the first image has not yet been downloaded, a thumbnail of the first image will be displayed on the receiving end. When the object clicks to view the first image, the thumbnail will be displayed, and a control for viewing the original image will appear. Therefore, in this embodiment, when an object views the first image, a corresponding source image can be displayed on the target interface. This source image can be determined based on the download status of the first image; it can be either the original image or a thumbnail. Specifically, if the original image has been downloaded, it will be displayed directly as the source image; if the original image has not been downloaded, a thumbnail will be displayed as the source image.

[0150] Next, it can be detected whether a target control exists within the target interface. In this embodiment, the target control is a control used to view the original image of the first image, such as... Figure 5 Control 540 in the document. It is understood that the implementation of the target control is not limited to the form of an icon button, and this application does not impose such limitations. It is understood that if the target interface contains the target control, it indicates that the original image of the first image is currently being displayed, confirming that the first image has been downloaded successfully. Conversely, if the target interface does not contain the target control, it indicates that a thumbnail of the first image is currently being displayed, confirming that the first image has not been downloaded successfully.

[0151] Specifically, in some embodiments, detecting the download status of the first image includes:

[0152] In response to the object's viewing operation on the first image, display the corresponding material image to the object in the target interface; wherein, the material image is a thumbnail of the first image or the original image of the first image;

[0153] Detect the data volume and loading time of the source images;

[0154] Calculate the ratio of data volume to loading time to obtain the displayed metric value;

[0155] If the displayed indicator value is greater than or equal to the first preset threshold, it is determined that the first image has been downloaded successfully.

[0156] If the displayed indicator value is less than the first preset threshold, it is determined that the first image has not been completely downloaded.

[0157] In this embodiment, when distinguishing whether the material image displayed to the object in the target interface is the original image or a thumbnail of the first image, the judgment can also be based on the data volume and loading time of the material image. Here, data volume refers to the size of the storage space or transmission resources occupied by the image, which can generally be represented in bytes. It is understandable that for the first image, the data volume of the original image is obviously greater than the data volume of the thumbnail. If the first image has already been downloaded, the loading time required for local loading and display is relatively short. If the first image has not been downloaded, the thumbnail of the first image needs to be downloaded from the backend server and then loaded and displayed. This process takes longer than the time required to directly load the locally downloaded first image.

[0158] Therefore, in this embodiment, for source images, their data volume and loading time during display can be detected. A larger data volume and shorter loading time indicate that the image is more likely to be the original image of the first image that has been downloaded and stored locally; conversely, a smaller data volume and longer loading time indicate that the image is more likely to be a thumbnail temporarily downloaded from the backend server. Of course, the above relationship is relative. The data volume of the thumbnail of the first image is related to the data volume of the original image. The data volume of the original images of different images varies, and it is not possible to directly determine whether an image is the original image or a thumbnail based solely on its data volume (or loading time).

[0159] In this embodiment, the ratio of data volume to loading time can be calculated, and the resulting value is recorded as the display metric value. It is understood that if the display metric value is large, it indicates that the source image has a relatively large data volume and a relatively short loading time; in this case, it can be identified as the original image of the first image, meaning the first image has been downloaded successfully. Conversely, if the display metric value is small, it indicates that the source image has a relatively small data volume and a relatively long loading time; in this case, it can be identified as a thumbnail of the first image, meaning the first image has not been downloaded successfully.

[0160] Specifically, in this embodiment, a threshold value, denoted as the first preset threshold, can be preset. The download is determined by comparing the displayed indicator value with the first preset threshold. That is, if the displayed indicator value is greater than or equal to the first preset threshold, it can be determined that the first image has been downloaded successfully; if the displayed indicator value is less than the first preset threshold, it can be determined that the first image has not been downloaded successfully. The size of the first preset threshold can be set according to actual needs and experience; this application does not impose any restrictions on it.

[0161] Specifically, in some embodiments, the first image is matched against a pre-established recognition result database to obtain the detection result of the image recognition process, including:

[0162] Determine the first hash value of the first image and the second hash values ​​of each of the second images;

[0163] Compare the first hash value with each of the second hash values;

[0164] If there exists a second hash value that is the same as the first hash value, the detection result of the image recognition process is determined to be that the image has been recognized.

[0165] If all second hash values ​​are different from the first hash value, the detection result of the image recognition process is determined to be that no image recognition has been performed.

[0166] In this embodiment of the application, when matching the first image in a pre-established recognition result database to determine the detection result of the image recognition process, the first image and the images in the recognition result database can be compared. The images in the recognition result database are denoted as the second images. The number of second images is generally large, and this application does not limit this.

[0167] Specifically, when matching the first image and the second image, their hash values ​​can be calculated. A hash value is a fixed-length unique identifier obtained by calculating input data of arbitrary length using a hash function; different inputs will not produce the same hash value. Therefore, based on the hash value, it can be quickly determined whether the first image and the second image are consistent. In this embodiment, the hash value corresponding to the first image is recorded as the first hash value, and the hash value corresponding to the second image is recorded as the second hash value. The second hash value can be pre-calculated and stored in the recognition result database. The algorithm used to calculate the hash value can be the MD5 algorithm or other algorithms; this application does not limit this.

[0168] For the first hash value, it is compared with each of the second hash values. If any second hash value is found to be the same as the first hash value, it means that the recognition result database already contains a second image identical to the first image, and a corresponding image recognition result exists. In this case, it can be determined that the detection result of the image recognition process corresponding to the first image is that image recognition has been performed. Conversely, if none of the second hash values ​​are found to be the same as the first hash value, it means that there is no second image identical to the first image in the recognition result database, and no corresponding image recognition result exists. In this case, it can be determined that the detection result of the image recognition process corresponding to the first image is that image recognition has not been performed.

[0169] Specifically, in some embodiments, the method further includes:

[0170] In response to the detection result of the image recognition process indicating that the first image has not undergone image recognition, an asynchronous sub-thread is established;

[0171] The first image is recognized by an asynchronous sub-thread to obtain the image recognition result corresponding to the first image.

[0172] Once the asynchronous sub-thread completes its task processing, it stores the image recognition result corresponding to the first image into a pre-established recognition result database.

[0173] In this embodiment, if the detection result of the image recognition process corresponding to the first image is determined to be that no image recognition has been performed, then image recognition can be performed on the first image. In this embodiment, to avoid affecting the normal use of the session application (such as when an object sends messages or views other images), an asynchronous sub-thread can be established to handle the image recognition task of the first image asynchronously. In this way, the entire recognition process is imperceptible to the object, improving the smoothness of the session application.

[0174] In this embodiment, image recognition of the first image is performed using an asynchronous sub-thread to obtain the corresponding image recognition result. After the asynchronous sub-thread completes its task processing, the image recognition result can be stored in a pre-established recognition result database. This way, when a subsequent image identical to the first image appears, it is unnecessary to perform image recognition on it again; the image recognition result of the first image can be used directly, reducing the consumption of computing resources.

[0175] It is understandable that the design of using asynchronous sub-threads to process image recognition tasks in this embodiment of the application can achieve efficient processing through background threads without interfering with the normal use of the session application. This allows time-consuming image recognition tasks to be separated from the main thread and executed asynchronously by an independent sub-thread, thereby avoiding blocking the front-end interface response or affecting related message sending and receiving functions. When sending messages or browsing other images in the session application, the main thread can maintain real-time responsiveness to operations, while the image recognition task runs silently in the background. Both are processed in parallel through a thread concurrency mechanism. The application remains smooth and lag-free in terms of object awareness, especially in high-frequency interaction scenarios, avoiding interface freezing or operation delays caused by image recognition tasks.

[0176] In addition, asynchronous child threads can use a task queue mechanism to manage image recognition tasks. Even if multiple images are received in a short period of time, they can be processed in order without causing congestion on the main thread, thereby maintaining the stable throughput of the session application.

[0177] Specifically, in some embodiments, image recognition is performed on the first image to obtain the image recognition result corresponding to the first image, including:

[0178] Perform edge detection on the first image to determine the text regions within the first image;

[0179] The key image is obtained by cropping the first image based on the text area;

[0180] Optical character recognition is performed on the key images to obtain the image recognition result corresponding to the first image.

[0181] In this embodiment of the application, as described above, image recognition of the first image can involve recognizing the text content it contains. In this application scenario, image recognition results can be obtained based on deep learning algorithms and optical character recognition technology.

[0182] Specifically, in this embodiment of the application, an edge detection engine based on a deep learning algorithm can be used to perform edge detection on the first image, determine the region containing text content, and record the region as the text region.

[0183] For example, edge detection algorithms such as Canny or CTPN (Connectionist Text Proposal Network) can be used to identify all continuous edge regions that may contain text. Generally, text regions are typically characterized by high-contrast boundaries, regular geometric shapes, and dense textures. By performing edge detection, multiple candidate regions can be obtained, each carrying a corresponding confidence parameter. In this embodiment, candidate regions with higher confidence parameters can be selected as text regions.

[0184] After obtaining the text region, the first image can be cropped based on the text region, and the resulting image is denoted as the key image. In other words, the image content of the text region is cropped from the first image to obtain the key image. It is understood that for a given first image, the number of key images obtained after cropping can be one or more; this application does not impose any limitation on this. For each key image, optical character recognition (OCR) can be performed to obtain the image recognition result corresponding to the first image.

[0185] Specifically, in some embodiments, the index status identifier is stored in a pre-established identification result database; the method further includes:

[0186] The index status identifiers stored in the recognition result database are queried to determine the target image; where the target image is the image whose corresponding retrieval index is in an incomplete state.

[0187] The target images are divided into several batches to obtain target image sets;

[0188] Based on the image recognition results stored in the recognition result database, the index of each target image set is added sequentially.

[0189] In this embodiment, the index status identifier for each image can be stored in the recognition result database. It is understood that for each image, its retrieval index may be successfully built and stored in the message database. However, in some cases, the retrieval index may fail to be built or stored correctly. In this situation, the index status identifier for the image will record that its corresponding retrieval index is in an incomplete state.

[0190] In this embodiment of the application, for images whose retrieval indexes are incomplete, their retrieval indexes can be supplemented at other times. Please refer to... Figure 6 , Figure 6 This illustration shows a flowchart of a supplementary retrieval index provided in an embodiment of this application. For example... Figure 6 As shown in the embodiments of this application, the retrieval index can be supplemented each time the session application is started, during data initialization. Of course, in other embodiments, the supplementation can also be performed at other times, and this application does not limit this.

[0191] Specifically, when supplementing the retrieval index for an image, the index status identifiers stored in the recognition result database can be queried to determine whether the index status identifier for each image is in a completed state. Images whose index status identifiers indicate that the retrieval index is in an incomplete state are selected and identified as target images. These target images are those for which a corresponding retrieval index has not been properly established and need to be supplemented. In this embodiment, the target images can be divided into several batches of target image sets. The number of target images in each batch is not limited in this application.

[0192] Then, based on the image recognition results stored in the recognition result database, the retrieval index is supplemented for each target image set in turn. Supplementing the retrieval index means regenerating the retrieval index corresponding to the target image in its current session based on the content information in the image recognition results, and then storing the retrieval index in the message database. If the storage is successful, the index status flag corresponding to the target image can be updated.

[0193] In this embodiment of the application, by supplementing the search index for target images that have not been properly indexed in batches, the probability of missing search indexes can be reduced. The index status identifier can record the status of the search index corresponding to each image, reducing the probability of duplicate search index creation. This can improve the practicality of image search in the session application and enhance the user experience of the session application.

[0194] Specifically, in some embodiments, generating a search index of a first image in a target session according to content information includes:

[0195] Performing word segmentation processing on the content information to obtain a plurality of words;

[0196] Filtering each word to obtain a plurality of content words;

[0197] Generating the search index of the first image in the target session according to each of the content words.

[0198] In the embodiments of the present application, when generating the search index of the first image in the target session according to the content information, it may be implemented by means of an inverted index. Specifically, the content information may be subjected to word segmentation processing to obtain a plurality of words contained therein. Generally, the content information includes some content words and function words, where the content words are words with actual meanings, such as nouns; the function words are words without actual meanings, such as "de", "di" and the like. In search applications, most of the input search terms are content words. Therefore, in the embodiments of the present application, each word obtained by performing word segmentation processing on the content information may be screened and filtered to determine the content words therein. Then, the search index of the first image in the target session is generated according to the content words.

[0199] Specifically, in some embodiments, the method further includes:

[0200] Detecting the occurrence frequency of each content word in the search index, and determining the content word whose corresponding occurrence frequency is greater than a second preset threshold as a target word;

[0201] Assigning a different identification field to each target word, and storing the association relationship between the target word and the identification field; wherein the number of characters of the identification field is less than the number of characters of the target word;

[0202] Replacing the target word with the identification field to obtain an updated search index.

[0203] In the embodiments of the present application, in some scenarios, dictionary-based encoding processing may be performed on the search index. It can be understood that there may be some longer content words or content words with a relatively high occurrence frequency in the search index. If they are stored as they are, a large amount of storage resources may be consumed.

[0204] In this regard, in the embodiments of the present application, the occurrence frequency of each content word in the search index may be detected, and a threshold for the occurrence frequency is preset, which is referred to as a second preset threshold, and the value thereof may be flexibly set as required. For each content word, if its occurrence frequency is greater than the second preset threshold, it may be determined as a target word; correspondingly, if its occurrence frequency is less than or equal to the second preset threshold, it may not be determined as a target word.

[0205] Next, a different identifier field can be assigned to each target word. This identifier field can be abbreviated characters (such as a, b) or numbers (such as 2, 5), without actual meaning. The number of characters in the identifier field must be less than the number of characters in the target word. This application does not restrict its specific content or format. Then, the association between each target word and the assigned identifier field can be stored. After storing the association, the target words can be replaced using the identifier field to obtain an updated search index. In this way, information that appears frequently in the search index can be dictionary-encoded, and the original content can be replaced with shorter identifier fields.

[0206] It is understood that, in this embodiment of the application, by performing dictionary-based encoding on the retrieval index, the amount of data in the retrieval index that needs to be stored can be effectively reduced without affecting the normal use of the retrieval index, thereby reducing the cost of storage resources.

[0207] Specifically, in some embodiments, the method further includes:

[0208] In response to an object's search operation on images in the target session, retrieve the search information entered by the object;

[0209] In the retrieval index corresponding to the target session, identify the target index that matches the search information;

[0210] Based on the image corresponding to the target index, the search results are returned to the object.

[0211] In this embodiment of the application, the stored retrieval index can be used in subsequent image search tasks.

[0212] Specifically, in this embodiment of the application, an object in the target session can perform a search operation on images within the target session within the session application. For example, please refer to... Figure 7 , Figure 7 This illustration shows a schematic diagram of searching for image messages in a target session, as provided in an embodiment of this application. Figure 7 The image shows the search. Figure 2 In the example of image application, a search box can be provided in a conversational application, allowing users to input search information for images. The search information can be words or phrases, etc., and this application does not impose any restrictions on this.

[0213] After obtaining the search information based on the search operation input, the target index that matches the search information can be determined in the retrieval index corresponding to the target session. Here, the retrieval index corresponding to the target session is the retrieval index corresponding to each image appearing in the target session. For example... Figure 7As shown, assuming the current input search information is the text "life is", it is matched with all search indices corresponding to the target session, and it is found that... Figure 2 The search index corresponding to the image message shown matches the search information, so this search index can be designated as the target index. Then, based on the image corresponding to the target index, search results can be returned to the target. For example... Figure 7 In the middle, you can display the content of a certain image message containing search information in the relevant conversation record, and prompt the target to view it.

[0214] Specifically, in some embodiments, determining the target index that matches the search information within the retrieval index corresponding to the target session includes:

[0215] Determine the similarity between the various retrieval indexes and search information corresponding to the target session;

[0216] The search indexes with a similarity greater than the preset similarity threshold are identified as the target indexes.

[0217] In this embodiment, when determining the target index from the retrieval index corresponding to the target session, the similarity between each retrieval index and the search information can be calculated. Here, the magnitude of the similarity can be used to characterize the closeness between the retrieval index and the search information. The greater the similarity, the closer the retrieval index and the search information are, and the more likely the corresponding image is to be the image the object wants to search for. In this embodiment, a preset similarity threshold can be set. For each retrieval index, its corresponding similarity can be compared with the preset similarity threshold. If it is greater than the preset similarity threshold, it can be determined as the target index. If it is less than or equal to the preset similarity threshold, it can not be determined as the target index.

[0218] It is understood that in this embodiment, the number of target indices can be one or more. When there are multiple target indices, the image messages can be sorted according to their corresponding similarity scores, and then the results can be returned to the object as search results. In some cases, it may be possible that no target index is determined; in this case, the object can be informed that no relevant search results were found.

[0219] In this application embodiment, there is no limitation on the type of similarity algorithm used to calculate similarity. For example, it can be implemented based on any one of the following: edit distance coefficient, cosine similarity, Jaccard similarity coefficient, Euclidean distance, Manhattan distance, etc.

[0220] The following describes and explains a session message service processing method provided in this application embodiment, with reference to specific application examples.

[0221] Please refer to Figure 8 , Figure 8 This illustration shows a schematic diagram of the specific implementation process of a session message service processing method provided in an embodiment of this application.

[0222] In this embodiment of the application, when an object receives an image message, clicking to view the image message can trigger the task flow of this application. Specifically, when the object clicks to view the image, it can detect whether the image has already undergone image recognition, specifically by initiating a query request to the recognition result database. If image recognition has already been performed, the image recognition result is directly obtained, and then a retrieval index is built based on the image recognition result and stored in the message database of the session application.

[0223] Specifically, during image display, if an object clicks the icon to view the original image, it means the image has not yet been downloaded, and a thumbnail is being displayed. In this case, it can be directly determined that the image has not undergone image recognition. This avoids querying the recognition results database, improving processing efficiency.

[0224] Conversely, if an image has not undergone image recognition, its text content can be extracted using optical character recognition (OCR) technology to obtain the corresponding image recognition result. In this embodiment, the image recognition result is written to both the recognition result database and the corresponding message, thus linking the image recognition result and the image message. For example, the image message can be stored using an in-memory data structure (such as Google Protobuf), where the `extra` field can be used to store the image recognition result. Of course, other data structures can also be used for the image message, and this application does not impose any limitations on this.

[0225] It should be noted that, in this embodiment, the process of extracting image recognition results using optical character recognition technology can be executed asynchronously. This has no impact on the normal use of the session application and is imperceptible to the object being processed.

[0226] In this embodiment, image messages containing image recognition results can be stored in a message database via the client's communication service. This allows the message database to use the image recognition results as a retrieval index for the corresponding image message. Subsequently, the message database can be used to perform image searches.

[0227] Please refer to Figure 9 , Figure 9 This illustration shows a storage representation of an identification result database provided in an embodiment of this application. For example... Figure 9 As shown in this embodiment, for each image type message, the recognition result database can store its corresponding session ID, message ID, image ID, image recognition result (Content), and index status ID (Indexed). The session ID identifies which session the image message originates from; the message ID identifies which message within the session the image message belongs to; the image ID uniquely identifies an image; the image recognition result represents the content information corresponding to the image; and the index status ID represents the completion status of the image's retrieval index within the target session.

[0228] It is understandable that the same image may appear in different sessions, or be sent multiple times within the same session, appearing in different messages. Therefore, to prevent duplicate recognition, in this embodiment, images that have already undergone image recognition can be distinguished based on image identifiers in the recognition result database. If an image exists in the recognition result database, the result can be directly obtained through the fields of the image recognition result without further recognition.

[0229] Please refer to Figure 10 , Figure 10 A timing flowchart of a session message service processing method provided in an embodiment of this application is shown. Figure 10 The relevant threads involved include the main thread of the session application, the image recognition thread, the recognition result database thread, and the message database thread. When executing the method in this embodiment, the object receives an image through the main thread of the session application and clicks to view it. At this time, a task to detect whether the image has undergone image recognition is triggered. This task determines the detection result of the image recognition process by querying the recognition result database to see if the same image exists. If it has not been recognized, the main thread will call the image recognition thread to recognize the image, obtain the image recognition result, and write it to the recognition result database. Furthermore, a retrieval index corresponding to the image is generated based on the image recognition result and written to the message database. If the writing is successful, the message database thread will report a successful write message. At this time, the main thread notifies the recognition result database to update the index status marker corresponding to the image to the completed state.

[0230] In this embodiment, by setting an index status flag, the establishment status of the search index for each image in its session can be clearly recorded. If the search index corresponding to an image is not generated normally or an accident occurs during storage, the index status flag will record the completion status of the corresponding search index as incomplete. This allows for the subsequent supplementation of these search indexes. Figure 10 As shown, when the object clicks on the same image again, the task of checking whether the image has undergone image recognition will be triggered again. At this time, since the image recognition results are already stored in the database, they can be retrieved directly from it. Then, the main thread can determine whether to supplement the image retrieval index based on the index status flag.

[0231] certainly, Figure 10 The illustration shows a scenario where the object actively clicks on the image again. However, in some cases, the object may not click on the image again. Therefore, in this embodiment, the image retrieval index can also be automatically updated. Please refer to... Figure 11 , Figure 11 This is a timing flowchart of a supplementary retrieval index provided in an embodiment of this application. Figure 11 The relevant threads involved include the main thread of the session application, the thread of the recognition result database, and the thread of the message database.

[0232] In this embodiment, the task of supplementing the retrieval index can be performed each time the session application starts. Specifically, after the session application completes initialization, it can read the image recognition results of images with an incomplete index status from the recognition result database in batches. Then, it generates corresponding retrieval indexes based on these image recognition results and writes them to the message database. After the message database reports a successful write, it updates the index status flags corresponding to these images. Then, it performs the next batch of supplementation until all supplementation is completed or a preset supplementation time is reached.

[0233] Reference Figure 12 In this embodiment of the application, a session message service processing apparatus is also provided, which includes:

[0234] The detection unit 1210 is used to detect the image recognition process of the first image appearing in the target session;

[0235] The acquisition unit 1220 is used to acquire the existing image recognition result corresponding to the first image if the detection result of the image recognition process indicates that the first image has been recognized; wherein the image recognition result includes the content information corresponding to the first image;

[0236] The generation unit 1230 is used to generate a retrieval index of the first image in the target session based on the content information;

[0237] The update unit 1240 is used to store the retrieval index into the message database and update the index status identifier of the first image in the target session after the retrieval index is successfully stored; wherein, the index status identifier is used to characterize the completion status of the retrieval index of the first image in the target session.

[0238] Optionally, in some embodiments, the detection unit is specifically used for:

[0239] Check the download status of the first image;

[0240] If the first image has been downloaded, it is matched against a pre-established recognition result database to obtain the detection results of the image recognition process; the recognition result database stores the image recognition results corresponding to the second images that appear in each session;

[0241] If the first image is not downloaded completely, the detection result of the image recognition process is determined to be that no image recognition has been performed.

[0242] Optionally, in some embodiments, the detection unit is specifically used for:

[0243] In response to an object's viewing operation of the first image, a material image corresponding to the first image is displayed to the object in the target interface; wherein, the material image is a thumbnail of the first image or the original image of the first image;

[0244] The data volume and loading time of the source images are detected.

[0245] Calculate the ratio of the data volume to the loading time to obtain the display metric value;

[0246] If the displayed indicator value is greater than or equal to the first preset threshold, it is determined that the first image has been downloaded.

[0247] If the displayed indicator value is less than the first preset threshold, it is determined that the first image has not been completely downloaded.

[0248] Optionally, in some embodiments, the detection unit is specifically used for:

[0249] Determine the first hash value of the first image and the second hash values ​​of each of the second images;

[0250] Compare the first hash value with each of the second hash values;

[0251] If there exists a second hash value that is the same as the first hash value, the detection result of the image recognition process is determined to be that the image has been recognized.

[0252] If all second hash values ​​are different from the first hash value, the detection result of the image recognition process is determined to be that no image recognition has been performed.

[0253] Optionally, in some embodiments, the service processing apparatus further includes an identification unit, which is specifically used for:

[0254] In response to the detection result of the image recognition process indicating that the first image has not undergone image recognition, an asynchronous sub-thread is established;

[0255] The first image is recognized by an asynchronous sub-thread to obtain the image recognition result corresponding to the first image.

[0256] Once the asynchronous sub-thread completes its task processing, it stores the image recognition result corresponding to the first image into a pre-established recognition result database.

[0257] Optionally, in some embodiments, the identification unit is specifically used for:

[0258] Perform edge detection on the first image to determine the text regions within the first image;

[0259] The key image is obtained by cropping the first image based on the text area;

[0260] Optical character recognition is performed on the key images to obtain the image recognition result corresponding to the first image.

[0261] Optionally, in some embodiments, the service processing apparatus further includes a supplementary recording unit, which is specifically used for:

[0262] The index status identifiers stored in the recognition result database are queried to determine the target image; where the target image is the image whose corresponding retrieval index is in an incomplete state.

[0263] The target images are divided into several batches to obtain target image sets;

[0264] Based on the image recognition results stored in the recognition result database, the index of each target image set is added sequentially.

[0265] Optionally, in some embodiments, the generating unit is specifically used for:

[0266] The content information is segmented into words to obtain a number of words;

[0267] Filter each word to obtain a number of content words;

[0268] Based on each content word, generate a retrieval index for the first image in the target session.

[0269] Optionally, in some embodiments, the service processing apparatus further includes a replacement unit, which is specifically used for:

[0270] The frequency of occurrence of each content word in the search index is detected, and the content words whose frequency of occurrence is greater than the second preset threshold are identified as target words;

[0271] Assign different identifier fields to each target word and store the association between the target word and the identifier field; wherein the number of characters in the identifier field is less than the number of characters in the target word;

[0272] The updated search index is obtained by replacing the target words with identifier fields.

[0273] Optionally, in some embodiments, the service processing apparatus further includes a feedback unit, which is specifically used for:

[0274] In response to an object's search operation on images in the target session, retrieve the search information entered by the object;

[0275] In the retrieval index corresponding to the target session, identify the target index that matches the search information;

[0276] Based on the image corresponding to the target index, the search results are returned to the object.

[0277] Optionally, in some embodiments, the feedback unit is specifically used for:

[0278] Determine the similarity between the various retrieval indexes and search information corresponding to the target session;

[0279] The search indexes with a similarity greater than the preset similarity threshold are identified as the target indexes.

[0280] It is understandable that, such as Figure 4 The content of the session message service processing method embodiment shown is applicable to the session message service processing device embodiment. The specific functions implemented by the session message service processing device embodiment are the same as those shown. Figure 4 The illustrated method for processing session messages is the same as the one described above, and the beneficial effects achieved are the same as those described above. Figure 4 The beneficial effects achieved by the illustrated embodiment of the session message business processing method are also the same.

[0281] This application also discloses an electronic device, including:

[0282] At least one processor;

[0283] At least one memory for storing at least one program;

[0284] When at least one program is executed by at least one processor, such that at least one processor implements as Figure 4 The example shown illustrates a business processing method for session messages.

[0285] The electronic device in the embodiments of this application may be a terminal device, a computer device, or a server device.

[0286] For example, refer to Figure 13 , Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Taking a terminal device as an example, Figure 13 In this context, the electronic device 1300 may include an RF (Radio Frequency) circuit 1310, a memory 1320 including one or more computer-readable storage media, an input unit 1330, a display unit 1340, a sensor 1350, an audio circuit 1360, a short-range wireless transmission module 1370, a processor 1380 including one or more processing cores, and a power supply 1390, among other components. Those skilled in the art will understand that... Figure 13 The device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0287] RF circuit 1310 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 1380 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 1310 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a SIM card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. Furthermore, RF circuit 1310 can also communicate wirelessly with networks and other devices. Wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0288] Memory 1320 can be used to store software programs and modules (or units). Processor 1380 executes various functional applications and data processing by running the software programs and modules (or units) stored in memory 1320. Memory 1320 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.); the data storage area may store data created based on the use of electronic device 1300 (such as audio data, telephone directory, etc.). Furthermore, memory 1320 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory 1320 may also include a memory controller to provide access to memory 1320 for processor 1380 and input unit 1330. Although Figure 13 The RF circuit 1310 is shown, but it is understood that it is not a necessary component of the electronic device 1300 and can be omitted as needed without changing the nature of the invention.

[0289] The input unit 1330 can be used to receive input digital or character information, and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to object settings and function control. Specifically, the input unit 1330 may include a touch-sensitive surface 1331 and other input devices 1332. The touch-sensitive surface 1331, also known as a touch display screen or touchpad, can collect touch operations on or near the object (such as operations performed by the object using a finger, stylus, or any suitable object or accessory on or near the touch-sensitive surface 1331), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface 1331 may include two parts: a touch detection device and a touch controller. The touch detection device detects the touch position of the object and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 1380, and can receive and execute instructions from the processor 1380. In addition, the touch-sensitive surface 1331 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch-sensitive surface 1331, the input unit 1330 may also include other input devices 1332. Specifically, other input devices 1332 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.

[0290] Display unit 1340 can be used to display information input by an object or information provided to an object, as well as various graphical object interfaces for controlling electronic device 1300. These graphical object interfaces can be composed of graphics, text, icons, video, and any combination thereof. Display unit 1340 may include display panel 1341, optionally configured as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, touch-sensitive surface 1331 may cover display panel 1341. When touch-sensitive surface 1331 detects a touch operation on or near it, it transmits the information to processor 1380 to determine the type of touch event. Subsequently, processor 1380 provides corresponding visual output on display panel 1341 according to the type of touch event. Although in Figure 13 In this embodiment, the touch-sensitive surface 1331 and the display panel 1341 are implemented as two separate components to realize input and output functions. However, in some embodiments, the touch-sensitive surface 1331 and the display panel 1341 can be integrated to realize input and output functions.

[0291] The electronic device 1300 may also include at least one sensor 1350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1341 according to the ambient light level, and the proximity sensor can turn off the display panel 1341 or the backlight when the electronic device 1300 is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometers, taps), etc. Other sensors that the electronic device 1300 may be equipped with, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0292] Audio circuitry 1360, speaker 1361, and microphone 1362 provide an audio interface between the device and electronic device 1300. Audio circuitry 1360 converts received audio data into electrical signals and transmits them to speaker 1361, where speaker 1361 converts them into sound signals for output. Conversely, microphone 1362 converts collected sound signals into electrical signals, which are then received by audio circuitry 1360, converted back into audio data, processed by processor 1380, and transmitted via RF circuitry 1310 to another electronic device, or output to memory 1320 for further processing. Audio circuitry 1360 may also include an earphone jack to facilitate communication between external headphones and electronic device 1300.

[0293] The short-range wireless transmission module 1370 can be a WIFI (wireless fidelity) module, Bluetooth module, or infrared module, etc. The electronic device 1300 can transmit information with wireless transmission modules on other devices via the short-range wireless transmission module 1370.

[0294] Processor 1380 is the control center of electronic device 1300. It connects various parts of the device via various interfaces and lines, and performs various functions and processes data of electronic device 1300 by running or executing software programs or modules stored in memory 1320 and calling data stored in memory 1320, thereby providing overall control of the device. Optionally, processor 1380 may include one or more processing cores; optionally, processor 1380 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may also not be integrated into processor 1380.

[0295] Electronic device 1300 also includes a power supply 1390 (such as a battery) for supplying power to various components. Optionally, the power supply 1390 can be logically connected to the processor 1380 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The power supply 1390 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0296] Although not shown, the electronic device 1300 may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0297] This application also discloses a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to implement, for example... Figure 4 The example shown illustrates a business processing method for session messages.

[0298] Understandable, Figure 4 The content of the session message service processing method embodiments shown are all applicable to the embodiments of this computer-readable storage medium. The specific functions implemented by the embodiments of this computer-readable storage medium are the same as those shown in the embodiments. Figure 4 The illustrated method for processing session messages is the same as the one used in this embodiment, and the beneficial effects achieved are the same. Figure 4 The beneficial effects achieved by the illustrated embodiment of the session message business processing method are also the same.

[0299] This application also discloses a computer program product or computer program, which includes computer instructions stored in the aforementioned computer-readable storage medium. Figure 13 The processor of the illustrated electronic device can read the computer instructions from the aforementioned computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform... Figure 4 The example shown illustrates a business processing method for session messages.

[0300] Understandable, Figure 4 The content of the session message service processing method embodiments shown are all applicable to this computer program product or computer program embodiment. The specific functions implemented by this computer program product or computer program embodiment are the same as those shown in the embodiments. Figure 4 The illustrated method for processing session messages is the same as the one used in this embodiment, and the beneficial effects achieved are the same. Figure 4 The beneficial effects achieved by the illustrated embodiment of the session message business processing method are also the same.

[0301] In some alternative embodiments, the functions / operations mentioned in the block diagrams may not occur in the order shown in the operation diagrams. For example, depending on the functions / operations involved, two consecutively shown blocks may actually be executed substantially simultaneously, or the blocks may sometimes be executed in reverse order. Furthermore, the embodiments presented and described in the flowcharts of this application are provided by way of example to provide a more comprehensive understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and sub-operations described as part of a larger operation are executed independently.

[0302] Furthermore, although this application is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding this application. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional technology for an engineer. Therefore, those skilled in the art can implement the application set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of this application, which is determined by the full scope of the appended claims and their equivalents.

[0303] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0304] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0305] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0306] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0307] In the foregoing description of this specification, the references to terms such as "one embodiment," "another embodiment," or "some embodiments," etc., indicate that a specific feature, structure, material, or characteristic described in connection with an embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0308] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.

[0309] The above is a detailed description of the preferred embodiments of this application, but this application is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application, and these equivalent modifications or substitutions are all included within the scope defined by the claims of this application.

Claims

1. A method for processing session messages, characterized in that, The method includes: The image recognition process is detected for the first image appearing in the target session; In response to the detection result of the image recognition process indicating that the first image has been recognized, the existing image recognition result corresponding to the first image is obtained; wherein, the image recognition result includes content information corresponding to the first image; Based on the content information, a retrieval index for the first image in the target session is generated; The retrieval index is stored in the message database, and the index status identifier of the first image in the target session is updated after the retrieval index is successfully stored; wherein, the index status identifier is used to characterize the completion status of the retrieval index of the first image in the target session.

2. The session message service processing method according to claim 1, characterized in that, The detection of the image recognition process for the first image appearing in the target session includes: Detect the download status of the first image; If the first image has been downloaded, the first image is matched in a pre-established recognition result database to obtain the detection result of the image recognition process; wherein, the recognition result database stores the image recognition results corresponding to the second image that appears in each session; If the first image has not been completely downloaded, the detection result of the image recognition process is determined to be that no image recognition has been performed.

3. The session message service processing method according to claim 2, characterized in that, The step of matching the first image in a pre-established recognition result database to obtain the detection result of the image recognition process includes: Determine the first hash value of the first image and the second hash value of each of the second images; The first hash value and each of the second hash values ​​are compared; If any of the second hash values ​​is the same as the first hash value, the detection result of the image recognition process is determined to be that image recognition has been performed; If all of the second hash values ​​are different from the first hash value, the detection result of the image recognition process is determined to be that no image recognition has been performed.

4. The session message service processing method according to claim 2, characterized in that, The detection of the download status of the first image includes: In response to an object's viewing operation of the first image, a material image corresponding to the first image is displayed to the object in the target interface; wherein, the material image is a thumbnail of the first image or the original image of the first image; The data volume and loading time of the source images are detected. Calculate the ratio of the data volume to the loading time to obtain the display metric value; If the displayed indicator value is greater than or equal to the first preset threshold, it is determined that the first image has been downloaded. If the displayed indicator value is less than the first preset threshold, it is determined that the first image has not been completely downloaded.

5. The session message service processing method according to claim 1, characterized in that, The method further includes: In response to the detection result of the image recognition process indicating that the first image has not undergone image recognition, an asynchronous sub-thread is established; The first image is recognized by the asynchronous sub-thread to obtain the image recognition result corresponding to the first image. When the asynchronous sub-thread completes its task processing, it stores the image recognition result corresponding to the first image into a pre-established recognition result database.

6. The session message service processing method according to claim 5, characterized in that, The step of performing image recognition on the first image to obtain the image recognition result corresponding to the first image includes: Edge detection is performed on the first image to determine the text regions within the first image; The first image is cropped based on the text area to obtain the key image; Optical character recognition is performed on the key image to obtain the image recognition result corresponding to the first image.

7. The session message service processing method according to claim 1, characterized in that, The index status identifier is stored in a pre-established identification result database; the method further includes: The index status identifiers stored in the recognition result database are queried to determine the target image; wherein, the target image is the image whose corresponding retrieval index is in an incomplete state; The target images are divided into several batches of target image sets; Based on the image recognition results stored in the recognition result database, the retrieval index is added sequentially for each of the target image sets.

8. The session message service processing method according to claim 1, characterized in that, The step of generating a retrieval index for the first image in the target session based on the content information includes: The content information is segmented into words to obtain several words; Filter each of the aforementioned words to obtain a number of content words; Based on each of the given content words, a retrieval index for the first image in the target session is generated.

9. The session message service processing method according to claim 8, characterized in that, The method further includes: The frequency of occurrence of each of the content words in the search index is detected, and the content words whose frequency of occurrence is greater than a second preset threshold are identified as target words; Different identifier fields are assigned to each target word, and the association between the target word and the identifier field is stored; wherein the number of characters in the identifier field is less than the number of characters in the target word; The target word is replaced by the identifier field to obtain the updated search index.

10. The service processing method for session messages according to any one of claims 1-9, characterized in that, The method further includes: In response to an object's search operation on an image in the target session, obtain the search information input by the object; In the retrieval index corresponding to the target session, determine the target index that matches the search information; Based on the image corresponding to the target index, the search results are returned to the object.

11. The session message service processing method according to claim 10, characterized in that, Determining the target index that matches the search information in the retrieval index corresponding to the target session includes: Determine the similarity between each of the retrieval indexes and the search information corresponding to the target session; The search indexes with a similarity greater than a preset similarity threshold are identified as target indexes.

12. A session message service processing apparatus, characterized in that, The device includes: The detection unit is used to detect the image recognition process of the first image appearing in the target session; The acquisition unit is configured to, in response to the detection result of the image recognition process indicating that the first image has been recognized, acquire the existing image recognition result corresponding to the first image; wherein, the image recognition result includes content information corresponding to the first image; The generation unit is configured to generate a retrieval index for the first image in the target session based on the content information. An update unit is configured to store the retrieval index into a message database, and update the index status identifier of the first image in the target session after the retrieval index is successfully stored; wherein the index status identifier is used to characterize the completion status of the retrieval index of the first image in the target session.

13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the session message service processing method according to any one of claims 1 to 11.

14. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the session message service processing method according to any one of claims 1 to 11.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the session message service processing method according to any one of claims 1 to 11.