Container-based service method, device and computer program product
By separating container application images into basic mirroring and dependency libraries, and allocating storage locations on edge nodes and cloud devices, the problem that edge node devices cannot deploy container applications in large quantities is solved, and high-density container application deployment and edge computing are fully applied.
Patent Information
- Application Number
- CN202411795081.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-04-18
AI Technical Summary
Edge node devices cannot deploy container applications in large quantities, resulting in insufficient application in edge computing scenarios.
By separating the application image of traditional container applications into two parts: basic container image and dependency library, the basic container image is stored on edge node devices and the dependency library is on cloud devices. Edge node devices obtain dependency libraries provided by cloud devices and combine them with local basic container images to generate application images to provide services.
High-density deployment of container applications on edge node devices is realized, reducing the space occupied by container applications, so that container technology can be applied more fully in edge computing scenarios.
Smart Images

Figure CN119847670A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud technology, and in particular to a container-based service method, device, and computer program product. Background Art
[0002] With the explosive development of Internet applications, traditional virtualization technology has been gradually replaced by container (Docker) technology due to its shortcomings such as slow cold start and high resource usage. Compared with virtual machines, containers have advantages such as short startup time and low performance loss, and play a vital role in the current agile development model.
[0003] Although container images have been greatly reduced in size compared to traditional virtual machines, they are still relatively large for current edge node devices. This results in a small number of container applications that can be deployed simultaneously on edge nodes, and they cannot be fully applied to edge computing scenarios. Summary of the invention
[0004] The purpose of this application is to provide a container-based service method, device and computer program product, which can solve the problem that edge node devices cannot deploy container applications in large quantities.
[0005] In order to achieve the above purpose, the embodiment of the present application is implemented as follows: In a first aspect, a container-based service method is provided, which is applied to an edge node device, wherein the edge node device is deployed with at least one container application and stores a basic container image of the at least one container application, wherein the basic container image is obtained by separating a dependent library from a corresponding container application, and the method comprises: Obtaining a dependency library of a target container application from a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the target container application belongs to the at least one container application; Generate an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependent library of the target container application; Run the application image of the target container application to provide a service corresponding to the target container application.
[0006] In a second aspect, a container-based service method is provided, which is applied to a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the method includes: In response to a service request of a target container application initiated by a user, obtaining a locally stored dependency library of the target container application, where the target container application belongs to the at least one container application; Sending a dependency library of a target container application to an edge node device, so that the edge node device generates an application image of the target container application based on a locally stored base container image of the target container application and an acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores a base container image of the at least one container application.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, cause the processor to execute the method described in the first aspect or the second aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the method described in the first aspect or the second aspect.
[0009] The embodiment of the present application separates the application image of the traditional container application into two parts: the basic container image and the dependent library. The basic container image part is stored in the database of the edge node device. The dependent library part is stored in the database of the cloud device. For the edge node device, the space occupied by the container application is greatly reduced, so high-density container application deployment can be achieved. Correspondingly, the local database of the cloud device records the dependent libraries of all container applications deployed by the edge node device. In related applications, when the user needs to use the service of the target container application, a service request for the target container application can be sent to the cloud device. Afterwards, the cloud device responds to the user's service request, obtains the dependent library of the target container application from the local database, and sends the dependent library of the target container application to the edge node device. Correspondingly, the edge node device further restores the application image of the traditional target container application based on the basic container image of the local target container application and the received basic container image of the target container application to run and provide services. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0011] Figure 1 A schematic diagram of a container application operation mode according to an embodiment of the present application.
[0012] Figure 2 This is a flow chart of the container-based service method according to an embodiment of the present application applied to an edge node device side.
[0013] Figure 3 This is a flow chart of the container-based service method according to an embodiment of the present application applied to a cloud device side.
[0014] Figure 4 A schematic diagram of determining a dependent library for a container-based service method according to an embodiment of the present application.
[0015] Figure 5 This is a schematic diagram of the structure of an edge node device according to an embodiment of the present application.
[0016] Figure 6 A schematic diagram of the structure of a cloud device according to an embodiment of the present application.
[0017] Figure 7 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0019] This application proposes a container-based service solution, which aims to separate the application image of the traditional container application into two parts: the basic container image and the dependent library. The basic container image part is stored in the database of the edge node device. The dependent library part is stored in the database of the cloud device. For the edge node device, the space occupied by the container application is greatly reduced, so high-density container application deployment can be achieved. Correspondingly, the local database of the cloud device records the dependent libraries of all container applications deployed by the edge node device. In related applications, refer to Figure 1 As shown, when the user needs to use the service of the target container application, he can send a service request for the target container application to the cloud device. After that, the cloud device responds to the user's service request, obtains the dependency library of the target container application from the local database, and sends the dependency library of the target container application to the edge node device. Correspondingly, the edge node device further restores the application image of the traditional target container application based on the basic container image of the local target container application and the received basic container image of the target container application to run the target container application.
[0020] based on Figure 1 The container application operation mode shown. On the one hand, the present application proposes a container-based service method. Figure 1 This is a flow chart of the service method applied to the edge node device side, including the following steps: S102: Obtain a dependency library of a target container application from a cloud device. The cloud device stores a dependency library of at least one container application, and the target container application belongs to at least one container application.
[0021] Dependent libraries are software libraries or frameworks required by container applications at runtime or compile time. They are used to provide the functions and services required by the application so that the container application can run normally.
[0022] In this embodiment, the dependent library of the target container application is determined based on the behavior record of the application image of the target container application when testing the application image of the target container application. The behavior record may include, but is not limited to, file call records and / or system call records. Correspondingly, the base container image of the target container application is obtained by separating the dependent library from the corresponding target container application.
[0023] That is, the basic container image is equivalent to a lightweight image after removing the dependent libraries.
[0024] S104: Generate an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependency library of the target container application.
[0025] S106: Run the application image of the target container application to provide a service corresponding to the target container application.
[0026] It should be noted that the target container application can provide more than one service, and this embodiment does not specifically limit this.
[0027] Correspondingly, Figure 2 This is a flow chart of the service method applied to the cloud device side, which specifically includes the following steps: S202, in response to a service request of a target container application initiated by a user, obtaining a locally stored dependency library of the target container application, where the target container application belongs to at least one container application.
[0028] Specifically, before obtaining the locally stored dependency library of the target container application, the cloud device may test the application image of the target container application to determine the dependency library of the target container application based on the behavior record of the application image of the target container application during the test. The behavior record may include, but is not limited to, file call records and / or system call records.
[0029] As an example introduction, Figure 4This is a flowchart for testing the application image of the container application. First, a monitoring program for monitoring the container behavior is implanted in the application image of the traditional container application. Next. The application image of the container application is started to test according to the test rules specified by the user. During the test, the container behavior collected by the monitoring program is added to the behavior database for storage. Finally, after the test is completed, all container behaviors are retrieved from the behavior database for analysis to determine the corresponding dependent libraries. Among them, if multiple dependent libraries are determined, they are represented in the form of a dependent library list.
[0030] S204, sending the dependency library of the target container application to the edge node device, so that the edge node device generates an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores at least one basic container image of the container application.
[0031] In addition, corresponding to Figure 2 Another embodiment of this embodiment further provides an edge node device, which is deployed with at least one container application and stores a basic container image of the at least one container application, wherein the basic container image is obtained by separating the dependent library from the corresponding container application, and the edge node device. Figure 5 is a schematic diagram of the structure of the edge node device 500, including: The acquisition module 510 is used to acquire a dependency library of a target container application from a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the target container application belongs to the at least one container application.
[0032] The combination module 520 is used to generate an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependent library of the target container application.
[0033] The running module 530 is used to run the application image of the target container application to provide the service corresponding to the target container application.
[0034] Optionally, the dependent library of the target container application is determined based on a behavior record of the application image of the target container application when the application image of the target container application is tested. The behavior record includes a file call record and / or a system call record.
[0035] It should be noted that the edge node device of this embodiment can be used as Figure 2 The execution subject of the method shown can thus realize Figure 1 The steps and functions in the method shown.
[0036] In addition, corresponding to Figure 3 Another embodiment of this embodiment further provides a cloud device, which stores at least one dependency library of a container application. Figure 6 Schematic diagram of the structure of the cloud device 600, including: The response module 610 is used to respond to a service request of a target container application initiated by a user, and obtain a locally stored dependency library of the target container application, where the target container application belongs to the at least one container application.
[0037] The sending module 620 is used to send the dependency library of the target container application to the edge node device, so that the edge node device generates an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores the basic container image of the at least one container application.
[0038] Optionally, before obtaining the locally stored dependency library of the target container application, the response module 610 is further used to: test the application image of the target container application to determine the dependency library of the target container application based on the behavior record of the application image of the target container application during the test.
[0039] Optionally, the behavior record includes a file call record and / or a system call record.
[0040] It should be noted that the cloud device of this embodiment can be used as Figure 3 The execution subject of the method shown can thus realize Figure 1 The steps and functions in the method shown.
[0041] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0042] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0043] The memory is used to store the computer program. Specifically, the computer program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides the computer program to the processor.
[0044] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming the above-mentioned Figure 5 The edge node device shown. Correspondingly, the processor executes the program stored in the memory and is specifically used to perform the following operations: Obtaining a dependency library of a target container application from a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the target container application belongs to the at least one container application; Generate an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependent library of the target container application; Run the application image of the target container application to provide a service corresponding to the target container application.
[0045] Alternatively, the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming the above-mentioned Figure 6 The cloud device shown. Correspondingly, the processor executes the program stored in the memory and is specifically used to perform the following operations: In response to a service request of a target container application initiated by a user, a locally stored dependency library of the target container application is acquired, where the target container application belongs to the at least one container application.
[0046] Sending a dependency library of a target container application to an edge node device, so that the edge node device generates an application image of the target container application based on a locally stored base container image of the target container application and an acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores a base container image of the at least one container application.
[0047] The above is as in this manual Figure 2 The method disclosed in the embodiment shown in or 3 can be applied to a processor and implemented by the processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0048] Of course, in addition to software implementation, the electronic device of this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0049] Furthermore, one embodiment of the present application provides a computer program product, which includes a computer-readable storage medium storing a computer program.
[0050] The computer program is operable to cause the computer to execute Figure 2 The steps in the method shown include: Obtain a dependency library of a target container application from a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the target container application belongs to the at least one container application.
[0051] Based on the locally stored base container image of the target container application and the acquired dependent library of the target container application, an application image of the target container application is generated.
[0052] Run the application image of the target container application to provide a service corresponding to the target container application.
[0053] Alternatively, the computer program may be operable to cause a computer to execute Figure 3 The steps in the method shown include: In response to a service request of a target container application initiated by a user, a locally stored dependency library of the target container application is acquired, where the target container application belongs to the at least one container application.
[0054] Sending a dependency library of a target container application to an edge node device, so that the edge node device generates an application image of the target container application based on a locally stored base container image of the target container application and an acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores a base container image of the at least one container application.
[0055] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0056] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0057] The above are only embodiments of this specification and are not intended to limit this specification. For those skilled in the art, this specification may be subject to various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims of this specification. In addition, all other embodiments obtained by ordinary technicians in this field without creative work shall fall within the scope of protection of this document.
Claims
1. A container-based service method, applied to edge node devices, characterized in that: The edge node device is deployed with at least one container application and stores a basic container image of the at least one container application, wherein the basic container image is obtained by separating a dependent library from a corresponding container application, and the method includes: Obtaining a dependency library of a target container application from a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the target container application belongs to the at least one container application; Generate an application image of the target container application based on the locally stored basic container image of the target container application and the acquired dependent library of the target container application; Run the application image of the target container application to provide a service corresponding to the target container application.
2. The method according to claim 1, characterized in that The dependent library of the target container application is determined based on the behavior record of the application image of the target container application when the application image of the target container application is tested.
3. The method according to claim 2, characterized in that The behavior record includes a file call record and / or a system call record.
4. A container-based service method, applied to a cloud device, characterized in that: The cloud device stores at least one dependency library of a container application, and the method includes: In response to a service request of a target container application initiated by a user, obtaining a locally stored dependency library of the target container application, where the target container application belongs to the at least one container application; Sending a dependency library of a target container application to an edge node device, so that the edge node device generates an application image of the target container application based on a locally stored base container image of the target container application and an acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores a base container image of the at least one container application.
5. The method according to claim 4, characterized in that Before obtaining the locally stored dependency library of the target container application in response to the service request of the target container application initiated by the user, the method further includes: The application image of the target container application is tested to determine a dependent library of the target container application based on a behavior record of the application image of the target container application during the test.
6. The method according to claim 5, characterized in that The behavior record includes a file call record and / or a system call record.
7. An edge node device, characterized in that: The edge node device is deployed with at least one container application and stores a basic container image of the at least one container application, wherein the basic container image is obtained by separating a dependent library from the corresponding container application, and the edge node device includes: An acquisition module, configured to acquire a dependency library of a target container application from a cloud device, wherein the cloud device stores a dependency library of at least one container application, and the target container application belongs to the at least one container application; A combination module, used to generate an application image of the target container application based on a locally stored base container image of the target container application and an acquired dependency library of the target container application; The running module is used to run the application image of the target container application to provide the service corresponding to the target container application.
8. A cloud device, characterized in that: The cloud device stores at least one dependency library of a container application, and the cloud device includes: a response module, configured to respond to a service request of a target container application initiated by a user and obtain a locally stored dependency library of the target container application, wherein the target container application belongs to the at least one container application; A sending module is used to send a dependency library of a target container application to an edge node device, so that the edge node device generates an application image of the target container application based on a locally stored basic container image of the target container application and an acquired dependency library of the target container application; wherein the edge node device is deployed with at least one container application and stores a basic container image of the at least one container application.
9. An electronic device, comprising: processor; and a memory arranged to store computer executable instructions which, when executed, cause the processor to perform a method as claimed in any one of claims 1 to 6.
10. A computer program product, comprising a computer-readable storage medium storing a computer program, wherein the computer program is operable to cause a computer to execute the method according to any one of claims 1 to 6.