Container processing method and device, electronic equipment and computer readable medium

By obtaining container identifiers and disaster recovery switching identifiers, updating configuration data and triggering a self-healing mechanism, the problems of low efficiency and poor stability of disaster recovery switching in the container platform are solved, and more efficient and stable disaster recovery switching are achieved.

CN119201338APending Publication Date: 2024-12-27CHINA CONSTRUCTION BANK +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411227597.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The problem of low disaster recovery switching efficiency, large impact range and poor switching stability based on container platforms.

Method used

By obtaining the container ID and disaster recovery switch ID, determine the status and target process of the main container, update the configuration data, send a termination command to stop the main center service, trigger the self-healing mechanism, start the backup center service, and start based on the updated configuration data Prepare the container and output the backup container status data.

Benefits of technology

Improve the efficiency and stability of disaster recovery switching in the container platform and reduce the scope of impact.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201338A_ABST
    Figure CN119201338A_ABST
Patent Text Reader

Abstract

The invention discloses a container processing method and device, electronic equipment and a computer readable medium, and relates to the technical field of computers.The specific implementation mode comprises the steps that in response to a container processing request, a corresponding container identifier and a disaster recovery backup switching identifier are obtained; based on the container identifier, obtaining the state of the main container, and determining a target process corresponding to the main container; in response to the condition that the state is the hot standby state and the disaster recovery switching identifier corresponds to disaster recovery switching, updating configuration data of the main container; sending a command of terminating the target process to the main container to stop the main center service, and triggering a container self-healing mechanism to start the standby center service in response to termination of the target process; and calling a standby center service to start a standby container corresponding to the main container according to the updated configuration data and output standby container state data. The disaster recovery switching efficiency and switching stability based on the containers in the container platform are improved, and the influence range is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a container processing method, device, electronic device and computer-readable medium. Background Art

[0002] Service containerization is the core technology of distributed cloud computing, which can achieve fast and consistent expansion and contraction of applications. The disaster recovery field is traditionally designed based on the concept of virtual machine services, and service management is achieved through Pod lifecycle management. If the disaster recovery center service is in cold standby state, the application cannot be started in time. The disaster recovery switching efficiency based on the container platform is low, the impact range is large, and the switching stability is poor. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a container processing method, device, electronic device and computer-readable medium, which can solve the problems of low disaster recovery switching efficiency, large impact range and poor switching stability based on the existing container platform.

[0004] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present application, a container processing method is provided, including: in response to a container processing request, obtaining a corresponding container identifier and a disaster recovery switching identifier; based on the container identifier, obtaining the state of the main container, and determining the target process corresponding to the main container; in response to the state being a hot standby state and the disaster recovery switching identifier corresponding to performing a disaster recovery switching, updating the configuration data of the main container; sending a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, triggering a container self-healing mechanism to start the standby center service; calling the standby center service to start the standby container corresponding to the main container according to the updated configuration data and output the standby container status data.

[0005] Optionally, determining the target process corresponding to the main container includes: determining a main process corresponding to the main container, and determining the main process as the target process corresponding to the main container.

[0006] Optionally, updating the configuration data of the main container includes: acquiring user requirement data and configuration data of a backup container corresponding to the main container; and updating the configuration data of the main container based on the user requirement data and the configuration data of the backup container.

[0007] Optionally, before triggering the container self-healing mechanism, the method further includes: in response to a command result being returned as a timeout or an error code being returned, retrying to terminate the target process until the command result is returned as normal.

[0008] Optionally, before outputting the standby container status data, the method further includes: querying the startup time of the standby container, and determining that the standby container status data is a restart failure in response to the startup time of the standby container being not greater than the start execution time, and determining that the standby container status data is a restart success in response to the startup time of the standby container being greater than the start execution time.

[0009] Optionally, before sending a command to terminate the target process to the main container, the method further includes: setting a flow control switch corresponding to the main container to be closed; and before outputting the standby container status data, the method further includes: setting a flow control switch corresponding to the standby container corresponding to the main container to be opened.

[0010] In addition, the present application also provides a container processing device, including: an acquisition unit, configured to obtain a corresponding container identifier and a disaster recovery switching identifier in response to a container processing request; a target process determination unit, configured to obtain the state of the main container based on the container identifier, and determine the target process corresponding to the main container; an update unit, configured to update the configuration data of the main container in response to the state being a hot standby state and the disaster recovery switching identifier corresponding to performing a disaster recovery switching; a self-healing unit, configured to send a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, trigger the container self-healing mechanism to start the standby center service; a starting unit, configured to call the standby center service to start the standby container corresponding to the main container according to the updated configuration data and output the standby container status data.

[0011] Optionally, the target process determining unit is further configured to: determine a main process corresponding to the main container, and determine the main process as a target process corresponding to the main container.

[0012] Optionally, the updating unit is further configured to: obtain user requirement data and configuration data of a backup container corresponding to the primary container; and update the configuration data of the primary container based on the user requirement data and the configuration data of the backup container.

[0013] Optionally, the device further comprises a retry unit configured to: in response to a command result being returned as a timeout or an error code being returned, retry to terminate the target process until the command result being returned as normal.

[0014] Optionally, the starting unit is further configured to: query the start time of the standby container, and determine that the standby container status data is a restart failure in response to the start time of the standby container being not greater than the start execution time; and determine that the standby container status data is a restart success in response to the start time of the standby container being greater than the start execution time.

[0015] Optionally, the self-healing unit is further configured to: set the flow control switch corresponding to the main container to be closed; and before outputting the backup container status data, the method is further configured to: set the flow control switch corresponding to the backup container corresponding to the main container to be open.

[0016] In addition, the present application also provides a container processing electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the container processing method as described above.

[0017] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the container processing method as described above is implemented.

[0018] To achieve the above objective, according to another aspect of the embodiments of the present application, a computer program product is provided.

[0019] A computer program product according to an embodiment of the present application includes a computer program, and when the program is executed by a processor, the container processing method provided by the embodiment of the present application is implemented.

[0020] One embodiment of the above invention has the following advantages or beneficial effects: the present application obtains the corresponding container identifier and disaster recovery switching identifier in response to a container processing request; obtains the state of the main container based on the container identifier, and determines the target process corresponding to the main container; updates the configuration data of the main container in response to the state being a hot standby state and the disaster recovery switching identifier corresponding to a disaster recovery switching; sends a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, triggers the container self-healing mechanism to start the backup center service; calls the backup center service to start the backup container corresponding to the main container according to the updated configuration data and outputs the backup container status data. The efficiency and switching stability of the disaster recovery switching of the container based on the container platform are improved, and the impact range is reduced.

[0021] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.

[0023] Figure 1 is a schematic diagram of the main process of a container processing method according to an embodiment of the present application;

[0024] Figure 2 is a schematic diagram of the main process of a container processing method according to an embodiment of the present application;

[0025] Figure 3 is a schematic diagram of the overall process of a container processing method according to an embodiment of the present application;

[0026] Figure 4 is a detailed flow chart of a container processing method according to an embodiment of the present application;

[0027] Figure 5 is a schematic diagram of the main units of a container processing device according to an embodiment of the present application;

[0028] Figure 6 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;

[0029] Figure 7 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0030] The following is a description of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of known functions and structures is omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of the present application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of the present application, certain software, components, models, and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must have used the solution. In the technical solution of the present application, the collection, analysis, use, transmission, storage, and other aspects of the user's personal information involved are in compliance with the provisions of relevant laws and regulations, and are used for legal and reasonable purposes, and are not shared, leaked, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Take necessary measures to prevent illegal access to such personal information, ensure that persons with access to personal information comply with relevant laws and regulations, and ensure the security of personal information. Once such personal information is no longer needed, risks should be minimized by limiting or even prohibiting data collection and / or deleting data.

[0031] When used, including in certain related applications, user privacy is protected by de-identifying data, such as by removing specific identifiers when used, controlling the amount or specificity of data stored, controlling how data is stored, and / or other methods of de-identification.

[0032] Figure 1 is a schematic diagram of the main process of the container processing method according to an embodiment of the present application, such as Figure 1 As shown, the container processing method mainly includes the following steps S101 to S105.

[0033] Step S101, in response to a container processing request, obtaining a corresponding container identifier and a disaster recovery switching identifier.

[0034] In this embodiment, the execution subject of the container processing method (for example, a server) can receive the container processing request through a wired connection or a wireless connection. After receiving the container processing request, the execution subject can obtain the container identifier and the disaster recovery switching identifier carried in the request. Among them, the container identifier is used to represent the number or name of the container to be switched between the primary and standby modes. The disaster recovery switching identifier can be used to represent whether to perform a disaster recovery switch. It can be understood that if the container is started, the container can provide corresponding services to the outside, and if the container is not started, the container cannot provide corresponding services to the outside.

[0035] Step S102: Based on the container identifier, the state of the main container is obtained, and the target process corresponding to the main container is determined.

[0036] The execution subject can locate the corresponding container according to the container identifier, for example, the main container, to obtain the current state of the main container, and determine the target process corresponding to the main container according to the associated data of the main container. The target process is used to control the stopping and starting of the service of the main container.

[0037] Specifically, determining the target process corresponding to the main container includes: determining a main process corresponding to the main container, and determining the main process as the target process corresponding to the main container.

[0038] In some embodiments, the execution subject may also determine the process with the highest priority corresponding to the main container as the target process corresponding to the main container, thereby achieving the fastest response to the start and stop instructions of the external services of the main container and improving the container processing efficiency.

[0039] Step S103: in response to the state being the hot standby state and the disaster recovery switching flag corresponding to performing disaster recovery switching, updating the configuration data of the primary container.

[0040] The hot standby state is real-time and can be enabled, and the response rate is increased. If the container state is hot standby and disaster recovery switching can be performed, the configuration data of the main container is updated.

[0041] Specifically, updating the configuration data of the main container includes: acquiring user demand data and configuration data of a backup container corresponding to the main container; and updating the configuration data of the main container based on the user demand data and the configuration data of the backup container.

[0042] User demand data, for example, may be timed startup data, startup maintenance duration data, etc., and configuration data of the backup container corresponding to the main container, for example, may include data such as the number, name, or address of the backup container corresponding to the main container. The execution subject may update the existing data in the configuration data of the main container and add the newly added configuration data based on the user demand data and the configuration data of the backup container, and then trigger the synchronous update of the configuration data of the backup container, so that the configuration data of the backup container is consistent with the real-time configuration data of the main container, which facilitates the disaster recovery restart of the container and improves the response speed and efficiency of the disaster recovery restart based on the container.

[0043] Step S104, sending a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, triggering the container self-healing mechanism to start the backup center service.

[0044] For example, the target process may be process 1, and the command to terminate the target process may be the kill 1 command, i.e., the command to terminate process 1. By terminating the target process used to control the main container through a command, control of a single container can be achieved, and the efficiency and stability of switching external services can be improved. And through the container self-healing mechanism after the target process is terminated, the backup center service is started to achieve a low-cost container restart.

[0045] Specifically, before triggering the container self-healing mechanism, the container processing method further includes: in response to a command result being returned as a timeout or an error code being returned, retrying to terminate the target process until the command result is returned as normal.

[0046] If the command result is returned normally, it means that the service of the main container is successfully stopped. If the command result is returned as timeout or an error code is returned, it means that the service of the main container is not successfully stopped, and it is necessary to retry the operation of stopping the service of the main container until the service of the main container is successfully stopped, so as to ensure the accuracy of the container processing result.

[0047] Specifically, before sending a command to terminate the target process to the main container, the method further includes: setting a flow control switch corresponding to the main container to be closed; and before outputting the standby container status data, the method further includes: setting a flow control switch corresponding to the standby container corresponding to the main container to be opened.

[0048] Step S105 , calling the backup center service to start the backup container corresponding to the main container according to the updated configuration data and output the backup container status data.

[0049] The configuration data of the standby container may be consistent with the updated configuration data of the main container, and the standby container is started according to the configuration data of the standby container that is the same as the updated configuration data of the main container by calling the standby center service and outputting the standby container status data at this time. For example, the standby container status data may include restart failure and restart success.

[0050] This embodiment obtains the corresponding container identifier and disaster recovery switching identifier in response to the container processing request; obtains the state of the main container based on the container identifier and determines the target process corresponding to the main container; updates the configuration data of the main container in response to the state being the hot standby state and the disaster recovery switching identifier corresponding to the disaster recovery switching; sends a command to terminate the target process to the main container to stop the main center service, and triggers the container self-healing mechanism in response to the termination of the target process to start the backup center service; calls the backup center service to start the backup container corresponding to the main container according to the updated configuration data and output the backup container state data. The efficiency and switching stability of the disaster recovery switching based on the container platform are improved, and the impact range is reduced.

[0051] Figure 2 FIG. 1 is a schematic diagram of the main process of a container processing method according to an embodiment of the present application. Figure 2 As shown, the container processing method mainly includes the following steps S201 to S207.

[0052] Step S201, in response to a container processing request, obtaining a corresponding container identifier and a disaster recovery switching identifier.

[0053] The container processing request may be a restart request of the same container, or may be a container active / standby switching request. The embodiment of the present application does not specifically limit the content of the container processing request.

[0054] If the container processing request is a restart request of the same container, the obtained container identifier may be the number or name of the container to be restarted. At this time, the disaster recovery switching identifier may be empty or non-empty, both indicating that only the restart operation of the same container is performed.

[0055] Step S202: Based on the container identifier, the state of the main container is obtained, and the target process corresponding to the main container is determined.

[0056] When restarting the same container, the main container and the backup container are the same container, that is, the container corresponding to the container identifier. The state of the container corresponding to the container identifier, that is, the state of the main container, is obtained, and the process bound to control the start and stop of the main container, that is, the target process, is determined according to the main container.

[0057] Step S203: in response to the state being the hot standby state and the disaster recovery switching flag corresponding to performing disaster recovery switching, updating the configuration data of the primary container.

[0058] When the same container is restarted, the configuration data of the main container is updated regardless of whether the disaster recovery switch flag is empty.

[0059] In some embodiments, updating the configuration data of the main container may include: obtaining the current system time, and obtaining configuration data corresponding to the current system time from a configuration database based on the current system time for updating the configuration data of the main container, thereby achieving timed update of the configuration data and personalization of container processing.

[0060] Step S204, sending a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, triggering the container self-healing mechanism to start the backup center service.

[0061] When restarting the same container, the backup center service can restart the container for external services whose target process is terminated.

[0062] Step S205: calling the backup center service to start the backup container corresponding to the main container according to the updated configuration data.

[0063] When restarting the same container, the backup container can be the terminated main container. The execution subject can call the backup central service to implement the backup function of the central service and restart the same container, that is, the backup container corresponding to the main container, according to the updated configuration data.

[0064] Step S206, querying the startup time of the standby container, and determining that the standby container status data is restart failure in response to the startup time of the standby container being not greater than the start execution time, and determining that the standby container status data is restart success in response to the startup time of the standby container being greater than the start execution time.

[0065] When restarting the same container, the start execution time refers to the time when the main container terminated by the target process starts to provide external services, and the start time of the backup container refers to the time when the main container terminated by the target process starts to provide external services again.

[0066] When the primary and backup containers are switched and restarted, the start execution time refers to the time when the primary container terminated by the target process starts to provide external services, and the start time of the backup container refers to the time when the backup container corresponding to the primary container terminated by the target process starts and starts to provide external services.

[0067] Step S207: outputting the standby container status data.

[0068] The standby container status data can be accurately determined by the start time and start execution time of the standby container (that is, the time when the main container terminated by the target process starts to provide external services), which can improve the accuracy of related container processing.

[0069] Figure 31 is a schematic diagram of the overall process of a container processing method according to an embodiment of the present application. In the embodiment of the present application, the target process may be, for example, process No. 1, and kill 1 means terminating process No. 1, that is, terminating the target process. Figure 3 As shown in the figure, in the container disaster recovery scenario, the disaster recovery control platform sends requests to the container platforms of data centers A and B in a time sequence. Among them, the container platform of data center A contains the Pod corresponding to service a, which contains containers A, B, and C; the container platform of data center B contains the Pod corresponding to service a, which contains containers A, B, and C. In the specific execution, the disaster recovery control platform first stops the main center service (1. Update the container configuration group; 2. Send a command to the container; 3. Query the container status), and then starts the backup center service (1. Update the container configuration group; 2. Send a command to the container; 3. Query the container status).

[0070] Figure 4 Detailed flow chart of a container processing method according to an embodiment of the present application. Figure 4 As shown, in the container platform of the data center, Pod includes container A, container B and container C. Among them, container A is controlled by process No. 1. The execution subject sends kill 1 (i.e. terminate process No. 1) to the execution container through the interface service (API Server) on the disaster recovery management and control platform, that is, terminates process No. 1 to stop the main center service A container service. The interface service (API Server) receives the command result returned by container A and processes the returned result. If the returned result is a timeout or returns a preset identifier 137, it will retry to send kill 1 to complete the termination of the main center service A container service. At this time, the message that the processing return result is normal is directly obtained or the status of container A is queried through the interface service (API Server). The interface service (API Server) returns the container status, and the updated container startup time is judged based on this. If the container startup time is not greater than the start execution time, the restart fails. If the container startup time is greater than the start execution time, the restart is determined to be successful.

[0071] For example, in the containerized disaster recovery scenario, the disaster recovery management and control platform sends requests to the container platforms of the two data centers A and B in a time sequence. Stopping the main center service A container service is mainly divided into three steps: update the configuration of the container and set the flow control switch to not closed; send the kill 1 command to the container to kill the main process of the container, that is, process No. 1, and use the container's self-healing mechanism to restore the container; query the status of the container, check the start time of the container and compare it with the current time to determine whether the restart is successful. Starting the backup center service A container is also mainly divided into three steps: update the configuration of the container and set the flow control switch to not open; send the kill 1 (that is, terminate process No. 1) command to the container to kill the main process of the container, that is, process No. 1, and use the container's self-healing mechanism to restore the container; query the status of the container, check the start time of the container and compare it with the current time to determine whether the restart is successful.

[0072] In the embodiment of the present application, the disaster recovery management and control platform: integrates the application switching tools of the main center and the backup center in the case of multiple data centers. It includes scenarios such as simulation drills, actual combat drills, and disaster switching. The system can be smoothly switched and the business can be taken over within the time frame required by supervision to ensure business continuity. Container platform: similar to k8s, it is a container orchestration platform that automates the deployment, management, and expansion of containerized applications. Pod: It is the smallest scheduling unit in the container platform, and a Pod contains at least one container. Container: Contains operating system, programs, running resources, and other resources, and can be run independently in an isolated environment. Container self-healing: The container platform provides a state maintenance through the controller and the defined declarative configuration. When the resources in the platform do not meet the relevant status, the relevant resources will be automatically configured for recovery. If it does not exist, it will be newly created, and if it is abnormal, it will be destroyed and rebuilt.

[0073] The embodiment of the present application operates in isolation through processes, and the mode of controlling whether to provide services externally through parameters while realizing hot standby can effectively improve the switching efficiency and switching stability. The application is in hot standby state in the container platform. Through parameter control, the application does not undertake actual business requests in the disaster recovery center. During the disaster recovery switching process, it is necessary to modify the parameter configuration in the main center, then restart the service, and close the entrance. Modify the parameters in the backup center, then restart the service and open the entrance. Technically, the component service in the Linux container is fixedly started by process No. 1, and the abnormality of process No. 1 will cause the service abnormality. If the command kills process No. 1, the service will automatically restart under the self-recovery mechanism of the container platform service. Achieve low-cost container restart. This solution accurately restarts specific containers in the Pod, improves the efficiency of disaster recovery switching, and reduces the total switching time. Using the self-healing mechanism of the container platform, it can recover quickly when the main process of the container is abnormal. Using container restart instead of Pod restart reduces the scope of impact caused by the restart.

[0074] Figure 5Schematic diagram of the main units of the container processing device according to an embodiment of the present application. Figure 5 As shown, the container processing device 500 includes an acquisition unit 501 , a target process determination unit 502 , an update unit 503 , a self-healing unit 504 and a startup unit 505 .

[0075] The acquisition unit 501 is configured to acquire the corresponding container identifier and disaster recovery switching identifier in response to the container processing request.

[0076] The target process determining unit 502 is configured to obtain the state of the main container based on the container identifier, and determine the target process corresponding to the main container.

[0077] The updating unit 503 is configured to update the configuration data of the primary container in response to the state being the hot standby state and the disaster recovery switching flag corresponding to performing disaster recovery switching.

[0078] The self-healing unit 504 is configured to send a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, trigger the container self-healing mechanism to start the backup center service.

[0079] The starting unit 505 is configured to call the standby center service to start the standby container corresponding to the main container according to the updated configuration data and output the standby container status data.

[0080] In some embodiments, the target process determination unit 502 is further configured to: determine a main process corresponding to the main container, and determine the main process as a target process corresponding to the main container.

[0081] In some embodiments, the updating unit 503 is further configured to: obtain user requirement data and configuration data of a backup container corresponding to the primary container; and update the configuration data of the primary container based on the user requirement data and the configuration data of the backup container.

[0082] In some embodiments, the container processing device further includes Figure 5 The retry unit not shown in the figure is configured to: in response to the return command result being a timeout or an error code being returned, perform a retry to terminate the target process until the return command result is normal.

[0083] In some embodiments, the startup unit 505 is further configured to: query the startup time of the standby container, and determine that the standby container status data is a restart failure in response to the startup time of the standby container being not greater than the start execution time; and determine that the standby container status data is a restart success in response to the startup time of the standby container being greater than the start execution time.

[0084] In some embodiments, the self-healing unit 504 is further configured to: set the flow control switch corresponding to the main container to closed; and before outputting the backup container status data, the method is further configured to: set the flow control switch corresponding to the backup container corresponding to the main container to open.

[0085] It should be noted that the container processing method and the container processing device of the present application have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0086] Figure 6 An exemplary system architecture 600 is shown to which the container processing method or container processing apparatus according to the embodiment of the present application can be applied.

[0087] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, 603, network 604 and server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0088] The user can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0089] The terminal devices 601 , 602 , and 603 may be various electronic devices having a container processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0090] Server 605 can be a server that provides various services, such as a background management server that provides support for container processing requests submitted by users using terminal devices 601, 602, and 603 (only as an example). The background management server can respond to the container processing request, obtain the corresponding container identifier and disaster recovery switching identifier; based on the container identifier, obtain the status of the main container, and determine the target process corresponding to the main container; in response to the state being a hot standby state and the disaster recovery switching identifier corresponding to a disaster recovery switch, update the configuration data of the main container; send a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, trigger the container self-healing mechanism to start the backup center service; call the backup center service to start the backup container corresponding to the main container according to the updated configuration data and output the backup container status data. Improve the efficiency and switching stability of disaster recovery switching based on containers in the container platform and reduce the scope of impact.

[0091] It should be noted that the container processing method provided in the embodiment of the present application is generally executed by the server 605 , and accordingly, the container processing device is generally disposed in the server 605 .

[0092] It should be understood that Figure 6 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0093] Reference below Figure 7 , which shows a schematic diagram of the structure of a computer system 700 of a terminal device suitable for implementing an embodiment of the present application. Figure 7 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0094] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage part 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0095] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0096] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present application are executed.

[0097] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0098] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0099] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a target process determination unit, an update unit, a self-healing unit, and a startup unit. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0100] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device responds to the container processing request, obtains the corresponding container identifier and disaster recovery switching identifier; based on the container identifier, obtains the state of the main container, and determines the target process corresponding to the main container; in response to the state being the hot standby state and the disaster recovery switching identifier corresponding to the disaster recovery switching, updates the configuration data of the main container; sends a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, triggers the container self-healing mechanism to start the backup center service; calls the backup center service to start the backup container corresponding to the main container according to the updated configuration data and outputs the backup container status data.

[0101] The computer program product of the present application includes a computer program, and when the computer program is executed by a processor, the container processing method in the embodiment of the present application is implemented.

[0102] According to the technical solution of the embodiment of the present application, the efficiency and switching stability of disaster recovery switching based on containers in the container platform can be improved, and the impact scope can be reduced.

[0103] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A container processing method, characterized in that: include: In response to the container processing request, obtain a corresponding container identifier and a disaster recovery switching identifier; Based on the container identifier, obtaining the state of the main container and determining the target process corresponding to the main container; In response to the state being a hot standby state and the disaster recovery switching identifier corresponding to performing a disaster recovery switching, updating configuration data of the primary container; Sending a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, triggering a container self-healing mechanism to start the backup center service; The backup center service is called to start the backup container corresponding to the main container according to the updated configuration data and output the backup container status data.

2. The method according to claim 1, characterized in that: The determining the target process corresponding to the main container includes: A main process corresponding to the main container is determined, and the main process is determined as a target process corresponding to the main container.

3. The method according to claim 1, characterized in that The updating of the configuration data of the main container includes: Acquire user demand data and configuration data of a backup container corresponding to the main container; The configuration data of the main container is updated based on the user requirement data and the configuration data of the standby container.

4. The method according to claim 1, characterized in that: Before triggering the container self-healing mechanism, the method further includes: In response to the command result being timed out or an error code being returned, a retry is performed to terminate the target process until the command result is normal.

5. The method according to claim 1, characterized in that Before outputting the standby container status data, the method further includes: The startup time of the standby container is queried, and in response to the startup time of the standby container being not greater than the start execution time, the standby container status data is determined to be a restart failure, and in response to the startup time of the standby container being greater than the start execution time, the standby container status data is determined to be a restart success.

6. The method according to any one of claims 1 to 5, characterized in that Before sending the command to terminate the target process to the main container, the method further includes: Setting the flow control switch corresponding to the main container to off; and Before outputting the standby container status data, the method further includes: The flow control switch corresponding to the backup container corresponding to the main container is set to open.

7. A container processing device, characterized in that: include: An acquisition unit, configured to acquire a corresponding container identifier and a disaster recovery switching identifier in response to a container processing request; a target process determining unit, configured to obtain a state of a main container based on the container identifier, and determine a target process corresponding to the main container; an updating unit, configured to update the configuration data of the primary container in response to the state being a hot standby state and the disaster recovery switching identifier corresponding to performing a disaster recovery switching; A self-healing unit is configured to send a command to terminate the target process to the main container to stop the main center service, and in response to the termination of the target process, trigger a container self-healing mechanism to start the backup center service; The starting unit is configured to call the standby center service to start the standby container corresponding to the main container according to the updated configuration data and output the standby container status data.

8. The device according to claim 7, characterized in that The target process determination unit is further configured to: A main process corresponding to the main container is determined, and the main process is determined as a target process corresponding to the main container.

9. The device according to claim 7, characterized in that The updating unit is further configured to: Acquire user demand data and configuration data of a backup container corresponding to the main container; The configuration data of the main container is updated based on the user requirement data and the configuration data of the standby container.

10. The device according to claim 7, characterized in that The device further comprises a retry unit configured to: In response to the command result being timed out or an error code being returned, a retry is performed to terminate the target process until the command result is normal.

11. The device according to claim 7, characterized in that The startup unit is further configured to: The startup time of the standby container is queried, and in response to the startup time of the standby container being not greater than the start execution time, the standby container status data is determined to be a restart failure, and in response to the startup time of the standby container being greater than the start execution time, the standby container status data is determined to be a restart success.

12. The device according to any one of claims 7 to 11, characterized in that The self-healing unit is further configured to: Setting the flow control switch corresponding to the main container to off; and Before outputting the standby container status data, the method is further configured to: The flow control switch corresponding to the backup container corresponding to the main container is set to open.

13. A container processing electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

14. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.