Device for checking missing process after system restart based on process comparison mode
Through the device based on process comparison method, the process information before and after the system restart is obtained and compared, the problems of low efficiency and high cost in the existing technology are solved, and the process information is quickly and automatically outputted missing process information is realized, and the detection efficiency and accuracy are improved. , supports the automated management of large-scale servers.
Patent Information
- Application Number
- CN202411377232.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
The method of checking missing processes after system restart in the prior art is inefficient and costly, affecting system stability and functional integrity.
The device based on process comparison method is adopted, including process acquisition module, process comparison module and output module. By obtaining process information before and after the system restart, comparing it to determine the difference information, and output missing process information, realizing automated management .
It improves the efficiency and accuracy of the missed processes after the detection system restart, saves labor costs, and realizes the automated management of large-scale servers.
Smart Images

Figure CN119311588A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a device for checking missing processes after a system restart based on a process comparison method in the technical field of data processing. Background Art
[0002] In the current operation of server systems, system restart is a common operation. However, sometimes some processes may not start normally after the system restarts, which may affect the stability and functional integrity of the system. Currently, the method for checking for missing processes after the system restarts is not efficient and accurate enough, and a more reliable solution is needed.
[0003] In the related technology, the network address of the machine to be restarted is used to confirm the purpose of the corresponding server, and then the corresponding operation and maintenance manual and system solution are found for analysis, and the service is restarted after the analysis. Usually, R&D personnel and operation and maintenance personnel need to check and verify the system processes one by one. This results in high labor costs, low efficiency and long time consumption. Summary of the invention
[0004] In order to solve the technical problems in the prior art of high labor cost, low efficiency and long time required in the process of checking the missing process after the system is restarted, the purpose of the present invention is to provide a device for checking the missing process after the system is restarted based on the process comparison method, and the technical solution adopted is as follows: In a first aspect, an embodiment of the present invention provides a device for checking missing processes after a system restart based on a process comparison method, the device comprising: a process collection module, a process comparison module, and an output module; wherein: The process acquisition module is used to obtain target process information in the system; The process comparison module is used to determine process difference information of the system before and after restart based on the target process information; The output module is used to determine and output the process missing information of the system after restart based on the process difference information.
[0005] In combination with the first aspect above, in some possible implementations, the process collection module includes: An acquisition submodule, used to acquire the first process information before the system is restarted and the second process information after the system is restarted; The first determining submodule is used to determine the first process information and the second process information as the target process information.
[0006] In the above device, the acquisition submodule collects the first process information before the system is restarted and the second process information after the system is restarted, so as to obtain the target process information, so as to analyze the process difference information more accurately.
[0007] In combination with the above-mentioned first aspect, in some possible implementations, the acquisition submodule is also used to feedback a restart instruction to the system after acquiring the first process information so as to restart the system; and after the system restarts, acquire the second process information.
[0008] In combination with the above-mentioned first aspect, in some possible implementations, the acquisition submodule is also used to obtain a first preset command script; and use the first preset command script to collect the first process information before the system restart and the second process information after the system restart.
[0009] In the above device, the first process information before the system is restarted and the second process information after the system is restarted can be collected more accurately through the acquisition submodule.
[0010] In combination with the above-mentioned first aspect, in some possible implementations, the process comparison module is further used to compare the first process information and the second process information to obtain the process difference information.
[0011] In the above device, the process difference information can reflect the missing processes of the system after the restart relative to before the restart.
[0012] In combination with the above-mentioned first aspect, in some possible implementations, the process comparison module is also used to obtain a second preset command script; and use the second preset command script to compare the first process information and the second process information to obtain the process difference information.
[0013] In the above device, by comparing the first process information and the second process information to analyze the difference between the process information before the system restart and the process information after the system restart, more accurate process difference information is obtained, which facilitates the analysis of process omissions through the process difference information.
[0014] In combination with the above-mentioned first aspect, in some possible implementations, the process comparison module includes: an extraction sub-module, used to use the second preset command script to extract the process names in the first process information and the second process information to obtain the first name of the first process information and the second name of the second process information; a comparison sub-module, used to compare the first name and the second name to obtain the process difference information.
[0015] In the above device, the first name of the first process information and the second name of the second process information are extracted by the extraction submodule, so that by comparing the first name and the second name, the process difference information after and before the system restart can be efficiently and accurately analyzed.
[0016] In combination with the first aspect above, in some possible implementations, the output module includes: a second determination submodule, used to determine a preset output mode; and a result output submodule, used to output the process omission information based on the preset output mode.
[0017] In the above device, the process missing information is output to the management end through a preset output method, so that the administrator can find the situation of missing process in time.
[0018] In combination with the first aspect above, in some possible implementations, the output module includes: The encapsulation submodule is used to encapsulate the missing information of the process to obtain encapsulated information; The capability output submodule is used to output the encapsulated information through an external interface.
[0019] In the above device, through the encapsulation of the underlying capabilities, the server system users do not need to pay attention to the specific system version number, and can quickly confirm the location and confirm which processes of the server have not been successfully started; thereby realizing the automated management of large quantities of servers without having to pay attention to the actual business situation of a single machine one by one.
[0020] In a second aspect, a method for checking missing processes after a system restart based on a process comparison method is provided, the method comprising: Get the target process information in the system; Based on the target process information, determining process difference information of the system before and after the restart; Based on the process difference information, process missing information of the system after restart is determined and output.
[0021] According to a third aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0022] In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the first aspect or any possible implementation manner described in the first aspect.
[0023] The present invention has the following beneficial effects: in a device for checking missing processes after a system restart based on a process comparison method, the target process information in the system is obtained through a process acquisition module, and then the process comparison module determines the process difference information of the system before and after the restart based on the target process information; in this way, the difference between the processes of the system before and after the restart can be more accurately indicated through the process difference information. Finally, the output module determines and outputs the missing process information of the system after the restart based on the process difference information; in this way, the missing process information of the system after the restart can be quickly and automatically output through the output module, and no manual intervention is required, thereby saving labor costs, and further improving the efficiency and accuracy of detecting missing processes after the system restarts. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 It is a schematic diagram of the composition structure of a device for checking missing processes after system restart based on a process comparison method provided by an embodiment of the present invention; Figure 2 It is another structural diagram of a device for checking missing processes after system restart based on a process comparison method provided by an embodiment of the present invention; Figure 3 It is another structural diagram of a device for checking missing processes after system restart based on process comparison provided by an embodiment of the present invention; Figure 4 It is a schematic diagram of an implementation flow of a method for checking missing processes after system restart based on a process comparison method provided by an embodiment of the present invention; Figure 5 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a device for checking missing processes after system restart based on process comparison proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0027] Among them, in the description of the embodiments of the present invention, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a way to describe the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present invention, "multiple" refers to two or more than two.
[0028] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0029] 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 invention belongs.
[0030] The following is a detailed description of a specific solution of a device for checking missing processes after system restart based on process comparison provided by the present invention in conjunction with the accompanying drawings. Figure 1 , which shows a schematic diagram of the composition structure of a device for checking missing processes after system restart based on process comparison according to an embodiment of the present invention, the device 100 includes: a process collection module 101, a process comparison module 102 and an output module 103; wherein: The process acquisition module 101 is used to obtain target process information in the system.
[0031] Here, the process acquisition module can be implemented by a shell script. The system can be any type of server system. For example, the process information in the system is collected by a shell script before and after the server system is restarted to obtain the target process information in the server system. That is, the target process information includes: the first process information before the system is restarted and the second process information after the system is restarted. Among them, the first process information mainly includes the process control block (Process Control Block, PCB), program segment and data segment before the system is restarted; the second process information mainly includes the process control block (Process Control Block, PCB), program segment and data segment after the system is restarted. Among them, the process control block (PCB): is the core part of the process entity, which is used to describe the state of the process and control the operation of the process. The PCB contains all the information required by the operating system, which is used to describe the current status of the process and control the execution of the process. Program segment: is the program code segment in the process that can be executed by the process scheduler on the central processing unit. Data segment: includes the original data processed by the program corresponding to the process, as well as the intermediate or final data generated after the program is executed.
[0032] In some possible implementations, the process acquisition module 101 includes: an acquisition submodule and a determination submodule, wherein: the acquisition submodule is used to acquire the first process information before the system is restarted and the second process information after the system is restarted.
[0033] Here, the acquisition submodule collects the first process information before the system restart and the second process information after the system restart through the shell script. For example, the first process information before the system restart is collected through "function collect_pre_restart_processes() { ps -ef>pre_restart_processes.txt}" in the shell script code; the second process information after the system restart is collected through "function collect_post_restart_processes() { ps -ef>post_restart_processes.txt}" in the shell script code.
[0034] In some possible implementations, after acquiring the first process information, the acquisition submodule feeds back a restart instruction to the system so that the system restarts; and after the system restarts, the second process information is acquired. For example, after the acquisition submodule collects the first process information before the system restarts, it feeds back a restart instruction to the system so that the system restarts; and after receiving the restart information fed back by the system, the second process information of the system is acquired. In some possible implementations, the acquisition submodule first acquires the first preset command script, wherein the first preset command script may be a shell script; the shell script is pre-placed into a file with various commands, which is a program file that is convenient for one-time execution, and is mainly used to facilitate the administrator to set up or manage. Then, the acquisition submodule uses the first preset command script to collect the first process information before the system restarts and the second process information after the system restarts. In this way, the acquisition submodule can more accurately collect the first process information before the system restarts and the second process information after the system restarts.
[0035] The first determination submodule is used to determine the first process information and the second process information as the target process information. In this way, the acquisition submodule collects the first process information before the system restart and the second process information after the system restart, so as to obtain the target process information, so as to more accurately analyze the process difference information.
[0036] The process comparison module 102 is used to determine process difference information of the system before and after the restart based on the target process information.
[0037] Here, the process comparison module can be implemented by a comparison function. Since the target process information includes: the first process information before the system restarts and the second process information after the system restarts. The process difference information is used to characterize the difference between the process information before the system restarts and the process information after the system restarts, that is, the process difference information can reflect the process missing after the system restarts relative to before the restart. In some possible implementations, the process comparison module 102 compares the first process information and the second process information to obtain the process difference information of the system before and after the restart. For example, the process comparison module 102 first obtains the second preset command script, and uses the second preset command script to compare the first process information and the second process information to obtain the process difference information. Among them, the second preset command script can be a shell script, which is used to characterize the function of the comparison function, so as to realize the comparison of the first process information and the second process information, so as to analyze the difference between the process information before the system restarts and the process information after the system restarts, that is, to obtain more accurate process difference information, and then facilitate the analysis of process omission through the process difference information.
[0038] In some possible implementations, such as Figure 2 As shown, the process comparison module 102 includes: an extraction submodule 201 and a comparison submodule 202, wherein: The extraction submodule 201 is used to extract the process names in the first process information and the second process information by using the second preset command script to obtain the first name of the first process information and the second name of the second process information.
[0039] Here, the process names in the first process information and the second process information can be extracted through "awk '{print $8}' pre_restart_processes.txt>pre_restart_process_names.txt; awk '{print $8}' post_restart_processes.txt>post_restart_process_names.txt" in the second preset command script to obtain the first name and the second name.
[0040] The comparison submodule 202 is used to use the second preset command script to extract and compare the first name and the second name to obtain the process difference information.
[0041] Here, the first name and the second name can be compared through "comm -23 pre_restart_process_names.txt post_restart_process_names.txt>missing_processes.txt}" in the second preset command script to find out the missing process after the system is restarted, that is, to obtain the process difference information. In this way, the first name of the first process information and the second name of the second process information are extracted through the extraction submodule, so that by comparing the first name and the second name, the process difference information after and before the system restart can be efficiently and accurately analyzed.
[0042] The output module 103 is used to determine and output the process missing information of the system after restart based on the process difference information.
[0043] Here, since the process difference information can reflect the difference between the processes before and after the system restart, that is, the processes omitted after the system restart relative to before the system restart, the process difference information output module can output the process omission information of the system after the restart more clearly.
[0044] In some possible implementations, the output module 103 includes: a second determination submodule and a result output submodule, wherein: the second determination submodule is used to determine a preset output mode.
[0045] Here, the preset output mode may be a customized clear and easy-to-understand output mode, for example, the preset output mode may be a text mode, a voice mode, or an alarm mode.
[0046] The result output submodule is used to output the process missing information based on the preset output mode.
[0047] Here, the process missing information is output to the management end through a preset output method, so that the administrator can find the missing process in time.
[0048] In some possible implementations, such as Figure 3 As shown, the output module 103 may further include: an encapsulation submodule 301 and a capability output submodule 302, wherein: the encapsulation submodule 301 is used to encapsulate the process missing information to obtain encapsulated information; for example, the process missing information is encapsulated through the underlying encapsulation capability to obtain the encapsulated information.
[0049] The capability output submodule 302 is used to output the packaged information through an external interface. For example, by outputting the packaged information through an external interface, it is possible to connect to a general platform such as an operation and maintenance management platform to realize automatic checking of processes after automatic restart. In this way, through the encapsulation of the underlying capabilities, the server system users do not need to pay attention to the specific system version number, and can quickly confirm the location and confirm which processes of the server have not been successfully started; thereby realizing the automated management of large batches of servers without having to pay attention to the actual business situation of a single machine one by one.
[0050] In the embodiment of the present invention, the target process information in the system is obtained through the process acquisition module, and then the process comparison module determines the process difference information of the system before and after the restart based on the target process information; in this way, the difference between the processes of the system before and after the restart can be more accurately indicated through the process difference information. Finally, the output module determines and outputs the process omission information of the system after the restart based on the process difference information; in this way, the process omission information of the system after the restart can be quickly and automatically output through the output module, and no manual intervention is required, thereby saving labor costs, thereby improving the efficiency and accuracy of detecting the missing process after the system restarts.
[0051] The embodiment of the present invention provides a method for checking missing processes after system restart based on process comparison. Figure 4, which shows a schematic diagram of an implementation flow of a method for checking missing processes after system restart based on a process comparison method provided by an embodiment of the present invention, the method comprising: 401, obtain target process information in the system.
[0052] Here, the target process information includes: the first process information before the system restart and the second process information after the system restart. The first process information before the system restart is obtained by executing a shell command script or calling a system interface to obtain a process list; then, the system is restarted. The process list after the system restart is obtained by performing the same operation, that is, the second process information after the system restart is obtained. The first process information and the second process information are determined as the target process information.
[0053] In some possible implementations, a first preset command script is first obtained; and the first preset command script is used to collect first process information before the system is restarted and second process information after the system is restarted.
[0054] 402 : Determine process difference information of the system before and after the restart based on the target process information.
[0055] Here, through the comparison function, the names of the first process information and the second process information in the target process information are compared to obtain the difference between the system before and after restart, that is, the process difference information, so that the process missed by the system after restart can be reflected through the process difference information.
[0056] In some possible implementations, a second preset command script is obtained; and the second preset command script is used to compare the first process information and the second process information to obtain process difference information. For example, the second preset command script is used to extract the process names in the first process information and the second process information to obtain a first name of the first process information and a second name of the second process information; and the first name and the second name are compared to obtain process difference information.
[0057] 403 : Based on the process difference information, determine and output process missing information of the system after restart.
[0058] Here, through the process omission situation of the system after restart represented by the process difference information, the process omission information can be encapsulated and the encapsulated information can be output to facilitate docking with general platforms such as operation and maintenance management platforms to realize automatic process inspection after automatic restart, thereby improving the accuracy of checking process omissions.
[0059] In some possible implementations, a preset output mode may be determined; and the process missing information is outputted using the preset output mode.
[0060] Optionally, the transmission medium can be a wired link (such as but not limited to coaxial cable, optical fiber and digital subscriber line (DSL), etc.) or a wireless link (such as but not limited to wireless Fidelity (WIFI), Bluetooth and mobile device network, etc.). It should be noted that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the method embodiments provided in the above embodiments belong to the same concept. The specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0061] Figure 5 is a schematic diagram of the structure of a computer device provided by an embodiment of the present invention. Figure 5 As shown, the computer device 500 includes: a memory 501, a processor 502, and a computer program 503 stored in the memory 501 and running on the processor 502, wherein when the processor 502 executes the computer program 503, the computer device can execute any of the aforementioned methods for checking for missing processes after system restart based on process comparison.
[0062] In addition, an embodiment of the present invention also protects a system, which may include a memory and a processor, wherein an executable program code is stored in the memory, and the processor is used to call and execute the executable program code to perform a method provided by an embodiment of the present invention for checking missing processes after system restart based on a process comparison method. This embodiment can divide the system into functional modules according to the above method example. For example, it can correspond to each functional module, or two or more functions can be integrated into one processing module, and the above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic, which is only a logical function division, and there may be other division methods in actual implementation. It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0063] It should be understood that the system provided in this embodiment is used to execute the above-mentioned method of checking the missing process after the system is restarted based on the process comparison method, so the same effect as the above-mentioned implementation method can be achieved. In the case of an integrated unit, the system may include a processing module and a storage module. Among them, when the system is applied to a device, the processing module can be used to control and manage the actions of the device. The storage module can be used to support the device to execute mutual program codes, etc. Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logical boxes, modules and circuits described in combination with the disclosure of the present invention. The processor can also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module can be a memory.
[0064] In addition, the system provided by the embodiment of the present invention may be specifically a chip, a component or a module, and the chip may include a connected processor and a memory; wherein the memory is used to store instructions, and when the processor calls and executes the instructions, the chip may execute a method for checking missing processes after system restart based on process comparison provided by the above embodiment. This embodiment also provides a computer-readable storage medium, in which a computer program code is stored, and when the computer program code is run on a computer, the computer executes the above related method steps to implement a method for checking missing processes after system restart based on process comparison provided by the above embodiment.
[0065] This embodiment also provides a computer program product, when the computer program product is run on a computer, the computer executes the above-mentioned related steps to implement a method for checking missing processes after the system is restarted based on a process comparison method provided in the above embodiment. Among them, the system, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding method provided above, so the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here. Through the description of the above implementation mode, the technicians in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional modules as needed, that is, the internal structure of the system is divided into different functional modules to complete all or part of the functions described above. In the embodiments provided by the present invention, it should be understood that the disclosed system and method can be implemented in other ways. For example, the system embodiment described above is only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, system or unit, which may be electrical, mechanical or other forms.
[0066] It should be noted that the sequence of the above-mentioned embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The process depicted in the accompanying drawings does not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or may be advantageous. The various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments. The above content is only a specific implementation method of the present invention, but the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered within the protection scope of the present invention.
Claims
1. A device for checking missing processes after system restart based on process comparison, characterized in that: The device comprises: a process collection module, a process comparison module, and an output module; wherein: The process acquisition module is used to obtain target process information in the system; The process comparison module is used to determine process difference information of the system before and after restart based on the target process information; The output module is used to determine and output the process missing information of the system after restart based on the process difference information.
2. The device for checking missing processes after system restart based on process comparison method according to claim 1, characterized in that: The process collection module includes: An acquisition submodule, used to acquire the first process information before the system is restarted and the second process information after the system is restarted; The first determining submodule is used to determine the first process information and the second process information as the target process information.
3. The device for checking missing processes after system restart based on process comparison method according to claim 2, characterized in that: The acquisition submodule is further configured to, after acquiring the first process information, feed back a restart instruction to the system so as to restart the system; and after the system restarts, acquire the second process information.
4. The device for checking missing processes after system restart based on process comparison method according to claim 2 or 3, characterized in that: The acquisition submodule is further used to acquire a first preset command script; and use the first preset command script to collect the first process information before the system is restarted and the second process information after the system is restarted.
5. The device for checking missing processes after system restart based on process comparison method according to claim 2 or 3, characterized in that: The process comparison module is further used to compare the first process information with the second process information to obtain the process difference information.
6. The device for checking missing processes after system restart based on process comparison method according to claim 2 or 3, characterized in that: The process comparison module is further used to obtain a second preset command script; and use the second preset command script to compare the first process information and the second process information to obtain the process difference information.
7. The device for checking missing processes after system restart based on process comparison method according to claim 6, characterized in that: The process comparison module includes: an extraction submodule, configured to extract the process names in the first process information and the second process information by using the second preset command script to obtain a first name of the first process information and a second name of the second process information; The comparison submodule is used to compare the first name and the second name to obtain the process difference information.
8. The device for checking missing processes after system restart based on process comparison method according to claim 1, characterized in that: The output module comprises: The second determination submodule is used to determine a preset output mode; The result output submodule is used to output the process missing information based on the preset output mode.
9. The device for checking missing processes after system restart based on process comparison method according to claim 1, characterized in that: The output module comprises: The encapsulation submodule is used to encapsulate the missing information of the process to obtain encapsulated information; The capability output submodule is used to output the encapsulated information through an external interface.
10. A method for checking missing processes after system restart based on process comparison, characterized in that: The method comprises: Get the target process information in the system; Based on the target process information, determining process difference information of the system before and after the restart; Based on the process difference information, process missing information of the system after restart is determined and output.