Cooperative starting, state synchronization and exception recovery method of desktop intelligent agent system
By employing collaborative startup and anomaly recovery methods, the consistency and reliability issues of the desktop intelligent agent system during startup were resolved, achieving stable operation and automated anomaly handling, thereby improving system availability and state synchronization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 北京库库麦电子商务中心(个体工商户)
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-26
AI Technical Summary
Existing desktop intelligent agent software suffers from problems during startup, such as unstable startup order between the main program and local services, easily corrupted configuration files, asynchronous states, and non-automated exception handling, leading to startup failures or inconsistent interface displays.
Through collaborative startup, state synchronization, and anomaly recovery methods, including named mutex detection, configuration repair and compatibility migration, health checks, unified state bus, and hierarchical recovery mechanisms, we ensure single-instance startup, configuration integrity, and state consistency, and provide automated anomaly handling.
It has achieved stable startup of desktop intelligent agent system, improved the recoverability of upgrade and migration, reduced the frequency of manual intervention, and improved the stability and state consistency of long-term operation.
Smart Images

Figure CN122285378A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of desktop software operation and control technology, specifically referring to the collaborative startup, state synchronization and anomaly recovery method of desktop intelligent agent system. Background Technology
[0002] Existing desktop intelligent agent software typically consists of a launcher, main program interface, local gateway service, configuration file, and session communication module. Due to the large number of components, complex dependencies, and significant differences in users' local environments, existing solutions generally suffer from the following problems: the startup order of the main program and local service is unstable, easily causing startup failure or duplicate instance execution; configuration files are prone to missing fields, version incompatibility, and address invalidation after upgrades, migrations, or abnormal exits; the states of the main process, rendering layer, and local gateway are not synchronized, resulting in inconsistencies between the displayed state and the underlying actual running state; and when an anomaly occurs, manual restart is usually the only option, lacking automatic retry, rollback, and recovery capabilities. Therefore, this paper proposes a method for collaborative startup, state synchronization, and anomaly recovery of desktop intelligent agent systems. Summary of the Invention
[0003] The purpose of this invention is to provide a method for collaborative startup, state synchronization and anomaly recovery of a desktop intelligent agent system, so as to solve the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system, comprising the following steps:
[0005] S1. The launcher process creates a named mutex and checks if a running instance already exists.
[0006] S2. If an existing running instance exists, activate the running instance and terminate the current instance;
[0007] S3. Load the local configuration file and verify the integrity of key fields when no running instance exists;
[0008] S4. Perform configuration repair and compatibility migration when missing fields, abnormal fields, or version incompatibility are detected;
[0009] S5. Start the local gateway process and perform a health check;
[0010] S6. After the health check is passed, establish a communication channel between the main process, the rendering layer and the local gateway;
[0011] S7. Establish a unified status bus to broadcast and synchronize operating status;
[0012] S8. During operation, perform graded recovery based on the type of exception; output structured logs and diagnostic results.
[0013] Preferably, the named mutex is generated based on the product unique identifier, installation path identifier, or instance identifier.
[0014] Preferably, the key fields include at least one or more of the following: token, working directory, gateway address, configuration version number, and runtime identifier.
[0015] Preferably, the configuration repair and compatibility migration includes: generating backups, version detection, field mapping, default value completion, write-back verification, and failure rollback.
[0016] Preferably, the health check includes one or more of the following: process liveness detection, port occupancy detection, and health check interface request.
[0017] Preferably, the communication channel includes one or more of the following: IPC channel, preloaded bridging channel, and WebSocket channel.
[0018] Preferably, the unified state bus is used to synchronize one or more of the following states: startup state, connection state, session state, voice state, abnormal state, and recovery state.
[0019] Preferably, the anomaly-level recovery includes one or more of the following: retry, delayed backoff, gateway restart, communication channel reconstruction, configuration rollback, and degraded operation.
[0020] Preferably, it also includes a startup control module, a configuration verification and repair module, a local gateway orchestration module, a communication bridging module, a status synchronization module, an anomaly recovery module, and a log diagnosis module, for executing the aforementioned methods.
[0021] Preferably, a storage medium stores a computer program thereon, which, when executed by a processor, implements the aforementioned method.
[0022] Compared with the prior art, the beneficial effects of the present invention are:
[0023] 1. This invention avoids resource conflicts caused by repeated startups by using single-instance mutual exclusion and activation of already running instances;
[0024] 2. This invention improves recoverability after upgrades, migrations, and reinstallations through configuration completion, compatible migration, and failure rollback;
[0025] 3. This invention improves the availability of local sidecar services through gateway orchestration and health check mechanisms;
[0026] 4. This invention improves state consistency between the main process, rendering layer, and gateway through a unified state bus;
[0027] 5. This invention reduces the frequency of manual intervention and improves long-term operational stability through an anomaly grading and recovery mechanism. Attached Figure Description
[0028] Figure 1 The operation flow of the collaborative startup, state synchronization and anomaly recovery method of the desktop intelligent agent system of the present invention. Figure 1 ;
[0029] Figure 2 The operation flow of the collaborative startup, state synchronization and anomaly recovery method of the desktop intelligent agent system of the present invention. Figure 2 . Detailed Implementation
[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0031] Example
[0032] Please see Figures 1-2 As shown, the present invention provides a technical solution comprising the following steps:
[0033] S1. The launcher process creates a named mutex and checks if a running instance already exists.
[0034] S2. If an existing running instance exists, activate the running instance and terminate the current instance;
[0035] S3. Load the local configuration file and verify the integrity of key fields when no running instance exists;
[0036] S4. Perform configuration repair and compatibility migration when missing fields, abnormal fields, or version incompatibility are detected;
[0037] S5. Start the local gateway process and perform a health check;
[0038] S6. After the health check is passed, establish a communication channel between the main process, the rendering layer and the local gateway;
[0039] S7. Establish a unified status bus to broadcast and synchronize operating status;
[0040] S8. During operation, perform graded recovery based on the type of exception; output structured logs and diagnostic results.
[0041] In this embodiment, the named mutex is generated based on the product unique identifier, installation path identifier, or instance identifier.
[0042] In this embodiment, the key fields include at least one or more of the following: token, working directory, gateway address, configuration version number, and running identifier.
[0043] In this embodiment, the configuration repair and compatibility migration includes: generating backups, version detection, field mapping, default value completion, write-back verification, and failure rollback.
[0044] In this embodiment, the health check includes one or more of the following: process liveness detection, port occupancy detection, and health check interface request.
[0045] In this embodiment, the communication channel includes one or more of the following: IPC channel, preloaded bridging channel, and WebSocket channel.
[0046] In this embodiment, the unified state bus is used to synchronize one or more of the following states: startup state, connection state, session state, voice state, abnormal state, and recovery state.
[0047] In this embodiment, the anomaly-level recovery includes one or more of the following: retry, delayed backoff, gateway restart, communication channel reconstruction, configuration rollback, and degraded operation.
[0048] In this embodiment, a startup control module, a configuration verification and repair module, a local gateway orchestration module, a communication bridging module, a status synchronization module, an anomaly recovery module, and a log diagnosis module are also included to execute the aforementioned methods.
[0049] In this embodiment, a storage medium stores a computer program, which, when executed by a processor, implements the aforementioned method.
[0050] In this embodiment, the system includes at least the following modules:
[0051] Startup control module: used to perform single instance mutual exclusion detection, activate running instances, and launch the main program.
[0052] Configuration verification and repair module: used to check configuration integrity, perform field completion, version migration, and rollback in case of failure.
[0053] Local gateway orchestration module: used to start the local sidecar gateway, perform health checks, retry on failure, and recover.
[0054] Communication bridging module: Used to establish IPC channels and WebSocket channels between the main process, the rendering layer, and the local gateway.
[0055] Status synchronization module: Used to establish a unified status bus and broadcast running status, session status and abnormal status.
[0056] Anomaly recovery module: Used to perform tiered handling for different fault types, including retry, restarting the gateway, rebuilding the channel, rolling back the configuration, and degrading the operation.
[0057] Log diagnostic module: Used to output startup logs, migration logs, exception logs, and export diagnostic packages.
[0058] In this embodiment, after the launcher process starts, it creates a named mutex and checks whether the same product instance already exists in the system.
[0059] When an existing instance is detected, an activation command is sent to the already running instance, and the currently newly launched instance is terminated to avoid duplicate execution.
[0060] If no running instance exists, load the local configuration file and check if the key fields are complete. The key fields include at least the token, working directory, gateway address, configuration version number, and running identifier.
[0061] When there are missing fields, invalid fields, or version incompatibility, perform configuration repair and compatibility migration; generate backup files before migration, and perform rollback if migration fails.
[0062] After the configuration verification is successful, start the local sidecar gateway process and send startup parameters to the gateway process.
[0063] Perform health checks on the gateway process. The health check methods include one or more of the following: local health check interface polling, process liveness detection, and port occupancy detection.
[0064] When the gateway health check passes, an IPC channel and a WebSocket channel are established between the main process, the rendering layer, and the gateway, and session binding is completed.
[0065] Establish a unified state bus to broadcast and subscribe to startup state, connection state, session state, voice state, abnormal state, and recovery state, so as to ensure that the interface state is consistent with the underlying running state.
[0066] During system operation, abnormal information is continuously collected, and graded handling is performed based on the abnormality type. The graded handling includes at least retry, delayed backoff, restarting the gateway, rebuilding the communication channel, rolling back the configuration, and degrading the operation.
[0067] The startup process, configuration migration process, anomaly recovery process, and final running results are written to a structured log, and diagnostic package export is supported.
[0068] In this embodiment, the named mutex can be generated using a unique product identifier to avoid conflicts caused by different versions or different instance paths.
[0069] When repairing a configuration, the current configuration can be read first, followed by the historical backup configuration, and then the default template can be used to fill in the missing fields.
[0070] The preferred method for gateway health checks is to first check if the process is alive, then check the local port, and then request the health check interface.
[0071] The retry mechanism preferably adopts a combination of a limited number of retries and a backoff delay, such as an incremental wait of 1 second, 2 seconds, or 4 seconds.
[0072] State synchronization preferably adopts a unified state source registration + broadcast subscription approach to avoid inconsistencies in the interface caused by different modules maintaining their own states.
[0073] Anomaly recovery is preferably handled in a tiered manner based on the error level: minor anomalies are retried, moderate anomalies are restarted, and severe anomalies are rolled back or degraded.
[0074] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their likenesses.
[0075] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system, characterized in that, Includes the following steps: S1. The launcher process creates a named mutex and checks if a running instance already exists. S2. If an existing running instance exists, activate the running instance and terminate the current instance; S3. Load the local configuration file and verify the integrity of key fields when no running instance exists; S4. Perform configuration repair and compatibility migration when missing fields, abnormal fields, or version incompatibility are detected; S5. Start the local gateway process and perform a health check; S6. After the health check is passed, establish a communication channel between the main process, the rendering layer and the local gateway; S7. Establish a unified status bus to broadcast and synchronize operating status; S8. Execute graded recovery based on the type of anomaly during operation; Output structured logs and diagnostic results.
2. The method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system according to claim 1, characterized in that: The named mutex is generated based on the product's unique identifier, installation path identifier, or instance identifier.
3. The method of claim 1, wherein: The key fields include at least one or more of the following: token, working directory, gateway address, configuration version number, and runtime identifier.
4. The method of claim 1, wherein: The configuration repair and compatibility migration includes: generating backups, version detection, field mapping, default value completion, write-back verification, and failure rollback.
5. The method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system according to claim 1, characterized in that: The health check includes one or more of the following: process liveness detection, port occupancy detection, and health check interface request.
6. The method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system according to claim 1, characterized in that: The communication channel includes one or more of the following: IPC channel, preloaded bridging channel, and WebSocket channel.
7. The method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system according to claim 1, characterized in that: The unified state bus is used to synchronize one or more of the following states: startup state, connection state, session state, voice state, abnormal state, and recovery state.
8. The method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system according to claim 1, characterized in that: The anomaly-level recovery includes one or more of the following: retry, delayed backoff, gateway restart, communication channel reconstruction, configuration rollback, and degraded operation.
9. The method for collaborative startup, state synchronization, and anomaly recovery of a desktop intelligent agent system according to claim 1, characterized in that: It also includes a startup control module, a configuration verification and repair module, a local gateway orchestration module, a communication bridging module, a status synchronization module, an anomaly recovery module, and a log diagnosis module, which are used to execute the aforementioned methods.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, it implements the aforementioned method.