IP Library Granted Patent US 12,710,954
Granted Patent B2
US 12,710,954 · App. 18/489,655 · Granted Aug 18, 2026

Container kernel upgrade methods and apparatuses based on programmable container kernel

Inventors: Yong He (Hangzhou, CN); Jianfeng Tan (Hangzhou, CN); Jiaqi Huang (Hangzhou, CN); Tiwei Bie (Hangzhou, CN); Tianyu Zhou (Hangzhou, CN); Anqi Shen (Hangzhou, CN); Xin Chen (Hangzhou, CN); Yan Yan (Hangzhou, CN)
Assignee: Alipay (Hangzhou) Information Technology Co., Ltd.
G06F8/65
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,710,954
App. No.
18/489,655
Granted
Aug 18, 2026
Kind
B2
Abstract

A container kernel upgrade based on a programmable container kernel, includes, in response to receiving a container kernel upgrade request, freezing an application container in which a to-be-upgraded first container kernel is located. Current container status data of an application container including first container kernel status data and application status data is stored. The application container is restarted by using a second container kernel used for upgrading a container kernel, where restarted container status data of the restarted application container includes second container kernel status data corresponding to the second container kernel when the application container is restarted. Using the stored current container status data, a corresponding data field is updated in a data structure of the restarted container status data. A container application is resumed running in the frozen application container in the restarted application container in response to completion of updating the restarted container status data.

Claims (71)

1 . A computer-implemented method for container kernel upgrade based on a programmable container kernel, comprising:

in response to receiving a container kernel upgrade request, freezing, as a frozen application container, an application container in which a to-be-upgraded first container kernel is located;

storing, as stored current container status data, current container status data of the application container, wherein the current container status data comprises first container kernel status data corresponding to a first container kernel and application status data of all applications running in the application container, and have a first data structure defined by the first container kernel, and wherein storing current container status data of the application container comprises storing the current container status data in a data file in a form of a container snapshot, wherein the container snapshot is generated by performing data serialization on the current container status data;

restarting, as a restarted application container, the application container by using a second container kernel used for upgrading a container kernel, wherein restarted container status data of the restarted application container comprises second container kernel status data corresponding to the second container kernel when the application container is restarted and has a second data structure defined by the second container kernel;

updating, using the stored current container status data, a corresponding data field in a data structure of the restarted container status data, wherein the stored current container status data and the restarted container status data are organized into a data tree, and comprising:

performing data deserialization on the container snapshot in the data file to restore, as restored current container status data, the stored current container status data; and

updating, using the restored current container status data, the corresponding data field in the data structure of the restarted container status data, wherein the update is performed on data nodes one by one from top to bottom and starting from a root data node of the data tree of the restarted container status data; and

in response to completion of updating the restarted container status data, resuming running of a container application in the frozen application container in the restarted application container.

2 . The computer-implemented method of claim 1 ,

wherein:

updating, by using the restored current container status data, the corresponding data field in the data structure of the restarted container status data, comprises:

performing, on data nodes one by one from top to bottom and starting from a root data node of the data tree of the restarted container status data, comprises:

determining whether a current data node has a corresponding data node in the data tree of the current container status data;

in response to that the data tree of the current container status data does not comprise the corresponding data node, skipping updating a data field part of the current data node;

in response to that the data tree of the current container status data comprises the corresponding data node, determining whether a data field of the current data node changes relative to the corresponding data node;

in response to that the data field of the current data node does not change relative to the corresponding data node, directly updating data field information of the current data node by using data field information of the corresponding data node; and

in response to that the data field of the current data node changes relative to the corresponding data node, updating the data field information of the current data node based on a specified policy by using the data field information of the corresponding data node.

3 . The computer-implemented method of claim 1 , wherein the data file comprises a memory file or a disk file.

4 . The computer-implemented method of claim 1 , wherein, before storing, as stored current container status data, current container status data of the application container:

disabling a packet receiving function of a driver cache of the application container; and

submitting a packet in the driver cache to the first container kernel.

5 . The computer-implemented method of claim 4 , wherein, before storing, as stored current container status data, current container status data of the application container:

discarding all cached data of the application container.

6 . The computer-implemented method of claim 1 , wherein, before storing current container status data of the application container:

performing abnormality detection on container status data corresponding to each container component in the current container status data of the application container; or

recording a system startup time and a current real time of the application container.

7 . The computer-implemented method of claim 1 , wherein, after updating, using the stored current container status data, the restarted container status data:

re-opening a host file that is set to open in the current container status data.

8 . The computer-implemented method of claim 7 , wherein, after updating, using the stored current container status data, the restarted container status data:

determining a system startup time of the application container; or

enabling a hardware transceiver function of the application container.

9 . A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform one or more operations for container kernel upgrade based on a programmable container kernel, comprising:

in response to receiving a container kernel upgrade request, freezing, as a frozen application container, an application container in which a to-be-upgraded first container kernel is located;

storing, as stored current container status data, current container status data of the application container, wherein the current container status data comprises first container kernel status data corresponding to a first container kernel and application status data of all applications running in the application container, and have a first data structure defined by the first container kernel, and wherein storing current container status data of the application container comprises storing the current container status data in a data file in a form of a container snapshot, wherein the container snapshot is generated by performing data serialization on the current container status data;

restarting, as a restarted application container, the application container by using a second container kernel used for upgrading a container kernel, wherein restarted container status data of the restarted application container comprises second container kernel status data corresponding to the second container kernel when the application container is restarted and has a second data structure defined by the second container kernel;

updating, using the stored current container status data, a corresponding data field in a data structure of the restarted container status data, wherein the stored current container status data and the restarted container status data are organized into a data tree, and comprising:

performing data deserialization on the container snapshot in the data file to restore, as restored current container status data, the stored current container status data; and

updating, using the restored current container status data, the corresponding data field in the data structure of the restarted container status data, wherein the update is performed on data nodes one by one from top to bottom and starting from a root data node of the data tree of the restarted container status data; and

in response to completion of updating the restarted container status data, resuming running of a container application in the frozen application container in the restarted application container.

10 . The non-transitory, computer-readable medium of claim 9 , wherein:

updating, by using the restored current container status data, the corresponding data field in the data structure of the restarted container status data, comprises:

performing, on data nodes one by one from top to bottom and starting from a root data node of the data tree of the restarted container status data:

determining whether a current data node has a corresponding data node in the data tree of the current container status data;

in response to that the data tree of the current container status data does not comprise the corresponding data node, skipping updating a data field part of the current data node;

in response to that the data tree of the current container status data comprises the corresponding data node, determining whether a data field of the current data node changes relative to the corresponding data node;

in response to that the data field of the current data node does not change relative to the corresponding data node, directly updating data field information of the current data node by using data field information of the corresponding data node; and

in response to that the data field of the current data node changes relative to the corresponding data node, updating the data field information of the current data node based on a specified policy by using the data field information of the corresponding data node.

11 . The non-transitory, computer-readable medium of claim 9 , wherein the data file comprises a memory file or a disk file.

12 . The non-transitory, computer-readable medium of claim 10 , wherein, before storing, as stored current container status data, current container status data of the application container:

disabling a packet receiving function of a driver cache of the application container; and

submitting a packet in the driver cache to the first container kernel.

13 . The non-transitory, computer-readable medium of claim 12 , wherein, before storing, as stored current container status data, current container status data of the application container:

discarding all cached data of the application container.

14 . The non-transitory, computer-readable medium of claim 9 , wherein, before storing current container status data of the application container:

performing abnormality detection on container status data corresponding to each container component in the current container status data of the application container; or

recording a system startup time and a current real time of the application container.

15 . The non-transitory, computer-readable medium of claim 9 , wherein, after updating, using the stored current container status data, the restarted container status data:

re-opening a host file that is set to open in the current container status data.

16 . The non-transitory, computer-readable medium of claim 15 , wherein, after updating, using the stored current container status data, the restarted container status data:

determining a system startup time of the application container; or

enabling a hardware transceiver function of the application container.

17 . A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations for container kernel upgrade based on a programmable container kernel, comprising:

in response to receiving a container kernel upgrade request, freezing, as a frozen application container, an application container in which a to-be-upgraded first container kernel is located;

storing, as stored current container status data, current container status data of the application container, wherein the current container status data comprises first container kernel status data corresponding to a first container kernel and application status data of all applications running in the application container, and have a first data structure defined by the first container kernel, and wherein storing current container status data of the application container comprises storing the current container status data in a data file in a form of a container snapshot, wherein the container snapshot is generated by performing data serialization on the current container status data;

restarting, as a restarted application container, the application container by using a second container kernel used for upgrading a container kernel, wherein restarted container status data of the restarted application container comprises second container kernel status data corresponding to the second container kernel when the application container is restarted and has a second data structure defined by the second container kernel;

updating, using the stored current container status data, a corresponding data field in a data structure of the restarted container status data, wherein the stored current container status data and the restarted container status data are organized into a data tree, and comprising:

performing data deserialization on the container snapshot in the data file to restore, as restored current container status data, the stored current container status data; and

updating, using the restored current container status data, the corresponding data field in the data structure of the restarted container status data, wherein the update is performed on data nodes one by one from top to bottom and starting from a root data node of the data tree of the restarted container status data; and

in response to completion of updating the restarted container status data, resuming running of a container application in the frozen application container in the restarted application container.