Method and device for restarting agent system, electronic equipment and storage medium

By executing a scheduled monitoring task before the agent system restarts to obtain the number of processes and information on tasks to be executed, and then restarting only after determining whether the conditions are met, the problem of scripts or services abnormally exiting during agent system restarts is solved, thus ensuring stability and security.

CN115373802BActive Publication Date: 2026-07-03CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2022-08-26
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

When the agent system restarts, all processes in the old resource space terminate, causing currently executing scripts or services to exit abnormally.

Method used

By executing scheduled monitoring tasks, information on the number of processes and pending tasks in the shared resource space is obtained, and a decision is made on whether to restart the agent system after determining whether the preset conditions are met.

Benefits of technology

This ensures the stability and security of the agent system, preventing scripts or services from exiting abnormally due to direct restart operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115373802B_ABST
    Figure CN115373802B_ABST
Patent Text Reader

Abstract

This disclosure provides a method for restarting an agent system, applicable to the fields of cloud computing and financial technologies. The method includes: responding to a restart command for the agent system from a server, obtaining a first timed monitoring task; by executing the first timed monitoring task, obtaining information on the number of processes currently using the shared resource space of the agent system from shared resource space information, and obtaining information on a first task to be executed from agent log information; and, if the information on the number of processes and the information on the first task to be executed satisfy a first preset condition, performing a restart operation on the agent system. This disclosure also provides a restart device, electronic device, storage medium, and program product for the agent system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of cloud computing technology and financial technology, specifically to methods for restarting agent systems, devices for restarting agent systems, electronic devices, storage media, and program products. Background Technology

[0002] As enterprises' demand for IT infrastructure resources, especially computing resources, increases, building their own private cloud services and leveraging innovative virtualization technologies to quickly deliver the IT infrastructure that meets their needs has become an increasingly popular choice. While cloud-based computing resources can be rapidly provisioned, these resources are often bare operating systems. To meet the delivery needs of application departments, enterprises still need to perform customized system configurations and application deployments on cloud-provided virtual machines or bare metal platforms, with configuration and deployment scripts executed via agents.

[0003] During the implementation of this disclosure, it was discovered that when the agent system restarts, it reclaims the old resource space and creates a new one. As a result, all processes in the old resource space terminate, causing the currently executing scripts or services to exit abnormally. Summary of the Invention

[0004] In view of the above problems, this disclosure provides a method for restarting an agent system, an apparatus for restarting an agent system, an electronic device, a storage medium, and a program product.

[0005] According to the first aspect of this disclosure, a method for restarting an agent system is provided, comprising:

[0006] In response to the restart command for the agent system from the server, obtain the first scheduled monitoring task;

[0007] By executing the first timed monitoring task, the system obtains information on the number of processes currently using the agent system's shared resource space from the shared resource space information, and information on the first task to be executed from the agent log information. The first process count information represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task.

[0008] If the information on the number of processes and the information on the first task to be executed meet the first preset condition, the agent system will be restarted.

[0009] According to embodiments of this disclosure, the information of the first task to be executed includes the time information of the first latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task. If the information of the first number of processes and the information of the first task to be executed meet a first preset condition, the agent system is restarted, including:

[0010] Based on the first moment information and the moment information of the first latest task to be executed, the first time interval information is determined, wherein the first time interval information represents the duration information of the agent system for processing the first task to be executed;

[0011] If the first time interval information meets the second preset condition and the first process quantity information meets the first preset condition, the agent system restart operation is executed.

[0012] According to embodiments of this disclosure, restarting the agent system when the first process quantity information and the first task to be executed information meet a first preset condition further includes:

[0013] If the first time interval information does not meet the second preset condition, obtain the first loop waiting time information;

[0014] Based on the information from the first moment and the first cycle waiting time, determine the information for the second moment;

[0015] At the second current moment, by executing the second timed monitoring task, the information of the second task to be executed is obtained from the agent log information. The information of the second task to be executed represents the time information of the second latest task to be executed received by the agent system from the server during the execution of the second timed monitoring task.

[0016] The second time interval information is determined based on the second time information and the time information of the second latest task to be executed;

[0017] If the second time interval information meets the second preset condition and the first process quantity information meets the first preset condition, the agent system restart operation is executed.

[0018] According to embodiments of this disclosure, restarting the agent system when the first process quantity information and the first task to be executed information meet a first preset condition further includes:

[0019] If the information in the first time interval does not meet the second preset condition, record the number of the first loop.

[0020] If the second time interval information does not meet the second preset condition, record the number of the second loop.

[0021] The target number of iterations is generated based on the first and second iteration counts.

[0022] If the target number of cycles exceeds a preset threshold, the timed monitoring task will terminate.

[0023] According to embodiments of this disclosure, when the first process quantity information and the first task to be executed information meet a first preset condition, a restart operation of the agent system is performed, including:

[0024] If the information on the number of first processes and the information on the first task to be executed meet the first preset condition, obtain the configuration change information of the agent system;

[0025] Modify the configuration information of the agent system according to the configuration change information;

[0026] Restart the agent system.

[0027] According to embodiments of this disclosure, the method for restarting the agent system further includes:

[0028] If the number of processes in the first process does not meet the first preset condition, obtain the second loop waiting time information;

[0029] Based on the information from the first moment and the waiting time information from the second cycle, determine the information for the third moment;

[0030] At the third moment, by executing the third timed monitoring task, the number of second processes using the shared resource space is obtained from the shared resource space information, and the information of the third task to be executed is obtained from the agent log information;

[0031] If the information on the number of second processes and the information on the third task to be executed meet the first preset condition, the agent system will be restarted.

[0032] A second aspect of this disclosure provides a restart apparatus for an agent system, comprising:

[0033] The first acquisition module is used to acquire the first scheduled monitoring task in response to the restart command for the agent system from the server.

[0034] The second acquisition module is used to obtain, by executing the first timed monitoring task, the first number of processes using the shared resource space of the agent system from the shared resource space information, and the information of the first task to be executed from the agent log information. The first number of processes represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task.

[0035] The first execution module is used to perform a restart operation of the agent system when the information on the number of first processes and the information on the first task to be executed meet the first preset conditions.

[0036] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to perform the aforementioned agent system restart method.

[0037] A fourth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the aforementioned agent system restart method.

[0038] The fifth aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method for restarting the agent system.

[0039] According to embodiments of this disclosure, by executing a timed detection task, information on the number of processes in the agent's shared resource space and information on automated tasks to be executed are obtained. By determining whether the number of processes using the agent system's shared resource space and the latest information on tasks to be executed received during the execution of the timed detection task meet a first preset condition, a decision is made on whether to restart the agent system. This ensures the stability and security of the agent system while effectively avoiding the abnormal termination of currently executing script processes or services due to directly executing a restart operation of the agent system. Attached Figure Description

[0040] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0041] Figure 1 This illustration schematically depicts an application scenario of a restart method for an agent system, a restart device for an agent system, an electronic device, a storage medium, and a program product according to embodiments of the present disclosure.

[0042] Figure 2 A flowchart illustrating a method for restarting an agent system according to an embodiment of this disclosure is shown schematically.

[0043] Figure 3 This schematically illustrates a flowchart of a method for restarting an agent system when the information on the number of first processes and the information on the first task to be executed meet a first preset condition, according to an embodiment of the present disclosure.

[0044] Figure 4 A flowchart illustrating a method for restarting an agent system according to another embodiment of this disclosure is shown schematically;

[0045] Figure 5 A schematic block diagram illustrating a restart apparatus for an agent system according to an embodiment of the present disclosure is shown; and

[0046] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a restart method for an agent system according to an embodiment of the present disclosure. Detailed Implementation

[0047] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0048] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0049] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0050] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0051] In the technical solution disclosed herein, the acquisition, storage, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.

[0052] In the technical solutions of this disclosure, user authorization or consent is obtained before acquiring or collecting user personal information.

[0053] During the implementation of this disclosure, it was discovered that when the agent system restarts, it reclaims the old resource space and creates new one. Consequently, all processes in the old shared space terminate, causing currently executing scripts or services to exit abnormally. For example, when a command is issued through the automated agent mcollective, the received command automatically uses mcollective's cgroup resource space to create a process for execution, which terminates after the command finishes. If the issued script is currently executing or has no exit mode, it will continuously use mcollective's cgroup resource space. If the agent system mcollective restarts at this time, it will reclaim the old cgroup resource space and create new one. During the reclamation of the old cgroup resource space, all processes using that space will terminate, causing currently executing scripts or services to exit abnormally.

[0054] Embodiments of this disclosure provide a method for restarting an agent system, including:

[0055] In response to a restart command for the agent system from the server, a first scheduled monitoring task is obtained; by executing the first scheduled monitoring task, the first number of processes using the shared resource space of the agent system is obtained from the shared resource space information, and the information of the first task to be executed is obtained from the agent log information. The first number of processes represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first scheduled monitoring task; and if the information of the first number of processes and the information of the first task to be executed meet the first preset condition, the agent system restart operation is executed.

[0056] Figure 1 The illustration schematically depicts an application scenario of a method for restarting an agent system, an apparatus for restarting an agent system, an electronic device, a storage medium, and a program product according to embodiments of the present disclosure.

[0057] like Figure 1 As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, network 104, and server 105. Network 104 is used as a medium to provide a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0058] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0059] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0060] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0061] It should be noted that the proxy system restart method provided in this embodiment can generally be executed by terminal devices 101, 102, and 103. Correspondingly, the proxy system restart device provided in this embodiment can also generally be located in terminal devices 101, 102, and 103. The proxy system restart method provided in this embodiment can also be executed by terminals other than terminal devices 101, 102, and 103. Correspondingly, the proxy system restart device provided in this embodiment can also be located in terminals other than terminal devices 101, 102, and 103.

[0062] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0063] The following will be based on Figure 1 The described scene, through Figures 2-4 The method for restarting the agent system according to the disclosed embodiments is described in detail.

[0064] Figure 2 A flowchart illustrating a method for restarting an agent system according to an embodiment of this disclosure is shown.

[0065] like Figure 2 As shown, the agent system restart method 200 of this embodiment includes operations S201 to S203.

[0066] In operation S201, in response to the restart command for the agent system from the server, the first scheduled monitoring task is obtained.

[0067] According to embodiments of this disclosure, the agent system may include the automated agent mcollective. A periodic monitoring task can periodically check whether a restart operation of the agent system can be performed. It should be noted that the automated agent mcollective is an automation tool developed based on the object-oriented programming language Ruby.

[0068] According to embodiments of this disclosure, after receiving a restart command for the proxy system from the server, the client will obtain a timed monitoring task for the restart command initiated by the server to confirm whether the restart operation of the proxy system can be executed. The timed monitoring task can be set to occur once per hour, so that a monitoring task is automatically triggered every hour.

[0069] In operation S202, by executing the first timed monitoring task, the first number of processes using the shared resource space of the agent system is obtained from the shared resource space information, and the information of the first task to be executed is obtained from the agent log information. The first number of processes represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task.

[0070] It should be noted that when commands are issued through the automated agent mcollective, the received commands will automatically use mcollective's cgroup resource space to create processes for execution, and the processes will terminate after the commands are completed. Here, cgroups are a series of hooks attached to a program by the kernel. These hooks are triggered by resource scheduling during program runtime to achieve resource tracking and restriction.

[0071] According to embodiments of this disclosure, when the client executes the first timed monitoring task, it can obtain the shared processes using the shared resource space of the agent system from the shared resource space information and the tasks to be executed from the agent log information. The number of processes used to execute the target task is not specifically limited and can be determined based on the target task. The server can generate instructions for executing tasks for the agent system and send these instructions to the client, which can then receive the instructions sent to the client.

[0072] For example, the first process count information can be 0, indicating that there are no shared processes in the shared resource space of the agent system. The first process count information can also be non-zero, indicating that there are shared processes in the shared resource space of the agent system. The information for the first pending task can include information about whether there is a new pending task or not.

[0073] In operation S203, if the information on the number of first processes and the information on the first task to be executed meet the first preset condition, the agent system is restarted.

[0074] According to an embodiment of this disclosure, the first preset condition can indicate that there is no shared process in the shared resource space of the agent system in use and that the agent system has not received the latest task to be executed from the server during the execution of the timed monitoring task.

[0075] For example, if the first process count is 0 and the first task to be executed has no latest task to be executed, the first preset condition is met, and the agent system needs to be restarted.

[0076] According to embodiments of this disclosure, by executing a timed detection task, information on the number of processes in the agent's shared resource space and information on automated tasks to be executed are obtained. After determining whether the number of processes using the agent system's shared resource space and the latest task information received during the timed detection task meet a first preset condition, a decision is made on whether to restart the agent system. This ensures the stability and security of the agent system while effectively avoiding the abnormal termination of currently executing script processes or services due to directly executing a restart operation of the agent system.

[0077] Figure 3 The illustration shows a flowchart of a method for restarting an agent system when the information on the number of first processes and the information on the first task to be executed meet a first preset condition, according to an embodiment of the present disclosure.

[0078] like Figure 3 As shown, the method 300 for restarting the agent system when the first process quantity information and the first task to be executed information meet the first preset conditions may include operations S301 to S302.

[0079] In operation S301, based on the first moment information and the moment information of the first latest task to be executed, the first time interval information is determined, wherein the first time interval information represents the duration information of the agent system for processing the first task to be executed.

[0080] It should be noted that the information of the first task to be executed may include the time information of the first latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task.

[0081] According to embodiments of this disclosure, the first time information can be the time information of the agent system processing the first task to be executed. The first time interval can be obtained based on the difference between the time when the agent system processes the first task to be executed and the time of the first latest task to be executed. The first time interval can be the duration for which the agent system processes the first task to be executed.

[0082] In operation S302, if the first time interval information meets the second preset condition and the first process quantity information meets the first preset condition, the agent system restart operation is executed.

[0083] According to an embodiment of this disclosure, the second preset condition can be determined based on the actual duration of task execution. The agent system can be restarted if the duration for which the agent system processes the first task to be executed meets the duration determined based on the actual task execution duration, and if the first process data is zero.

[0084] For example, a second preset condition can be set based on the actual duration of the script executed on the port. The interval time can be obtained from the first time interval information and compared with the actual execution duration determined by the second preset condition. If the interval time obtained from the first time interval information (e.g., 6 minutes) is higher than the actual execution duration determined by the second preset condition (e.g., 5 minutes), then the first time interval information satisfies the second preset condition; if the interval time obtained from the first time interval information (e.g., 3 minutes) is lower than the actual execution duration determined by the second preset condition (e.g., 5 minutes), then the first time interval information does not satisfy the second preset condition.

[0085] According to the embodiments of this disclosure, during the execution of the first timed monitoring task, the agent system receives the time information of the first latest task to be executed and the first time information from the server, determines the time interval information, and compares it with the second preset condition to further determine whether there is a task currently being executed, thus avoiding the direct execution of the agent system's restart operation and the abnormal termination of the task being executed.

[0086] According to another embodiment of this disclosure, when the information on the number of first processes and the information on the first task to be executed meet the first preset condition, the agent system is restarted. In addition to the operations S301 to S302 described above, this may further include:

[0087] If the first time interval information does not meet the second preset condition, obtain the first loop waiting duration information; determine the second time information based on the first time information and the first loop waiting duration information; at the second current time, obtain the second task information to be executed from the agent log information by executing the second timed monitoring task. The second task information to be executed represents the time information of the second latest task to be executed received by the agent system from the server during the execution of the second timed monitoring task; determine the second time interval information based on the second time information and the time information of the second latest task to be executed; if the second time interval information meets the second preset condition and the first process quantity information meets the first preset condition, execute the agent system restart operation.

[0088] It should be noted that if no shared resource space process is detected, but there are currently pending tasks, you can wait for one cycle time before checking whether the agent system needs to be restarted.

[0089] According to an embodiment of this disclosure, the first loop waiting duration information may include the waiting time when a first task to be executed exists. The second time can be obtained by adding the first time obtained from the first time information to the waiting time when a first task to be executed exists, obtained from the first loop waiting duration information. The second time can be the time when the agent system processes the second task to be executed. The second current time can be the second time. The second time interval can be obtained based on the difference between the time when the agent system processes the second task to be executed and the time of the second latest task to be executed. If the second time interval meets a second preset condition, and the first process quantity information meets a first preset condition, a restart operation of the agent system is performed.

[0090] According to the embodiments of this disclosure, when no shared resource space process is detected, but there is a task to be executed, a loop time is waited before checking whether the agent system needs to be restarted. This avoids directly executing the agent system restart operation, which could cause the currently executing task to be abnormally terminated.

[0091] According to another embodiment of this disclosure, restarting the agent system when the first process quantity information and the first task to be executed information meet a first preset condition may further include:

[0092] If the first time interval information does not meet the second preset condition, record the first loop count; if the second time interval information does not meet the second preset condition, record the second loop count; generate the target loop count based on the first loop count information and the second loop count information; if the target loop count is greater than the preset threshold, end the timed monitoring task.

[0093] According to embodiments of this disclosure, the preset threshold can be set based on the actual frequency of receiving tasks. If the first time interval information does not meet the second preset condition, the first cycle count can be determined based on the first cycle waiting time information and the frequency of receiving tasks. If the second time interval information does not meet the second preset condition, the second cycle count can be determined based on the second cycle waiting time information and the frequency of receiving tasks. The target cycle count can be the sum of the first cycle count and the second cycle count.

[0094] According to embodiments of this disclosure, a target number of loops generated by recording the first and second loop counts is compared with a preset threshold. If the target number of loops exceeds the preset threshold, the timed detection task is terminated, effectively preventing the background looping task from being abnormally terminated.

[0095] According to embodiments of this disclosure, when the first process quantity information and the first task to be executed information meet a first preset condition, the restart operation of the agent system may further include:

[0096] If the information on the number of first processes and the information on the first task to be executed meet the first preset condition, obtain the configuration change information of the agent system; change the configuration information of the agent system according to the configuration change information; and perform a restart operation on the agent system.

[0097] According to embodiments of this disclosure, when the configuration information of the agent system changes, the agent system can be restarted after the change.

[0098] For example, if the first process count is 0 and the first pending task information indicates there are no new pending tasks, the first preset condition is met. If a change in the agent system's configuration information is detected, the agent system's configuration information is updated by acquiring the configuration change information.

[0099] According to embodiments of this disclosure, based on the number of processes in the shared resource space, information on tasks to be executed, and configuration change information of the agent system, after making judgments from multiple dimensions, the configuration information of the agent system and the restart operation of the agent system are safely and stably changed without affecting the execution of tasks and services.

[0100] According to embodiments of this disclosure, the method for restarting the agent system may further include:

[0101] If the number of first processes does not meet the first preset condition, obtain the second loop waiting time information; determine the information for the third time based on the information for the first time and the second loop waiting time information; at the third time, obtain the number of second processes using the shared resource space from the shared resource space information and obtain the information for the third task to be executed from the agent log information by executing the third timed monitoring task; if the number of second processes and the information for the third task to be executed meet the first preset condition, execute the agent system restart operation.

[0102] According to embodiments of this disclosure, the first preset condition may indicate that there is no shared process in the shared resource space of the agent system in use, and that the agent system has not received any new pending tasks from the server during the execution of the scheduled monitoring task. The information on the third pending task may include information on the existence of a new pending task and information on the absence of a new pending task.

[0103] For example, if the number of processes in the first loop is not zero, the first preset condition is not met. The third time point can be obtained by summing the second loop waiting time and the first time point. When the number of processes in the second loop is zero and there is no information on the latest task to be executed, the first preset condition is met, and the agent system can be restarted.

[0104] According to the embodiments of this disclosure, when a shared process is detected in the shared resource space of the agent system, a loop is performed to wait, and then the existence of a shared process is detected at the current moment. If there is no shared process and no new task to be executed, the agent system is restarted. This ensures the stability and security of the agent system while effectively avoiding the abnormal exit of the currently executing script process or service caused by directly executing the agent system restart operation.

[0105] Figure 4 A flowchart illustrating a method for restarting an agent system according to another embodiment of this disclosure is shown.

[0106] like Figure 4 As shown, the agent system restart method 400 of this embodiment includes operations S401 to S407.

[0107] Start the scheduled monitoring task by operating S401.

[0108] According to embodiments of this disclosure, in response to a restart command for the agent system from the server, after obtaining the first timed monitoring task, the timed monitoring task can be started.

[0109] Does the S402 operating system contain a shared process?

[0110] According to embodiments of this disclosure, when the scheduled detection task begins, information about shared processes using the shared resource space of the agent system can be obtained from the shared resource space information. If a shared process exists, operation S406 is executed. If no shared process exists, operation S403 is executed.

[0111] When operating S403, are there any tasks to be executed?

[0112] According to embodiments of this disclosure, when a scheduled detection task begins execution, information about tasks to be executed can be obtained from the agent log information. If there are tasks to be executed, operation S406 is executed. If there are no tasks to be executed, operation S404 is executed.

[0113] This involves restarting the agent system in the S404 process.

[0114] When operating S405, end the scheduled monitoring task.

[0115] According to embodiments of this disclosure, the timed detection task can be terminated after the agent system restart operation of operation S404 is completed.

[0116] Operating S406, looping and waiting.

[0117] According to embodiments of this disclosure, when a timed detection task begins execution, a loop waiting state can be entered if a shared process or a task to be executed is detected. The duration of the loop waiting state can be recorded.

[0118] In operation S407, is the number of loops greater than the preset threshold?

[0119] According to embodiments of this disclosure, the number of loops can be determined based on the loop waiting time and the frequency of receiving tasks to be executed. A preset threshold can be set according to the actual frequency of task reception. If the number of loops is greater than the preset threshold, operation S405 is executed to end the timed detection task. If the number of loops is less than the preset threshold, operation S402 is executed to perform the detection again.

[0120] According to embodiments of this disclosure, a timed detection task is executed to obtain shared process information of the proxy shared resource space and receive automated tasks to be executed. If it is determined that no process is using the shared space and there are no tasks to be executed, the proxy system is restarted, avoiding the direct execution of a proxy system restart operation, which could lead to the abnormal termination of currently executing tasks. If it is determined that a process is using the shared space or there are tasks to be executed, a loop wait is set, and the number of loops is determined to decide whether to terminate the timed detection task, effectively preventing the abnormal termination of background looping tasks.

[0121] Based on the above-described agent system restart method, this disclosure also provides an agent system restart device. The following will be combined with... Figure 5 The device is described in detail.

[0122] Figure 5 A schematic block diagram of a restart apparatus for an agent system according to an embodiment of the present disclosure is shown.

[0123] like Figure 5 As shown, the information recommendation device 500 in this embodiment includes a first acquisition module 510, a second acquisition module 520, and a first execution module 530.

[0124] The first acquisition module 510 is used to acquire the first timed monitoring task in response to a restart command for the agent system from the server. In one embodiment, the first acquisition module 510 can be used to perform the operation S201 described above, which will not be repeated here.

[0125] The second acquisition module 520 is used to acquire, by executing the first timed monitoring task, the first number of processes using the shared resource space of the agent system from the shared resource space information, and the information of the first task to be executed from the agent log information. The first number of processes represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task. In one embodiment, the second acquisition module 520 can be used to execute the operation S202 described above, which will not be repeated here.

[0126] The first execution module 530 is used to perform a restart operation of the agent system when the information on the number of first processes and the information on the first task to be executed meet a first preset condition. In one embodiment, the first execution module 530 can be used to perform the operation S203 described above, which will not be repeated here.

[0127] According to embodiments of this disclosure, the agent system restart device 500 may further include a third acquisition module, a determination module, a fourth acquisition module, and a second execution module.

[0128] The third acquisition module is used to acquire the second loop waiting time information when the first process quantity information does not meet the first preset condition.

[0129] The determination module is used to determine the information at the third moment based on the information at the first moment and the waiting time information in the second cycle.

[0130] The fourth acquisition module is used to obtain information on the number of second processes using the shared resource space from the shared resource space information and information on the third task to be executed from the agent log information by executing the third timed monitoring task at the third time.

[0131] The second execution module is used to perform a restart operation of the agent system when the information on the number of second processes and the information on the third task to be executed meet the first preset condition.

[0132] According to embodiments of this disclosure, any plurality of modules among the first acquisition module 510, the second acquisition module 520, and the first execution module 530 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the first acquisition module 510, the second acquisition module 520, and the first execution module 530 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented by any other reasonable means of integrating or packaging circuitry, or implemented in any one of software, hardware, and firmware methods, or in a suitable combination of any of these. Alternatively, at least one of the first acquisition module 510, the second acquisition module 520, and the first execution module 530 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0133] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing a restart method for an agent system according to an embodiment of the present disclosure.

[0134] like Figure 6 As shown, an electronic device 600 according to an embodiment of this disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this disclosure.

[0135] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0136] According to embodiments of this disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.

[0137] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0138] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.

[0139] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this disclosure.

[0140] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0141] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0142] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0143] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0144] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0145] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0146] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A method for restarting an agent system, comprising: In response to the restart command for the agent system from the server, obtain the first scheduled monitoring task; By executing the first timed monitoring task, the system obtains information on the number of processes using the shared resource space of the agent system from the shared resource space information, and information on the first task to be executed from the agent log information. The first process count information represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task. If the information on the number of processes and the information on the first task to be executed meet the first preset condition, the agent system is restarted, including: If the first time interval information does not meet the second preset condition, the first loop waiting time information is obtained, wherein the first time interval information represents the time information for the agent system to process the first task to be executed; Based on the first moment information and the first loop waiting time information, the second moment information is determined, wherein the first moment information represents the moment information when the agent system processes the first task to be executed; At the second current moment, by executing the second timed monitoring task, information of the second task to be executed is obtained from the agent log information. The information of the second task to be executed represents the time information of the second latest task to be executed received by the agent system from the server during the execution of the second timed monitoring task. The second time interval information is determined based on the difference between the second time information and the time information of the second latest task to be executed, wherein the second time information represents the time information of the agent system processing the second task to be executed; If the second time interval information meets the second preset condition and the first process quantity information meets the first preset condition, the agent system restart operation is performed.

2. The method according to claim 1, wherein, The information of the first task to be executed includes the time information of the first latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task. The step of restarting the agent system when the first process quantity information and the information of the first task to be executed meet a first preset condition includes: Based on the first time information and the time information of the first latest task to be executed, determine the first time interval information; If the first time interval information meets the second preset condition and the first process quantity information meets the first preset condition, the agent system restart operation is performed.

3. The method according to claim 2, further comprising: If the first time interval information does not meet the second preset condition, record the first loop count; If the second time interval information does not meet the second preset condition, record the second loop count; Based on the first loop count information and the second loop count information, generate the target loop count; If the target number of cycles exceeds a preset threshold, the timed monitoring task will end.

4. The method according to claim 1, wherein, If the information on the number of processes and the information on the first task to be executed meet the first preset condition, the agent system is restarted, including: If the first process quantity information and the first task to be executed information meet the first preset condition, obtain the configuration change information of the agent system; The configuration information of the agent system is changed according to the configuration change information; Perform a restart operation on the agent system.

5. The method according to claim 1, further comprising: If the first process quantity information does not meet the first preset condition, obtain the second loop waiting time information; Based on the information at the first moment and the information on the second loop waiting time, determine the information at the third moment; At the third moment, by executing a third timed monitoring task, the number of second processes using the shared resource space is obtained from the shared resource space information, and the information of the third task to be executed is obtained from the agent log information; If the second process quantity information and the third task to be executed information meet the first preset condition, the agent system restart operation is performed.

6. A restart device for an agent system, comprising: The first acquisition module is used to acquire the first scheduled monitoring task in response to the restart command for the agent system from the server. The second acquisition module is configured to, by executing the first timed monitoring task, acquire information on the number of processes using the shared resource space of the agent system from the shared resource space information, and acquire information on the first task to be executed from the agent log information. The first process count information represents the number of processes created by the agent system in the shared resource space for executing the target task, and the first task to be executed represents the latest task to be executed received by the agent system from the server during the execution of the first timed monitoring task. The first execution module is used to execute the restart operation of the agent system when the first process quantity information and the first task to be executed information meet a first preset condition. The first execution module includes a first execution submodule, a second execution submodule, a third execution submodule, a fourth execution submodule, and a fifth execution submodule. The first execution submodule is used to obtain the first loop waiting time information when the first time interval information does not meet the second preset condition, wherein the first time interval information represents the time information of the agent system for processing the first task to be executed; The second execution submodule is used to determine the second time information based on the first time information and the first loop waiting time information, wherein the first time information represents the time information when the agent system processes the first task to be executed; The third execution submodule is used to obtain information about the second task to be executed from the agent log information by executing the second timed monitoring task at the second current time. The information about the second task to be executed represents the time information of the second latest task to be executed received by the agent system from the server during the execution of the second timed monitoring task. The fourth execution submodule is used to determine the second time interval information based on the difference between the second time information and the time information of the second latest task to be executed, wherein the second time information represents the time information of the agent system processing the second task to be executed; The fifth execution submodule is used to perform a restart operation of the agent system when the second time interval information meets the second preset condition and the first process number information meets the first preset condition.

7. An electronic device, comprising: One or more processors; Storage device for storing one or more programs. Wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 5.

9. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 5.