A context-aware dialogue recommendation method, system, device and storage medium
Patent Information
- Application Number
- CN202610799908.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-04
- Publication Date
- 2026-09-11
AI Technical Summary
[0004]可传统的客服坐席话术推荐系统存在以下明显缺陷:触发检索后,服务器无法区分新消息与历史消息,一旦业务人员上滑查看记录,服务器会基于页面底端的历史消息重复触发推荐,进而造成卡顿与干扰;另外,服务器在切换对话、滑动界面时会重复计算,消耗资源且延迟高;缺乏上下文感知,推荐触发时机不准确,误触率高、可用性差
1、采用时间轴校验、文本去重、视图模式判定三重过滤逻辑,对触发条件进行多层约束,从根源上避免功能误触发,提升触发可靠性。
Smart Images

Figure CN122734019A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent customer service technology, and in particular to a context-aware dialogue recommendation method, system, device and storage medium. Background Technology
[0002] Script recommendations are often used in professional fields such as consultation, Q&A, or sales services, including scenarios like traffic information, product promotion, and customer service. When customers communicate with sales personnel online, the system analyzes the text of customer feedback in real time to help sales personnel understand the customer's intentions and recommend relevant scripts to the sales personnel communicating with the customer, thereby providing more professional services to the customer.
[0003] In the application of script recommendation, the traditional approach is to use script recommendation based on retrieval technology. That is, based on a preset dialogue corpus, the text currently fed back by the customer is approximated by vector, and the scripts or business processes matched by the retrieval are recommended to the business personnel, guiding them to respond according to the recommended scripts or to guide the communication with the customer according to the recommended business processes.
[0004] Traditional customer service script recommendation systems have the following obvious drawbacks: After a search is triggered, the server cannot distinguish between new messages and historical messages. Once a business user swipes up to view the records, the server will repeatedly trigger recommendations based on historical messages at the bottom of the page, causing lag and interference. In addition, the server will repeatedly calculate when switching conversations and swiping the interface, consuming resources and causing high latency. It lacks context awareness, the timing of recommendation triggering is inaccurate, the accidental touch rate is high, and the usability is poor. Summary of the Invention
[0005] Therefore, in order to overcome the shortcomings of the prior art, the present invention provides a speech recommendation method that is accurate in triggering, has ultra-low latency, is context-aware, provides a smooth experience, and is stable and reliable.
[0006] To achieve the above objectives, the present invention provides a context-aware speech recommendation method, comprising: The system receives trigger requests from customer service terminals; acquires the current desktop image of the customer service terminal, identifies new messages in the current desktop image, and marks the new messages; determines the current mode based on the overlap of bottom messages in consecutive desktop images, where the mode includes real-time dialogue mode and history browsing mode; when the current mode is determined to be real-time dialogue mode, it identifies the question carried by the new message; it determines whether the question exists in the history snapshot cache, and if it exists, it acquires the history snapshot corresponding to the question; if it does not exist, it triggers a dual-channel asynchronous retrieval; it implements dual-channel asynchronous retrieval through vector retrieval in the dialogue knowledge base and large language model retrieval, acquires the retrieval results corresponding to the question, and stores the retrieval results and the question in a new history snapshot cache for display on the customer service terminal interface.
[0007] Preferably, acquiring the current desktop image of the customer service terminal, identifying new messages on the current desktop image, and marking the new messages includes: acquiring the current desktop image of the customer service terminal, parsing the current desktop image, and extracting message text and time axis coordinate information; associating a session identifier, and uniquely marking a single message with the message text, time axis coordinate information, and session identifier; comparing the unique message identifier with historical message records to identify new messages; and marking the identified new messages.
[0008] Preferably, determining the current mode based on the overlap of bottom messages in consecutive frame desktop images includes: acquiring bottom message text data of the display area of the current frame and the previous frame desktop images based on consecutive frame desktop images; calculating the overlap between the bottom message text data of the current frame and the bottom message text data of the previous frame to obtain the overlap between the bottom message text data of the current frame and the bottom message text data of the previous frame; comparing the overlap with a set determination threshold, and determining that the current mode is a history browsing mode when the overlap is greater than the threshold, and determining that the current mode is a real-time dialogue mode when the overlap is less than the threshold.
[0009] Preferably, when the current mode is determined to be real-time dialogue mode, the state is not switched immediately after a single frame determination, but a state confirmation queue is maintained; the next frame desktop image of the customer service terminal is obtained, and the mode of the next frame desktop image is determined; when the candidate modes determined in two consecutive frame periods are completely consistent, the working mode is switched to real-time dialogue mode.
[0010] Preferably, the process involves determining whether the question exists in the historical snapshot cache. If the question exists, the corresponding historical snapshot is retrieved. If the question does not exist, a dual-channel asynchronous retrieval is triggered. This includes determining whether the question exists in the historical snapshot cache, where the historical snapshot cache stores historically high-frequency questions and their corresponding response snapshot data. If the question exists, the historical snapshot corresponding to the question's identifier or characteristics is retrieved from the historical snapshot cache, and the historical snapshot is output as the retrieval result.
[0011] Preferably, asynchronous dual-channel retrieval is achieved through vector retrieval in the dialogue knowledge base and retrieval using a large language model. This retrieves the search results corresponding to the question and stores the search results and the question as a new historical snapshot cache for display on the customer service terminal. The process includes: inputting the question into the asynchronous dual-channel retrieval; calling the vector retrieval interface to search the dialogue knowledge base for the question, receiving the search results from the dialogue knowledge base, and filling the search results into the matching dialogue box; inputting the question into the large language model, which returns a semantically appropriate and tone-suited response as the search result. Preferably, storing the search results and the question as a new historical snapshot cache for provision to the customer service terminal's display interface includes: encapsulating the search results from the dialogue knowledge base and the question into structured snapshot data to obtain a temporary snapshot; displaying the temporary snapshot on the customer service terminal's display interface; and storing the search results and questions from large language models with long response times as a new historical snapshot cache for provision to the customer service terminal's display interface.
[0012] This invention also provides an OCR-driven context-aware speech recommendation system, comprising: A request receiving module is used to receive trigger requests from the customer service terminal; The message acquisition module is used to acquire the current desktop image of the customer service terminal, identify new messages on the current desktop image, and mark the new messages; The mode determination module is used to determine the current mode based on the overlap of the bottom messages compared with the desktop images in consecutive frames, wherein the modes include real-time dialogue mode and history browsing mode. The question identification module is used to identify the question carried in the new message when the current mode is determined to be a real-time dialogue mode; The snapshot identification module is used to determine whether the problem exists in the historical snapshot cache. If it is determined to exist, the historical snapshot corresponding to the problem is obtained. If it is determined not to exist, a dual-channel asynchronous retrieval is triggered. The dual-channel recommendation display module is used to achieve asynchronous retrieval of the dual channels through vector retrieval in the speech knowledge base and retrieval of the large language model, obtain the retrieval results corresponding to the question, and store the retrieval results and the question as a new historical snapshot cache for display on the customer service terminal.
[0013] The present invention also provides an electronic device, the electronic device comprising: One or more processors; and A memory that stores computer program instructions, which, when executed, cause the processor to perform the steps of any of the aforementioned methods.
[0014] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.
[0015] Compared with the prior art, the advantages of the present invention are as follows: 1. Employs a triple filtering logic of timeline verification, text deduplication, and view mode determination to impose multi-layered constraints on triggering conditions, thereby preventing accidental function triggering from the source and improving triggering reliability.
[0016] 2. Snapshot caching and reuse of frequently asked questions reduces the time spent on data calculation and retrieval, enabling rapid output of recommendation results and achieving a response time within seconds.
[0017] 3. It can automatically identify whether the current running status is real-time mode or historical mode, and handle different modes differently. This will not cause mutual interference between business functions, avoid repeated calculations, and save system computing power.
[0018] 4. Data is processed by asynchronously backfilling and covering vector retrieval results using large language model retrieval results to ensure more accurate retrieval results. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the context-aware speech recommendation method in an embodiment of the present invention; Figure 2 This is a block diagram of the context-aware speech recommendation system in an embodiment of the present invention; and Figure 3 This is a flowchart illustrating the context-aware speech recommendation system in an embodiment of the present invention. Detailed Implementation
[0021] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0022] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. This application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] It should be noted that the following description covers various aspects of embodiments within the scope of protection of this invention. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this application, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0024] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. The drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0025] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0026] like Figure 1 As shown in the figure, this application provides a context-aware speech recommendation method.
[0027] Step 101: Receive the trigger request from the customer service terminal.
[0028] The server received a trigger request from the client terminal.
[0029] Step 102: Obtain the current desktop image of the customer service terminal, identify new messages on the current desktop image, and mark the new messages.
[0030] The server acquires the current desktop image of the customer service terminal. It then performs OCR (Optical Character Recognition) on the desktop image in real time, collecting the text content corresponding to customer messages and the timeline coordinates of the message interface. The server binds the text content, timeline coordinates, and unique identifier corresponding to the current session to distinguish feature combinations of different messages.
[0031] The server uses image template matching to locate the message display area of the target desktop application. For applications with fixed window positions, a preset screenshot area is used to eliminate interference from irrelevant areas of the desktop. For applications with draggable windows, image feature matching is used to first locate the real-time coordinates of the message window before cropping the area. This ensures that the screenshot is always focused on the message list.
[0032] The server loads the OCR engine to recognize the text in the area, recording the text recognition results and timeline. The recognized text block is compared with the previous record. New messages are identified using hash values or text similarity algorithms. Hash values are calculated for the text content on the current desktop and the text content on historical desktops, or text similarity is calculated using an algorithm. If the hash value of the current text block is completely inconsistent with historical records, or if the text similarity is below a preset threshold, the text block is determined to be a new message. New messages are marked; their locations can be highlighted on the image, or they can be marked as pending processing.
[0033] Step 103: Determine the current mode by comparing the overlap of bottom messages with the desktop images of consecutive frames, where the modes include real-time dialogue mode and history browsing mode.
[0034] The server continuously captures screen image frames of the chat window area at fixed time intervals (e.g., one frame every 16ms). For each frame of the desktop image, the pixel data of the message located at the bottom of the image is extracted. The server uses an image difference algorithm to calculate the overlap between the bottom message text data of the current frame and the bottom message text data of the previous frame, obtaining the overlap degree between them. The overlap degree is compared with a set judgment threshold. When the overlap degree is greater than the threshold, the current mode is determined to be history browsing mode; when the overlap degree is less than the threshold, the current mode is determined to be real-time chat mode.
[0035] When the server determines that the current mode is real-time chat, it retrieves the next frame of the desktop image and repeats the overlap calculation operation above. If at least two consecutive desktop images are determined to be in real-time chat mode, the server switches to real-time chat mode and enables recommendations. To prevent false judgments due to screen flickering, recommendations are only triggered when genuine new messages appear.
[0036] Step 104: When the current mode is determined to be real-time dialogue mode, identify the problem carried by the new message.
[0037] After the server switches from the current mode to real-time dialogue mode, it continuously listens for and acquires new message data input by the user. Semantic parsing is performed on the new message data, including word segmentation, syntactic analysis, and intent recognition, to determine whether interrogative semantic features exist in the message. If interrogative semantic features are detected, the core interrogative content in the message is extracted to form a structured question representation; otherwise, the message is marked as a plain statement.
[0038] Step 105: Determine if the problem exists in the historical snapshot cache. If it exists, retrieve the historical snapshot corresponding to the problem. If it does not exist, trigger a dual-channel asynchronous retrieval.
[0039] The server queries the historical snapshot cache database to determine if the question's feature values exist in the cache. If the question exists in the historical snapshot cache, the server directly retrieves the historical snapshot data associated with the question from the historical snapshot cache database. This historical snapshot data includes previously generated answers and related question features. If the question does not exist in the historical snapshot cache, a dual-channel asynchronous retrieval is triggered.
[0040] While triggering the dual-channel asynchronous retrieval, the server builds a new snapshot cache. The snapshot cache includes at least the questions extracted from the customer service terminal and the matching dialogue boxes generated based on the questions. The extracted questions and matching dialogue boxes are encapsulated and built into structured snapshot data.
[0041] Step 106: Implement asynchronous retrieval through dual channels using vector retrieval and large language model retrieval in the dialogue knowledge base, obtain retrieval results corresponding to the question, and store the retrieval results and questions as a new historical snapshot cache for display on the customer service terminal.
[0042] The server stores a script knowledge base, which stores multiple script records. Each script record includes at least the standard response text, applicable scenario tags, trigger matching features, and context adaptation parameters.
[0043] The standardized construction of the dialogue knowledge base is a core element in ensuring accurate intelligent responses, unified services, and business adaptability. The overall implementation is achieved through a standardized three-step process: data collection and cleaning, vector embedding and transformation, and storage and indexing. The specific construction method is as follows: The first step is the collection and cleaning of multi-source script data. This involves aggregating script data from all business scenarios, including existing standard scripts, high-frequency FAQs, response guidelines, business scripts for various scenarios, high-quality historical responses, and fallback scripts, covering all service scenarios such as pre-sales, sales, after-sales, and complaints. The raw data undergoes standardized cleaning, removing duplicate, invalid, erroneous, expired, and incomplete content. Business terminology, expressions, and format specifications are standardized, ambiguities are corrected, and missing content is supplemented. The result is a selection of compliant, accurate, and usable high-quality structured script data, providing a reliable data foundation for subsequent modeling.
[0044] The second step is structured speech vector embedding and transformation. Based on the cleaned standard speech text, natural language processing and vector embedding models are used to extract semantic features from the speech content, accurately capturing the core intent, scene features, and key information of the text. Breaking through the limitations of traditional keyword matching, the natural language text is uniformly converted into standardized high-dimensional semantic vectors, giving each speech a unique semantic numerical identifier, fully preserving semantic connections and business characteristics, and supporting subsequent intelligent semantic matching and retrieval capabilities.
[0045] The third step is vector storage and retrieval index construction. The generated high-dimensional vectors of the dialogue scripts are associated with the original dialogue script content, scene tags, response priorities, and other auxiliary information, and then stored persistently in a vector database. Simultaneously, a dedicated retrieval index is built based on the full vector data. By optimizing similarity algorithms, scene partitioning, matching weights, and sorting rules, an efficient and accurate semantic retrieval system is constructed. This allows for rapid comparison of user questions with dialogue script vectors in the database, accurately identifying user intent and matching the optimal response. This effectively solves the problems of matching bias and poor scene adaptation in traditional retrieval methods, ultimately forming a standardized, efficient, and adaptable intelligent dialogue script knowledge base suitable for all business scenarios, supporting business applications such as intelligent response and agent assistance.
[0046] Based on the identified question, the server simultaneously triggers two independent retrieval threads to perform vector retrieval in the discourse knowledge base and large language model retrieval, executing the retrieval operations in parallel. The two threads do not block each other and run independently.
[0047] The server performs vector retrieval in the dialogue knowledge base, converts the preprocessed user questions into vectors, performs similarity matching in the vector dialogue knowledge base, filters out standard response texts with high similarity thresholds, fills the matching dialogue box with the retrieved standard response texts, and then outputs the results.
[0048] The server executes a large language model retrieval, inputting pre-processed user questions into the model. The model integrates the user's question with pre-defined "role settings" (e.g., senior salesperson, professional customer service), "scenario background," and "style requirements" (e.g., gentle, urgency) to create a semantically rich prompt. Subsequently, the model uses the self-attention mechanism in the Transformer architecture to deeply analyze the logical relationships between these elements, identifying whether the current context requires reassurance, guidance, or facilitating a transaction. Based on language patterns learned from massive pre-trained data, the large language model no longer generates words randomly but adjusts the probability distribution of words, significantly reducing the weight of inappropriate or awkward words and increasing the weight of polite expressions and conversion techniques. The large language model retrieval results and questions are stored as a new historical snapshot cache for display on the customer service terminal interface.
[0049] The question is input into a dual-channel asynchronous retrieval system. Based on the question, a vector retrieval interface is invoked to search the script knowledge base for the question. The script knowledge base provides the search results, which are then filled into the matching script box. The question is then input into a large language model, which returns semantically appropriate and tone-suited response scripts as the search results. The large language model's search results and the question are stored as a new historical snapshot cache for display on the customer service terminal's interface.
[0050] The above methods employ a triple filtering logic of timeline verification, text deduplication, and view mode determination to impose multi-layered constraints on triggering conditions, fundamentally preventing accidental function triggering and improving trigger reliability. Snapshot caching and reuse of frequently encountered problem data reduces data computation and retrieval time, enabling rapid output of recommendation results and achieving sub-second response times. It can automatically identify whether the current running state is real-time or historical mode, handling different modes differently to avoid interference between business functions and redundant calculations, thus saving system computing power. Asynchronous backfilling of vector retrieval results using large language model search results ensures more accurate and relevant search results.
[0051] In one embodiment, the current desktop image of the client terminal is acquired, new messages on the current desktop image are identified, and the new messages are marked. This includes: the server acquiring the current desktop image of the client terminal; after acquiring the desktop image, the server uses optical character recognition (OCR) technology to convert the image visual information into computer-readable text data.
[0052] The server optimizes the captured desktop image, including brightness and contrast adjustment, noise removal, tilt correction, and image binarization, to improve subsequent recognition accuracy. An artificial intelligence model traverses the entire image to locate text-containing target areas such as chat windows and work order fields. Based on deep learning models such as CRNN and Transformer, line-by-line and character-by-character recognition is performed on the located text regions, outputting the corresponding message text.
[0053] The server filters the message text, removing invalid content such as system menus and icon text, and extracts the dialogue text between customer service and users.
[0054] The server collects two types of data: screen window coordinates and timestamps corresponding to the message text. It then associates and binds the chat content within the message text with the timestamp regions within the image, constructing a complete business communication timeline that carries both spatial location and temporal dimensions. By comparing the current timeline with historical data, new messages are identified based on their chronological order.
[0055] The above method uses Optical Character Recognition (OCR) technology to parse text from desktop images. Combined with image preprocessing, text region detection, and a deep learning recognition model, it significantly improves the accuracy and stability of text and time information recognition. Extracting the text's timeline enables deep correlation between dialogue content, location information, and time information, resulting in highly structured data that facilitates subsequent data management and traceability. Using a historical timeline as a reference and judging new messages based on chronological logic, the recognition rules are clear and the judgment logic is objective, accurately distinguishing new messages and effectively avoiding missed or false judgments.
[0056] In one embodiment, the current mode is determined by comparing the overlap of bottom messages in consecutive desktop images. This includes: the server continuously capturing screen image frames of the chat window area at fixed time intervals (e.g., one frame every 16ms); and comparing the overlap of bottom messages in two consecutive desktop images.
[0057] In each frame refresh cycle, the server retrieves the pixel data of the bottom three client messages in the current display area from the message queue, forming the current frame message set. It also reads and retains the bottom three client messages recorded in the previous frame refresh cycle, defining them as the previous frame message set.
[0058] The server uses an image difference algorithm to calculate the overlap between the current frame message set and the previous frame message set, obtaining the overlap between the bottom message text data of the current frame and the bottom message text data of the previous frame. The overlap comparison can be based on the unique identifier of the message text or the hash value of the message content. The server counts the number of messages with the same content or the same ID in the two sets, and defines this value as the overlap number. In this embodiment, since the bottom 3 messages are collected, the overlap number ranges from 0 to 3.
[0059] The overlap is compared with a set threshold. If the overlap is greater than the threshold, the current mode is determined to be history browsing mode; if the overlap is less than the threshold, the current mode is determined to be real-time conversation mode. In this embodiment, if the overlap is 3, it indicates that the current bottom message is completely consistent with the previous frame, and it is determined to be history browsing mode (the user is viewing historical messages, and there are no new messages). If the overlap is less than 3, it indicates that a new message has entered the bottom display area, and it is determined to be real-time conversation mode (the user is participating in real-time communication).
[0060] When the server determines that the current mode is real-time dialogue, it does not immediately switch states after a single frame determination. Instead, it maintains a state confirmation queue. The server retrieves the next frame of the desktop image and repeats the above overlap calculation operation. The server only officially confirms the determination result and switches its operating mode to real-time dialogue mode to enable recommendations after at least two consecutive frames of desktop images are determined to be in real-time dialogue mode. For example, if the i-th frame is determined to be in real-time dialogue mode, and the (i+1)-th frame is also determined to be in real-time dialogue mode, the system officially switches to real-time dialogue mode at the end of the (i+1)-th frame. If the determination result of the (i+1)-th frame changes, the counter is reset, and the original mode remains unchanged.
[0061] The above method utilizes the spatiotemporal locality of messages at the bottom of the display area, and characterizes the message flow rate by calculating the overlap between message sets of consecutive frames. This judgment rule based on quantified data has clear logic and well-defined judgment boundaries, significantly improving the accuracy of pattern recognition. A consistency check between two consecutive frames is introduced into the pattern judgment process. This effectively filters out noise interference within a single frame, prevents misjudgments caused by interface flickering, and ensures that recommendations are triggered only when genuine new messages appear.
[0062] In one embodiment, it is determined whether the question exists in the historical snapshot cache. If it exists, the historical snapshot corresponding to the question is retrieved; if it does not exist, a dual-channel asynchronous retrieval is triggered. This includes: the server retrieving new message text generated by real-time dialogue in the current desktop image and extracting the question from the new message text.
[0063] The server has a built-in historical snapshot cache database, which is a high-speed cache database used to store frequently accessed or recently generated question-and-answer historical snapshot cache data. When a new message is received, it first checks whether the question exists in the historical snapshot cache data. It calculates the identifier or characteristics of the current question using an MD5 hash or SimHash algorithm and compares this identifier or characteristics with the index key in the historical snapshot cache database. If the comparison is successful, it is determined that a corresponding historical snapshot exists. Once a match is confirmed in the historical snapshot cache database, the server directly retrieves the historical snapshot data, encapsulates the extracted historical snapshot data in a format (such as JSON format), and returns it to the client terminal for rendering and display via a network interface. If it is determined that the question does not exist in the historical snapshot cache database, a dual-channel asynchronous retrieval is triggered.
[0064] In this invention, a historical snapshot refers to a structured record formed by encapsulating the question's characteristics, answer, and related metadata after the server first receives a user's question and completes the script retrieval and generation. When the same or semantically equivalent question is subsequently received, if a corresponding historical snapshot exists in the cache, the answer from that snapshot is directly retrieved and returned to the user, without re-executing the retrieval and generation process.
[0065] The above method caches the question-and-answer results of processed questions in the form of snapshots in a historical snapshot cache database. When the same or semantically equivalent question is received again, the historical snapshot can be read directly from the cache and returned, avoiding repeated execution of computationally intensive operations such as semantic understanding, knowledge base retrieval and answer generation, and significantly reducing response latency.
[0066] In one embodiment, the method further includes snapshot validity verification, extracting the timestamps of historical snapshots and calculating the difference between them and the current time. If the difference is within a preset validity period (e.g., 24 hours), the snapshot is loaded directly. If it has expired, it is marked as invalid and the process is switched to dual-channel asynchronous retrieval.
[0067] The above methods perform timeliness verification on historical snapshots to avoid retrieving outdated or expired data, ensuring both response speed and the real-time nature and reliability of feedback information. This gives the solution both the high performance of caching and the accuracy of real-time queries.
[0068] In one embodiment, when the server determines that the problem does not exist in the historical snapshot cache or the historical snapshot cache data has expired, a new snapshot cache is constructed. The snapshot cache includes at least the problem extracted by the customer service terminal and the matching dialogue box generated based on the problem. The extracted problem and the matching dialogue box are encapsulated and constructed into structured snapshot data.
[0069] The server assigns a unique issue identifier to each issue and uses this identifier as the cache key. Each cache key corresponds to a list-type snapshot cache. Snapshot caches for different issues are independent and isolated from each other.
[0070] The above methods utilize a two-domain structure for snapshot caching, consisting of questions and matching phrase boxes. This structure is clear and facilitates unified parsing, identification, and management. Snapshot caching is partitioned and grouped by question, enabling rapid expiration identification and quantity reduction, resulting in high execution efficiency.
[0071] In one embodiment, the dual-channel asynchronous retrieval is achieved through vector retrieval in the dialogue knowledge base and large language model retrieval, obtaining retrieval results corresponding to the question, and storing the retrieval results and the question as a new historical snapshot cache for display on the customer service terminal interface. This includes: the server initiating dual-channel asynchronous retrieval, inputting the question into the dual-channel asynchronous retrieval; the vector retrieval module and the large language model retrieval module are invoked to execute retrieval actions in parallel, with the two retrieval links operating independently and asynchronously. The vector retrieval module vectorizes the current question, performs similarity matching between the generated question vector and the pre-stored dialogue vector set in the dialogue knowledge base, and retrieves the dialogue content with the highest matching degree from the dialogue knowledge base as the first retrieval result. The large language model retrieval module performs semantic understanding and content retrieval in the dialogue knowledge base based on the semantics of the question text, combines the knowledge base text context and scene tags to complete accurate semantic matching, and outputs the second retrieval result.
[0072] The vector retrieval module quickly provides the first retrieval result, filling it into the matching dialogue box. The large language model requires some caching time before providing the second retrieval result. The server determines, based on the conversation, whether the first retrieval result in the matching dialogue box needs to be replaced with the second retrieval result. Alternatively, the first retrieval result in the matching dialogue box can be directly replaced with the second retrieval result. The server stores the large language model retrieval results and the question as a new historical snapshot cache for display on the customer service terminal interface.
[0073] The above method combines two approaches: the vector retrieval channel focuses on high-precision matching of existing phrases, while the large language model retrieval channel focuses on generating flexible and context-relevant answers. Combining the two approaches balances accuracy and coverage. The vector retrieval channel converts the question into a high-dimensional semantic vector and performs similarity matching in the phrase knowledge base. Due to its low computational cost, it can return candidate phrases quickly. The large language model retrieval channel inputs the question into a large language model, generating answers based on contextual understanding and reasoning. Due to the high computational complexity of the model, its response time is longer. The two channels execute asynchronously, with the vector retrieval channel obtaining its results first, followed by the large language model channel. The rapid response of vector retrieval and the deep analysis of the large language model complement each other, ensuring the quality of the results while shortening the overall waiting time through parallel execution.
[0074] In one embodiment, it further includes: a request receiving module 201, a message collection module 202, a pattern judgment module 203, a problem identification module 204, a snapshot identification module 205, and a dual-channel recommendation display module 206.
[0075] The request receiving module 201 is used to receive the trigger request from the customer service terminal.
[0076] The message acquisition module 202 is used to acquire the current desktop image of the customer service terminal, identify new messages on the current desktop image, and mark the new messages.
[0077] The mode determination module 203 is used to determine the current mode based on the overlap of the bottom messages compared with the desktop images in consecutive frames, wherein the modes include real-time dialogue mode and history browsing mode.
[0078] The question identification module 204 is used to identify the question carried in the new message when the current mode is determined to be a real-time dialogue mode.
[0079] The snapshot recognition module 205 is used to determine whether the problem exists in the historical snapshot cache. If it is determined to exist, the historical snapshot corresponding to the problem is obtained. If it is determined not to exist, a dual-channel asynchronous retrieval is triggered. The dual-channel recommendation display module 206 is used to achieve asynchronous retrieval of the dual channels through vector retrieval and large language model retrieval in the speech knowledge base, obtain the retrieval results corresponding to the question, and store the retrieval results and the question as a new historical snapshot cache for display on the customer service terminal.
[0080] In one embodiment, a computer device is provided, which may be a server. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores time-queue data, etc. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a camera photo stitching method.
[0081] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: receiving a trigger request from the customer service terminal; acquiring the current desktop image of the customer service terminal, identifying new messages in the current desktop image, and marking the new messages; determining the current mode based on the overlap of bottom messages in consecutive frames of the desktop image, wherein the mode includes a real-time dialogue mode and a history browsing mode; when the current mode is determined to be a real-time dialogue mode, identifying the question carried by the new message; determining whether the question exists in a history snapshot cache, acquiring the history snapshot corresponding to the question when it exists, and triggering a dual-channel asynchronous retrieval when it does not exist; implementing the dual-channel asynchronous retrieval through vector retrieval and large language model retrieval in a dialogue knowledge base, acquiring the retrieval result corresponding to the question, and storing the retrieval result and the question as a new history snapshot cache for provision to the display interface of the customer service terminal.
[0082] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When executed by a processor, the computer program performs the following steps: receiving a trigger request from the customer service terminal; acquiring the current desktop image of the customer service terminal, identifying new messages in the current desktop image, and marking the new messages; determining the current mode based on the overlap of bottom messages in consecutive frames of the desktop image, wherein the mode includes a real-time dialogue mode and a history browsing mode; when the current mode is determined to be a real-time dialogue mode, identifying the question carried by the new message; determining whether the question exists in a history snapshot cache, acquiring the history snapshot corresponding to the question when it exists, and triggering a dual-channel asynchronous retrieval when it does not exist; implementing the dual-channel asynchronous retrieval through vector retrieval and large language model retrieval in the dialogue knowledge base, acquiring the retrieval results corresponding to the question, and storing the retrieval results and the question as a new history snapshot cache for provision to the display interface of the customer service terminal.
[0083] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A context-aware dialogue recommendation method for recommending dialogue in customer service terminals, characterized in that, include: Receive the trigger request from the customer service terminal; Obtain the current desktop image of the customer service terminal, identify new messages on the current desktop image, and mark the new messages; The current mode is determined by comparing the overlap of bottom messages with the desktop images in consecutive frames, wherein the modes include real-time dialogue mode and history browsing mode. When the current mode is determined to be a real-time dialogue mode, the question carried by the new message is identified; Determine if the problem exists in the historical snapshot cache. If it exists, retrieve the historical snapshot corresponding to the problem. If it does not exist, trigger a dual-channel asynchronous retrieval. The asynchronous retrieval of the dual channels is achieved by vector retrieval and large language model retrieval in the dialogue knowledge base, obtaining the retrieval results corresponding to the question, and storing the retrieval results and the question as a new historical snapshot cache for display on the customer service terminal.
2. The context-aware speech recommendation method according to claim 1, characterized in that, The step of obtaining the current desktop image of the customer service terminal, identifying new messages on the current desktop image, and marking the new messages includes: Obtain the current desktop image of the customer service terminal, parse the current desktop image, and extract message text and time axis coordinate information; Associate a session identifier to uniquely mark a single message by combining the message text, timeline coordinate information, and session identifier. The unique identifier of a message is compared with historical message records to identify new messages; The newly identified messages are marked.
3. The context-aware speech recommendation method according to claim 1, characterized in that, The method of determining the current mode based on the overlap of desktop images compared with bottom messages in consecutive frames includes: Based on the desktop images of consecutive frames, obtain the bottom message text data of the desktop image display area of the current frame and the previous frame; The overlap between the bottom message text data of the current frame and the bottom message text data of the previous frame is calculated to obtain the overlap between the bottom message text data of the current frame and the bottom message text data of the previous frame. The overlap is compared with a set threshold. If the overlap is greater than the threshold, the current mode is determined to be historical browsing mode. If the overlap is less than the threshold, the current mode is determined to be real-time dialogue mode.
4. The context-aware speech recommendation method according to claim 3, characterized in that, When the current mode is determined to be real-time dialogue mode, the state will not be switched immediately after a single frame determination, but a state confirmation queue will be maintained. Obtain the next frame of the desktop image from the client terminal and determine the mode of the next frame of the desktop image; When the candidate modes determined within two consecutive frame periods are completely consistent, the working mode is switched to real-time dialogue mode.
5. The context-aware speech recommendation method according to claim 1, characterized in that, The process involves determining whether the problem exists in the historical snapshot cache. If it exists, the corresponding historical snapshot is retrieved; if it does not exist, a dual-channel asynchronous retrieval is triggered, including: Determine whether the problem exists in the historical snapshot cache, wherein the historical snapshot cache stores historically high-frequency problems and their corresponding response snapshot data; When it is determined that the problem exists, a historical snapshot corresponding to the identifier or feature of the problem is retrieved from the historical snapshot cache, and the historical snapshot is output as the search result.
6. The context-aware speech recommendation method according to claim 1, characterized in that, The method involves asynchronous dual-channel retrieval through vector retrieval in the dialogue knowledge base and retrieval using a large language model to obtain retrieval results corresponding to the question. The retrieval results and the question are then stored as a new historical snapshot cache for display on the customer service terminal interface. This includes: The question is input into the asynchronous retrieval of the dual channels; Based on the question, the vector retrieval interface is invoked to retrieve the question from the speech knowledge base, and the speech knowledge base returns the retrieval results. The question is input into a large language model, which then returns semantically appropriate and tone-suitable responses as search results.
7. The context-aware speech recommendation method according to claim 1, characterized in that, The step of storing the search results and the question as a new historical snapshot cache for display on the customer service terminal includes: The search results from the dialogue knowledge base are encapsulated with the question to construct structured snapshot data, resulting in a temporary snapshot; The temporary snapshot is displayed on the display interface of the customer service terminal; The search results and questions for large language models with long response times are stored as new historical snapshots in the cache for display on the customer service terminal.
8. A context-aware speech recommendation system driven by OCR, characterized in that, include: A request receiving module is used to receive trigger requests from the customer service terminal; The message acquisition module is used to acquire the current desktop image of the customer service terminal, identify new messages on the current desktop image, and mark the new messages; The mode determination module is used to determine the current mode based on the overlap of the bottom messages compared with the desktop images in consecutive frames, wherein the modes include real-time dialogue mode and history browsing mode. The question identification module is used to identify the question carried in the new message when the current mode is determined to be a real-time dialogue mode; The snapshot identification module is used to determine whether the problem exists in the historical snapshot cache. If it is determined to exist, the historical snapshot corresponding to the problem is obtained. If it is determined not to exist, a dual-channel asynchronous retrieval is triggered. The dual-channel recommendation display module is used to achieve asynchronous retrieval of the dual channels through vector retrieval in the speech knowledge base and retrieval of the large language model, obtain the retrieval results corresponding to the question, and store the retrieval results and the question as a new historical snapshot cache for display on the customer service terminal.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; and A memory storing computer program instructions, which, when executed, cause the processor to perform the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
