CN115373802A - Method and device for restarting agent system, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115373802A
CN115373802A CN202211037214.7A CN202211037214A CN115373802A CN 115373802 A CN115373802 A CN 115373802A CN 202211037214 A CN202211037214 A CN 202211037214A CN 115373802 A CN115373802 A CN 115373802A
Authority
CN
China
Prior art keywords
information
task
executed
executing
agent system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211037214.7A
Other languages
Chinese (zh)
Inventor
龙盼
欧阳梦云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211037214.7A priority Critical patent/CN115373802A/en
Publication of CN115373802A publication Critical patent/CN115373802A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Hardware Redundancy (AREA)

Abstract

The disclosure provides a method for restarting an agent system, which can be applied to the technical field of cloud computing and the technical field of finance. The method for restarting the agent system comprises the following steps: responding to a restart instruction aiming at the proxy system from a server, and acquiring a first timing monitoring task; acquiring first process quantity information of a shared resource space of an agent system from the shared resource space information by executing a first timing monitoring task, and acquiring information of a first to-be-executed task from agent log information; and under the condition that the first process quantity information and the first to-be-executed task information meet a first preset condition, executing the restarting operation of the agent system. The present disclosure also provides a restart apparatus of a broker system, an electronic device, a storage medium, and a program product.

Description

Restart method and device of proxy system, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of cloud computing technology and financial technology, and in particular, to a method and apparatus for restarting a proxy system, an electronic device, a storage medium, and a program product.
Background
With the increasing demand of enterprises for IT infrastructure resources, particularly computing resources, the enterprises build own private cloud services, and the IT infrastructure meeting the demand is rapidly delivered by using innovative virtualization technology to become the choice of more and more enterprises. Although the cloud computing resources can be rapidly supplied, the supplied computing resources are often bare operating systems, in order to meet delivery requirements of application departments, enterprises still need to perform personalized system configuration and deployment application on cloud-supplied virtual machines or bare metals, and configuration deployment scripts are executed based on agents.
In the process of implementing the present disclosure, it is found that, when the proxy system is restarted, the old resource space is recovered and a new resource space is created, so that all processes in the old resource space are finished, and the script or service being executed is abnormally exited.
Disclosure of Invention
In view of the above, the present disclosure provides a restart method of a proxy system, a restart apparatus of a proxy system, an electronic device, a storage medium, and a program product.
According to a first aspect of the present disclosure, there is provided a restart method of a broker system, including:
responding to a restart instruction aiming at the agent system from a server, and acquiring a first timing monitoring task;
acquiring first process quantity information of a shared resource space using an agent system from the shared resource space information and acquiring information of a first task to be executed from agent log information by executing a first timing monitoring task, wherein the first process quantity information represents process quantity information which is created in the shared resource space by the agent system and is used for executing a target task, and the first task to be executed represents a latest task to be executed received by the agent system from a server end during the execution of the first timing monitoring task; and
and under the condition that the first process quantity information and the first to-be-executed task information meet a first preset condition, executing the restarting operation of the agent system.
According to the embodiment of the present disclosure, the restarting of the agent system when the first process quantity information and the information of the first task to be executed satisfy a first preset condition includes that the first task to be executed information includes first latest task to be executed time information received by the agent system from the server in the process of executing the first timing monitoring task:
determining first time interval information according to the first time information and the latest time information of the first task to be executed, wherein the first time interval information represents duration information of the agent system for processing the first task to be executed;
and executing the restarting operation of the agent system under the condition that the first time interval information meets the second preset condition and the first process quantity information meets the first preset condition.
According to the embodiment of the present disclosure, in a case that the first process quantity information and the first information of the task to be executed satisfy the first preset condition, the restarting of the agent system further includes:
under the condition that the first time interval information does not meet a second preset condition, acquiring first cycle waiting duration information;
determining information of a second moment according to the first moment information and the first cycle waiting duration information;
at a second current moment, acquiring information of a second task to be executed from the proxy log information by executing a second timing monitoring task, wherein the information of the second task to be executed represents the moment information of a second latest task to be executed received by the proxy system from the server in the process of executing the second timing monitoring task;
determining second time interval information according to the second time information and the second latest time information of the task to be executed;
and executing the restarting operation of the agent system under the condition that the second time interval information meets a second preset condition and the first process quantity information meets a first preset condition.
According to the embodiment of the present disclosure, in a case that the first process quantity information and the first information of the task to be executed satisfy the first preset condition, restarting the agent system further includes:
recording the first cycle times under the condition that the first time interval information does not meet a second preset condition;
recording a second cycle number under the condition that the second time interval information does not meet a second preset condition;
generating a target cycle number according to the first cycle number information and the second cycle number information;
and ending the timing monitoring task under the condition that the target cycle number is greater than a preset threshold value.
According to the embodiment of the present disclosure, in a case where the first process quantity information and the first information of the task to be executed satisfy a first preset condition, the executing of the restart operation of the agent system includes:
acquiring configuration change information of the agent system under the condition that the first process quantity information and the first to-be-executed task information meet a first preset condition;
changing the configuration information of the agent system according to the configuration change information;
and executing the restart operation of the proxy system.
According to the embodiment of the disclosure, the method for restarting the agent system further comprises the following steps:
acquiring second cycle waiting duration information under the condition that the first process quantity information does not meet a first preset condition;
determining information of a third moment according to the first moment information and the second cycle waiting duration information;
at a third moment, by executing a third timing monitoring task, acquiring second process quantity information using a shared resource space from the shared resource space information, and acquiring information of a third task to be executed from the proxy log information;
and under the condition that the second process quantity information and the information of the third task to be executed meet the first preset condition, executing the restarting operation of the agent system.
A second aspect of the present disclosure provides a restart apparatus of a proxy system, including:
the first acquisition module is used for responding to a restart instruction aiming at the agent system from the server side and acquiring a first timing monitoring task;
a second obtaining module, configured to obtain, from shared resource space information, first process quantity information of a shared resource space in which the agent system is being used by executing the first timing monitoring task, and obtain information of a first task to be executed from agent log information, where the first process quantity information represents process quantity information created in the shared resource space by the agent system and used for executing a target task, and the first task to be executed represents a latest task to be executed received by the agent system from the server during execution of the first timing monitoring task; and
and the first execution module is used for executing the restarting operation of the agent system under the condition that the first process quantity information and the first to-be-executed task information meet a first preset condition.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the above-described method of restarting an agent system.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of restarting the above-described agent system.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described method of restarting the agent system.
According to the embodiment of the disclosure, by executing the timing detection task, the process quantity information in the agent shared resource space is acquired and the information of the automatic task to be executed is received. By judging the number of processes using the shared resource space of the proxy system and determining whether to restart the proxy system after the condition that whether the information of the latest task to be executed received during the execution of the timing detection task meets the first preset condition, the stability and the safety of the proxy system are guaranteed, and meanwhile, the direct execution of the restart operation of the proxy system is effectively avoided, so that the script process or the service being executed is abnormally quitted.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
fig. 1 schematically illustrates an application scenario diagram of a restart method of a proxy system, a restart apparatus of a proxy system, an electronic device, a storage medium, and a program product according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a method of restarting a proxy system according to an embodiment of the present disclosure;
fig. 3 schematically shows a flowchart of a method for restarting the agent system in a case where the first process quantity information and the information of the first to-be-executed task satisfy a first preset condition according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a flow chart of a method of restarting a proxy system according to another embodiment of the present disclosure;
fig. 5 schematically shows a block diagram of a restart apparatus of a proxy system according to an embodiment of the present disclosure; and
fig. 6 schematically shows a block diagram of an electronic device adapted to implement a restart method of a proxy system according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B, and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, and C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.).
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, necessary security measures are taken, and the customs of the public order is not violated.
In the technical scheme of the embodiment of the disclosure, before the personal information of the user is obtained or collected, the authorization or the consent of the user is obtained.
In the process of implementing the present disclosure, it is found that, when the proxy system is restarted, the old resource space is recycled and a new resource space is created, so that all processes in the old shared space are finished, and the script or service being executed is abnormally exited. For example, when an instruction is issued by an automatic agent mcollctive, the received instruction can be automatically executed by using a cgroup resource space creation process of mcollctive, and the process is ended after the instruction is executed. If the issued script is being executed or the script has no exit mode, the cgroup resource space of mcollective is used all the time, if the agent system mcollective restarts at this time, the old cgroup resource space is recovered, a new cgroup resource space is created, and when the old cgroup resource space is recovered, all processes using the resource space are finished, which causes the executing script or service to be exited abnormally.
An embodiment of the present disclosure provides a method for restarting a proxy system, including:
responding to a restart instruction aiming at the agent system from a server, and acquiring a first timing monitoring task; acquiring first process quantity information of a shared resource space using an agent system from the shared resource space information and acquiring information of a first task to be executed from agent log information by executing a first timing monitoring task, wherein the first process quantity information represents process quantity information which is created in the shared resource space by the agent system and is used for executing a target task, and the first task to be executed represents a latest task to be executed received by the agent system from a server end during the execution of the first timing monitoring task; and under the condition that the first process quantity information and the first task to be executed meet a first preset condition, executing the restarting operation of the agent system.
Fig. 1 schematically illustrates an application scenario diagram of a restart method of a broker system, a restart apparatus of a broker system, an electronic device, a storage medium, and a program product according to an embodiment of the present disclosure.
As shown in fig. 1, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The backend management server may analyze and process the received data such as the user request, and feed back a processing result (for example, a web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the restart method of the proxy system provided by the embodiment of the present disclosure may be generally executed by the terminal devices 101, 102, and 103. Accordingly, the restarting device of the proxy system provided by the embodiment of the present disclosure may also be generally disposed in the terminal devices 101, 102, 103. The restart method of the proxy system provided by the embodiment of the present disclosure may also be executed by other terminals different from the terminal devices 101, 102, and 103. Accordingly, the restart apparatus of the proxy system provided by the embodiment of the present disclosure may also be disposed in other terminals different from the terminal devices 101, 102, and 103.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The restart method of the agent system of the disclosed embodiment will be described in detail below with fig. 2 to 4 based on the scenario described in fig. 1.
Fig. 2 schematically shows a flowchart of a restart method of a broker system according to an embodiment of the present disclosure.
As shown in fig. 2, the restart method 200 of the agent system of this embodiment includes operations S201 to S203.
In operation S201, a first timing monitoring task is obtained in response to a restart instruction from a server for the proxy system.
According to embodiments of the present disclosure, a proxy system may include an automated proxy mcollective. The timing monitoring task can regularly detect whether the restarting operation of the agent system can be executed. It should be noted that the automation agent mcollective is an automation tool developed based on an object-oriented development language ruby.
According to the embodiment of the disclosure, after receiving a restart instruction for the proxy system from the server, the client acquires a timing monitoring task for the restart instruction initiated by the server, so as to confirm whether the restart operation of the proxy system can be executed. The timed monitoring task may be set, for example, once an hour, so that the detection task is automatically triggered once every hour.
In operation S202, by executing the first timing monitoring task, first process quantity information of the shared resource space of the agent system being used is obtained from the shared resource space information, and information of the first task to be executed is obtained from the agent log information, where the first process quantity information represents process quantity information created in the shared resource space by the agent system for executing the target task, and the first task to be executed represents a latest task to be executed received by the agent system from the server during execution of the first timing monitoring task.
It should be noted that, when the command is issued by the automation agent mcollective, the received command is automatically executed by using the cgroup resource space creation process of mcollective, and the process is ended after the command is executed. Wherein, cgroup is a series of hooks (hook) attached to the program by the kernel, and the purpose of tracking and limiting the resource is achieved by triggering the corresponding hooks through the scheduling of the resource when the program runs.
According to the embodiment of the disclosure, when the client executes the first timing monitoring task, the client can acquire the shared process of the shared resource space using the proxy system from the shared resource space information and acquire the task to be executed from the proxy log information. The number of processes for executing the target task is not particularly limited, and may be determined according to the target task. The server can generate an instruction for the agent system to execute the task and issue the instruction to the client, and the agent system can receive the instruction issued to the client.
For example, the first process number information may be 0, indicating that there is no shared process using the shared resource space of the proxy system. The first process number information may not be 0, indicating that there is a shared process using the shared resource space of the proxy system. The information of the first to-be-executed task may include information that a latest to-be-executed task exists and information that a latest to-be-executed task does not exist.
In operation S203, in a case where the first process quantity information and the information of the first task to be executed satisfy a first preset condition, a restart operation of the agent system is performed.
According to the embodiment of the disclosure, the first preset condition may represent that there is no shared process in using the shared resource space of the proxy system and that the proxy system does not receive the latest task to be executed from the server during the execution of the timing monitoring task.
For example, the first process quantity information is 0, and when the information of the first to-be-executed task is that the latest to-be-executed task does not exist, the first preset condition is met, and the restart operation of the agent system needs to be executed.
According to the embodiment of the disclosure, by executing the timing detection task, the process quantity information in the agent shared resource space is acquired and the information of the automatic task to be executed is received. By judging the number of processes using the shared resource space of the proxy system and determining whether to restart the proxy system after the condition that whether the information of the latest task to be executed received during the execution of the timing detection task meets the first preset condition, the stability and the safety of the proxy system are guaranteed, and meanwhile, the direct execution of the restart operation of the proxy system is effectively avoided, so that the script process or the service being executed is abnormally quitted.
Fig. 3 schematically shows a flowchart of a method for restarting the agent system in a case where the first process quantity information and the first to-be-executed task information satisfy a first preset condition according to an embodiment of the present disclosure.
As shown in fig. 3, the method 300 of restarting the agent system in the case where the first process quantity information and the first to-be-executed task information satisfy the first preset condition of the embodiment may include operations S301 to S302.
In operation S301, first time interval information is determined according to the first time information and the time information of the first latest task to be executed, where the first time interval information represents duration information used by the agent system to process the first task to be executed.
It should be noted that the information of the first to-be-executed task may include time information of the first latest to-be-executed task received by the agent system from the server during the execution of the first timing monitoring task.
According to the embodiment of the disclosure, the first time information may be time information for the agent system to process the first task to be executed. The first time interval may be obtained according to a difference between a time when the agent system processes the first task to be executed and a time when the agent system processes the first task to be executed last. The first time interval may be a time duration for the agent system to process the first task to be performed.
In operation S302, in a case that the first time interval information satisfies the second preset condition and the first process quantity information satisfies the first preset condition, a restart operation of the agent system is performed.
According to the embodiment of the present disclosure, the second preset condition may be determined according to a duration of actually executing the task. The restart operation of the agent system may be performed in a case where a time length for the agent system to process the first task to be performed satisfies a time length determined according to a time length for actually performing the task, and the first progress data is zero.
For example, the second preset condition may be set according to a duration of a script executed by an actual port. The interval time can be obtained according to the first time interval information, the interval time is compared with the actual task execution time length determined by the second preset condition, and if the interval time (such as 6 min) obtained according to the first time interval information is higher than the actual task execution time length (such as 5 min) determined by the second preset condition, the first time interval information meets the second preset condition; if the interval time (e.g., 3 min) obtained according to the first time interval information is lower than the actual task execution time length (e.g., 5 min) determined by the second preset condition, the first time interval information does not satisfy the second preset condition.
According to the embodiment of the disclosure, in the process of executing the first timing monitoring task, the agent system determines the time interval information from the time information of the first latest task to be executed and the first time information received by the server side, so as to compare the time interval information with the second preset condition, and further determine whether the task is currently executed, thereby avoiding that the restarting operation of the agent system is directly executed, and the task being executed is abnormally ended.
According to another embodiment of the present disclosure, in a case that the first process quantity information and the first information of the to-be-executed task satisfy the first preset condition, restarting the agent system may further include, in addition to the above operations S301 to S302:
under the condition that the first time interval information does not meet a second preset condition, acquiring first cycle waiting duration information; determining information of a second moment according to the first moment information and the first cycle waiting duration information; at a second current moment, acquiring information of a second task to be executed from the proxy log information by executing a second timing monitoring task, wherein the information of the second task to be executed represents time information of a second latest task to be executed received by the proxy system from the server in the process of executing the second timing monitoring task; determining second time interval information according to the second time information and the second latest time information of the task to be executed; and executing the restarting operation of the agent system under the condition that the second time interval information meets a second preset condition and the first process quantity information meets a first preset condition.
It should be noted that, when it is not detected that there is a shared resource space process, but there is a task to be executed currently, it may be detected whether a restart operation of the proxy system needs to be executed after waiting for a cycle time.
According to the embodiment of the present disclosure, the first loop waiting duration information may include a duration of waiting when the first task to be executed exists. The first time obtained from the first time information and the time length of waiting for the first task to be performed obtained from the first loop waiting time length information may be added to obtain the second time. The second time may be a time when the second to-be-executed task is processed according to the agent system. The second current time may be the second time. The second time interval may be obtained according to a difference between a time at which the agent system processes the second task to be executed and a time at which the second task to be executed is the latest. And if the second time interval meets a second preset condition and the first process quantity information meets the first preset condition, executing the restarting operation of the agent system.
According to the embodiment of the disclosure, when the shared resource space process is not detected, but the current task to be executed is received, the process waits for a cycle time and then detects whether the restart operation of the proxy system needs to be executed, so that the problem that the task being executed is abnormally ended due to the fact that the restart operation of the proxy system is directly executed is avoided.
According to still another embodiment of the present disclosure, in a case that the first process quantity information and the information of the first task to be executed satisfy the first preset condition, restarting the agent system may further include:
recording the first cycle times under the condition that the first time interval information does not meet a second preset condition; recording a second cycle number under the condition that the second time interval information does not meet a second preset condition; generating a target cycle number according to the first cycle number information and the second cycle number information; and under the condition that the target cycle number is greater than a preset threshold value, ending the timing monitoring task.
According to an embodiment of the present disclosure, the preset threshold may be set according to a frequency of actually receiving the task. And under the condition that the first time interval information does not meet the second preset condition, determining the first cycle number according to the first cycle waiting time length information and the frequency of the receiving task. And under the condition that the second time interval information does not meet the second preset condition, determining the second cycle number according to the second cycle waiting time length information and the frequency of the receiving task. The target number of cycles may be a sum of the first number of cycles and the second number of cycles.
According to the embodiment of the disclosure, the target cycle times generated by the recorded first cycle times and the second cycle times are compared with the preset threshold, and the timing detection task is ended under the condition that the target cycle times are greater than the preset threshold, so that the task in the background cycle operation is effectively prevented from being abnormally ended.
According to the embodiment of the present disclosure, in a case that the first process quantity information and the first information of the task to be executed satisfy the first preset condition, the executing of the restart operation of the agent system may further include:
acquiring configuration change information of the agent system under the condition that the first process quantity information and the information of the first task to be executed meet a first preset condition; changing the configuration information of the agent system according to the configuration change information; and executing the restarting operation of the agent system.
According to the embodiment of the disclosure, when the configuration information of the proxy system is changed, the restart operation of the proxy system can be executed after the change.
For example, the first process quantity information is 0, and the first preset condition is satisfied when the information of the first to-be-executed task is that the latest to-be-executed task does not exist. When the configuration information of the agent system is detected to be changed, the configuration information of the agent system is changed by acquiring the configuration change information.
According to the embodiment of the disclosure, after judgment is carried out from multiple dimensions according to the process number of the shared resource space, the information of the tasks to be executed and the configuration change information of the proxy system, the configuration information of the proxy system is safely and stably changed and the restart operation of the proxy system is executed under the condition that the execution tasks and the service are not influenced.
According to an embodiment of the present disclosure, the method for restarting the proxy system may further include:
acquiring second cycle waiting duration information under the condition that the first process quantity information does not meet a first preset condition; determining information of a third moment according to the first moment information and the second cycle waiting duration information; at a third moment, by executing a third timing monitoring task, acquiring second process quantity information using a shared resource space from the shared resource space information, and acquiring information of a third task to be executed from the proxy log information; and under the condition that the second process quantity information and the information of the third task to be executed meet the first preset condition, executing the restarting operation of the agent system.
According to an embodiment of the present disclosure, the first preset condition may characterize that there is no shared progress in using the shared resource space of the proxy system and that the proxy system does not receive the latest task to be executed from the server during the execution of the timing monitoring task. The information of the third task to be performed may include information that there is a latest task to be performed and information that there is no latest task to be performed.
For example, when the first process number information is not 0, the first preset condition is not satisfied. The third time may be obtained according to a sum of the waiting time of the second cycle and the first time. And when the second process quantity information is 0 and the latest information of the task to be executed does not exist, meeting a first preset condition and executing the restarting operation of the agent system.
According to the embodiment of the disclosure, when it is detected that a shared process exists in a shared resource space using an agent system, after a loop waiting is performed, whether the shared process exists at the current moment is detected, and if the shared process does not exist and a task to be executed latest does not exist, a restart operation of the agent system is executed, so that the stability and the security of the agent system are guaranteed, and meanwhile, the direct execution of the restart operation of the agent system is effectively avoided, and the script process or the service being executed is abnormally exited.
Fig. 4 schematically shows a flowchart of a restart method of a proxy system according to another embodiment of the present disclosure.
As shown in fig. 4, the restart method 400 of the proxy system of this embodiment includes operations S401 to S407.
In operation S401, a timing monitoring task is started.
According to the embodiment of the disclosure, the timing monitoring task can be started after the first timing monitoring task is acquired in response to a restart instruction for the proxy system from the server.
In operation S402, whether a sharing process exists.
According to an embodiment of the present disclosure, when starting to execute the timing detection task, shared process information of the shared resource space in which the proxy system is being used may be acquired from the shared resource space information. If there is a sharing process, operation S406 is performed. If there is no sharing process, operation S403 is performed.
In operation S403, whether there is a task to be performed.
According to the embodiment of the present disclosure, when the execution of the timing detection task is started, information of the task to be executed may be acquired from the proxy log information. If there is a task to be performed, operation S406 is performed. If there is no task to be executed, operation S404 is performed.
In operation S404, a restart operation of the system is proxied.
In operation S405, the timing monitoring task is ended.
According to an embodiment of the present disclosure, the timing detection task may be ended after the restart operation of the agent system of operation S404 is performed.
In operation S406, a loop waits.
According to the embodiment of the disclosure, when the timing detection task starts to be executed, the shared process is detected to exist or the task to be executed can enter the loop waiting. The time of the loop wait may be recorded.
In operation S407, whether the number of cycles is greater than a preset threshold.
According to the embodiment of the disclosure, the number of cycles can be determined according to the time of the cycle waiting and the frequency of receiving the task to be executed. The preset threshold may be set according to the frequency of actually receiving the tasks. If the number of loops is greater than the preset threshold, operation S405 is performed to end the timing detection task. If the number of cycles is less than the preset threshold, operation S402 is performed to perform the detection again.
According to the embodiment of the disclosure, by executing the timing detection task, shared process information of the agent shared resource space is acquired and automatic task information to be executed is received. And under the condition that no process using the shared space is determined and no task to be executed exists, restarting the proxy system, and avoiding that the task being executed is abnormally ended due to the fact that the restart operation of the proxy system is directly executed. When the process using the shared space is determined or the task to be executed is determined, the loop waiting is set, the loop times are judged, whether the timing detection task is finished or not is further determined, and the task circularly running in the background is effectively prevented from being abnormally finished.
Based on the agent system restarting method, the invention also provides a agent system restarting device. The apparatus will be described in detail below with reference to fig. 5.
Fig. 5 schematically shows a block diagram of a restart apparatus of a proxy system according to an embodiment of the present disclosure.
As shown in fig. 5, the information recommendation apparatus 500 of the embodiment includes a first obtaining module 510, a second obtaining module 520, and a first executing module 530.
The first obtaining module 510 is configured to obtain a first timing monitoring task in response to a restart instruction from the server for the proxy system. In an embodiment, the first obtaining module 510 may be configured to perform the operation S201 described above, which is not described herein again.
The second obtaining module 520 is configured to obtain, from the shared resource space information, first process quantity information of a shared resource space in which the agent system is being used by executing the first timing monitoring task, and obtain information of a first task to be executed from the agent log information, where the first process quantity information represents process quantity information created in the shared resource space by the agent system and used for executing a target task, and the first task to be executed represents a latest task to be executed received by the agent system from the server during execution of the first timing monitoring task. In an embodiment, the second obtaining module 520 may be configured to perform the operation S202 described above, which is not described herein again.
The first executing module 530 is configured to execute a restart operation of the agent system if the first process quantity information and the first to-be-executed task information satisfy a first preset condition. In an embodiment, the first performing module 530 may be configured to perform the operation S203 described above, which is not described herein again.
According to an embodiment of the present disclosure, the restarting apparatus 500 of the agent system may further include a third obtaining module, a determining module, a fourth obtaining module, and a second executing module.
The third obtaining module is used for obtaining the second cycle waiting duration information under the condition that the first process quantity information does not meet the first preset condition.
The determining module is used for determining the information of the third moment according to the first moment information and the second cycle waiting duration information.
The fourth obtaining module is configured to obtain, at a third time, second process quantity information that the shared resource space is being used from the shared resource space information by executing a third timing monitoring task, and obtain information of a third task to be executed from the proxy log information.
The second execution module is used for executing the restarting operation of the agent system under the condition that the second process quantity information and the information of the third task to be executed meet the first preset condition.
According to an embodiment of the present disclosure, any plurality of the first obtaining module 510, the second obtaining module 520, and the first executing module 530 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first obtaining module 510, the second obtaining module 520, and the first executing module 530 may be implemented at least partially as a hardware circuit, 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 a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented in any one of three implementations of software, hardware, and firmware, or in a suitable combination of any of the three implementations. Alternatively, at least one of the first obtaining module 510, the second obtaining module 520 and the first executing module 530 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement a restart method of a proxy system according to an embodiment of the present disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present 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 section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include on-board memory for caching purposes. The processor 601 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 600 are stored. The processor 601, the ROM602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to embodiments of the present disclosure by executing programs in the ROM602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the present disclosure. The electronic device 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that the computer program read out therefrom is mounted in the storage section 608 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be embodied in the device/apparatus/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM602 and/or RAM 603 described above and/or one or more memories other than the ROM602 and RAM 603.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 601. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of signals over a network medium, downloaded and installed via the communication section 609, and/or installed from a removable medium 611. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609 and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In situations involving remote computing devices, the remote computing devices may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to external computing devices (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A method of restarting a proxy system, comprising:
responding to a restart instruction aiming at the proxy system from a server, and acquiring a first timing monitoring task;
acquiring first process quantity information of a shared resource space using the proxy system from shared resource space information and acquiring information of a first task to be executed from proxy log information by executing the first timing monitoring task, wherein the first process quantity information represents process quantity information which is created in the shared resource space by the proxy system and is used for executing a target task, and the first task to be executed represents a latest task to be executed received by the proxy system from the server during execution of the first timing monitoring task; and
and under the condition that the first process quantity information and the first task to be executed meet a first preset condition, executing the restarting operation of the agent system.
2. The method according to claim 1, wherein the information of the first to-be-executed task includes time information of a first latest to-be-executed task received by the agent system from the server during execution of the first timing monitoring task, and in a case that the first process quantity information and the information of the first to-be-executed task satisfy a first preset condition, restarting the agent system includes:
determining first time interval information according to the first time information and the latest time information of the first task to be executed, wherein the first time interval information represents time length information used by the agent system for processing the first task to be executed;
and executing the restarting operation of the agent system under the condition that the first time interval information meets a second preset condition and the first process quantity information meets the first preset condition.
3. The method of claim 2, further comprising:
under the condition that the first time interval information does not meet the second preset condition, acquiring first cycle waiting duration information;
determining information of a second moment according to the first moment information and the first cycle waiting duration information;
at the second current moment, acquiring information of a second task to be executed from the agent log information by executing a second timing monitoring task, wherein the information of the second task to be executed represents time information of a second latest task to be executed, which is received by the agent system from the server end in the process of executing the second timing monitoring task;
determining second time interval information according to the second time information and the second latest time information of the task to be executed;
and executing the restarting operation of the agent system under the condition that the second time interval information meets a second preset condition and the first process quantity information meets the first preset condition.
4. The method of claim 3, further comprising:
recording a first cycle number under the condition that the first time interval information does not meet the second preset condition;
recording a second cycle number under the condition that the second time interval information does not meet a second preset condition;
generating a target cycle number according to the first cycle number information and the second cycle number information;
and under the condition that the target cycle number is greater than a preset threshold value, ending the timing monitoring task.
5. The method according to claim 1, wherein, in case that the first process quantity information and the first task to be executed information satisfy a first preset condition, performing a restart operation of the agent system includes:
acquiring configuration change information of the agent system under the condition that the first process quantity information and the information of the first task to be executed meet a first preset condition;
changing the configuration information of the agent system according to the configuration change information;
and executing the restart operation of the proxy system.
6. The method of claim 1, further comprising:
acquiring second cycle waiting duration information under the condition that the first process quantity information does not meet the first preset condition;
determining information of a third moment according to the first moment information and the second cycle waiting duration information;
at the third moment, by executing a third timing monitoring task, acquiring second process quantity information of the shared resource space in use from the shared resource space information, and acquiring information of a third task to be executed from the proxy log information;
and executing the restarting operation of the agent system under the condition that the second process quantity information and the information of the third task to be executed meet the first preset condition.
7. A restart apparatus of a proxy system, comprising:
the first acquisition module is used for responding to a restart instruction aiming at the agent system from the server side and acquiring a first timing monitoring task;
a second obtaining module, configured to obtain, from shared resource space information, first process quantity information that is using a shared resource space of the proxy system by executing the first timing monitoring task, and obtain information of a first task to be executed from proxy log information, where the first process quantity information represents process quantity information that is created in the shared resource space by the proxy system and is used for executing a target task, and the first task to be executed represents a latest task to be executed that the proxy system receives from the server during execution of the first timing monitoring task; and
and the first execution module is used for executing the restarting operation of the agent system under the condition that the first process quantity information and the first task to be executed meet a first preset condition.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 6.
CN202211037214.7A 2022-08-26 2022-08-26 Method and device for restarting agent system, electronic equipment and storage medium Pending CN115373802A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211037214.7A CN115373802A (en) 2022-08-26 2022-08-26 Method and device for restarting agent system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211037214.7A CN115373802A (en) 2022-08-26 2022-08-26 Method and device for restarting agent system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115373802A true CN115373802A (en) 2022-11-22

Family

ID=84069672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211037214.7A Pending CN115373802A (en) 2022-08-26 2022-08-26 Method and device for restarting agent system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115373802A (en)

Similar Documents

Publication Publication Date Title
CN107766101B (en) Method, device and equipment for processing App starting event
CN113132489A (en) Method, device, computing equipment and medium for downloading file
US8938490B2 (en) System and method for accessing mainframe system automation from a process automation application
CN113900834A (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN114416378A (en) Data processing method and device, electronic equipment and storage medium
CN111611086A (en) Information processing method, information processing apparatus, electronic device, and medium
CN115630033A (en) Log information processing method and device, electronic equipment and medium
CN113132400B (en) Business processing method, device, computer system and storage medium
CN112953769B (en) Data transmission method, device, computer system and readable storage medium
CN116302561A (en) State control method, device, equipment and storage medium for application instance
CN115373802A (en) Method and device for restarting agent system, electronic equipment and storage medium
CN114356713A (en) Thread pool monitoring method and device, electronic equipment and storage medium
CN112395194B (en) Method and device for accessing test platform
CN115080434A (en) Case execution method, device, equipment and medium
CN113535568A (en) Verification method, device, equipment and medium for application deployment version
CN114020513A (en) Method and device for processing log information
CN113781154A (en) Information rollback method, system, electronic equipment and storage medium
CN112597224A (en) Data export method, data export device, electronic equipment and medium
CN111130702A (en) Decoding method, decoding system, electronic device, and storage medium
CN113259431B (en) Service calling method, service calling device, electronic device and storage medium
CN115190008B (en) Fault processing method, fault processing device, electronic equipment and storage medium
CN112749042B (en) Application running method and device
CN114371979A (en) Container resource monitoring method, device, equipment, medium and program product
CN117785275A (en) Daemon implementation method, daemon implementation device, daemon implementation equipment, daemon implementation medium and daemon implementation program product
CN115344398A (en) Host job management method, device, electronic apparatus, medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination