Search

WO-2026091868-A1 - CONTAINER PROCESS UPDATING METHOD AND APPARATUS, STORAGE MEDIUM AND ELECTRONIC DEVICE

WO2026091868A1WO 2026091868 A1WO2026091868 A1WO 2026091868A1WO-2026091868-A1

Abstract

A container process updating method, which is executed by an electronic device, and comprises: when a first container process is running, acquiring an update request for updating the first container process, the update request carrying resource acquisition data, the resource acquisition data being used for acquiring a first process resource, and the first process resource being used for updating the first container process (S202); in response to the update request, associating the first process resource obtained on the basis of the resource acquisition data with a process resource management directory, the process resource management directory being associated with a process resource of at least one container process managed by a process management component (S204); using the process management component to read the first process resource from the process resource management directory, and starting a second container process on the basis of the first process resource, the second container process being a container process after updating the first container process (S206); and sending, to the running second container process, resource access information of a service resource managed by the first container process, such that the second container process acquires the service resource by means of the resource access information (S208).

Inventors

  • WANG, CHENG
  • PENG, Lei
  • Sun, Yongfu

Assignees

  • 腾讯科技(深圳)有限公司

Dates

Publication Date
20260507
Application Date
20250904
Priority Date
20241029

Claims (15)

  1. A method for updating a container process, performed by an electronic device, includes: While the first container process is running, an update request for updating the first container process is obtained, wherein the update request carries resource acquisition data, the resource acquisition data is used to acquire resources of the first process, and the first process resources are used to update the first container process. In response to the update request, the first process resource obtained based on the resource acquisition data is associated with the process resource management directory, wherein the process resource management directory is associated with the process resources of at least one container process managed by the process management component; The process management component reads the first process resource from the process resource management directory and starts a second container process based on the first process resource, wherein the second container process is an updated container process of the first container process; and The resource access information of the business resources managed by the first container process is sent to the running second container process, so that the second container process can obtain the business resources through the resource access information.
  2. According to the method of claim 1, sending the resource access information of the business resources managed by the first container process to the running second container process includes: Create a process communication auxiliary object for the second container process, wherein the process communication auxiliary object is used to provide communication services between container processes; A process communication connection between the first container process and the second container process is created through the process communication auxiliary object; The resource access information of the business resources managed by the first container process is sent to the running second container process through the inter-process communication connection.
  3. According to the method described in claim 2, the process communication auxiliary object is a domain socket, which is a socket used for inter-process communication under the same operating system kernel.
  4. According to the method of claim 2 or 3, the step of sending the resource access information of the business resources managed by the first container process to the running second container process through the process communication connection includes: The link creation trigger event included in the resource access information is sent to the running second container process through the process communication connection. The link creation trigger event is used to create a data transmission link between the client and the container process when a link creation request is triggered. If the second container process determines that the link creation request has been triggered based on the link creation trigger event, a second data transmission link is created between the client and the second container process.
  5. According to the method of claim 4, the step of sending the resource access information of the business resources managed by the first container process to the running second container process through the process communication connection further includes: The link information of the first data transmission link and historical session messages included in the resource access information are sent to the running second container process through the process communication connection. The first data transmission link is a data transmission link created between the client and the first container process when the first container process determines that the link creation request has been triggered based on the link creation trigger event. The historical session messages are used to indicate the session messages that have been transmitted between the client and the first container process.
  6. According to claim 5, after sending the resource access information of the business resources managed by the first container process to the running second container process through the process communication connection, the method further includes: A trigger event is created to terminate the link for the first container process, and the first data transmission link is adjusted to a terminated communication state.
  7. According to any one of claims 1 to 6, associating the first process resource obtained based on the resource acquisition data with the process resource management directory includes: Obtain the storage path of the resources of the first process; If it is determined that the first process resource is managed by the process management component, the access address allocated to the first process resource is obtained from the process resource management directory; Associate the storage path with the access address.
  8. The method according to any one of claims 1 to 7, after sending the resource access information of the business resources managed by the first container process to the running second container process so that the second container process can obtain the business resources through the resource access information, further includes: If it is determined that the process resource management directory is associated with a second process resource of the first container process, the association between the second process resource and the process resource management directory is terminated. If the association between the second process resource and the process resource management directory is successfully severed, the first container process is terminated using the process management component.
  9. The method according to any one of claims 1 to 8, further comprising, before obtaining the update request for updating the first container process: Determine a first container for running the first container process; The process management component is configured as the master container in the container cluster where the first container resides, wherein the master container is used to manage each container in the container cluster.
  10. The method according to any one of claims 1 to 9, further comprising, after obtaining the update request for updating the first container process: If the resource acquisition data includes the process compressed resource of the first process resource, the process compressed resource is decompressed to obtain the first process resource.
  11. The method according to any one of claims 1 to 9, further comprising, after obtaining the update request for updating the first container process: If the resource acquisition data includes the resource storage address of the compressed process resource of the first process resource in the cloud storage server, a request message for requesting the compressed process resource is sent to the cloud storage server. Upon receiving the request message, the cloud storage server acquires the compressed process resource based on the resource storage address carried in the request message and sends the compressed process resource to the container runtime server, which is a server used to run the first container process. Upon receiving the compressed process resource sent by the cloud storage server, the compressed process resource is decompressed to obtain the first process resource.
  12. An apparatus for updating a container process, comprising: The acquisition unit is configured to acquire an update request for updating the first container process while the first container process is running, wherein the update request carries resource acquisition data, the resource acquisition data is used to acquire resources of the first process, and the first process resources are used to update the first container process. An association unit is configured to, in response to the update request, associate the first process resource obtained based on the resource acquisition data with the process resource management directory, wherein the process resource management directory is associated with the process resources of at least one container process managed by the process management component. A startup unit is configured to read the first process resource from the process resource management directory using the process management component, and start a second container process based on the first process resource, wherein the second container process is an updated container process of the first container process; and The sending unit is used to send the resource access information of the business resources managed by the first container process to the running second container process, so that the second container process can obtain the business resources through the resource access information.
  13. A computer-readable storage medium comprising a stored program, wherein the program, when executed by a processor, performs the method described in any one of claims 1 to 11.
  14. A computer program product comprising a computer program/instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 11.
  15. An electronic device includes a memory and a processor, the memory storing a computer program, the processor being configured to perform the method of any one of claims 1 to 11 via the computer program.

Description

Methods and apparatus for updating container processes, storage media and electronic devices Related applications This application claims priority to Chinese patent application filed on October 29, 2024, with application number 202411525762.3, entitled "Method and apparatus for updating container processes, storage medium and electronic device", the entire contents of which are incorporated herein by reference. Technical Field This application relates to the field of computers, and more specifically, to a method and apparatus for updating container processes, a storage medium, and an electronic device. Background Technology Kubernetes (K8s) is an open-source container orchestration platform that provides powerful, scalable, and flexible container orchestration capabilities. It can automate the deployment, scaling, and management of containerized applications, improve the efficiency of development and operations teams, reduce complexity, and ensure high availability and reliability of applications. To ensure the continued availability and security of applications, technicians using Kubernetes need to update applications, fix security vulnerabilities, optimize performance, or introduce new features as required, which necessitates updating the container processes within Kubernetes. Currently, the typical approach to updating container processes in Kubernetes is to first terminate the container process to be updated and clear all business resources associated with that process. Then, after acquiring the process resources of the updated container process, the updated container process is started and used to take over the business processes required by the containerized application before the update. However, during the update process using the above-mentioned container process update method, the containerized application process of the existing business will terminate. During the process termination, it will be unable to receive new business requests and process the business corresponding to the business requests, resulting in a technical problem of poor business upgrade continuity. There is currently no effective solution to the above problems. Summary of the Invention This application provides a method and apparatus for updating container processes, a storage medium, and an electronic device. On the one hand, a method for updating a container process, executed by an electronic device, includes: While the first container process is running, an update request for updating the first container process is obtained, wherein the update request carries resource acquisition data, the resource acquisition data is used to acquire resources of the first process, and the first process resources are used to update the first container process. In response to the update request, the first process resource obtained based on the resource acquisition data is associated with the process resource management directory, wherein the process resource management directory is associated with the process resources of at least one container process managed by the process management component; The process management component reads the first process resource from the process resource management directory and starts a second container process based on the first process resource, wherein the second container process is an updated container process of the first container process; and The resource access information of the business resources managed by the first container process is sent to the running second container process, so that the second container process can obtain the business resources through the resource access information. On the other hand, a container process update device is also provided, including: The acquisition unit is configured to acquire an update request for updating the first container process while the first container process is running, wherein the update request carries resource acquisition data, the resource acquisition data is used to acquire resources of the first process, and the first process resources are used to update the first container process. The association unit is configured to, in response to the update request, associate the first process resource obtained based on the resource acquisition data with the process resource management directory, wherein the process resource management directory is associated with the process resources of at least one container process managed by the process management component. A startup unit is configured to read the first process resource from the process resource management directory using the process management component, and start a second container process based on the first process resource, wherein the second container process is an updated container process of the first container process; and The sending unit is used to send the resource access information of the business resources managed by the first container process to the running second container proces