Process state recovery method and device, storage medium and electronic device
By using checkpoint files to restore the visual service process and target task process in the management process, the problem of insufficient operation stability of the visual service application is solved, fast and accurate process recovery and resource optimization are achieved, and the system availability and user experience are improved.
Patent Information
- Application Number
- CN202510506098.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-04-22
AI Technical Summary
Existing visual service applications have insufficient stability during operation, which leads to the service process being unexpectedly interrupted and needs to restart the job from scratch, wasting time and computing resources, and may lead to data loss.
By listening to the node communication port in the management process to receive visual service requests, find matching checkpoint files and restore the visual service process and target task process according to the recovery information therein, and use the first recovery information and the second recovery information recorded in the checkpoint file to restore the visual service process and target task process respectively to realize process communication recovery.
It realizes accurate recovery of different processes during the service node failure recovery process, reduces recovery time, improves system availability and service integrity, reduces resource consumption, simplifies user operations, and improves user experience and resource utilization efficiency.
Smart Images

Figure CN120029828B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a method and device for recovering a process state, a storage medium, and an electronic device. Background Art
[0002] High-performance computing clusters typically provide powerful high-performance computing services to one or more clients. When a cluster receives a visualization service request, it typically needs to run both the visualization application and the service application in the service node, operating based on the visualization service protocol.
[0003] However, some visualization applications can run for extended periods of time, during which they can be unexpectedly interrupted by hardware failures (such as CPU or power outages) or client requests. Restarting the job from scratch after an interruption not only wastes significant time and computing resources, but can also lead to data loss during the re-execution process, which is unacceptable. This suggests that existing visualization service application runtimes suffer from technical instability. Currently, no effective solution exists to this problem.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] The embodiments of the present application provide a method and apparatus for recovering a process state, a storage medium, and an electronic device, so as to at least solve the technical problem that the existing visualization service application operation mode has insufficient stability.
[0006] According to one aspect of an embodiment of the present invention, a method for recovering a process state is provided, comprising: receiving a visualization service request sent by a target client to the node communication port during monitoring by a management process on a current service node; upon finding a checkpoint file matching the visualization service request, recovering the visualization service process according to first recovery information recorded in the checkpoint file, wherein the visualization service process is used to provide a visualization service interface to the target client; recovering the target task process according to second recovery information recorded in the checkpoint file, wherein the target task process is a task process for executing a target service task in the visualization service interface; and upon recovery of process communication between the visualization service process and the target task process, providing visualization service to the target client through the visualization service process and the target task process.
[0007] According to another aspect of an embodiment of the present invention, a process status recovery device is also provided, including: a receiving unit, for receiving a visualization service request sent by a target client to the node communication port of the current service node during the process of the management process monitoring the node communication port of the current service node; a first recovery unit, for restoring the visualization service process according to the first recovery information recorded in the checkpoint file when a checkpoint file matching the visualization service request is found, wherein the visualization service process is used to provide a visualization service interface to the target client; a second recovery unit, for restoring the target task process according to the second recovery information recorded in the checkpoint file, wherein the target task process is a task process for executing the target service task in the visualization service interface; a service unit, for providing visualization service to the target client through the visualization service process and the target task process when the process communication between the visualization service process and the target task process is restored.
[0008] Optionally, the above-mentioned first recovery unit is used to: create a first sub-process through the above-mentioned management process; obtain the communication description information included in the above-mentioned first recovery information according to the above-mentioned first sub-process, and perform a communication recovery operation according to the above-mentioned communication description information; obtain the process status description information included in the above-mentioned first recovery information according to the above-mentioned first sub-process, and perform a process status recovery operation on the above-mentioned visualization service process according to the above-mentioned process description information.
[0009] Optionally, the above-mentioned first recovery unit is used to: determine the first communication description identifier that matches the above-mentioned first sub-process; obtain the first historical communication description identifier that matches the above-mentioned visualization service process from the above-mentioned first recovery information through the above-mentioned first sub-process; and update the above-mentioned first communication description identifier according to the above-mentioned first historical communication description identifier.
[0010] Optionally, the above-mentioned second recovery unit is used to: create a second sub-process through the above-mentioned management process; obtain the communication description information included in the above-mentioned second recovery information according to the above-mentioned second sub-process, and perform a communication recovery operation on the above-mentioned target task process according to the above-mentioned communication description information; obtain the process status description information included in the above-mentioned second recovery information according to the above-mentioned second sub-process, and perform a process status recovery operation on the above-mentioned target task process according to the above-mentioned process description information.
[0011] Optionally, the above-mentioned second recovery unit is used to: determine a second communication description identifier that matches the above-mentioned second sub-process, and establish a process communication connection between the above-mentioned first sub-process and the above-mentioned second sub-process based on the first communication description identifier and the above-mentioned second communication description identifier; obtain the second historical communication description identifier that matches the above-mentioned visualization service process from the above-mentioned second recovery information through the above-mentioned second sub-process; and update the above-mentioned second communication description identifier according to the above-mentioned second historical communication description identifier.
[0012] Optionally, the above-mentioned process state recovery device also includes: a third recovery unit, used for at least one of the following: restoring the memory state corresponding to the above-mentioned current process according to the historical memory state parameters in the above-mentioned process state description information matching the current process; restoring the CPU state corresponding to the above-mentioned current process according to the historical CPU state parameters in the above-mentioned process state description information matching the current process; restoring the reference process state corresponding to the above-mentioned current process according to the historical reference state parameters in the above-mentioned process state description information matching the current process, wherein the above-mentioned reference process state includes at least one of the following: process priority state, device resource state, file handle state; wherein the above-mentioned current process includes the above-mentioned visualization service process and the above-mentioned target task process.
[0013] Optionally, the above-mentioned process status recovery device also includes: an interruption unit, which is used to suspend the above-mentioned target task process when the above-mentioned management process detects a target event, and save the communication description information used to indicate the communication status of the above-mentioned target task process, and the process description information used to indicate the process status of the above-mentioned target task process to the above-mentioned second recovery information in the above-mentioned checkpoint file; suspend the above-mentioned visualization service process, and save the communication description information used to indicate the communication status of the above-mentioned visualization service process, and the process description information used to indicate the process status of the above-mentioned visualization service process to the above-mentioned first recovery information in the above-mentioned checkpoint file; end the above-mentioned target task process and the above-mentioned visualization service process.
[0014] Optionally, the above-mentioned interruption unit is also used for at least one of the following: determining that the above-mentioned target event is detected when the above-mentioned management process receives a service suspension instruction according to the above-mentioned node communication port; determining that the above-mentioned target event is detected when the above-mentioned management process detects communication interruption indication information according to the above-mentioned node communication port; determining that the above-mentioned target event is detected when the above-mentioned management process detects that the current timestamp is a target timestamp that matches the target inspection period.
[0015] Optionally, the above-mentioned interruption unit is also used to, when the above-mentioned current service node is the target service node determined by the service cluster scheduling system to respond to the above-mentioned target client, the above-mentioned management process obtains the first visualization service request of the above-mentioned target client according to the allocated above-mentioned node communication port, wherein the above-mentioned service cluster scheduling system includes multiple service nodes, and the above-mentioned service cluster scheduling system, when receiving the visualization service request of at least one client, allocates the corresponding above-mentioned service nodes to at least one of the above-mentioned clients respectively; starts the visualization service process through the above-mentioned management process, and starts the above-mentioned target task process through the above-mentioned management process; when the process communication connection between the above-mentioned visualization service process and the above-mentioned target task process is established, and the service communication connection between the above-mentioned visualization service process and the above-mentioned target client is established, provides the above-mentioned target client with a visualization service matching the above-mentioned first visualization service request through the above-mentioned visualization service process and the above-mentioned target task process.
[0016] Optionally, the device for recovering the above-mentioned process status also includes: a starting unit, used to start the above-mentioned management process when the current service node is the target node determined by the service cluster scheduling system to respond to the above-mentioned target client; monitor the above-mentioned node communication port allocated to the above-mentioned target client through the above-mentioned management process; and maintain the listening state of the above-mentioned management process when the management process does not detect the first visual service request of the above-mentioned target client according to the above-mentioned node communication port.
[0017] Optionally, the above-mentioned starting unit is used to: create a third sub-process through the above-mentioned management process, and obtain at least one visualization request parameter carried in the above-mentioned first visualization service request according to the above-mentioned third sub-process; start the above-mentioned visualization service process according to at least one of the above-mentioned visualization request parameters; create a fourth sub-process through the above-mentioned management process, and configure the visualization service environment according to the above-mentioned fourth sub-process; when the above-mentioned visualization service environment configuration is completed, start the above-mentioned target task process according to the above-mentioned fourth sub-process.
[0018] Optionally, the above-mentioned starting unit is also used to: obtain a third communication description identifier matching the above-mentioned node communication port according to the above-mentioned third sub-process, and update the fourth communication description identifier of the above-mentioned third sub-process according to the above-mentioned third communication description identifier; when the above-mentioned fourth communication description identifier of the above-mentioned third sub-process is updated, determine that the service communication connection between the above-mentioned visualization service process and the above-mentioned target client is established; according to the above-mentioned fourth sub-process, obtain the above-mentioned fourth communication description identifier from the configuration information of the above-mentioned visualization service environment; the above-mentioned visualization service process and the above-mentioned target task process establish the above-mentioned process communication connection according to the above-mentioned fourth communication description identifier.
[0019] Optionally, the device for recovering the process state further includes: a reference service unit, which is used to determine the reference node communication ports respectively allocated to the above-mentioned reference clients when the above-mentioned current service node is the reference service node determined by the above-mentioned service cluster scheduling system to respond to the reference client; start a reference management process for monitoring the above-mentioned reference node communication port; and when the above-mentioned reference management process receives the second visualization service request of the above-mentioned reference client according to the above-mentioned reference node communication port, start a reference visualization service process and a reference task process for responding to the above-mentioned second visualization service request according to the above-mentioned reference management process.
[0020] Optionally, the above-mentioned reference service unit is also used to: create a reference service container that matches the above-mentioned reference node communication port; run a reference management process for listening to the above-mentioned reference node communication port in the above-mentioned reference service container; and in the above-mentioned reference service container, start the above-mentioned reference visualization service process and the above-mentioned reference task process for responding to the above-mentioned second visualization service request according to the above-mentioned reference management process.
[0021] Optionally, the above-mentioned reference service unit is also used for at least one of the following: sending a service transfer request to the above-mentioned service cluster scheduling system when the number of the above-mentioned management processes running in the above-mentioned current service node is greater than or equal to the quantity threshold; sending a service transfer request to the above-mentioned service cluster scheduling system when at least one node status parameter corresponding to the above-mentioned current service node meets the parameter condition; wherein the above-mentioned service transfer request is used to request the above-mentioned service cluster scheduling system to re-determine the above-mentioned reference service node from the multiple above-mentioned service nodes.
[0022] Optionally, the above-mentioned process status recovery device also includes: a statistical unit, which is used to obtain at least one start timestamp matching the above-mentioned visualization service and a termination timestamp corresponding to each of the at least one start timestamp when the above-mentioned management process receives an end service instruction according to the above-mentioned node communication port, wherein the above-mentioned start timestamp is used to indicate the start running time node of the above-mentioned visualization service process, and the above-mentioned termination timestamp is used to indicate the termination running time node of the above-mentioned visualization service process; determine the target service duration according to the at least one start timestamp and the corresponding termination timestamps; and send service duration prompt information to the above-mentioned target client according to the above-mentioned target service duration.
[0023] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned process state recovery method when running.
[0024] According to another aspect of an embodiment of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the above-described process state recovery method.
[0025] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the process state recovery method through the computer program.
[0026] In an embodiment of the present invention, when a visualization service is interrupted, only the management process is kept in a running state, and the management process occupies very few resources. This design significantly reduces the consumption of system resources, thereby achieving the effect of saving CPU and memory resources and energy saving. In addition, after the client interrupts the visualization service request, if the visualization request is initiated again, the user does not need to perform complicated manual recovery operations, but can directly connect to the original node communication port through the client to trigger the visualization application to recover from the checkpoint. This process not only simplifies the user's operating steps, but also ensures that the user can seamlessly access the terminated visualization application. Therefore, the present invention achieves significant improvements in resource optimization and user experience, and solves the problems of complex recovery and high resource usage after the visualization service is interrupted in the prior art.
[0027] Furthermore, by recording first and second recovery information in a checkpoint file, which are used to restore the visualization service process and the target task process, respectively, precise recovery of different processes is achieved during the service node failure recovery process. On the one hand, utilizing the recovery information recorded in the checkpoint file allows for rapid location and recovery of the visualization service process and the target task process, reducing recovery time and improving system availability. On the other hand, by restoring process communication between the visualization service process and the target task process, the integrity and consistency of the service are ensured. Furthermore, through the precise recovery mechanism of the checkpoint file and the rapid recovery of process communication, the efficiency of the service node during the failure recovery process is significantly improved, resolving the technical issue of insufficient stability in the operation of visualization service applications in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0029] Figure 1This is a hardware structure block diagram of a server device for a process status recovery method according to an embodiment of the present application;
[0030] Figure 2 is a flowchart of a method for restoring a process state according to an embodiment of the present application;
[0031] Figure 3 is a schematic diagram of a method for restoring a process state according to an embodiment of the present application;
[0032] Figure 4 is a schematic diagram of another process status recovery method according to an embodiment of the present application;
[0033] Figure 5 is a flowchart of another method for restoring process status according to an embodiment of the present application;
[0034] Figure 6 is a flowchart of another method for restoring process status according to an embodiment of the present application;
[0035] Figure 7 1 is a schematic structural diagram of a process status recovery device according to an embodiment of the present application;
[0036] Figure 8 It is a structural diagram of an electronic device for recovering a process state according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0038] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0039] The following is an explanation of the technical terms involved in this case:
[0040] Checkpoint-restart is a process-level failure recovery technique that allows the system to recover quickly after a failure. This technique is particularly suitable for application scenarios that require high availability or fault tolerance.
[0041] X server: It is the display server in the X Window System, which is used to listen to the graphical interface display requests sent by the Xclient and draw and display the graphical interface on the screen.
[0042] X client: X client, usually various GUI applications, such as Firefox browser, x term, x clock, etc.
[0043] File Descriptor: A file descriptor in Linux is an abstract pointer used to represent an open file or other input / output resource. Each open file or resource is assigned a unique non-negative integer that is used to identify a specific file or resource in system calls.
[0044] Local socket: It can realize communication between different processes on the same host. The link is the socket file. The server creates the socket file and listens. The client establishes a socket connection with the socket file path as a parameter to communicate with the server.
[0045] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 This is a hardware structure diagram of a server device of a process state recovery method according to an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown) a first processor 102 (the first processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a first memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0046] The first memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data processing method of the memory in the embodiment of the present application. The first processor 102 executes various functional applications and data processing by running the computer program stored in the first memory 104, that is, implementing the above method. The first memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the first memory 104 may further include a memory remotely located relative to the first processor 102, and these remote memories may be connected to a server device via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0047] Transmission device 106 is used to receive or transmit data via a network. A specific example of the aforementioned network may include a wireless network provided by a communication provider of the server device. In one embodiment, transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0048] As an optional implementation, Figure 2 As shown, the above process status recovery method can be applied to a service node in a service cluster, including:
[0049] S202, receiving a visualization service request sent by a target client to the node communication port of the current service node during the process of the management process monitoring the node communication port of the current service node;
[0050] S204, when a checkpoint file matching the visualization service request is found, resuming the visualization service process according to the first restoration information recorded in the checkpoint file, wherein the visualization service process is used to provide a visualization service interface to the target client;
[0051] S206, restoring the target task process according to the second restoration information recorded in the checkpoint file, wherein the target task process is the task process for executing the target service task in the visual service interface;
[0052] S208 : When the process communication between the visualization service process and the target task process is restored, provide visualization service to the target client through the visualization service process and the target task process.
[0053] It should be noted that the above-mentioned embodiments of the present application can be applied to the current service node in a service cluster. The above-mentioned current service node can refer to a service node assigned to process a specific client request in a distributed system or cluster environment. Optionally, the above-mentioned current service node can be a physical server or virtual machine with independent computing resources and communication capabilities.
[0054] Furthermore, in step S202, the management process may be a process in the current service node responsible for monitoring and managing the running status of the service node, and may be used to monitor the node communication port, receive client requests, and suspend or resume the process when necessary.
[0055] It is understood that the visualization service request can be a request sent by a target client requesting the current service node to provide a visualization service interface. This request may include user operation instructions, data query requests, or other instructions related to visualization services. In one alternative, the visualization service request can be specifically a service request transmitted using the X protocol or the VNC protocol, requesting a compute node (i.e., a specific service node) in a high-performance computing cluster to perform a visualization job.
[0056] The implementation methods of this application can be applied to any service node in a high-performance computing cluster. A client sends a visualization service request to a computing node (service node) in the cluster to execute a visualization job. When the cluster receives the visualization service request, it typically runs both the visualization application and the service application on the service node, operating based on the visualization service protocol.
[0057] However, some visualization applications can run for extended periods of time, during which they can be unexpectedly interrupted by hardware failures (such as CPU or power outages) or client requests. Restarting the job from scratch after an interruption not only wastes significant time and computing resources, but can also lead to data loss during the re-execution process, which is unacceptable. This demonstrates the technical stability issues inherent in existing visualization service application runtimes.
[0058] In response to the above technical problems, in the above implementation of the present application, a management process responsible for monitoring and managing the operating status of the service node can be maintained running in the current service node, and then when the application processes of the above-mentioned visualization application and service application are closed, the process status of the application processes of the visualization application and service application in the current service node can be restored through the above-mentioned management process.
[0059] During the recovery process, the above steps S204 to S208 may be further included. The following is an explanation of the method for recovering the above process status.
[0060] In step S204, the checkpoint file may be a file that stores process status information, used to save critical data when the process is paused for subsequent recovery. The checkpoint file may include recovery information, such as communication description information and process status description information. In this embodiment, the specific information type included in the checkpoint file is not limited.
[0061] In an embodiment of the present application, the checkpoint file may include first recovery information and second recovery information. The first recovery information may be used to indicate recovery data related to the visualization service process in the checkpoint file. It includes communication description information and process status description information, and is used to restore the state of the visualization service process. The second recovery information may be used to indicate recovery data related to the target task process in the checkpoint file. It also includes communication description information and process status description information, and is used to restore the state of the target task process.
[0062] It should be noted that the visualization service process can be a process specifically used to provide a visualization service interface to the target client. It is responsible for generating and managing the visualization interface and interacting with the target client. In one specific embodiment, the visualization service process can be an Xvnc process. It should be noted that in the embodiments of the present application, Xvnc is a VNC (Virtual Network Computing) server based on the X Window System, which allows users to remotely access and operate a graphical interface running on another computer via a network. Xvnc combines the functions of X Server and VNC Server, acting as an X Server to provide display services for applications and as a VNC Server to provide desktop access for remote clients.
[0063] Furthermore, the target task process can be a process in the visual service interface for executing a specific service task. It is responsible for processing the target client's request and feeding the result back to the visual service process. In the embodiment of the present application, the above-mentioned target task process can match the above-mentioned visual service request.
[0064] For example, when the visualization service request is specifically a text editing request, the target task process may be a Gedit process. Gedit is a lightweight text editor suitable for processing text file editing tasks. When the target client sends a text editing request, the current service node may start the Gedit process as the target task process. The Gedit process receives the text content input by the user sent by the target client, performs text editing operations (such as inserting, deleting, searching and replacing, etc.), and saves the edited results to a local file. Subsequently, the Gedit process feeds back the edited text content to the visualization service process, and the visualization service process then returns the edited text content to the target client via network communication for display.
[0065] For example, if the visualization service request is specifically an image processing request, the target task process may be a GIMP (GNU Image Manipulation Program) process. When the current service node receives an image processing request from a target client, it may initiate the GIMP process as the target task process. The GIMP process receives the user-uploaded image file from the target client, performs image processing operations (such as cropping, adjusting color, applying filters, etc.), and saves the processed image as a new file. The GIMP process then feeds the processed image back to the visualization service process, which then returns the processed image to the target client via network communication for display.
[0066] For example, if the visualization service request is specifically a data analysis request, the target task process can be an R language process. R language processes can be used to handle complex data analysis tasks. When the target client sends a data analysis request, the system launches an R language process as the target task process. The R language process receives the user-uploaded data file (such as a CSV file), performs operations such as data cleaning, statistical analysis, or visualization, and saves the analysis results (such as statistical charts or analysis reports) as an output file. The R language process then feeds the analysis results back to the visualization service process, which then displays the results to the user through a visual interface.
[0067] The correspondence between the target task process and the visualization service request is merely an exemplary description, and the specific types and correspondences between the target task process and the visualization service request are not limited in the embodiments of the present application.
[0068] Furthermore, in step S208, the management process can establish a communication connection between the visualization service process and the target task process, and start providing a visualization service interface to the target client when the visualization service process establishes a connection with the target client through the restored communication state.
[0069] The following is an explanation of the further implementation of the above process status recovery method. Figure 3 and Figure 4 , describes the process running status in various service nodes before and after the process status is restored.
[0070] like Figure 4 As shown in the figure, before the visualization service is interrupted, multiple processes may be running in the system, including the management process, Xvnc process, and target task process. These processes communicate through port 5901 and jointly provide visualization services to the target client (vcn client).
[0071] Then as Figure 3 As shown, when the visualization service is interrupted (for example, by the VCN client actively exiting), all processes except the management process are terminated. Before the service is interrupted, the system records first and second recovery information in the checkpoint file. The first recovery information is used to restore the visualization service process (such as the Xvnc process), and the second recovery information is used to restore the target task process. Due to its lightweight design, the management process consumes minimal system resources, such as CPU and memory, thereby conserving resources and energy.
[0072] Furthermore, after the client interrupts the visualization service request, if a visualization request is initiated again, the client can directly connect to the original node communication port (port 5901) to trigger the visualization application to recover from the checkpoint. Figure 4 Figure 2 shows the restored system structure. The management process continues to listen on port 5901, and the VNC client connects through port 5901, triggering the aforementioned recovery process. Once communication between the management process, Xvnc process, and target task process is restored, the process states of the Xvnc process and target task process can be restored to their pre-interruption states based on the checkpoint file.
[0073] In the above embodiment of the present application, when the visualization service is interrupted, only the management process is kept in the running state, and the management process occupies very few resources. This design significantly reduces the consumption of system resources, thereby achieving the effect of saving CPU and memory resources and energy saving. In addition, after the client interrupts the visualization service request, if the visualization request is initiated again, the user does not need to perform complicated manual recovery operations, but can directly connect to the original node communication port through the client to trigger the visualization application to recover from the checkpoint. This process not only simplifies the user's operating steps, but also ensures that the user can seamlessly access the terminated visualization application. Therefore, the present invention achieves significant improvements in resource optimization and user experience, and solves the problems of complex recovery and high resource usage after the visualization service is interrupted in the prior art.
[0074] Furthermore, by recording first and second recovery information in a checkpoint file, which are used to restore the visualization service process and the target task process, respectively, precise recovery of different processes is achieved during the service node failure recovery process. On the one hand, utilizing the recovery information recorded in the checkpoint file allows for rapid location and recovery of the visualization service process and the target task process, reducing recovery time and improving system availability. On the other hand, by restoring process communication between the visualization service process and the target task process, the integrity and consistency of the service are ensured. Furthermore, through the precise recovery mechanism of the checkpoint file and the rapid recovery of process communication, the efficiency of the service node during the failure recovery process is significantly improved, resolving the technical issue of insufficient stability in the operation of visualization service applications in related technologies.
[0075] The following describes a method for restoring the specific process state in steps S204 to S208. First, the following describes a process for restoring the visualization service process based on the first restoration information.
[0076] In an optional implementation, the above-mentioned restoring the visualization service process according to the first restoration information recorded in the checkpoint file includes:
[0077] S1, creates the first child process through the management process;
[0078] S2, obtaining, according to the first sub-process, communication description information included in the first recovery information, and performing a communication recovery operation according to the communication description information;
[0079] S3: Obtain process state description information included in the first restoration information according to the first sub-process, and perform a process state restoration operation on the visualization service process according to the process state description information.
[0080] In the above implementation of the present application, a first sub-process can be created through the management process, and the above-mentioned visualization service process can be restored through the first sub-process. The sub-process can then be used to isolate the recovery process to avoid affecting the management process itself.
[0081] In an optional implementation, the acquiring, according to the first sub-process, the communication description information included in the first recovery information, and performing the communication recovery operation according to the communication description information, includes:
[0082] S1, determining a first communication description identifier that matches a first subprocess;
[0083] S2, obtaining, by the first sub-process, from the first recovery information, a first historical communication description identifier that matches the visualization service process;
[0084] S3: Update the first communication description identifier according to the first historical communication description identifier.
[0085] In the above embodiment, in the first sub-process, a communication description identifier that matches the sub-process can be determined. The communication description identifier can be used to identify and distinguish communications between different processes.
[0086] Next, the first child process retrieves a historical communication description identifier that matches the visualization service process from the first recovery information. The first recovery information is a previously saved checkpoint file that contains communication state information about the process at the time of the checkpoint. Furthermore, the first communication description identifier in the first child process is updated based on the retrieved first historical communication description identifier. This update can be performed by copying or mapping the information in the historical communication description identifier to the new communication description identifier.
[0087] In the aforementioned implementation of the present application, inter-process communication is restored by the first child process acquiring and utilizing communication description information. By determining, acquiring, and updating the communication description identifier, it is possible to ensure that the communication connection can be correctly reestablished after process recovery, thereby restoring service integrity and consistency. This approach not only improves system availability and stability but also simplifies the complexity of process recovery, making the process recovery process more efficient and reliable.
[0088] In an optional implementation, when the current process is a visualization service process, the above-mentioned process state recovery operation includes at least one of the following:
[0089] Method 1: Restore the memory state corresponding to the current process based on the historical memory state parameters in the process state description information matching the current process;
[0090] Optionally, the above-mentioned memory state may include one or more of the program counter, register value, stack content, and allocated memory area corresponding to the visualization service process. Restoring the memory state through the above-mentioned method 1 can ensure that the visualization service process can return to the working state before the interruption, including all data and variables in the memory.
[0091] Method 2: Restore the CPU state corresponding to the current process based on the historical CPU state parameters in the process state description information that matches the current process;
[0092] Optionally, the CPU state may include, but is not limited to, general registers, floating-point registers, program counters, flag registers, etc. Restoring the CPU state through the second method above ensures that parameters reflecting the execution state of the visualization service process, such as CPU registers and program counters, are restored to their pre-interruption states.
[0093] Method 3: Restore the reference process state corresponding to the current process based on the historical reference state parameters in the process state description information matching the current process, wherein the reference process state includes at least one of the following: process priority state, device resource state, and file handle state.
[0094] Optionally, the process priority status can be used to indicate the importance of the process in operating system scheduling. The device resource status can be used to indicate the status of device resources held by the process, such as file descriptors and device locks. The file handle status can be used to indicate the files and network connections opened by the process, thereby ensuring that these resources remain valid and accessible upon recovery.
[0095] In the above-mentioned embodiments of the present application, the purpose of the above-mentioned at least one recovery operation is to restore the visualization service process to its previous state as quickly as possible after the interruption, thereby reducing the impact of the interruption on the user and maintaining the continuity of the service.
[0096] In an optional embodiment, the management process is a pre-processed BLCR (Berkeley Lab Checkpoint / Restart) process. The pre-processing method may be to modify the BLCR with reference to the implementation of the super daemon process xinetd so that the BLCR also has the function of a super daemon process.
[0097] The following describes an implementation method for restoring the process state of the Xvnc process based on BLCR as the management process, the visualization service process as the Xvnc process, and the target task process as the gedit process.
[0098] S1, the user accesses the application again;
[0099] Specifically, after saving the application data and ending the application, the user accesses the host's port 5901 again through the VNC client. This is the trigger point for the user to restart the session.
[0100] S2, BLCR process handles the client connection request;
[0101] When the vnc client connects to port 5901, the BLCR process receives the connection request. Since the Xvnc and gedit processes have ended, the BLCR process needs to restart these processes to restore the user's session.
[0102] S3, check the checkpoint file;
[0103] The BLCR process checks whether a checkpoint file has been created for Xvnc and gedit. If so, it uses the checkpoint file to restore the process status. If not, it restarts the Xvnc and gedit processes from the beginning based on the BLCR process.
[0104] S4, create the first child process;
[0105] The BLCR process forks to create a first child process, which is used to restore the Xvnc and gedit processes. In this step, using a child process isolates the recovery process and avoids affecting the BLCR process itself.
[0106] S5, create a local socket
[0107] A local socket for communication between Xvnc and gedit is created in the first child process. For example, a local socket (such as / tmp / .X11-unix / X0) for communication between Xvnc and gedit can be created in the child process. Assume that the file descriptor of the created local socket is fda (which can be a specific first communication description identifier).
[0108] S6, copy file descriptor;
[0109] In step S6, the file descriptor can be a specific communication description information. Specifically, the dup2() function can be used to copy the file descriptor of the socket bound to port 5901 by the BLCR process to the standard input, output, and error file descriptors of the first child process, thereby passing the client's connection request to the first child process.
[0110] Next, the file descriptor of the local socket for X protocol communication opened by the Xvnc process when the checkpoint is executed is obtained from the Xvnc checkpoint file and copied to the first child process, thereby restoring the communication between Xvnc and gedit.
[0111] Specifically, the dup2() function is called three times in the first child process to copy the file descriptor of the socket currently bound to port 5901 of the BLCR process to the file descriptors 0 (standard input), 1 (standard output), and 2 (standard error) of the first child process respectively; the checkpoint file will record the information of the file descriptors that the process has opened when the checkpoint is executed, and obtain the file descriptor of the local socket opened by the Xvnc process for X protocol communication when the checkpoint is executed from the Xvnc checkpoint file. It is assumed to be fdb (that is, a specific first historical communication description identifier). The dup2(fda, fdb) function is called in the first child process to copy the created local socket file descriptor fda to the file descriptor fdb of the child process. In this way, the local socket file descriptor in the first child process is restored. This socket is used for communication between Xvnc and gedit. Subsequently, the first child process can communicate with the gedit process through this file descriptor.
[0112] S7, restore the Xvnc process state: restore the Xvnc process's CPU state and memory data from the Xvnc checkpoint file. This is to restore the Xvnc process to the state at the time the checkpoint was executed.
[0113] Through the above-mentioned implementation of the present application, the checkpoint file can be managed and the process status can be restored through the BLCR process. This solution can effectively manage and restore the running status of the visualization service application without sacrificing the user experience.
[0114] The following describes a process of restoring the target task process based on the second restoration information.
[0115] In an optional implementation, the above-mentioned restoring the target task process according to the second restoration information recorded in the checkpoint file includes:
[0116] S1, creates the second child process through the management process;
[0117] S2, obtaining communication description information included in the second recovery information according to the second sub-process, and performing a communication recovery operation according to the communication description information;
[0118] S3: Obtain process state description information included in the second recovery information according to the second sub-process, and perform a process state recovery operation on the target task process according to the process state description information.
[0119] In the above-mentioned implementation mode of the present application, a second sub-process can be further created through the management process, and the above-mentioned target task process can be restored through the second sub-process. The sub-process can then be used to isolate the recovery process to avoid affecting the management process itself.
[0120] In an optional implementation, the acquiring of the communication description information included in the second recovery information according to the second sub-process and performing the communication recovery operation according to the communication description information includes:
[0121] S1, determining a second communication description identifier that matches the second sub-process, and establishing a process communication connection between the first sub-process and the second sub-process according to the first communication description identifier and the second communication description identifier;
[0122] S2, obtaining, through the second subprocess, from the second recovery information, a second historical communication description identifier that matches the target task process;
[0123] S3: Update the second communication description identifier according to the second historical communication description identifier.
[0124] In the above embodiment, in the second sub-process, a communication description identifier that matches the sub-process can be determined. The above communication description identifier can be used to identify and distinguish communications between different processes.
[0125] Next, a second sub-process retrieves a historical communication description identifier that matches the target task process from the second recovery information. The second recovery information is a previously saved checkpoint file containing communication status information about the process at the time of the checkpoint. Furthermore, based on the retrieved second historical communication description identifier, the second communication description identifier in the second sub-process is updated. This updating method may involve copying or mapping the information in the historical communication description identifier to the new communication description identifier.
[0126] In an optional embodiment, when the current process is the target task process, the above-mentioned process state recovery operation includes at least one of the following:
[0127] Method 1: Restore the memory state corresponding to the current process based on the historical memory state parameters in the process state description information matching the current process;
[0128] Optionally, the above-mentioned memory state may include one or more of the program counter, register value, stack content, and allocated memory area corresponding to the visualization service process. Restoring the memory state through the above-mentioned method 1 can ensure that the target task process can return to the working state before the interruption, including all data and variables in the memory.
[0129] Method 2: Restore the CPU state corresponding to the current process based on the historical CPU state parameters in the process state description information that matches the current process;
[0130] Optionally, the CPU state may include, but is not limited to, general registers, floating-point registers, program counters, flag registers, etc. Restoring the CPU state through the second method above ensures that parameters reflecting the execution state of the target task process, such as CPU registers and program counters, are restored to their pre-interruption states.
[0131] Method 3: Restore the reference process state corresponding to the current process based on the historical reference state parameters in the process state description information matching the current process, wherein the reference process state includes at least one of the following: process priority state, device resource state, and file handle state.
[0132] Optionally, the process priority status can be used to indicate the importance of the process in operating system scheduling. The device resource status can be used to indicate the status of device resources held by the process, such as file descriptors and device locks. The file handle status can be used to indicate the files and network connections opened by the target task process, thereby ensuring that these resources remain valid and accessible upon recovery.
[0133] The following continues to describe an implementation method for restoring the process state of the Xvnc process, taking BLCR as the management process, the visualization service process as the Xvnc process, and the target task process as the gedit process.
[0134] S1: Create a second child process. The BLCR process forks and creates a new child process, called the second child process. In this step, the second child process is used exclusively to restore the state of the gedit process, isolating the recovery process and preventing it from affecting other processes.
[0135] S2: Create a socket connection. In the second child process, create a new socket connection and connect it to the local socket created in step a. This step establishes a communication channel between the second child process and the visualization service process (Xvnc), resuming inter-process interaction. Assume that the file descriptor of the newly created socket is fdc (a specific second communication descriptor identifier).
[0136] S3, obtain the file descriptor of gedit; obtain the file descriptor of the local socket opened by the gedit process for X protocol communication when executing the checkpoint from the gedit checkpoint file, assuming it is fdd (that is, a specific second history communication description identifier).
[0137] S4, duplicates the file descriptor; in the second child process, calls the dup2(fdc, fdd) function to copy file descriptor fdc to file descriptor fdd. This step maps the new socket file descriptor fdc in the second child process to the file descriptor fdd of the gedit process at the time of the checkpoint, thereby restoring the communication status of the gedit process.
[0138] It should be noted that the dup2 function is used to copy the file descriptor and replace the old file descriptor with the new one.
[0139] S5, restore the gedit process status; specifically, the CPU status and memory data of the gedit process can be restored from the gedit checkpoint file.
[0140] Through the above steps, the BLCR process can restore the state of the gedit process by creating a child process and using the checkpoint file. This process not only restores the communication state of the process, but also restores the process's computing state and memory data, thus achieving complete recovery of the process.
[0141] The following combination Figure 5 Describes the complete process status recovery steps.
[0142] S502, creating a first child process;
[0143] S504, creating a local socket in the first child process;
[0144] S506, calling the dup2 function in the first child process to copy the socket of port 5901;
[0145] S508, calling the dup2 function in the first child process to duplicate the local socket;
[0146] S510, restoring the CPU memory data of the first child process;
[0147] S512, creating a second child process;
[0148] S514, creating a local socket connection in the second child process;
[0149] S516, calling the dup2 function in the second child process to copy the local socket;
[0150] S518: Restore the CPU memory data of the second child process.
[0151] It should be noted that the specific implementation of the above steps can be carried out in the manner described in the above embodiment. Through the above embodiment, the recovery of the Xvnc and gedit processes is completed, and the connection between the vnc client and Xvnc and the connection between Xvnc and gedit are restored.
[0152] On the one hand, after pausing an application, users can directly use a VNC client to connect to the original port to access the application again. In other words, for users, when accessing a suspended application, there is no need to manually resume the application. Using a VNC client to directly connect to the VNC port can trigger the application to resume from the checkpoint, which is very convenient.
[0153] On the other hand, from the perspective of fault recovery, the job process may fail to exit due to various software and hardware reasons during operation, which may lead to loss of user data and cause serious consequences. By adopting the above implementation method, checkpoints can be created for the user's job process at regular intervals. When the job process exits abnormally, the job application can be automatically restored to the state of the most recent checkpoint when the user connects to VNC, minimizing the user's loss.
[0154] The following describes the preparatory steps for triggering the above-mentioned process status recovery method.
[0155] In an optional embodiment, before receiving the visualization service request sent by the target client to the node communication port, the method further includes:
[0156] S1, when the management process detects a target event, suspending the target task process, and saving communication description information for indicating the communication state of the target task process and process description information for indicating the process state of the target task process to second recovery information in the checkpoint file;
[0157] S2, pausing the visualization service process, and saving communication description information for indicating the communication state of the visualization service process and process description information for indicating the process state of the visualization service process to the first recovery information in the checkpoint file;
[0158] S3, end the target task process and visualization service process.
[0159] It is understood that in the above embodiment of the present application, when a target event is detected, the target task process can be first paused and the status of the target task process can be recorded; then the visualization service process can be paused and the status of the visualization service process can be recorded; and finally, the target task process and the visualization service process can be terminated.
[0160] It should be noted that the above target event may include at least one of the following:
[0161] Method 1: When the management process receives a service suspension instruction according to the node communication port, it is determined that the target event is detected;
[0162] In the first approach described above, the management process determines that a target event has been detected when it receives an explicit service pause instruction via a node's communication port. For example, a user can send a pause instruction to the current service node through the management interface. Such pause instructions may include, but are not limited to, exit service, close service, or pause service operations received by the client. Upon receiving the pause instruction, the management process recognizes it as the target event and triggers the saving of the process state and the suspension of the process.
[0163] Method 2: When the management process detects communication interruption indication information according to the node communication port, it is determined that the target event is detected;
[0164] In the second approach described above, the target event is determined to have been detected when the management process detects an indication of communication interruption via a node's communication port. Specifically, in a distributed system, if a service node loses connectivity with other nodes due to network issues or node failure, the management process on that node may detect the communication interruption. In this case, the management process will assume that the target event has occurred and will immediately suspend the relevant processes, save their states, and prepare to resume or shut down.
[0165] Mode 3: When the management process detects that the current timestamp is a target timestamp that matches the target inspection period, it is determined that the target event is detected.
[0166] In the third method above, the management process determines that the target event has been detected when the current timestamp matches the preset target check interval. Specifically, a periodic checkpoint operation can be set to save the process status. For example, the status of all key processes can be automatically saved and a checkpoint can be created every 10 minutes.
[0167] It should be noted that, when the target event corresponding to the third method is detected, only the checkpoint creation operation may be performed without executing the temporary process and the process termination operations.
[0168] The following further describes how to detect a target event and create a checkpoint.
[0169] In this embodiment, the Berkeley Lab Checkpoint / Restart (BLCR) tool can be used to checkpoint and restore user applications (such as the gedit text editor) to ensure that users can save application status when needed and resume the application at a later time point for continued use.
[0170] S1, the user requests to save application data; the user sends a request to the high-performance computing (HPC) cluster scheduling system through the client, requesting to save the data of the gedit application currently in use, and can choose to automatically end the application after the save is completed.
[0171] In step S2, the HPC cluster scheduling system executes the BLCR command. After receiving the user's request, the HPC cluster scheduling system uses the BLCR tool to checkpoint the gedit and Xvnc processes. BLCR first pauses the gedit process and saves gedit's CPU state, memory data, and file descriptor information to a local file (called the gedit checkpoint file). Then, BLCR pauses the Xvnc process and saves Xvnc's CPU state, memory data, and file descriptor information to a local file (called the Xvnc checkpoint file).
[0172] S3 decides whether to terminate the process based on the user's selection. If the user chooses to automatically exit after saving, the Xvnc and gedit processes will be terminated after saving to the checkpoint file. If the user does not choose to automatically exit, the Xvnc and gedit processes will resume after saving to the checkpoint file.
[0173] S4: The BLCR process continues to listen to the port.
[0174] It is understandable that regardless of whether the Xvnc and gedit processes are terminated, the BLCR process continues to listen to port 5901 so that it can respond quickly when the user requests to access the application again.
[0175] In the above implementations of this application, using BLCR for checkpoint and restore operations provides users with a reliable way to save and restore application state. This capability is particularly important for preventing data loss and improving resource utilization in HPC environments. Through this process, users can pause applications when needed, save their state, and resume applications at the appropriate time to continue their previous work without worrying about data loss or wasted resources.
[0176] The following further describes the process of establishing the visualization service before the above process recovery operation.
[0177] In an optional embodiment, before suspending the target task process when the management process detects the target event, the process further includes:
[0178] S1, when the current service node is a target service node determined by the service cluster scheduling system to respond to the target client, the management process obtains a first visualization service request of the target client according to the assigned node communication port, wherein the service cluster scheduling system includes multiple service nodes, and when the service cluster scheduling system receives the visualization service request of at least one client, it allocates a corresponding service node to each of the at least one client;
[0179] S2, start the visualization service process through the management process, and start the target task process through the management process;
[0180] S3, when the process communication connection between the visualization service process and the target task process is established, and the service communication connection between the visualization service process and the target client is established, the visualization service matching the first visualization service request is provided to the target client through the visualization service process and the target task process.
[0181] In the aforementioned embodiments of this application, the service cluster scheduling system can be used to refer to a system responsible for managing and scheduling multiple service nodes in a service cluster. This system's primary function is to dynamically allocate service nodes to handle client requests, thereby achieving load balancing and improving system availability and responsiveness. The service cluster scheduling system is a key component in distributed systems, ensuring high service availability and scalability.
[0182] In an optional implementation, the service cluster scheduling system may be configured to include the following functions:
[0183] Service node management function: Track the status of all service nodes in the cluster, including the health status and load of the nodes.
[0184] Request scheduling function: Receive client requests and assign them to appropriate service nodes based on certain strategies (such as polling, minimum number of connections, load balancing, etc.).
[0185] Load balancing function: According to the current load of the service node, the request is reasonably distributed to avoid some nodes being overloaded while other nodes are idle.
[0186] Failover function: When a service node fails, it can automatically transfer requests to other healthy nodes to ensure service continuity.
[0187] Scaling management function: Dynamically increase or decrease service nodes according to the system load to adapt to load changes.
[0188] In the above-mentioned implementation of the present application, when the service cluster scheduling system receives a visualization service request from a target client, it will allocate a suitable service node to the client based on the status and load of the service nodes in the current cluster.
[0189] The management process runs on the assigned service node and listens on the assigned communication port to receive client requests. Once a client request is received, the management process launches the visualization service process and the target task process to handle the request. The visualization service process is responsible for establishing a communication connection with the client and providing a user interface; the target task process is responsible for executing the specific service task.
[0190] Once the communication connection between the visualization service process and the target task process is established, the two processes will work together to provide the required visualization services to the target client. The visualization service process forwards the client's interaction request to the target task process and displays the processing results of the target task process to the client.
[0191] Through the above-described implementation of this application, the service cluster scheduling system ensures that client requests can be processed efficiently and reliably. By dynamically allocating service nodes, the system can achieve load balancing, improve resource utilization, and ensure high service availability and scalability. In addition, the service cluster scheduling system can also implement failover in the event of a service node failure, ensuring service continuity.
[0192] The following further details the process of establishing the visualization service before the above process recovery operation.
[0193] In an optional embodiment, before the management process obtains the first visualization service request of the target client according to the allocated node communication port, the method further includes:
[0194] S1, when the current service node is the target node determined by the service cluster scheduling system to respond to the target client, start the management process;
[0195] S2, monitors the node communication port allocated to the target client through the management process;
[0196] S3: When the management process does not detect the first visualization service request of the target client according to the node communication port, the management process is kept in a listening state.
[0197] In the above embodiment of the present application, the management process can be started first, but the child process is not created immediately. Instead, the child process is created after a VNC client is connected, and then the Xvnc and visualization application child processes are started.
[0198] In an optional implementation, starting the visualization service process through the management process and starting the target task process through the management process include:
[0199] S1, creating a third sub-process through the management process, and obtaining at least one visualization request parameter carried in the first visualization service request through the third sub-process;
[0200] S2, starting a visualization service process according to at least one visualization request parameter;
[0201] S3, creating a fourth sub-process through the management process, and configuring a visualization service environment according to the fourth sub-process;
[0202] S4: When the visualization service environment configuration is completed, the target task process is started according to the fourth sub-process.
[0203] In the above-mentioned implementation manner of the present application, the third sub-process and the fourth sub-process may be created respectively through the management process, so as to further create and start the visualization service process and the target service process respectively.
[0204] In an optional embodiment, before providing the visualization service matching the first visualization service request to the target client through the visualization service process and the target task process, the process further includes:
[0205] S1, obtaining a third communication description identifier that matches the node communication port according to the third sub-process, and updating a fourth communication description identifier of the third sub-process according to the third communication description identifier;
[0206] S2, when the fourth communication description identifier of the third sub-process is updated, determining that the service communication connection between the visualization service process and the target client is established;
[0207] S3, according to the fourth sub-process, obtaining a fourth communication description identifier from the configuration information of the visualization service environment;
[0208] S4. The visualization service process and the target task process establish a process communication connection according to the fourth communication description identifier.
[0209] In the above implementation manner of the present application, the above communication description identifier can specifically be a file descriptor of a socket.
[0210] The following combination Figure 6 The specific implementation method of creating a visualization service at the current service node is described.
[0211] S602, configure the super daemon function of BLCR;
[0212] When configuring BLCR, refer to the implementation of the super daemon xinetd and modify BLCR to enable it to function as a super daemon. Use BLCR to launch Xvnc and the application requested by the user. To run other processes through BLCR, you can use the command cr_run, where the argument is the application to be launched. Assuming the application requested is gedit, you can execute cr_rungedit to run gedit through BLCR.
[0213] On the other hand, since the target application requested must be accessed through VNC during the visualization service process, in addition to starting the requested application, Xvnc must also be started (both are started through BLCR). When starting Xvnc, some VNC-related parameters are required, such as the VNC port number and VNC password.
[0214] Therefore, it is necessary to further extend two parameters for the cr_run command, the vnc port number (that is, the port number assigned by the system) and the vnc password. When BLCR starts Xvnc later, these two parameters will be used to start the vnc process.
[0215] S604, processing the client request;
[0216] In the application implementation method, the user submits a request to the HPC scheduling system (i.e., a specific service cluster scheduling system) to use a visualization application. The following uses gedit as an example, assuming that the visualization application requested by the user is gedit, which is a graphical text editor program in the Linux desktop environment.
[0217] The HPC cluster scheduling system selects a suitable computing node to run the graphical application and randomly assigns an idle port on the computing node host as the port for providing external VNC services. Assume that the port assigned is port 5901 on the host.
[0218] Subsequently, the user who submitted the request will use a VNC client to connect to this port on the host to access the running gedit program. Different requests submitted by different users will use different hosts or different ports on the same host, so that the VNC ports used by visualization applications requested by different users do not conflict.
[0219] S606, the BLCR process monitors the port and creates a child process based on the monitoring situation;
[0220] After executing the cr_run command, the BLCR process will be started. The process will bind to the vnc port passed in S604 and listen to the port, but will not immediately start Xvnc and gedit until a user connects to the port using a vnc client. Here, the role of BLCR is equivalent to a super daemon process such as xinetd. After it is started, it will continue to listen to the port and enable the corresponding application when a client accesses the port. It is understandable that the port listening function in this step can be an application function configured for the BLCR extension. The HPC cluster management system will return the assigned computing node host IP, vnc port number (i.e., the previously assigned port 5901), and vnc password (if a vnc password is used) to the user who submitted the request.
[0221] S608, setting environment variables and starting the process; S610, configuring inter-process communication and client network access communication.
[0222] In the above implementation, the user can use a vnc client to connect to port 5901 of the host;
[0223] Since step S606 indicates that the BLCR process is already listening on port 5901, when a VNC client connects to that port, the BLCR process will receive the connection. BLCR forks and creates a child process (the third child process). Within that child process, the dup2() function is called three times to copy the file descriptor of the BLCR process's socket currently bound to port 5901 to the child process's file descriptors 0 (standard input), 1 (standard output), and 2 (standard error). This is done by executing dup2(socket0,0), dup2(socket0,1), and dup2(socket0,2), respectively. Here, socket0 represents the file descriptor of the socket listening on port 5901. Thus, file descriptors 0, 1, and 2 of the child process are associated with the file descriptors of the socket on port 5901. Reading and writing file descriptors 0, 1, and 2 by the child process are equivalent to reading and writing to that socket.
[0224] Furthermore, the child process uses the parameters received in the previous step to start the Xvnc program through the execve function. In this way, Xvnc can communicate with the VNC client through file descriptors 0, 1, and 2.
[0225] Then, after BLCR starts a child process and starts Xvnc in the child process, the BLCR process executes fork again, starts the second child process (the fourth child process), and executes the export command in the fourth child process to set the Linux operating system environment variables, such as export DISPLAY=:1. The DISPLAY environment variable format is as follows: host:NumA.NumB
[0226] The host parameter indicates the host to which the projection is being made. If it's the local host, leave host blank. For other hosts, enter the corresponding IP address. When projecting to the local host, the NumA parameter indicates the path to the Unix socket. If 0, it connects to the local socket file / tmp / .X11-unix / X0. When projecting to a remote host, it indicates the port number minus 5900. If NumA is 1, it connects to port 5901. The NumB parameter is usually 0.
[0227] Since in this embodiment, Xvnc and gedit are both running on the same computing node host, that is, the local machine mentioned above, the host parameter should be empty.
[0228] Next, in the fourth child process, gedit is started using the execve function. After starting, the gedit process automatically obtains the local socket file used by Xvnc through the environment variable DISPLAY set in the previous step. gedit then connects to the socket file and passes the content to be displayed to Xvnc through this connection. Xvnc then passes the displayed content to the VNC client using the VNC protocol, allowing the user to see the content displayed in the gedit application window on the VNC client.
[0229] The above is the process of BLCR starting Xvnc and gedit, and the user accessing the application through the VNC client.
[0230] In an optional implementation, the process in which the management process monitors the node communication port of the current node further includes:
[0231] S1, when the current service node is a reference service node determined by the service cluster scheduling system to respond to the reference client, determining the reference node communication ports respectively allocated to the reference client;
[0232] S2, start the reference management process for monitoring the reference node communication port;
[0233] S3 , when the reference management process receives a second visualization service request from the reference client according to the reference node communication port, the reference management process starts a reference visualization service process and a reference task process for responding to the second visualization service request.
[0234] When the service cluster scheduling system determines that the current service node is the reference service node for responding to a reference client, the system will allocate a separate reference node communication port for each reference client. This step ensures that each client's request can be processed through a separate communication port, thus enabling concurrent access by multiple users.
[0235] Next, the service cluster scheduling system can start a dedicated reference management process for each assigned reference node communication port. The management process is responsible for listening to the assigned communication port and preparing to receive and process requests from reference clients.
[0236] Furthermore, when the reference management process receives a second visualization service request from a reference client via the reference node communication port it monitors, it will launch the corresponding reference visualization service process and reference task process based on the request. These processes will be dedicated to handling the client's request, ensuring personalized and isolated services.
[0237] It will be appreciated that the solution described above is particularly well-suited for scenarios where multiple users access visualization applications. When different users request the same or different applications, the system dynamically launches a BLCR super daemon process for each request, with each process listening on a different VNC port. This design not only improves the system's flexibility and scalability, but also ensures the independence and security of user requests.
[0238] In the above-mentioned embodiments of the present application, a dynamic port allocation strategy may be further adopted. For example, the system may dynamically allocate ports according to the current load conditions and available resources to optimize resource usage and avoid port conflicts.
[0239] The above-described embodiments of the present application enhance the security of remote visualization services. By assigning independent communication ports and management processes to each client, the system can better isolate user requests, preventing interference between different users and potential security risks. Furthermore, the user experience is further optimized. Users can connect to the specific port assigned to them through a VNC client, accessing the visualization applications they requested and enjoying a personalized service experience.
[0240] In an optional embodiment, when the current service node is a reference service node determined by the service cluster scheduling system to respond to the reference client, after determining the reference node communication ports respectively allocated to the reference client, the method further includes:
[0241] S1, create a reference service container that matches the reference node communication port;
[0242] Containerization technology can be involved in these steps. Containers create an independent runtime environment for each client request, enhancing isolation and preventing conflicts between different applications. Containers implement resource isolation and restrictions through Linux namespaces and control groups (cgroups).
[0243] S2, runs a reference management process in the reference service container to monitor the reference node communication port;
[0244] S3: In the reference service container, start a reference visualization service process and a reference task process for responding to the second visualization service request according to the reference management process.
[0245] In specific implementations, Docker container technologies, such as Chroot, Cgroups, and Namespaces in Linux, can be used to isolate applications from the system environment and restrict resources. Chroot changes the root directory of a process to isolate the file system. Cgroups control group technology limits, records, and isolates the physical resources (such as CPU and memory) used by process groups. Namespace technology provides isolation of processes, networks, mount points, and other resources.
[0246] In an optional embodiment, when the current service node is a reference service node determined by the service cluster scheduling system to respond to the reference client, the method further includes at least one of the following:
[0247] Method 1: When the number of management processes running in the current service node is greater than or equal to the number threshold, a service transfer request is sent to the service cluster scheduling system;
[0248] In the first approach, when the number of management processes running in the current service node reaches or exceeds a preset threshold, a service transfer request is sent to the service cluster scheduling system.
[0249] Method 2: When at least one node status parameter corresponding to the current service node meets the parameter conditions, a service transfer request is sent to the service cluster scheduling system;
[0250] In the second approach, if at least one of the current service node's status parameters meets certain conditions, such as high CPU usage or insufficient memory, a service transfer request is sent to the service cluster scheduling system. This helps to transfer services in a timely manner when resources are scarce, avoiding service interruptions or performance degradation.
[0251] The service transfer request is used to request the service cluster scheduling system to re-determine a reference service node from multiple service nodes.
[0252] In the above-mentioned implementation manner of the present application, the current service node may reject the system's allocation when local service resources are insufficient, and request the system to allocate the client service request to other service nodes according to the load balancing principle.
[0253] In one specific implementation, assume a service cluster scheduling system uses Docker containerization technology to deploy its services. Each client requests an independent service environment, and the service cluster scheduling system orchestrates and manages the containers using Kubernetes. When the number of containers deployed on a node reaches a threshold, Kubernetes automatically deploys new containers to other nodes to balance the load and ensure high service availability.
[0254] In another specific embodiment, the service cluster scheduling system can use containerization technology to deploy applications with a microservice architecture. The platform monitors the resource usage of each service node, such as CPU and memory usage. When it detects that the resource usage of a node is approaching the upper limit, the platform will automatically transfer some services to other nodes based on the feedback from the node to avoid overload and ensure the stability of the service. It is understandable that during the service transfer process, the checkpoint creation method in the above embodiment can be further adopted to determine the checkpoint file of the service to be transferred. The checkpoint file is then forwarded to the reallocated service node, thereby realizing dynamic transfer of the service.
[0255] In an optional embodiment, after providing the visualization service to the target client through the visualization service process and the target task process, the method further includes:
[0256] S1, when the management process receives a service termination instruction according to the node communication port, obtains at least one start timestamp matching the visualization service and a termination timestamp corresponding to each of the at least one start timestamp, wherein the start timestamp is used to indicate a start time node of the visualization service process, and the termination timestamp is used to indicate a termination time node of the visualization service process;
[0257] S2, determining a target service duration based on at least one start timestamp and the corresponding end timestamps;
[0258] S3: Send service duration reminder information to the target client according to the target service duration.
[0259] In the above-mentioned implementation mode of the present application, in a high-performance cluster scheduling system, it is usually necessary to meter and bill the resources used by users. In our solution, because the visualization application used by the user is started through BLCR, and the started visualization application is a child process of the BLCR process, when the visualization application process exits, it can also be perceived by its parent process, namely the BLCR process. In this way, BLCR can accurately record the start and end time of the user's use of the visualization application, thereby performing accurate metering and billing.
[0260] S1: When the management process receives a service termination instruction via a node communication port, it obtains at least one start timestamp matching the visualization service and a termination timestamp corresponding to each of the at least one start timestamp. The start timestamp indicates the start time of the visualization service process, and the termination timestamp indicates the termination time of the visualization service process.
[0261] S2: Determine a target service duration according to at least one start timestamp and the corresponding end timestamps.
[0262] S3: Send service duration reminder information to the target client according to the target service duration.
[0263] In the above-mentioned implementation of the present application, the management process in the current service node can accurately record the start and end times of the visualization service process. This can be achieved by having the BLCR process record the current timestamp when the process starts and exits. The timestamp can be stored in a log file or database to facilitate subsequent billing and analysis.
[0264] Furthermore, during the service duration calculation process, the service duration can be determined by calculating the difference between the end timestamp and the start timestamp. This calculation can be performed immediately when the process exits, or when needed.
[0265] In an optional manner, the service duration reminder information may be displayed to the user through a user interface, or sent to the user through an email, text message, or the like.
[0266] In the above-described embodiments of this application, in high-performance cluster scheduling systems, user resource usage is typically metered and billed. In our solution, because the visualization application used by the user is launched through BLCR and is a child process of the BLCR process, its parent process, the BLCR, can detect when the visualization application process exits. This allows BLCR to accurately record the start and end times of the user's visualization application usage, thereby providing accurate metering and billing.
[0267] Through the above implementation of the present application, the super daemon process and BLCR can be combined and applied to process management in high-performance computing scenarios to achieve efficient, transparent and automated checkpoint recovery of job processes.
[0268] Specifically, in the process of comprehensive capture and recovery of process status, combined with the BLCR tool, comprehensive state capture of the process is achieved, including CPU status, memory status, and socket status, ensuring that it can be quickly restored from the last saved state when a failure occurs.
[0269] In addition, the implementation of this application also supports manual and automated checkpoint mechanisms. This allows users to manually create checkpoints and exit applications, while also enabling automated, timed checkpoint strategies to periodically save job status. This reduces computing interruptions and resource waste caused by failures, and improves system stability and reliability.
[0270] Furthermore, the embodiments of this application further provide fast and flexible recovery capabilities. If a process terminates abnormally, the process state can be quickly restored using a checkpoint file. This allows for automatic recovery. Specifically, when a user accesses an application through a VNC client, the BLCR process automatically checks for a previously created checkpoint file. If so, it restores Xvnc and the visualization application from that checkpoint; if not, it restarts Xvnc and the visualization application.
[0271] This invention integrates these innovations into a comprehensive solution to address the need for visual job process checkpointing and rapid recovery in high-performance computing environments. Through this innovative integrated approach, the invention provides an efficient and reliable process management strategy, significantly improving the efficiency and stability of job execution in high-performance computing clusters.
[0272] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0273] According to another aspect of the embodiment of the present application, there is also provided a data processing device in memory for implementing the above-mentioned process state recovery method. Figure 7 As shown, the device includes:
[0274] The receiving unit 702 is configured to receive a visualization service request sent by a target client to the node communication port of the current service node during the process of the management process monitoring the node communication port of the current service node;
[0275] A first recovery unit 704 is configured to, upon finding a checkpoint file matching the visualization service request, recover the visualization service process according to first recovery information recorded in the checkpoint file, wherein the visualization service process is configured to provide a visualization service interface to the target client;
[0276] A second recovery unit 706 is configured to recover the target task process according to the second recovery information recorded in the checkpoint file, wherein the target task process is the task process for executing the target service task in the visual service interface;
[0277] The service unit 708 is configured to provide visualization service to the target client through the visualization service process and the target task process when the process communication between the visualization service process and the target task process is restored.
[0278] Optionally, the above-mentioned first recovery unit 704: creates a first sub-process through the above-mentioned management process; obtains the communication description information included in the above-mentioned first recovery information according to the above-mentioned first sub-process, and performs a communication recovery operation according to the above-mentioned communication description information; obtains the process status description information included in the above-mentioned first recovery information according to the above-mentioned first sub-process, and performs a process status recovery operation on the above-mentioned visualization service process according to the above-mentioned process description information.
[0279] Optionally, the above-mentioned first recovery unit 704: determines the first communication description identifier that matches the above-mentioned first sub-process; obtains the first historical communication description identifier that matches the above-mentioned visualization service process from the above-mentioned first recovery information through the above-mentioned first sub-process; and updates the above-mentioned first communication description identifier according to the above-mentioned first historical communication description identifier.
[0280] Optionally, the above-mentioned second recovery unit 706: creates a second sub-process through the above-mentioned management process; obtains the communication description information included in the above-mentioned second recovery information according to the above-mentioned second sub-process, and performs a communication recovery operation according to the above-mentioned communication description information; obtains the process status description information included in the above-mentioned second recovery information according to the above-mentioned second sub-process, and performs a process status recovery operation on the above-mentioned target task process according to the above-mentioned process description information.
[0281] Optionally, the second recovery unit 706: determines a second communication description identifier that matches the second sub-process, and establishes a process communication connection between the first sub-process and the second sub-process based on the first communication description identifier and the second communication description identifier; obtains a second historical communication description identifier that matches the visualization service process from the second recovery information through the second sub-process; and updates the second communication description identifier based on the second historical communication description identifier.
[0282] Optionally, the above-mentioned process state recovery device also includes: a third recovery unit, used for at least one of the following: restoring the memory state corresponding to the above-mentioned current process according to the historical memory state parameters in the above-mentioned process state description information matching the current process; restoring the CPU state corresponding to the above-mentioned current process according to the historical CPU state parameters in the above-mentioned process state description information matching the current process; restoring the reference process state corresponding to the above-mentioned current process according to the historical reference state parameters in the above-mentioned process state description information matching the current process, wherein the above-mentioned reference process state includes at least one of the following: process priority state, device resource state, file handle state; wherein the above-mentioned current process includes the above-mentioned visualization service process and the above-mentioned target task process.
[0283] Optionally, the above-mentioned process status recovery device also includes: an interruption unit, which is used to suspend the above-mentioned target task process when the above-mentioned management process detects a target event, and save the communication description information used to indicate the communication status of the above-mentioned target task process, and the process description information used to indicate the process status of the above-mentioned target task process to the above-mentioned second recovery information in the above-mentioned checkpoint file; suspend the above-mentioned visualization service process, and save the communication description information used to indicate the communication status of the above-mentioned visualization service process, and the process description information used to indicate the process status of the above-mentioned visualization service process to the above-mentioned first recovery information in the above-mentioned checkpoint file; end the above-mentioned target task process and the above-mentioned visualization service process.
[0284] Optionally, the above-mentioned interruption unit is also used for at least one of the following: determining that the above-mentioned target event is detected when the above-mentioned management process receives a service suspension instruction according to the above-mentioned node communication port; determining that the above-mentioned target event is detected when the above-mentioned management process detects communication interruption indication information according to the above-mentioned node communication port; determining that the above-mentioned target event is detected when the above-mentioned management process detects that the current timestamp is a target timestamp that matches the target inspection period.
[0285] Optionally, the above-mentioned interruption unit is also used to, when the above-mentioned current service node is the target service node determined by the service cluster scheduling system to respond to the above-mentioned target client, the above-mentioned management process obtains the first visualization service request of the above-mentioned target client according to the allocated above-mentioned node communication port, wherein the above-mentioned service cluster scheduling system includes multiple service nodes, and the above-mentioned service cluster scheduling system, when receiving the visualization service request of at least one client, allocates the corresponding above-mentioned service nodes to at least one of the above-mentioned clients respectively; starts the visualization service process through the above-mentioned management process, and starts the above-mentioned target task process through the above-mentioned management process; when the process communication connection between the above-mentioned visualization service process and the above-mentioned target task process is established, and the service communication connection between the above-mentioned visualization service process and the above-mentioned target client is established, provides the above-mentioned target client with a visualization service matching the above-mentioned first visualization service request through the above-mentioned visualization service process and the above-mentioned target task process.
[0286] Optionally, the device for recovering the above-mentioned process status also includes: a starting unit, used to start the above-mentioned management process when the current service node is the target node determined by the service cluster scheduling system to respond to the above-mentioned target client; monitor the above-mentioned node communication port allocated to the above-mentioned target client through the above-mentioned management process; and maintain the listening state of the above-mentioned management process when the management process does not detect the first visual service request of the above-mentioned target client according to the above-mentioned node communication port.
[0287] Optionally, the above-mentioned starting unit is used to: create a third sub-process through the above-mentioned management process, and obtain at least one visualization request parameter carried in the above-mentioned first visualization service request according to the above-mentioned third sub-process; start the above-mentioned visualization service process according to at least one of the above-mentioned visualization request parameters; create a fourth sub-process through the above-mentioned management process, and configure the visualization service environment according to the above-mentioned fourth sub-process; when the above-mentioned visualization service environment configuration is completed, start the above-mentioned target task process according to the above-mentioned fourth sub-process.
[0288] Optionally, the above-mentioned starting unit is also used to: obtain a third communication description identifier matching the above-mentioned node communication port according to the above-mentioned third sub-process, and update the fourth communication description identifier of the above-mentioned third sub-process according to the above-mentioned third communication description identifier; when the above-mentioned fourth communication description identifier of the above-mentioned third sub-process is updated, determine that the service communication connection between the above-mentioned visualization service process and the above-mentioned target client is established; according to the above-mentioned fourth sub-process, obtain the above-mentioned fourth communication description identifier from the configuration information of the above-mentioned visualization service environment; the above-mentioned visualization service process and the above-mentioned target task process establish the above-mentioned process communication connection according to the above-mentioned fourth communication description identifier.
[0289] Optionally, the device for recovering the process state further includes: a reference service unit, which is used to determine the reference node communication ports respectively allocated to the above-mentioned reference clients when the above-mentioned current service node is the reference service node determined by the above-mentioned service cluster scheduling system to respond to the reference client; start a reference management process for monitoring the above-mentioned reference node communication port; and when the above-mentioned reference management process receives the second visualization service request of the above-mentioned reference client according to the above-mentioned reference node communication port, start a reference visualization service process and a reference task process for responding to the above-mentioned second visualization service request according to the above-mentioned reference management process.
[0290] Optionally, the above-mentioned reference service unit is also used to: create a reference service container that matches the above-mentioned reference node communication port; run a reference management process for listening to the above-mentioned reference node communication port in the above-mentioned reference service container; and in the above-mentioned reference service container, start the above-mentioned reference visualization service process and the above-mentioned reference task process for responding to the above-mentioned second visualization service request according to the above-mentioned reference management process.
[0291] Optionally, the above-mentioned reference service unit is also used for at least one of the following: sending a service transfer request to the above-mentioned service cluster scheduling system when the number of the above-mentioned management processes running in the above-mentioned current service node is greater than or equal to the quantity threshold; sending a service transfer request to the above-mentioned service cluster scheduling system when at least one node status parameter corresponding to the above-mentioned current service node meets the parameter condition; wherein the above-mentioned service transfer request is used to request the above-mentioned service cluster scheduling system to re-determine the above-mentioned reference service node from the multiple above-mentioned service nodes.
[0292] Optionally, the above-mentioned process status recovery device also includes: a statistical unit, which is used to obtain at least one start timestamp matching the above-mentioned visualization service and a termination timestamp corresponding to each of the at least one start timestamp when the above-mentioned management process receives an end service instruction according to the above-mentioned node communication port, wherein the above-mentioned start timestamp is used to indicate the start running time node of the above-mentioned visualization service process, and the above-mentioned termination timestamp is used to indicate the termination running time node of the above-mentioned visualization service process; determine the target service duration according to the at least one start timestamp and the corresponding termination timestamps; and send service duration prompt information to the above-mentioned target client according to the above-mentioned target service duration.
[0293] For specific embodiments, reference may be made to the examples shown in the above process status recovery method, which will not be described in detail in this example.
[0294] According to another aspect of the embodiment of the present application, an electronic device for implementing the above-mentioned data processing method in the memory is also provided. The electronic device may be Figure 1The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a mobile phone or a computer as an example. Figure 8 As shown, the electronic device includes a second memory 802 and a second processor 804. The second memory 802 stores a computer program, and the second processor 804 is configured to execute the steps of any of the above method embodiments through the computer program.
[0295] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0296] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0297] S1, in the process of monitoring the node communication port of the current service node by the management process, receiving a visualization service request sent by a target client to the node communication port;
[0298] S2, when a checkpoint file matching the visualization service request is found, resuming the visualization service process according to the first restoration information recorded in the checkpoint file, wherein the visualization service process is used to provide a visualization service interface to the target client;
[0299] S3, restoring the target task process according to the second restoration information recorded in the checkpoint file, wherein the target task process is the task process for executing the target service task in the visual service interface;
[0300] S4: When the process communication between the visualization service process and the target task process is restored, the visualization service is provided to the target client through the visualization service process and the target task process.
[0301] Alternatively, those skilled in the art will appreciate that Figure 8 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 8 It does not limit the structure of the above electronic device. For example, the electronic device may also include Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations shown.
[0302] Among them, the second memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the process state recovery method and device in the embodiment of the present application. The second processor 804 executes various functional applications and data processing by running the software programs and modules stored in the second memory 802, that is, realizing the above-mentioned process state recovery method. The second memory 802 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the second memory 802 may further include a memory remotely located relative to the second processor 804, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, corporate intranet, local area network, mobile communication network and combinations thereof. As an example, Figure 8 As shown, the second memory 802 may include, but is not limited to, the receiving unit 702, the first recovery unit 704, the second recovery unit 706, and the service unit 708 in the process state recovery device. In addition, it may also include, but is not limited to, other module units in the process state recovery device, which will not be repeated in this example.
[0303] Optionally, the transmission device 806 is configured to receive or transmit data via a network. Specific examples of the aforementioned network may include wired networks and wireless networks. In one embodiment, the transmission device 806 includes a network interface controller (NIC), which can be connected to other network devices and a router via a network cable to enable communication with the Internet or a local area network. In one embodiment, the transmission device 806 is a radio frequency (RF) module configured to communicate with the Internet wirelessly.
[0304] In addition, the electronic device further includes: a display 808 for displaying the target page; and a connection bus 810 for connecting various module components in the electronic device.
[0305] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes via network communication. The nodes may form a point-to-point network, and any computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the point-to-point network.
[0306] According to one aspect of the present application, a computer-readable storage medium is provided. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the methods provided in the various optional implementations described above.
[0307] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0308] S1, in the process of monitoring the node communication port of the current service node by the management process, receiving a visualization service request sent by a target client to the node communication port;
[0309] S2, when a checkpoint file matching the visualization service request is found, resuming the visualization service process according to the first restoration information recorded in the checkpoint file, wherein the visualization service process is used to provide a visualization service interface to the target client;
[0310] S3, restoring the target task process according to the second restoration information recorded in the checkpoint file, wherein the target task process is the task process for executing the target service task in the visual service interface;
[0311] S4: When the process communication between the visualization service process and the target task process is restored, the visualization service is provided to the target client through the visualization service process and the target task process.
[0312] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or portion of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal. It can be implemented in whole or in part using software, hardware (such as processing circuits or memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the functionality of the module or unit.
[0313] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0314] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of each embodiment of the present application.
[0315] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0316] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, there may be other division methods, such as combining or integrating multiple units or components into another system, or ignoring or not implementing some features. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interface, indirect coupling or communication connection of units or modules, and may be electrical or other forms.
[0317] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0318] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0319] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
[0320] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0321] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above method embodiments when run.
[0322] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0323] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0324] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0325] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0326] An embodiment of the present application also provides a computer program, which includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps of any of the above method embodiments.
[0327] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0328] Obviously, those skilled in the art should understand that the modules or steps of the present application described above can be implemented using a general-purpose computing device, they can be concentrated on a single computing device, or distributed across a network composed of multiple computing devices, they can be implemented using program code executable by the computing device, and thus, they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in a different order than herein, or they can be fabricated into separate integrated circuit modules, or multiple modules or steps can be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0329] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various modifications and variations of the present application are possible. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for restoring a process state, characterized in that: include: In the process of the management process monitoring the node communication port of the current service node, receiving a visualization service request sent by a target client to the node communication port; In a case where a checkpoint file matching the visualization service request is found, a first child process is created through the management process; first recovery information recorded in the checkpoint file is obtained according to the first child process, and a communication recovery operation is performed according to communication description information in the first recovery information; process state description information in the first recovery information is obtained according to the first child process, and a process state recovery operation is performed on a visualization service process according to the process state description information in the first recovery information, wherein the visualization service process is used to provide a visualization service interface to the target client; Creating a second child process through the management process; obtaining second recovery information recorded in the checkpoint file according to the second child process, and performing a communication recovery operation according to communication description information in the second recovery information; obtaining process state description information in the second recovery information according to the second child process, and performing a process state recovery operation on a target task process according to the process state description information in the second recovery information, wherein the target task process is a task process in the visual service interface for executing a target service task; When the process communication between the visualization service process and the target task process is restored, the visualization service is provided to the target client through the visualization service process and the target task process.
2. The method according to claim 1, characterized in that The obtaining, according to the first sub-process, the first recovery information recorded in the checkpoint file, and performing a communication recovery operation according to the communication description information in the first recovery information, includes: Determining a first communication description identifier that matches the first sub-process; Acquiring, by the first sub-process, from the first recovery information, a first historical communication description identifier that matches the visualization service process; The first communication description identifier is updated according to the first historical communication description identifier.
3. The method according to claim 1, characterized in that The step of obtaining the second recovery information recorded in the checkpoint file according to the second sub-process and performing a communication recovery operation according to the communication description information in the second recovery information includes: Determining a second communication description identifier that matches the second sub-process, and establishing a process communication connection between the first sub-process and the second sub-process according to the first communication description identifier and the second communication description identifier; Acquiring, by the second sub-process, from the second recovery information, a second historical communication description identifier that matches the target task process; The second communication description identifier is updated according to the second historical communication description identifier.
4. The method according to claim 1, wherein The execution process state recovery operation includes at least one of the following: Restoring the memory state corresponding to the current process according to the historical memory state parameters in the process state description information matching the current process; Restoring the CPU state corresponding to the current process according to the historical CPU state parameters in the process state description information matching the current process; Restoring a reference process state corresponding to the current process according to historical reference state parameters in the process state description information matching the current process, wherein the reference process state includes at least one of the following: process priority state, device resource state, and file handle state; The current process includes the visualization service process and the target task process.
5. The method according to claim 1, wherein Before receiving the visualization service request sent by the target client to the node communication port, the method further includes: When the management process detects a target event, pausing the target task process, and saving communication description information indicating a communication state of the target task process and process description information indicating a process state of the target task process to the second recovery information in the checkpoint file; Pausing the visualization service process, and saving communication description information indicating a communication state of the visualization service process and process description information indicating a process state of the visualization service process to the first recovery information in the checkpoint file; End the target task process and the visualization service process.
6. The method according to claim 5, characterized in that Before the management process detects a target event, the method further includes at least one of the following: In a case where the management process receives a service suspension instruction according to the node communication port, determining that the target event is detected; In a case where the management process detects communication interruption indication information according to the node communication port, determining that the target event is detected; In a case where the management process detects that the current timestamp is a target timestamp that matches a target checking period, it is determined that the target event is detected.
7. The method according to claim 5, characterized in that In the case where the management process detects a target event, before suspending the target task process, the method further includes: When the current service node is a target service node determined by the service cluster scheduling system to respond to the target client, the management process obtains the first visualization service request of the target client according to the assigned node communication port, wherein the service cluster scheduling system includes multiple service nodes, and when the service cluster scheduling system receives the visualization service request of at least one client, it allocates the corresponding service node to each of the at least one client; Start the visualization service process through the management process, and start the target task process through the management process; When the process communication connection between the visualization service process and the target task process is established, and the service communication connection between the visualization service process and the target client is established, the visualization service matching the first visualization service request is provided to the target client through the visualization service process and the target task process.
8. The method according to claim 7, characterized in that Before the management process obtains the first visualization service request of the target client according to the allocated node communication port, the process further includes: In a case where the current service node is the target node determined by the service cluster scheduling system to respond to the target client, starting the management process; Monitoring the node communication port allocated to the target client by the management process; When the management process does not detect the first visualization service request of the target client according to the node communication port, the monitoring state of the management process is maintained.
9. The method according to claim 7, characterized in that The starting of the visualization service process through the management process and the starting of the target task process through the management process include: Creating a third sub-process through the management process, and obtaining at least one visualization request parameter carried in the first visualization service request according to the third sub-process; Starting the visualization service process according to at least one visualization request parameter; Creating a fourth sub-process through the management process, and configuring a visualization service environment according to the fourth sub-process; When the visualization service environment is configured, the target task process is started according to the fourth sub-process.
10. The method according to claim 9, characterized in that Before providing the target client with the visualization service matching the first visualization service request through the visualization service process and the target task process, the method further includes: Acquire a third communication description identifier that matches the node communication port according to the third sub-process, and update a fourth communication description identifier of the third sub-process according to the third communication description identifier; When the fourth communication description identifier of the third sub-process is updated, determining that the service communication connection between the visualization service process and the target client is established; According to the fourth sub-process, obtaining the fourth communication description identifier from the configuration information of the visualization service environment; The visualization service process and the target task process establish the process communication connection according to the fourth communication description identifier.
11. The method according to claim 7, characterized in that During the process of the management process monitoring the node communication port of the current node, the method further includes: In a case where the current service node is a reference service node determined by the service cluster scheduling system to respond to a reference client, determining reference node communication ports respectively allocated to the reference clients; Starting a reference management process for monitoring the communication port of the reference node; When the reference management process receives the second visualization service request from the reference client through the reference node communication port, the reference management process starts a reference visualization service process and a reference task process for responding to the second visualization service request.
12. The method according to claim 11, characterized in that In the case where the current service node is a reference service node determined by the service cluster scheduling system to respond to the reference client, after determining the reference node communication ports respectively allocated to the reference client, the method further includes: Creating a reference service container that matches the reference node communication port; Running a reference management process in the reference service container for monitoring the reference node communication port; In the reference service container, the reference visualization service process and the reference task process for responding to the second visualization service request are started according to the reference management process.
13. The method according to claim 11, characterized in that In a case where the current service node is a reference service node determined by the service cluster scheduling system to respond to the reference client, the method further includes at least one of the following: When the number of the management processes running in the current service node is greater than or equal to a number threshold, sending a service transfer request to the service cluster scheduling system; When at least one node status parameter corresponding to the current service node meets a parameter condition, sending a service transfer request to the service cluster scheduling system; The service transfer request is used to request the service cluster scheduling system to re-determine the reference service node from the multiple service nodes.
14. The method according to claim 7, wherein: After providing the visualization service to the target client through the visualization service process and the target task process, the method further includes: When the management process receives a service termination instruction according to the node communication port, obtaining at least one start timestamp matching the visualization service and a termination timestamp corresponding to each of the at least one start timestamp, wherein the start timestamp is used to indicate a start time node of the visualization service process, and the termination timestamp is used to indicate a termination time node of the visualization service process; Determining a target service duration based on at least one start timestamp and respective corresponding end timestamps; Sending service duration prompt information to the target client according to the target service duration.
15. A process status recovery device, characterized in that: include: A receiving unit, configured to receive a visualization service request sent by a target client to the node communication port of the current service node during a process in which the management process monitors the node communication port of the current service node; A first recovery unit is configured to, upon finding a checkpoint file matching the visualization service request, create a first child process through the management process; obtain, according to the first child process, first recovery information recorded in the checkpoint file, and perform a communication recovery operation according to communication description information in the first recovery information; obtain, according to the first child process, process state description information in the first recovery information, and perform a process state recovery operation on a visualization service process according to the process state description information in the first recovery information, wherein the visualization service process is configured to provide a visualization service interface to the target client; a second recovery unit configured to create a second child process through the management process; obtain second recovery information recorded in the checkpoint file according to the second child process, and perform a communication recovery operation according to communication description information in the second recovery information; obtain process state description information in the second recovery information according to the second child process, and perform a process state recovery operation on a target task process according to the process state description information in the second recovery information, wherein the target task process is a task process in the visual service interface for executing a target service task; The service unit is configured to provide visualization service to the target client through the visualization service process and the target task process when the process communication between the visualization service process and the target task process is restored.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 14 when executed by a processor.
17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 14 are implemented.
18. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
Citation Information
Patent Citations
Method for implementing checkpoint of Linux program at user level based on virtual kernel object
CN101093453A
Recommended data display method and system
CN105893558A