[go: up one dir, main page]

CN119961057A - Process recovery method, device, equipment and storage medium - Google Patents

Process recovery method, device, equipment and storage medium Download PDF

Info

Publication number
CN119961057A
CN119961057A CN202510039444.4A CN202510039444A CN119961057A CN 119961057 A CN119961057 A CN 119961057A CN 202510039444 A CN202510039444 A CN 202510039444A CN 119961057 A CN119961057 A CN 119961057A
Authority
CN
China
Prior art keywords
executable file
file path
identifier
linked list
preset
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
CN202510039444.4A
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.)
Chongqing Chang'an Technology Co ltd
Original Assignee
Chongqing Chang'an Technology 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 Chongqing Chang'an Technology Co ltd filed Critical Chongqing Chang'an Technology Co ltd
Priority to CN202510039444.4A priority Critical patent/CN119961057A/en
Publication of CN119961057A publication Critical patent/CN119961057A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a process recovery method, a device, equipment and a storage medium, wherein the process recovery method comprises the steps of searching a corresponding executable file path from a configuration file based on a process identifier of a first process under the condition that the first process needs to be recovered through a first monitoring process; the configuration file comprises at least one executable file path corresponding to the process, a sub-process is created through the first monitoring process, and the executable file is executed in the sub-process based on the executable file path of the first process so as to recover the first process. Under the condition that the first process needs to be recovered through the first monitoring process, the executable file path of the first process is directly obtained from the configuration file, and the executable file path of the first process is further executed, so that the purpose of recovering the first process is achieved, and meanwhile, the rapidity and the accuracy of recovering the first process are guaranteed.

Description

Process recovery method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computers, and in particular, to a process recovery method, apparatus, device, and storage medium.
Background
In the current work production environment, a large number of linux systems are running, and a large number of application programs are deployed on the systems. The abnormal exit of the application program is avoided in the running process. In order to ensure the normal operation of the application program, some processes which are abnormally exited need to be immediately restarted. It is therefore important to provide a self-healing technique immediately after an application exits.
Disclosure of Invention
The invention provides a process recovery method for solving the problem of process recovery, a process recovery device, an electronic device, a computer storage medium and a computer program product.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
a process recovery method, the process recovery method comprising:
Under the condition that the first process needs to be recovered through the first monitoring process, searching a corresponding executable file path from a configuration file based on a process identifier of the first process, wherein the configuration file comprises at least one executable file path corresponding to the process;
Creating a sub-process by the first monitoring process, and executing an executable file in the sub-process based on an executable file path of the first process to recover the first process.
According to the technical means, under the condition that the first process needs to be recovered through the first monitoring process, the executable file path of the first process is directly obtained from the configuration file, and then the first process is recovered based on the executable file path of the first process, so that the purpose of recovering the first process is achieved, and meanwhile, the rapidity and the accuracy of recovering the first process are also ensured.
Further, the process recovery method further comprises the steps of storing an identifier of a second process in a preset linked list if the second process which is running is determined to be a user state process through a callback function under the condition that a timer is triggered, obtaining an executable file path of the second process from a process directory file through a first kernel thread based on the process identifier of the second process in the preset linked list, and storing the executable file path in the configuration file.
According to the technical means, the process identifier of the second process in the preset linked list is obtained through the first kernel thread, and then the executable file path of the second process is obtained from the process directory file based on the process identifier of the running second process and is stored in the configuration file. Thus, if a certain exiting process needs to be restored later, the executable file path of the process needing to be restored is directly obtained from the configuration file, and the process is restored based on the executable file path of the process needing to be restored. Thus, the rapidity and the accuracy of the process recovery are ensured.
Further, the step of obtaining the executable file path of the second process from the process catalog file based on the process identifier of the second process in the preset linked list through the first kernel thread and storing the executable file path of the second process in the configuration file comprises the step of obtaining a command line character string used for starting the second process from the process catalog file through the first kernel thread based on the process identifier of the second process and analyzing the command line character string to obtain the executable file path of the second process.
According to the technical means, the command line character string used for starting the second process is obtained from the process directory file through the first kernel thread based on the process identifier of the second process, and then the command line character string is analyzed, so that an executable file path of the second process is obtained, and the accurate acquisition of the executable file path of the second process is ensured.
Further, the step of storing the identifier of the second process in a preset linked list comprises the steps of determining whether the process identifier of the second process is included in the preset linked list through the callback function, storing the process identifier of the second process in the preset linked list if the process identifier of the second process is not included, and not processing if the process identifier of the second process is included.
Further, the configuration file is stored, and the configuration file comprises the steps of storing the executable file path of the second process in the preset linked list under the condition that the executable file path of the second process is not included in the preset linked list through the first kernel thread, or updating the historical executable file path of the second process in the preset linked list by using the executable file path of the second process under the condition that the historical executable file path of the second process is included in the preset linked list, and storing the process identifier of the second process and the executable file path of the second process in the preset linked list in the configuration file according to a format of a key value pair.
According to the technical means, the process identifier and the executable file path of the second process in the preset linked list are stored in the configuration file, so that when the running second process is abnormally exited and needs to be recovered, the executable file path of the second process can be directly obtained from the configuration file, the recovery of the process is realized, and the situation that the executable file path of the second process cannot be obtained when the process is recovered is avoided.
The process recovery method further comprises the steps of obtaining a process identifier of the first process from a preset queue through a second kernel thread and transmitting the process identifier to the first monitoring process, wherein the preset queue comprises at least one process identifier of an abnormally-exited process, and determining that the first process needs to be recovered under the condition that the first monitoring process determines that a process identifier set of the preset recovery process comprises the process identifier of the first process.
Further, the process recovery method further comprises the step of storing a process identifier of the first process in the preset queue under the condition that the first process is determined to be abnormally exited by a second monitoring process.
A process recovery apparatus, the process recovery apparatus comprising:
The first monitoring process is used for searching a corresponding executable file path from a configuration file based on a process identifier of the first process under the condition that the first process needs to be recovered, wherein the configuration file comprises at least one executable file path corresponding to the process;
The first monitor process is further configured to create a sub-process, and execute an executable file in the sub-process based on an executable file path of the first process to restore the first process.
An electronic device comprising a processor and a memory configured to store a computer program capable of running on the processor, wherein the processor is configured to perform the steps of the aforementioned method when the computer program is run.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the aforementioned method.
A computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the aforementioned method.
The invention has the beneficial effects that:
(1) Under the condition that the first process needs to be recovered through the first monitoring process, the executable file path of the first process is directly obtained from the configuration file, and the first process is recovered based on the executable file path of the first process, so that the purpose of recovering the first process is achieved, and meanwhile, the rapidity and the accuracy of recovering the first process are also ensured;
(2) The process identifier and the executable file path of the second process are stored in the configuration file, so that when the second process is abnormally exited and needs to be recovered, the executable file path of the second process can be directly obtained from the configuration file, the recovery of the process is realized, and the situation that the executable file path of the second process cannot be obtained when the process is recovered is avoided.
Drawings
FIG. 1 is a flowchart of a process recovery method according to an embodiment of the present invention;
FIG. 2 is a second flow chart of a process recovery method according to an embodiment of the invention;
FIG. 3 is a flowchart illustrating a process recovery method according to an embodiment of the present invention;
FIG. 4 is a flowchart of a process recovery method according to an embodiment of the present invention;
FIG. 5 is a flowchart of a process recovery method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a process recovery method according to an embodiment of the present invention;
FIG. 7 is a flowchart of a process recovery method according to an embodiment of the present invention;
FIG. 8 is a flowchart of a configuration method of a configuration file according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a process recovery device according to an embodiment of the present invention;
fig. 10 is a schematic diagram of an electronic device according to an embodiment of the invention.
Detailed Description
For a more complete understanding of the nature and the technical content of the embodiments of the present application, reference should be made to the following detailed description of embodiments of the application, taken in conjunction with the accompanying drawings, which are meant to be illustrative only and not limiting of the embodiments of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing the embodiments only and is not intended to be limiting of the application.
In the following description reference is made to "some embodiments," "this embodiment," and examples, etc., which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with one another without conflict.
If a similar description of "first/second" appears in the application document, the following description is added, in which the terms "first/second/third" are merely distinguishing between similar objects and not representing a particular ordering of the objects, it being understood that the "first/second/third" may be interchanged with a particular order or precedence, where allowed, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein.
The term "and/or" in this embodiment is merely an association relation describing the associated objects, and indicates that three kinds of relations may exist, for example, object a and/or object B may indicate that object a exists alone, object a and object B exist together, and object B exists alone.
An embodiment of the present invention provides a process recovery method, fig. 1 is a schematic flow diagram of the process recovery method in the embodiment of the present invention, and as shown in fig. 1, the process recovery method includes the following steps:
and S101, under the condition that the first process needs to be recovered through the first monitoring process, searching a corresponding executable file path from a configuration file based on a process identifier of the first process, wherein the configuration file comprises at least one executable file path corresponding to the process.
In the embodiment of the invention, the first monitoring process is a process for monitoring whether the first process which is abnormally exited needs to be restored or not. The configuration file includes a process identifier (Process Identifier, PID) of at least one process and an executable file path of a corresponding process. Where PID is a unique digital identifier assigned to each process by the operating system.
In the embodiment of the invention, under the condition that the first process which is abnormally exited is monitored by the first monitoring process and needs to be recovered, the process identifier of the first process is obtained, the process identifier of the first process is searched from the process identifier of at least one process in the configuration file, and then the executable file path of the first process corresponding to the process identifier of the first process is obtained from the configuration file.
S102, creating a sub-process through the first monitoring process, and executing an executable file in the sub-process based on an executable file path of the first process to recover the first process.
In the embodiment of the invention, the first monitoring process can be understood as a main process of the subprocess, the first monitoring process creates the subprocess through frok functions, and executes the executable file of the first process based on the executable file path of the first process to be restored through execve functions in the subprocess, so that the subprocess is operated, and the running subprocess is the first process which is restored, namely the purpose of restoring the first process is achieved.
In the embodiment of the invention, under the condition that the first process needs to be recovered through the first monitoring process, the executable file path of the first process is directly obtained from the configuration file, and the first process is recovered based on the executable file path of the first process, so that the purpose of recovering the first process is achieved, and meanwhile, the rapidity and the accuracy of the recovery of the first process are also ensured.
Regarding the configuration file mentioned in S101 comprising at least one executable file path corresponding to a process, in some embodiments, the process restoration method further comprises the following steps S201 to S202:
And S201, under the condition that the timer is triggered, if the running second process is determined to be the user state process through the callback function, storing the identifier of the second process in a preset linked list.
In the embodiment of the invention, under the condition that a timer is triggered according to a preset time interval or a time point, traversing whether at least one second process running is a user state process or not through a callback function, and if the at least one second process is the user state process, storing a process identifier of the at least one second process in a preset linked list. The user state process refers to a process running in a user space. The user space is the environment in which the application runs. The first kernel thread refers to a thread that is finished being scheduled by the operating system kernel.
S202, obtaining an executable file path of a second process from a process directory file based on a process identifier of the second process in a preset linked list through a first kernel thread, and storing the executable file path in a configuration file.
In the embodiment of the invention, the process identifier of at least one running second process is stored in the preset linked list. The process directory file (i.e. proc file) includes therein an executable file path of at least one second process being run.
In the embodiment of the invention, the process identifier of at least one second process in the preset linked list is acquired through the first kernel thread, then the executable file path of each at least one second process is acquired from the process directory file based on the process identifier of the running at least one second process, and the process identifier of the at least one second process and the corresponding executable file path are stored in the configuration file according to the format of the key value pair. Thus, if a certain exiting process needs to be restored later, the executable file path of the process needing to be restored is directly obtained from the configuration file, and the process is restored based on the executable file path of the process needing to be restored. Thus, the rapidity and the accuracy of the process recovery are ensured.
In some embodiments, if the second process being run is determined to be a kernel-mode process by the callback function, no processing is done if the timer is triggered.
Here, a kernel-mode process refers to a process running in kernel space. Kernel space is the environment in which the operating system kernel runs.
In some embodiments, the process recovery method further includes the following steps S301 to S303:
s301, obtaining a command line character string used for starting a second process in a process directory file based on a process identifier of the second process through a first kernel thread.
In the embodiment of the present invention, the process directory file (i.e., proc file) includes at least one sub-directory file of the second process, where the sub-directory file is a file named by a process identifier of the second process, and the sub-directory file includes a command line string (i.e., cmdline string) used for starting the second process. Therefore, through the first kernel thread, the sub-directory file of the second process is searched from the process directory file based on the process identifier of the second process, and then the command line character string used for starting the second process is obtained from the sub-directory file of the second process.
S302, analyzing the command line character string to obtain an executable file path of the second process.
In the embodiment of the invention, the first kernel thread firstly obtains the command line character string used for starting the second process from the process catalog file based on the process identifier of the second process, and then analyzes the command line character string, thereby obtaining the executable file path of the second process, and ensuring the accurate acquisition of the executable file path of the second process.
In some embodiments, the transmitting the process identifier of the second process to the first kernel thread includes the following steps S401 to S402:
s401, determining whether a process identifier of the second process is included in the preset linked list through a callback function.
If the preset linked list does not include the process identifier of the second process, S402 is executed, and if the preset linked list includes the process identifier of the second process, S403 is executed without any processing.
S402, storing a process identifier of the second process in a preset linked list.
S403, do not do any processing.
In the embodiment of the invention, the preset linked list is a linked list preset in the kernel. The preset linked list is used for caching data information of related processes, the data information of each process corresponds to one data item, and each data item comprises a process identifier field, and the process identifier field is used for caching a process identifier.
Here, the process identifier of the running at least one second process is stored in the process identifier field in the preset linked list, so that the first kernel thread can conveniently acquire the process identifier of the running at least one second process from the preset linked list, and further execute the step of acquiring the executable file path of the at least one second process, so that the executable file path of the running at least one second process can be ensured to be stored in the configuration file, and thus, when the running second process is abnormally exited and needs to be recovered, the executable file path of the running second process can be directly acquired from the configuration file, and the recovery of the running second process is realized, and the situation that the executable file path of the running second process cannot be acquired during the recovery process is avoided.
In some embodiments, the storing in the configuration file includes the following steps S501 to S503:
S501, storing the executable file path of the second process in the preset linked list under the condition that the executable file path of the second process is not included in the preset linked list through the first kernel thread.
S502, under the condition that the historical executable file path of the second process is included in the preset linked list, updating the historical executable file path of the second process in the preset linked list by using the executable file path of the second process.
S503, according to the format of the key value pair, storing a process identifier of the second process in the preset linked list and an executable file path in the configuration file.
In the embodiment of the invention, the preset linked list is used for caching the data information of the related processes, the data information of each process corresponds to one data item, and each data item further comprises an executable file path field which is used for caching the executable file path of the process.
In the embodiment of the invention, the executable file path of at least one running second process is stored in the executable file path field through the first kernel thread, and then the process identifier and the executable file path of the at least one running second process are obtained from the preset linked list and stored in the configuration file according to the format of the key value pair, so that when the running second process is abnormally exited and needs to be recovered, the executable file path of the running second process can be directly obtained from the configuration file, the recovery of the process is realized, and the situation that the executable file path of the running second process cannot be obtained when the process is recovered is avoided.
In some embodiments, the process restoration method further includes the following steps S601 to S602:
s601, obtaining a process identifier of a first process from a preset queue through a second kernel thread and transmitting the process identifier to a first monitoring process, wherein the preset queue comprises at least one process identifier of an abnormal exit process.
S602, through a first monitoring process, determining that the first process needs to be recovered under the condition that the process identifier of the first process is included in the process identifier set of the preset recovery process.
In some embodiments, the process recovery method further comprises storing a process identifier of the first process in the preset queue in the event that the first process is determined to be an exception exit by a second monitoring process.
In the embodiment of the invention, the process identifier set comprises at least one process identifier of the process which is abnormally exited and needs to be recovered. Here, a process that is abnormally exited and needs to be restored generally refers to a process that is suddenly terminated at run-time due to some error or abnormality, which is critical to the stability of the system or the continuity of traffic, and thus needs to be restored. Reasons for the abnormal exit include, but are not limited to, program errors, system resources starvation.
Based on the above embodiments, the present invention provides a process recovery method, and fig. 7 is a flow chart of a process recovery method in the embodiment of the present invention, as shown in fig. 7, where the process recovery method includes the following steps:
And S701, monitoring the first process which is abnormally exited on the central processing unit through a second monitoring process.
S702, storing a process identifier of the first process in a preset queue through a second monitoring process.
The preset queue is a queue with an advanced definition number.
S703, obtaining a process identifier of the first process from a preset queue through the second kernel thread, and transmitting the process identifier of the first process to the first monitoring process based on a netlink protocol.
S704, determining whether the first process needs to be recovered or not through the first monitoring line process.
If the first monitoring process determines that the first process needs to be recovered, S705 is executed, and if the first monitoring process determines that the first process does not need to be recovered, S708 is executed, that is, no processing is performed.
And S705, searching an executable file path of the first process from the configuration file through the first monitoring line process.
S706, creating a sub-process based on a fork function through the first monitor line process.
S707, executing the executable file in the subprocess through execve functions by the first monitoring process based on the executable file path of the first process so as to recover the first process.
S708, not processing.
In the above embodiment, the executable file path corresponding to at least one process is preconfigured in the configuration file.
When the system is started and initialized, a timer htimer and a PID buffer chain table (i.e. the preset chain table mentioned above) are set in the kernel, the timer is used for detecting running processes, the PID buffer chain table is used for buffering data information of related processes, the data information of each process corresponds to a data item, and each data item consists of 3 fields including the PID, the process name and the corresponding executable file path of the newly added process. The process name is a name that each process is given at creation time or run time to describe or identify the process.
Fig. 8 is a flow chart of a configuration method of a configuration file in an embodiment of the present invention, and as shown in fig. 8, the configuration method of the configuration file includes the following steps:
S801 timer is triggered.
S802, traversing the second running process through the callback function.
S803, whether the process is a user state process.
If yes, executing S804, otherwise, not processing.
S804, whether the PID of the second process is in the PID cache chain table.
If not, S805 is executed, and if yes, S806 is executed.
S805, storing the PID of the second process in the PID field in the PID cache chain table.
And storing the process name of the second process into a process name field in the PID cache linked list.
S806, obtaining the PID of the second process in the PID cache chain table through the first kernel thread.
S807, the PID and proc file names of the second process are transmitted to the traversing function through the first kernel thread.
S808, obtaining cmdline character strings used for starting the second process, namely command line character strings, from the/proc/pid file through a traversing function.
And S809, analyzing the executable file path of the second process from the cmdline character strings through a filtering function.
S810, detecting whether an executable file path field in the PID cache chain table exists an executable file path of the second process or not through a calibration function.
If so, S811 is performed, and if not, S812 is performed.
S811, updating the historical executable file path of the second process in the PID cache chain table by using the executable file path of the second process.
S812 stores the executable file path of the second process in the executable file path field in the PID cache linked list.
And S813, storing the process identifier of the second process and the executable file path in the PID cache chain table in the configuration file according to the format of the key value pair.
S814, not processing.
An embodiment of the present invention provides a process recovery device, fig. 9 is a schematic diagram of a structure of a process recovery device in the embodiment of the present invention, and as shown in fig. 9, a process recovery device 90 includes:
the first monitoring process 901 is configured to, when it is determined that the first process needs to be restored, find a corresponding executable file path from a configuration file based on a process identifier of the first process, where the configuration file includes at least one executable file path corresponding to the process;
The first monitor process 901 is further configured to create a sub-process, and execute an executable file in the sub-process based on the executable file path of the first process, so as to restore the first process.
In the embodiment of the invention, under the condition that the first process needs to be recovered through the first monitoring process, the executable file path of the first process is directly obtained from the configuration file, and the first process is recovered based on the executable file path of the first process, so that the purpose of recovering the first process is achieved, and meanwhile, the rapidity and the accuracy of the recovery of the first process are also ensured.
In some embodiments, when a timer is triggered, a callback function is used for determining that a second process which is running is a user state process, storing an identifier of the second process in a preset linked list, and a first kernel thread is used for obtaining an executable file path of the second process from a process directory file based on the process identifier of the second process in the preset linked list and storing the executable file path in the configuration file.
In some embodiments, the first kernel thread is further configured to obtain, in the process directory file, a command line string used for starting the second process based on a process identifier of the second process, and parse the command line string to obtain an executable file path of the second process.
In some embodiments, the callback function is further configured to determine whether the process identifier of the second process is included in the preset linked list, if not, store the process identifier of the second process in the preset linked list, and if not, do not perform processing.
In some embodiments, the first kernel thread is further configured to store the executable file path of the second process in the preset linked list if it is determined that the executable file path of the second process is not included in the preset linked list;
Or under the condition that the historical executable file path of the second process is included in the preset linked list, updating the historical executable file path of the second process in the preset linked list by using the executable file path of the second process;
And storing the process identifier and the executable file path of the second process in the preset linked list in the configuration file according to the format of the key value pair.
In some embodiments, the second kernel thread is configured to obtain a process identifier of the first process from a preset queue and transmit the process identifier to the first monitoring process, where the preset queue includes at least one process identifier of an abnormally exiting process, and the first monitoring process is configured to determine that the first process needs to be restored if it is determined that a process identifier of the first process is included in a process identifier set of a preset restoring process.
In some embodiments, a second monitor process is configured to store a process identifier of the first process in the preset queue if it is determined that the first process is an exception exit.
The embodiment of the invention also provides another electronic device, fig. 10 is a schematic diagram of the composition structure of the electronic device in the embodiment of the invention, and as shown in fig. 10, the electronic device 100 includes a processor 1001 and a memory 1002 configured to store a computer program capable of running on the processor;
Wherein the processor 1001 is configured to execute the method steps in the aforementioned embodiments when running a computer program.
Of course, in actual practice, the various components of the electronic device 100 would be coupled together via a bus system 1003, as shown in FIG. 10. It is appreciated that the bus system 1003 is used to implement connective communication between these components. The bus system 1003 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 1003 in fig. 10.
In practical applications, the processor may be at least one of an Application Specific Integrated Circuit (ASIC), a digital signal processing device (DSPD, digital Signal Processing Device), a Programmable logic device (PLD, programmable Logic Device), a Field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a controller, a microcontroller, and a microprocessor. It will be appreciated that the electronics for implementing the above-described processor functions may be other for different devices, and embodiments of the present invention are not particularly limited.
The Memory may be a volatile Memory (RAM), such as Random Access Memory (RAM), or a non-volatile Memory (non-volatile Memory), such as Read-Only Memory (ROM), flash Memory (flash Memory), hard disk (HDD, hard Disk Drive) or Solid state disk (SSD, solid-STATE DRIVE), or a combination of the above types of Memory, and provides instructions and data to the processor.
In an exemplary embodiment, the present invention also provides a computer-readable storage medium storing a computer program.
Optionally, the computer readable storage medium may be applied to any one of the methods in the embodiments of the present invention, and the computer program causes a computer to execute a corresponding flow implemented by a processor in each method in the embodiments of the present invention, which is not described herein for brevity.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be additional divisions of actual implementation, such as multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate components may or may not be physically separate, and components displayed as units may or may not be physical units, may be located in one place, may be distributed on a plurality of network units, and may select some or all of the units according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing module, or each unit may be separately used as a unit, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of hardware plus a form of software functional unit. It will be appreciated by those of ordinary skill in the art that implementing all or part of the steps of the above method embodiments may be implemented by hardware associated with program instructions, where the above program may be stored in a computer readable storage medium, where the program when executed performs the steps comprising the above method embodiments, where the above storage medium includes various media that may store program code, such as a removable storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic or optical disk, etc.
The methods disclosed in the method embodiments provided by the invention can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the several product embodiments provided by the invention can be combined arbitrarily under the condition of no conflict to obtain new product embodiments.
The features disclosed in the embodiments of the method or the apparatus provided by the invention can be arbitrarily combined without conflict to obtain new embodiments of the method or the apparatus.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A process recovery method, characterized in that the process recovery method comprises:
Under the condition that the first process needs to be recovered through the first monitoring process, searching a corresponding executable file path from a configuration file based on a process identifier of the first process, wherein the configuration file comprises at least one executable file path corresponding to the process;
Creating a sub-process by the first monitoring process, and executing an executable file in the sub-process based on an executable file path of the first process to recover the first process.
2. The process recovery method according to claim 1, characterized in that the process recovery method further comprises:
Under the condition that a timer is triggered, if the running second process is determined to be a user state process through a callback function, storing an identifier of the second process in a preset linked list;
And obtaining an executable file path of the second process from a process directory file based on a process identifier of the second process in the preset linked list through the first kernel thread, and storing the executable file path in the configuration file.
3. The process restoration method according to claim 2, wherein the obtaining, by the first kernel thread, the executable file path of the second process from the process directory file based on the process identifier of the second process in the preset linked list, and storing the executable file path in the configuration file includes:
Acquiring a command line character string used for starting the second process from the process directory file based on the process identifier of the second process through the first kernel thread;
and analyzing the command line character string to obtain an executable file path of the second process.
4. The process restoration method according to claim 2, wherein storing the identifier of the second process in a preset linked list includes:
Determining whether a process identifier of the second process is included in the preset linked list through the callback function;
if not, storing a process identifier of the second process in the preset linked list;
if so, the processing is not performed.
5. The process restoration method according to claim 2, wherein the storing in the configuration file includes:
Storing, by the first kernel thread, the executable file path of the second process in the preset linked list under the condition that it is determined that the executable file path of the second process is not included in the preset linked list;
Or under the condition that the historical executable file path of the second process is included in the preset linked list, updating the historical executable file path of the second process in the preset linked list by using the executable file path of the second process;
And storing the process identifier and the executable file path of the second process in the preset linked list in the configuration file according to the format of the key value pair.
6. The process recovery method according to any one of claims 1 to 5, further comprising:
The process identifier of the first process is obtained from a preset queue through a second kernel thread and is transmitted to the first monitoring process, wherein the preset queue comprises at least one process identifier of an abnormal exit process;
And determining, by the first monitoring process, that the first process needs to be restored under the condition that it is determined that a process identifier set of a preset restoring process includes a process identifier of the first process.
7. The process restoration method according to claim 6, wherein the process restoration method further comprises:
And in the case that the first process is determined to be abnormal exit by the second monitoring process, storing a process identifier of the first process in the preset queue.
8. A process recovery apparatus, characterized by comprising:
The first monitoring process is used for searching a corresponding executable file path from a configuration file based on a process identifier of the first process under the condition that the first process needs to be recovered, wherein the configuration file comprises at least one executable file path corresponding to the process;
The first monitor process is further configured to create a sub-process, and execute an executable file in the sub-process based on an executable file path of the first process to restore the first process.
9. An electronic device comprising a processor and a memory configured to store a computer program capable of running on the processor,
Wherein the processor is configured to perform the process restoration steps of any one of claims 1 to 7 when the computer program is run.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor performs the step of restoring the process according to any of claims 1 to 7.
CN202510039444.4A 2025-01-10 2025-01-10 Process recovery method, device, equipment and storage medium Pending CN119961057A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510039444.4A CN119961057A (en) 2025-01-10 2025-01-10 Process recovery method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510039444.4A CN119961057A (en) 2025-01-10 2025-01-10 Process recovery method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN119961057A true CN119961057A (en) 2025-05-09

Family

ID=95599593

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510039444.4A Pending CN119961057A (en) 2025-01-10 2025-01-10 Process recovery method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN119961057A (en)

Similar Documents

Publication Publication Date Title
US12124326B2 (en) Automatic correlation of dynamic system events within computing devices
CN113656168B (en) Method, system, medium and equipment for automatically disaster recovery and scheduling of traffic
US8429453B2 (en) Management system for outputting information denoting recovery method corresponding to root cause of failure
JP5075736B2 (en) System failure recovery method and system for virtual server
US11157373B2 (en) Prioritized transfer of failure event log data
US10824517B2 (en) Backup and recovery of configuration files in management device
WO2018109825A1 (en) Version management system and version management method
US8799716B2 (en) Heap dump occurrence detection
US9734191B2 (en) Asynchronous image repository functionality
CN113672306B (en) Method, device, system and medium for recovery from abnormal self-checking of server components
JP2019159729A (en) Failure prediction system
CN113641693A (en) Data processing method and device of streaming computing system, electronic equipment and medium
CN106708865B (en) Method and device for accessing window data in stream processing system
CN119814529B (en) Fault alarm method, device, computer equipment and storage medium
CN113760608B (en) Data recovery method and device, electronic equipment and storage medium
CN119961057A (en) Process recovery method, device, equipment and storage medium
CN106911508B (en) DNS configuration recovery method and device
WO2015194651A1 (en) Malfunction notification apparatus, malfunction notification method, and program
US9891615B2 (en) Numerical controller with function of automatically reconstructing settings and function of preventing incorrect settings
CN107273291B (en) Processor debugging method and system
US20160004584A1 (en) Method and computer system to allocate actual memory area from storage pool to virtual volume
CN107179911A (en) A kind of method and apparatus for restarting management engine
CN116016128A (en) Process management method, device, electronic device and storage medium of gateway device
JP5466740B2 (en) System failure recovery method and system for virtual server
CN115412514A (en) Restart information recording method, apparatus, system, device and medium

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