A desktop application intelligent reply delivery method
By binding the window handle in the desktop chat system and performing validity checks before and after generation, the problems of insufficient input before generation and invalid output after generation are solved. The clipboard injection method is adopted to reduce the risk of misdelivery, improve the stability of long text replies, adapt to various levels of automation, and form a controllable reply loop.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
- Filing Date
- 2026-04-28
- Publication Date
- 2026-06-16
AI Technical Summary
Existing technologies in desktop chat assistance systems suffer from problems such as insufficient input validity checks before generation, lack of output validity checks after generation, high risk of misdelivery in multi-window environments, and poor stability of character-by-character simulated input, leading to invalid replies, misdelivery, and unstable delivery.
By recording and binding the target chat window handle, validity checks are performed before and after generation to ensure that the reply content meets the conditions before and after calling the generation model. After generation, the reply text is written to the system clipboard. Clipboard injection is used to replace word-by-word simulated input, and multiple sending modes are combined to ensure accurate delivery of the reply.
It reduces the probability of invalid replies entering the delivery chain, reduces the risk of misdelivery in a multi-window environment, improves the stability of long text replies, and is compatible with office needs of different levels of automation, forming a controllable desktop reply closed loop.
Smart Images

Figure CN122220474A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction automation technology, and in particular to a method for intelligent reply delivery in desktop applications. Background Technology
[0002] In desktop chat assistance systems, the system must not only address the question of "whether the answer is correct," but also two additional questions: "whether it should be sent" and "where it should be sent." Unlike ordinary text-based question-and-answer systems, the final output of a desktop chat assistance system is not a piece of text, but a precise write operation to a real chat window. Therefore, ensuring the quality of the response content while guaranteeing that the response can be safely, stably, and accurately delivered to the user's intended target window, thereby truly implementing intelligent question-and-answer capabilities in the actual desktop workflow, is the core requirement.
[0003] However, existing technical solutions have the following shortcomings in engineering implementation:
[0004] 1. Lack of input validity check before generation. When the screenshot quality is low, the chat structure is invalid, or the system fails to extract a clear latest message to be replied to, the generation model is still forcibly called, resulting in the model outputting invalid reply content that is irrelevant to the current session. This wastes computing resources and interferes with user decision-making.
[0005] 2. Lack of output validity validation after generation. The system defaults to allowing the sending process to proceed as long as the model returns non-empty text. However, in practice, empty strings, invalid placeholders, or obviously unsendable generated results frequently occur. The system will directly push invalid content to the delivery stage, causing unnecessary automated errors.
[0006] 3. Accidental delivery is prone to occur in a multi-window desktop environment. There is usually a time interval of several seconds between screenshot capture and reply generation, during which users may switch to other windows to work. If the system only relies on the "current foreground window" to perform the sending, content that should be sent to the chat window may be mistakenly pasted into a document, browser, or other application, posing serious information security and operational risks.
[0007] 4. Character-by-character simulated input method has poor stability. In long text reply scenarios, the character-by-character simulated keyboard input method is highly sensitive to input method status, window focus changes, and system latency, and is prone to problems such as missing characters, out-of-order text, or incomplete content, making it difficult to meet the requirements for stable delivery.
[0008] Chinese patent CN113347075A discloses a method for responding to WeChat group messages, which can automate responses to repetitive questions to a certain extent. However, it has significant shortcomings in input validity verification, output content verification, dynamic generation capabilities, delivery stability, protection against misdelivery, and process decoupling control.
[0009] Therefore, how to provide a method that can simultaneously cover the four key stages of "pre-generation interception, post-generation interception, bound window directional refocusing, and stable text injection" has become an urgent technical problem to be solved. Summary of the Invention
[0010] In view of this, in order to overcome the shortcomings of the prior art, the present invention aims to provide a method for intelligent reply delivery in desktop applications.
[0011] This invention provides a method for intelligent reply delivery in desktop applications, the method comprising:
[0012] Step S1: Record and bind the window handle of the target chat window as a fixed target for subsequent reply delivery;
[0013] Step S2: Perform a pre-generation validity check before calling the response generation model, and a post-generation validity check after generating the response text;
[0014] Step S3: After both the validity check before generation and the validity check after generation pass, call the system window activation interface to refocus the target chat window corresponding to the bound window handle to the foreground;
[0015] Step S4: Targeted delivery of the response content that has undergone validity checks before and after generation.
[0016] Optionally, in the desktop application intelligent reply delivery method of the present invention, step S1, recording and binding the window handle of the target chat window includes: in the system automatic binding mode, capturing the currently active chat window handle of the user through window recognition and saving it to the system configuration.
[0017] Optionally, in the desktop application intelligent reply delivery method of the present invention, step S1, recording and binding the window handle of the target chat window includes: in the user manual binding mode, the system responds to the user's window selection operation, records the chat window handle specified by the user through interface selection or dragging, and the recorded bound window handle is persistently stored.
[0018] Optionally, in the desktop application intelligent reply delivery method of the present invention, step S2 involves determining the validity of the reply before generation in the following manner:
[0019] Obtain the optical character recognition results and chat context information from chat screenshots;
[0020] The system sequentially checks whether the following three conditions are met simultaneously: whether the optical character recognition quality reaches the preset minimum quality threshold, whether the screenshot constitutes a valid chat history structure, and whether there is a clearly identified latest message awaiting reply in the current chat context.
[0021] The pre-response generation process is considered successful only if all three conditions are met, allowing entry into the response generation stage. If any condition is not met, the subsequent response generation and sending process is blocked.
[0022] Optionally, in the desktop application intelligent reply delivery method of the present invention, step S2, the validity of the generated reply is determined in the following manner:
[0023] Obtain the response text output by the response generation model;
[0024] The system checks whether the following three conditions are met simultaneously: the reply text is not an empty string or contains only whitespace characters; the reply text does not contain a system-preset invalid flag; and the reply text meets the minimum deliverable conditions in the currently set sending mode.
[0025] If all three conditions above are met, the result will be deemed successful, allowing the reply delivery process to proceed. If any condition is not met, the sending process will be terminated, the window activation and paste operations will not be performed, and the reason for the block can be optionally recorded for the user to view.
[0026] Optionally, in the desktop application intelligent reply delivery method of the present invention, if the current sending request does not explicitly provide a bound window handle in step S3, refocusing is achieved by supplementing the window positioning method as follows:
[0027] Based on one or more preset window title prompts, traverse all top-level windows on the current desktop to find candidate chat windows whose window titles match the prompts.
[0028] Select the window with the highest matching degree from all candidate windows as the target chat window, and set the currently visible text input control in the target chat window as the keyboard focus.
[0029] Optionally, in the desktop application intelligent reply delivery method of the present invention, in step S4, the reply text that has been determined by validity before generation and validity after generation is written to the system clipboard, and a paste command is sent to the target chat window that has been refocused to complete the targeted delivery of the reply content.
[0030] Optionally, in the desktop application intelligent reply delivery method of the present invention, in step S4, the reply content that has passed the validity determination before generation and the validity determination after generation is written to the system clipboard and a paste command is sent to the target chat window that has been refocused, in the following manner:
[0031] After the system refocuses the target window, it writes the entire reply text to the operating system's clipboard, replacing the text injection method that simulates keyboard input word by word.
[0032] After writing is complete, the system sends a system-level paste command to the refocused target chat window, causing the window to read the reply text from the clipboard corresponding to its input area and write it into the input box.
[0033] Optionally, in the desktop application intelligent reply delivery method of the present invention, after the reply text is written to the system clipboard and before the paste command is sent, the system also performs a clipboard stabilization and waiting operation in the following manner:
[0034] The system waits for a preset short delay time, which is pre-configured based on the typical response time of the operating system's clipboard mechanism;
[0035] After the delay period ends, the system confirms that the clipboard content has been completely written and can be stably read by other processes before sending the paste command to the target window.
[0036] Optionally, in the desktop application intelligent reply delivery method of the present invention, the reply content is sent in one of the following modes:
[0037] In the "Generate but Do Not Deliver" mode, the system only generates a reply text for the user to preview, without executing window activation, clipboard writing, or paste commands. The use of the reply content is entirely up to the user.
[0038] Paste but do not confirm sending mode: In this mode, the system sequentially completes window refocusing, clipboard injection and paste command sending, writes the reply content into the input area of the target window, but does not automatically send a confirmation command. The user has to manually check and decide whether to click the send button.
[0039] The automatic send mode after pasting allows the system to send a confirmation command to the target window after the paste command is completed, thus automatically delivering the reply from the input box to the chat channel.
[0040] The desktop application intelligent reply delivery method of the present invention has the following beneficial technical effects:
[0041] 1. Separate generation control and transmission control into two independent gates to reduce the probability of invalid replies entering the delivery link.
[0042] 2. Reduce the risk of misdelivery in multi-window desktop environments.
[0043] 3. Improve the stability of desktop delivery for long text replies.
[0044] 4. Compatible with varying degrees of human intervention, adapting to different automation needs.
[0045] 5. Facilitates integration with upstream identification and knowledge retrieval modules, forming a controllable closed-loop desktop response system. Attached Figure Description
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating the desktop application intelligent reply delivery method according to an exemplary embodiment 1 of the present invention;
[0048] Figure 2 This is a flowchart illustrating the process of determining the validity of a desktop application intelligent reply delivery method before generation, according to an exemplary embodiment 1 of the present invention.
[0049] Figure 3 This is a flowchart illustrating the validity determination process after generation in the desktop application intelligent reply delivery method according to an exemplary embodiment 1 of the present invention.
[0050] Figure 4 This is a flowchart illustrating the refocusing process for the desktop application intelligent reply delivery method according to Exemplary Embodiment 1 of the present invention. Detailed Implementation
[0051] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0052] It should be noted that, in the absence of conflict, the following embodiments and features can be combined with each other; and, based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0053] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. 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 disclosure, 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 of 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.
[0054] Example 1
[0055] Exemplary embodiment 1 of the present invention provides a method for intelligent reply delivery in desktop applications. Figure 1 This is a flowchart illustrating the desktop application intelligent reply delivery method according to Exemplary Embodiment 1 of the present invention, as follows: Figure 1 As shown, in this embodiment, the method of the present invention is implemented in the following manner:
[0056] Step S1: Record and bind the window handle of the target chat window as a fixed target for subsequent reply delivery.
[0057] In this embodiment, the window handle of the target chat window is recorded and bound in the following manner:
[0058] In the system's automatic binding mode, the handle of the user's currently active chat window is captured by window recognition and saved to the system configuration.
[0059] In manual binding mode, the system responds to the user's window selection operation, records the chat window handle specified by the user through interface selection or drag-and-drop, and the recorded bound window handle is persistently stored.
[0060] Step S2: Perform a pre-generation validity check before calling the response generation model, and a post-generation validity check after generating the response text.
[0061] Figure 2 This is a flowchart illustrating the pre-generation validity determination process of the desktop application intelligent reply delivery method according to Exemplary Embodiment 1 of the present invention, as follows: Figure 2 As shown, in this embodiment, the validity determination is generated in the following manner:
[0062] Obtain the optical character recognition results and chat context information from chat screenshots;
[0063] The system sequentially checks whether the following three conditions are met simultaneously: whether the optical character recognition quality reaches the preset minimum quality threshold, whether the screenshot constitutes a valid chat history structure, and whether there is a clearly identified latest message awaiting reply in the current chat context.
[0064] The pre-response generation process is considered successful only if all three conditions are met, allowing entry into the response generation stage. If any condition is not met, the subsequent response generation and sending process is blocked.
[0065] Figure 3 This is a flowchart illustrating the validity determination process after generation in the desktop application intelligent reply delivery method according to Exemplary Embodiment 1 of the present invention. Figure 3 As shown, in this embodiment, the validity is determined after generation in the following manner:
[0066] Obtain the reply text output by the reply generation model; sequentially determine whether the following three conditions are met simultaneously: the reply text is not an empty string or contains only whitespace characters, the reply text does not contain system-preset invalid tags, and the reply text meets the minimum deliverable conditions in the currently set sending mode; only when all three conditions are met is the result of the generation process deemed as passed, allowing the reply delivery process to proceed; if any condition is not met, the sending process is terminated, the window activation and paste operations are not performed, and the reason for the interception can be optionally recorded for the user to view.
[0067] Step S3: After both the validity check before and after generation are passed, call the system window activation interface to refocus the target chat window corresponding to the bound window handle to the foreground.
[0068] In this embodiment, if the current request does not explicitly provide a bound window handle, refocusing is performed using a supplementary window positioning method. Figure 4 This is a flowchart illustrating the refocusing process of the desktop application intelligent reply delivery method according to Exemplary Embodiment 1 of the present invention, as follows: Figure 4 As shown, in this embodiment, based on one or more preset window title prompts, all top-level windows on the current desktop are traversed to find candidate chat windows whose window title information matches the prompt information; the window with the highest matching degree is selected from all candidate windows as the target chat window, and the currently visible text input control in the target chat window is set as the keyboard focus.
[0069] Step S4: Targeted delivery of the response content that has undergone validity checks before and after generation.
[0070] In this embodiment, the reply text, which has undergone validity checks before and after generation, is written to the system clipboard, and a paste command is sent to the target chat window that has been refocused, thus completing the targeted delivery of the reply content.
[0071] As an optional example, in this embodiment, the response content, which has undergone validity checks before and after generation, is written to the system clipboard and a paste command is sent to the refocused target chat window in the following manner:
[0072] After the system refocuses the target window, it writes the entire reply text to the operating system's clipboard, replacing the text injection method that simulates keyboard input word by word. After writing, the system sends a system-level paste command to the refocused target chat window, causing the window to read the reply text from the clipboard corresponding to its input area and write it into the input box.
[0073] It should be noted that in this embodiment, after writing the reply text to the system clipboard and before sending the paste command, the system also performs a clipboard stabilization waiting operation in the following manner: the system waits for a preset short delay time, which is pre-configured according to the typical response time of the operating system clipboard mechanism; after the delay time ends, the system confirms that the clipboard content has been completely written and can be stably read by other processes before sending the paste command to the target window.
[0074] In practical applications, when implementing the method of this embodiment, the response content is sent in one of the following modes:
[0075] In the "Generate but Do Not Deliver" mode, the system only generates a reply text for the user to preview, without executing window activation, clipboard writing, or paste commands. The use of the reply content is entirely up to the user.
[0076] Paste but do not confirm sending mode: In this mode, the system sequentially completes window refocusing, clipboard injection and paste command sending, writes the reply content into the input area of the target window, but does not automatically send a confirmation command. The user has to manually check and decide whether to click the send button.
[0077] The automatic send mode after pasting allows the system to send a confirmation command to the target window after the paste command is completed, thus automatically delivering the reply from the input box to the chat channel.
[0078] In this embodiment, the following sequential execution paths are formed in the overall process to achieve complete decoupling between generation control and transmission control:
[0079] The system first reads the chat screenshot recognition result and chat context information; then it performs a pre-generation validity check as the first control gate to intercept invalid generation requests with insufficient input conditions; only when the pre-generation check passes will the system call the reply generation model to generate reply text; next, it performs a post-generation validity check on the generated reply text as the second control gate to intercept invalid or unsendable content output by the model; only when the post-generation check passes will the system read the bound window handle and activate the target chat window; then, it writes the reply text to the system clipboard and sends a paste command to the target window; finally, it decides whether to add a send confirmation command based on the current sending mode; through the above path, "whether it can be generated" and "whether it can be sent" are clearly separated into two independent control stages, and the final delivery action is fixedly bound to a pre-determined window target.
[0080] In practical applications, the method of this embodiment can also be connected to the upstream optical character recognition module and knowledge retrieval module in the following ways:
[0081] After passing the pre-generation judgment, the system organizes the most recent chat context and the text fragments matched by the knowledge retrieval module into the prompt words input for the response generation model. The response text generated by the response generation model is based on the latest message to be replied to and can also refer to local knowledge evidence as the basis for the response. The post-generation judgment is independent of the state of the upstream module and only performs validity verification on the response text output by the model itself. The judgment logic is not changed due to fluctuations in the upstream recognition quality. Through the above connection method, the three links of recognition, generation and delivery are decoupled, so that each link can be optimized independently while maintaining interface stability.
[0082] Example 2
[0083] Exemplary embodiment 2 of the present invention provides a method for intelligent reply delivery in desktop applications. In this embodiment, two validity judgments are set in the reply chain: the first judgment determines whether the basic conditions for continuing to generate a reply are met, and the second judgment determines whether the text produced by the model is allowed to enter the sending stage; only when both the first and second judgments pass, the system performs refocusing based on the pre-bound target chat window handle, and writes the reply content to the target window through clipboard injection and paste instructions.
[0084] Specifically, in this embodiment, the method of the present invention is implemented in the following manner:
[0085] Step 1: Record the target chat window binding information
[0086] When automatically or manually binding a chat window, the handle information of the target window is recorded; the handle information serves as the target for subsequent message delivery and does not depend on the currently active window at the time of sending.
[0087] Step 2: Perform validity check before generation
[0088] Before invoking the response generation model, a pre-generation judgment is performed on the current screenshot recognition result and chat context. The judgment includes at least: whether the OCR quality reaches the minimum threshold, whether the screenshot constitutes a valid chat record, and whether a clear latest message to be replied to is identified. If any condition is not met, the system directly blocks the subsequent generation and sending process.
[0089] Step 3: Generate reply text
[0090] Once the pre-generation check is passed, the system generates a reply text based on the chat context and knowledge retrieval results; the reply text can be used in different sending modes such as generating a preview only, pasting only, or sending automatically.
[0091] Step 4: Perform validity check after generation
[0092] Perform a post-generation validity check on the response text generated by the model. The post-generation validity check includes at least: whether the response text is empty, whether it contains a preset invalid flag, and whether it meets the minimum deliverable conditions in the current sending mode. If the post-generation check fails, the system terminates the sending process and only retains the generation result or the reason for interception.
[0093] Step 5: Perform refocusing based on the bound window handle
[0094] When a reply is needed, the system first reads the pre-bound window handle and calls the system window activation interface to switch the target chat window to the foreground; if no handle is explicitly provided, the chat window can be retrieved through the preset window title prompt information, and the visible input control can be set as the focus as a supplementary solution for the direct path of the handle.
[0095] Step Six: Perform Clipboard Injection and Patterned Delivery
[0096] The reply text that has passed the dual-check is written to the system clipboard; a paste command is sent to the target chat window that has been refocused, and the reply content is written to the input area; a decision is made on whether to continue sending a confirmation command based on the sending mode, which includes at least three modes: generate but do not deliver, paste but do not confirm sending, and automatically confirm sending after pasting.
[0097] This embodiment explicitly separates "whether it can be generated" and "whether it can be sent" into two different control stages, and binds the final delivery action to the determined window target, thereby reducing the dual risks of invalid generation and misdelivery.
[0098] Example 3
[0099] Exemplary embodiment 3 of the present invention provides a method for intelligent reply delivery in desktop applications. In this embodiment,
[0100] Step 1: Validity determination before generation
[0101] After obtaining the chat screenshot recognition results and chat context, the system does not immediately invoke the reply generation model. Instead, it first performs a pre-generation judgment, which prioritizes checking whether the OCR quality meets the minimum requirements, whether the screenshot can be recognized as a valid chat record, and whether there is a clear latest message awaiting a reply in the current context. For example, in practical applications, if the OCR quality is below 0.35, the screenshot does not form a valid chat structure, and there is no single visible message that can be degraded for use, or the system does not recognize a latest message awaiting a reply, the system directly blocks the generation process. Through this pre-gate, the system avoids calling the large model to generate content that "looks like a reply but is not actually based on the current conversation" when the input conditions are obviously insufficient.
[0102] Step 2: Response Generation
[0103] The system only invokes the response generation model after the pre-generation check has passed. During generation, the system combines recent chat context and text fragments matched by knowledge retrieval to organize prompts, ensuring the response both revolves around the latest message awaiting reply and references local knowledge evidence. The generated response text is not immediately sent but first enters the post-generation check as "content to be delivered." This breaks down the response generation and delivery process from a one-off sequential action into a three-stage process of "output first, acceptance second, and delivery third."
[0104] Step 3: Validity determination after generation
[0105] After obtaining the model output, the system continues to perform a second judgment, which focuses on whether the reply text itself is sendable. For example, whether the reply text is an empty string or contains only whitespace characters; whether the reply text contains a preset invalidation flag; and whether the reply text meets the minimum deliverability conditions in the current sending mode.
[0106] For example, in practical applications, if the model output is empty or contains invalid flags such as [NO_ANSWER], the system will terminate the transmission and will not proceed to the window activation and pasting stage. Through this post-gate, the system intercepts cases where "generation fails but superficially returns a value" before delivery.
[0107] Step 4: Directed Refocusing of the Bound Window Handle
[0108] When a reply needs to enter the sending phase, the system prioritizes using the pre-bound and saved target chat window handle. After reading this handle, the sending module calls the system's foreground window activation interface to bring the target chat window back to the foreground. The significance of this action is not to "activate a chat application," but to ensure that the window that actually receives the paste command is the previously confirmed target window, and not some other application that happens to be active on the desktop. If the current sending request does not directly carry a valid handle, the system can also search for suspicious chat windows through window title prompts, select the window with the best matching title, and further set the visible input controls as focus, as a supplementary compatibility solution for the direct handle path.
[0109] Step 5: Clipboard injection to replace verbatim input
[0110] After the target window refocuses, the system does not send long text by simulating keyboard input character by character. Instead, it first writes the reply text to the system clipboard and then sends the paste command to the target window. Compared to character-by-character input, clipboard injection is less sensitive to the input method state, more stable for long text replies, and more likely to ensure that the entire content is entered into the input box at once. In practical applications, the system waits briefly for the clipboard to stabilize after writing the text before sending the paste command to reduce the risk of missing characters caused by system-level timing jitter.
[0111] Step Six: Modular Sending Control
[0112] This embodiment allows the same reply to be used under different levels of automation, including at least the following three sending modes:
[0113] 1. Generate but do not deliver: Only generate reply text for manual preview; do not activate the window or paste.
[0114] 2. Paste but do not confirm sending: The system writes the reply content into the input box of the target window, but the user decides whether to click send;
[0115] 3. Automatic sending after pasting: After pasting, the system sends a confirmation command to directly complete the message delivery.
[0116] By explicitly incorporating the sending mode into the process control, this embodiment can serve both fully automated scenarios and semi-automated office scenarios with "human-machine collaboration and final human confirmation".
[0117] The desktop application intelligent reply delivery method of this invention has the following beneficial technical effects:
[0118] 1. Separate generation control and transmission control into two independent gates to reduce the probability of invalid replies entering the delivery link.
[0119] By setting up two independent stages—pre-generation and post-generation judgment—the system performs validity interception on the input and output sides for both the generation conditions and results. Only when the screenshot recognition quality, chat structure integrity, and the existence of the latest message all meet the requirements, and the model's output reply text is not empty, contains no invalid markers, and meets the minimum delivery conditions of the current sending mode, is the system allowed to proceed to the delivery stage. This significantly reduces invalid reply sending caused by insufficient input conditions or model generation failure.
[0120] 2. Reduce the risk of misdelivery in multi-window desktop environments.
[0121] The system pre-binds the handle information of the target chat window. When sending, it directly calls the system window activation interface to refocus the bound window to the foreground, rather than relying on the currently active window at the time of sending. This effectively avoids the problem of accidental delivery caused by the user switching windows while the system is generating a reply, and ensures that the reply content is always written to the target window that the user has pre-confirmed.
[0122] 3. Improve the stability of desktop delivery for long text replies.
[0123] The clipboard injection method replaces the traditional character-by-character simulated keyboard input: the system writes the entire reply text to the system clipboard and then sends a paste command to the target window to complete the text injection. This method is insensitive to input method status, window focus changes, and system timing delays, and can stably complete the writing of reply content of any length, avoiding the common problems of missing characters, out-of-order content, or incomplete content in character-by-character input.
[0124] 4. Compatible with varying degrees of human intervention, adapting to different automation needs.
[0125] It supports three configurable sending modes: "Generate only, do not send", "Paste but do not confirm sending", and "Send automatically after pasting". Users or upper-level applications can choose the fully automatic, semi-automatic, or preview-only working mode according to the actual scenario. It can be used for fully unattended automated processes as well as auxiliary office scenarios with human-machine collaboration and final human confirmation.
[0126] 5. Facilitates integration with upstream identification and knowledge retrieval modules, forming a controllable closed-loop desktop response system.
[0127] Using pre-generation and post-generation judgments as boundaries, the upstream optical character recognition quality, chat structure parsing results, and knowledge retrieval hit rate are linked with the downstream window delivery action into a complete and controllable processing chain. The responsibilities of each module are clearly defined and well decoupled, which facilitates the overall engineering implementation of the system and also allows for independent optimization and upgrades of each subsequent stage.
[0128] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.
[0129] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for intelligent reply delivery in a desktop application, characterized in that, The method includes: Step S1: Record and bind the window handle of the target chat window as a fixed target for subsequent reply delivery; Step S2: Perform a pre-generation validity check before calling the response generation model, and a post-generation validity check after generating the response text; Step S3: After both the validity check before generation and the validity check after generation pass, call the system window activation interface to refocus the target chat window corresponding to the bound window handle to the foreground; Step S4: Targeted delivery of the response content that has undergone validity checks before and after generation.
2. The desktop application intelligent reply delivery method according to claim 1, characterized in that, In step S1, the window handle of the target chat window is recorded and bound, including: in the system automatic binding mode, capturing the currently active chat window handle of the user through window recognition and saving it to the system configuration.
3. The desktop application intelligent reply delivery method according to claim 1, characterized in that, In step S1, the window handle of the target chat window is recorded and bound, including: in the user manual binding mode, the system responds to the user's window selection operation, records the chat window handle specified by the user through interface selection or drag and drop, and the recorded bound window handle is persistently stored.
4. The desktop application intelligent reply delivery method according to claim 1, characterized in that, In step S2, the validity determination before generation is performed as follows: Obtain the optical character recognition results and chat context information from chat screenshots; The system sequentially checks whether the following three conditions are met simultaneously: whether the optical character recognition quality reaches the preset minimum quality threshold, whether the screenshot constitutes a valid chat history structure, and whether there is a clearly identified latest message awaiting reply in the current chat context. The pre-response generation process is considered successful only if all three conditions are met, allowing entry into the response generation stage. If any condition is not met, the subsequent response generation and sending process is blocked.
5. The desktop application intelligent reply delivery method according to claim 1, characterized in that, In step S2, the validity of the generated data is determined as follows: Obtain the response text output by the response generation model; The system checks whether the following three conditions are met simultaneously: the reply text is not an empty string or contains only whitespace characters; the reply text does not contain a system-preset invalid flag; and the reply text meets the minimum deliverable conditions in the currently set sending mode. Only when all three conditions above are met will the generated result be deemed as passed, allowing entry into the reply delivery process; If any condition is not met, the sending process will be terminated, the window activation and paste operations will not be performed, and the reason for the interception can be optionally recorded for the user to view.
6. The desktop application intelligent reply delivery method according to claim 1, characterized in that, In step S3, if the current request does not explicitly provide a bound window handle, refocusing is achieved using the following supplementary window positioning method: Based on one or more preset window title prompts, traverse all top-level windows on the current desktop to find candidate chat windows whose window titles match the prompts. Select the window with the highest matching degree from all candidate windows as the target chat window, and set the currently visible text input control in the target chat window as the keyboard focus.
7. The desktop application intelligent reply delivery method according to claim 1, characterized in that, In step S4, the reply text, which has undergone validity checks before and after generation, is written to the system clipboard, and a paste command is sent to the target chat window that has been refocused, thus completing the targeted delivery of the reply content.
8. The desktop application intelligent reply delivery method according to claim 7, characterized in that, In step S4, the response content, which has passed the validity checks before and after generation, is written to the system clipboard and a paste command is sent to the refocused target chat window as follows: After the system refocuses the target window, it writes the entire reply text to the operating system's clipboard, replacing the text injection method that simulates keyboard input word by word. After writing is complete, the system sends a system-level paste command to the refocused target chat window, causing the window to read the reply text from the clipboard corresponding to its input area and write it into the input box.
9. The desktop application intelligent reply delivery method according to claim 8, characterized in that, After writing the reply text to the system clipboard and before sending the paste command, the system also performs a clipboard stabilization wait operation as follows: The system waits for a preset short delay time, which is pre-configured based on the typical response time of the operating system's clipboard mechanism; After the delay period ends, the system confirms that the clipboard content has been completely written and can be stably read by other processes before sending the paste command to the target window.
10. The desktop application intelligent reply delivery method according to claim 1, characterized in that, The response content in the method is sent according to one of the following modes: In the "Generate but Do Not Deliver" mode, the system only generates a reply text for the user to preview, without executing window activation, clipboard writing, or paste commands. The use of the reply content is entirely up to the user. Paste but do not confirm sending mode: In this mode, the system sequentially completes window refocusing, clipboard injection and paste command sending, writes the reply content into the input area of the target window, but does not automatically send a confirmation command. The user has to manually check and decide whether to click the send button. The automatic send mode after pasting allows the system to send a confirmation command to the target window after the paste command is completed, thus automatically delivering the reply from the input box to the chat channel.
Citation Information
Patent Citations
WeChat group message response method and device
CN113347075A