A method and system for realizing application containerization

By setting up the application container manufacturing library and dependency information library, the process of application containerization is simplified, the complexity of writing image files is solved, and the environmental consistency and standardization of applications on different platforms are achieved.

CN113821219BActive Publication Date: 2024-09-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202011277657.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-16
Publication Date
2024-09-20
Estimated Expiration
2040-11-16

AI Technical Summary

Technical Problem

When implementing application containerization, writing image files needs to contain the environment information of the application and its dependencies, which results in a huge workload and cannot be easily implemented. Especially because the installation instructions in different operating system environments are very different, the writing process is complicated. .

Method used

Set up an application container manufacturing library to store application components and dependency information, obtain components and dependency information by accessing the library, perform containerization settings, generate image files, simplify the writing process, and access and execute containers through server/client mode.

Benefits of technology

It realizes the simplification of application containerization, reduces the workload, ensures the consistency and standardization of the application environment on different platforms, and simplifies the setup and execution process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113821219B
    Figure CN113821219B
Patent Text Reader

Abstract

The present invention discloses a method and system for implementing application containerization. The embodiment of the present invention sets an application container manufacturing library to store components involved in the application and dependency information of the components involved in the application. When setting the image file corresponding to the application, the application container manufacturing library is accessed, and the components involved in the application and the dependency information of the components involved in the application are obtained from the application container manufacturing library. According to the dependency information of the components involved in the application, the components involved in the application are containerized to obtain the image file corresponding to the application. Furthermore, the dependency information of the components involved in the application includes dependency relationship information between the components involved in the application and the environment information on which the components involved in the application depend. In this way, the embodiment of the present invention can simply implement application containerization and reduce the workload.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for implementing application containerization. Background Art

[0002] In order to realize various application functions on a computer platform or a mobile terminal platform, it is usually necessary to set up an application program and load the set application program onto the computer platform or the mobile terminal platform for operation. Due to the different architectures of the platforms, even if the same application function is realized, the application programs loaded onto different platforms will be different. Each platform must be set up and loaded separately, which is very complicated. Therefore, in order to solve the above problems, the application program is containerized, the compiled application program is set in the application container, the application container engine is set on the platform, and the application program in the application container is directly called for execution. The application container eliminates the differences in the architectures of different platforms and the environment of the computer network, and ensures the environmental consistency and standardization of the application life cycle in the application container.

[0003] When implementing application containerization, the image method is used to build a standard development environment for the application container. After development is completed, the image file that encapsulates the complete environment and application is migrated on different platforms. The platform uses the application container engine to call and execute the application in the application container, which greatly simplifies the application setting and execution process. For different platforms, the application container is equivalent to a sandbox, and the application container is created through the image file.

[0004] Currently, application containers can be implemented using Docker, an open source application container engine that allows developers to package applications and environments into a portable image file, and then publish the image file to platforms with different architectures, such as Linux operating system or Windows operating system platforms. Docker can be used directly to access the image file, and application virtualization can also be achieved.

[0005] It can be seen that when implementing application containerization, the most important thing is to write an image file, such as writing a Dockerfile when using Docker. However, writing an image file requires not only writing the included application, but also including the environment information required by the application container on which the application depends. The process of writing an image file is like deploying an application environment for an operating system. The writer needs to master the version dependencies and installation steps of a large number of operating system libraries and application libraries involved, as well as the configuration and compilation methods of the application. Since the installation instructions under different operating system environments are also very different, for example, the Linux operating system (ubuntu) that mainly uses desktop applications uses aptinstall as the local installation instruction, and the community enterprise operating system (centos) uses yuminstall as the local installation instruction, etc., the workload is huge when writing an image file and it cannot be simply implemented. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a method for implementing application containerization, which can simply implement application containerization.

[0007] An embodiment of the present invention also provides a system for implementing application containerization, which can simply implement application containerization.

[0008] The embodiment of the present invention is implemented as follows:

[0009] A method for implementing application containerization includes:

[0010] Set up an application container manufacturing library to store components involved in the application and dependency information of components involved in the application;

[0011] When setting the image file corresponding to the application, access the application container manufacturing library, and obtain the components involved in the application and the dependency information of the components involved in the application from the application container manufacturing library;

[0012] According to the dependency information of the components involved in the application, the components involved in the application are containerized to obtain the image file corresponding to the application.

[0013] Preferably, the dependency information of the components involved in the application includes dependency relationship information between the components involved in the application and environment information on which the components involved in the application depend.

[0014] Preferably, the step of setting up containerization of the components involved in the application according to the dependency information of the components involved in the application further includes:

[0015] Get the components involved in the image file of the application that has been set up, and the history of the component dependency information;

[0016] When the components involved in the application are set as containers of the application, the components involved in the application and the dependency information of the components are matched from the historical records.

[0017] Preferably, the method further comprises: compiling the image file corresponding to the application to form an application container corresponding to the application;

[0018] The application container is accessed and executed using a server / client C / S mode.

[0019] A system for implementing application containerization includes: a container manufacturing library, a management unit, an order management unit, and a containerization setting unit, wherein:

[0020] The container manufacturing library is used to store the components involved in the application and the dependency information of the components involved in the application;

[0021] A management unit, used to extract and display components involved in the stored application and dependency information of the components involved in the application from the container manufacturing library;

[0022] An order management unit is used to request the image file corresponding to the application program to be set and send it to the containerization setting unit;

[0023] The containerization setting unit is used to receive a request for setting an image file corresponding to an application sent by an order management unit, and obtain components involved in the application and dependency information of components involved in the application from a container manufacturing library through the management unit; according to the dependency information of components involved in the application, the components involved in the application are containerized to obtain an image file corresponding to the application.

[0024] Preferably, the dependency information of the components involved in the application includes dependency relationship information between the components involved in the application and environment information on which the components involved in the application depend.

[0025] Preferably, the containerization setting unit is further used to obtain components involved in the image file of the application that has been set up, and a historical record of component dependency information;

[0026] When the components involved in the application are set as containers of the application, the components involved in the application and the dependency information of the components are matched from the historical records.

[0027] Preferably, the containerization setting unit is further used to compile the image file corresponding to the application to form an application container corresponding to the application;

[0028] The application container engine unit uses a C / S mode to access and execute the application container.

[0029] A device for implementing application containerization, comprising:

[0030] A memory; and a processor coupled to the memory, wherein the processor is configured to execute any of the above methods for implementing application containerization based on instructions stored in the memory.

[0031] A computer-readable storage medium, characterized in that a computer program is stored thereon, and when the program is executed by a processor, any of the above-mentioned methods for realizing application containerization is implemented.

[0032] As can be seen above, the embodiment of the present invention sets up an application container manufacturing library to store the components involved in the application and the dependency information of the components involved in the application. When the image file corresponding to the application is to be set, the application container manufacturing library is accessed, and the components involved in the application and the dependency information of the components involved in the application are obtained from the application container manufacturing library. According to the dependency information of the components involved in the application, the components involved in the application are containerized to obtain the image file corresponding to the application. Furthermore, the dependency information of the components involved in the application includes the dependency relationship information between the components involved in the application and the environment information on which the components involved in the application depend. In this way, the embodiment of the present invention can simply realize the containerization of the application and reduce the workload. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flow chart of a method for implementing application containerization provided by an embodiment of the present invention;

[0034] Figure 2 A schematic diagram of a system for implementing application containerization provided by an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of the DockerfileFactory architecture provided in an embodiment of the present invention;

[0036] Figure 4 A schematic diagram of the Recipe file structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0040] It can be seen from the background technology that when implementing application containerization, the image file corresponding to the application not only contains the application code itself, but also contains the environment information required by the application container on which the application depends, which places high demands on the technical requirements of the writing personnel, and the workload is huge when writing, and it cannot be simply implemented. In order to overcome the above problems, the embodiment of the present invention sets an application container manufacturing library to store the components involved in the application and the dependency information of the components involved in the application. When setting the image file corresponding to the application, the application container manufacturing library is accessed, and the components involved in the application and the dependency information of the components involved in the application are obtained from the application container manufacturing library. According to the dependency information of the components involved in the application, the components involved in the application are containerized to obtain the image file corresponding to the application.

[0041] Furthermore, the dependency information of the components of the application includes dependency information between the components of the application and environment information on which the components of the application depend. In this way, the embodiment of the present invention can simply implement application containerization and reduce workload.

[0042] Figure 1A flowchart of a method for implementing application containerization provided in an embodiment of the present invention, wherein the specific steps include:

[0043] Step 101: Set up an application container manufacturing library to store components involved in the application and dependency information of components involved in the application;

[0044] Step 102: When setting the image file corresponding to the application, access the application container manufacturing library, and obtain the components involved in the application and the dependency information of the components involved in the application from the application container manufacturing library;

[0045] Step 103: According to the dependency information of the components involved in the application, the components involved in the application are containerized to obtain an image file corresponding to the application.

[0046] In this method, the dependency information of the components involved in the application includes the dependency relationship information between the components involved in the application and the environment information on which the components involved in the application depend. In this way, the image file corresponding to the application can be constructed directly based on the application code itself extracted from the application container manufacturing library and the environment information required by the application container on which the application depends, which simplifies the writing process and saves workload.

[0047] In the method, the step of setting the components involved in the application as containers of the application according to the dependency information of the components involved in the application further includes:

[0048] Get the components involved in the image file of the application that has been set up, and the history of the component dependency information;

[0049] When the components involved in the application are set as containers of the application, the components involved in the application and the dependency information of the components are matched from the historical records.

[0050] The method further includes: compiling the image file corresponding to the application to form an application container corresponding to the application;

[0051] The application container is accessed and executed using a server / client (C / S) mode.

[0052] In this way, platforms with different architectures can directly access the application container in C / S mode, execute the corresponding image file, and implement the application's functional execution without having to load the application and then execute it, making the execution process seamless.

[0053] This method is applied in Docker.

[0054] Figure 2A schematic diagram of a system for implementing application containerization provided by an embodiment of the present invention includes: a container manufacturing library, a management unit, an order management unit, and a containerization setting unit, wherein:

[0055] The container manufacturing library is used to store the components involved in the application and the dependency information of the components involved in the application;

[0056] A management unit, used to extract and display components involved in the stored application and dependency information of the components involved in the application from the container manufacturing library;

[0057] An order management unit is used to request the image file corresponding to the application program to be set and send it to the containerization setting unit;

[0058] The containerization setting unit is used to receive a request for setting an image file corresponding to an application sent by an order management unit, and obtain components involved in the application and dependency information of components involved in the application from a container manufacturing library through the management unit; according to the dependency information of components involved in the application, the components involved in the application are containerized to obtain an image file corresponding to the application.

[0059] In the system, the dependency information of the components of the application includes dependency relationship information between the components of the application and environment information on which the components of the application depend.

[0060] In the system, the container manufacturing library includes a component module and a component dependency information module, wherein:

[0061] Component module, used to store components involved in the application;

[0062] The component dependency information module is used to store the dependency information of the application components.

[0063] In the system, the containerized setting unit is further used to obtain components involved in the image file of the application that has been set up, and a history record of dependency information of the components;

[0064] When the components involved in the application are set as containers of the application, the components involved in the application and the dependency information of the components are matched from the historical records.

[0065] In the system, the containerization setting unit is also used to compile the image file corresponding to the application to form an application container corresponding to the application;

[0066] The application container engine unit uses a server / client (C / S) mode to access and execute the application container.

[0067] The system is implemented using Docker.

[0068] The following is a specific example of using Docker to implement the application containerization process.

[0069] In this example, the image file corresponding to the application is automatically generated, namely the Dockerfile solution. The generated Dockerfile solution can be called DockerfileFactory, so that the writing staff can complete the construction of the image file corresponding to the application just like ordering dishes in a restaurant, while ignoring the dependency information between the complex components of the components (dishes) of each application, and the environment information (cooking) process on which the components of the application depend, thereby shielding the writing staff from the compilation and installation details of various applications.

[0070] In this example, the application container manufacturing library is DockerfileRecipe, which stores the components involved in the application and the dependency information of the components involved in the application, that is, it maintains the installation instruction fragments of various system libraries, software libraries and toolkits. The author selects the components required to set the container environment through the management unit, that is, DockerfileMenu to form an order "DockerfileOrder", and DockerfileFactory selects the operating system, software library, and automatically solves the software dependency according to the menu defined by the author to generate Dockerfile. Furthermore, the written Dockerfile can also be compiled to form a compiled image file.

[0071] Figure 3 The schematic diagram of the DockerfileFactory architecture provided for the embodiment of the present invention includes: a recipe management unit (RecipeManager), a menu management module (MenuManger), an order management module (OrderManager) and DockerfileMaker, wherein the recipe management unit (RecipeManager) includes recipes (Recipes) and recipe dependencies (Recipe dependency), Recipes include components involved in the application, and Recipe dependency includes dependency information of components involved in the application.

[0072] Specifically, Recipes are used to include fine-grained software and library installation configuration instructions required by an application.

[0073] In this example, recipe files are defined as text files with the suffix df. Figure 4The structure diagram of the recipe file provided by the embodiment of the present invention is shown in the figure. The structure of the recipe file includes: number, required operating system, recipe summary and recipe file suffix. The content of the recipe file needs to include comments and instructions. If the instruction has parameters, the default value is marked.

[0074] RecipeManager is responsible for managing recipes and recipe dependencies.

[0075] MenuManger provides an interface for OrderManager to display the components involved in the optional application. Each component corresponds to a Recipe file to complete the corresponding installation and environment configuration functions.

[0076] OrderManager mainly provides two functions. The main one is to support the author to request orders based on the component list provided by MenuManger. The second function is to manage the author's Dockerfile history, which can be called directly.

[0077] After receiving the DockerfileOder submitted by the author, DockerfileMaker queries the components and dependencies of the selected application through MenuManager to RecipeManager, determines and selects the appropriate dependent components based on auxiliary information such as the operating system type and data type, and builds the Dockerfile. In this process, the most matching components and their dependencies can be found from the Dockerfile history records, and the existing Dockerfile can be reused to the greatest extent to reduce the workload and working time when building the Dockerfile.

[0078] It can be seen that the DockerfileFacktory of the embodiment of the present invention can store a large amount of system configuration and installation process of an application as general knowledge in the form of a Recipe file. When a new container environment is required, a complete and streamlined containerized configuration of the application can be automatically built and a Dockerfile can be output based on the input of a small amount of known necessary information.

[0079] The embodiment of the present application also provides a computer-readable medium, the computer-readable storage medium stores instructions, and the instructions can execute the steps in the method for implementing application containerization as described above when executed by a processor. In practical applications, the computer-readable medium may be included in the device / device / system described in the above embodiment, or it may exist alone without being assembled into the device / device / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the implementation method for implementing application containerization described in the above embodiments can be implemented. According to the embodiment disclosed in the present application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, it may include but is not limited to: 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), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, but it is not used to limit the scope of protection of the present application. In the embodiment disclosed in the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it.

[0080] The embodiment of the present invention further provides an electronic device, in which the device for implementing the method of the embodiment of the present application can be integrated. Specifically:

[0081] The electronic device may include a processor with one or more processing cores, a memory with one or more computer-readable storage media, and a computer program stored in the memory and executable on the processor. When executing the program in the memory, the above-mentioned method for realizing application containerization may be implemented.

[0082] Specifically, in practical applications, the electronic device may further include components such as a power supply, an input unit, and an output unit. Those skilled in the art will appreciate that the structure of the electronic device in the embodiment of the present invention does not limit the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0083] The processor is the control center of the electronic device. It uses various interfaces and lines to connect the various parts of the entire electronic device. It performs various functions of the server and processes data by running or executing software programs and / or modules stored in the memory, and calling data stored in the memory, thereby monitoring the electronic device as a whole.

[0084] The memory can be used to store software programs and modules, that is, the above-mentioned computer-readable storage medium. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the server, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.

[0085] The electronic device also includes a power supply for supplying power to various components, which can be logically connected to the processor through a power management system, so as to manage charging, discharging, and power consumption through the power management system. The power supply can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0086] The electronic device may further include an input unit, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0087] The electronic device may further include an output unit, which may be used to display information input by a user or information provided to a user and various graphical user interfaces, which may be composed of graphics, texts, icons, videos and any combination thereof.

[0088] The flow chart and block diagram in the accompanying drawings of the present application show the possible architecture, function and operation of the system, method and computer program product according to the various embodiments disclosed in 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 implementations as replacements, the functions marked in the box can also occur in the order of the standards in different figures. For example, the boxes represented by two connections 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 the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0089] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present application. In particular, without departing from the spirit and teachings of the present application, the features described in the various embodiments and / or claims of the present application may be combined and / or combined in a variety of ways, and all of these combinations and / or combinations fall within the scope disclosed in the present application.

[0090] Specific embodiments are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas, and is not used to limit the present application. For those skilled in the art, changes can be made in the specific implementation methods and application scopes according to the ideas, spirits and principles of the present invention, and any modifications, equivalent substitutions, improvements, etc. made therein should be included in the scope of protection of this application.

Claims

1. A method for implementing application containerization, characterized in that: include: An application container manufacturing library is set up to store components involved in the application and dependency information of components involved in the application; wherein each of the components corresponds to a recipe file, and the recipe file includes fine-grained software and library installation configuration instructions required by the application; the structure of the recipe file includes: number, required operating system, recipe summary and recipe file suffix; the recipe file is used to complete the corresponding installation and environment configuration functions; When setting the image file corresponding to the application, access the application container manufacturing library, and obtain the components involved in the application and the dependency information of the components involved in the application from the application container manufacturing library; According to the dependency information of the components involved in the application, the components involved in the application are containerized to obtain the image file corresponding to the application.

2. The method according to claim 1, characterized in that The dependency information of the components of the application includes dependency relationship information between the components of the application and environment information on which the components of the application depend.

3. The method according to claim 1, characterized in that The step of setting the components involved in the application as containers according to the dependency information of the components involved in the application further includes: Get the components involved in the image file of the application that has been set up, and the history of the component dependency information; When the components involved in the application are set as containers of the application, the components involved in the application and the dependency information of the components are matched from the historical records.

4. The method according to claim 1, characterized in that The method further includes: compiling an image file corresponding to the application to form an application container corresponding to the application; The application container is accessed and executed using a server / client C / S mode.

5. A system for implementing application containerization, characterized in that: include: Container manufacturing library, management unit, order management unit and containerization setting unit, among which, A container manufacturing library is used to store components involved in an application and dependency information of components involved in the application; wherein each of the components corresponds to a recipe file, and the recipe file includes fine-grained software and library installation configuration instructions required by the application; the structure of the recipe file includes: number, required operating system, recipe summary and recipe file suffix; the recipe file is used to complete the corresponding installation and environment configuration functions; A management unit, used to extract and display components involved in the stored application and dependency information of the components involved in the application from the container manufacturing library; An order management unit is used to request the image file corresponding to the application program to be set and send it to the containerization setting unit; The containerization setting unit is used to receive a request for setting an image file corresponding to an application sent by an order management unit, and obtain components involved in the application and dependency information of components involved in the application from a container manufacturing library through the management unit; according to the dependency information of components involved in the application, the components involved in the application are containerized to obtain an image file corresponding to the application.

6. The system according to claim 5, characterized in that The dependency information of the components of the application includes dependency relationship information between the components of the application and environment information on which the components of the application depend.

7. The system according to claim 5, characterized in that The containerization setting unit is further used to obtain components involved in the image file of the application that has been set up, and a historical record of component dependency information; When the components involved in the application are set as containers of the application, the components involved in the application and the dependency information of the components are matched from the historical records.

8. The system according to claim 5, characterized in that The containerization setting unit is further used to compile the image file corresponding to the application to form an application container corresponding to the application; The application container engine unit uses a C / S mode to access and execute the application container.

9. A device for implementing application containerization, characterized in that: include: Memory; And a processor coupled to the memory, wherein the processor is configured to execute the method for implementing application containerization as described in any one of claims 1 to 4 based on instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method for realizing application containerization as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Deployment system and deployment method of application program

    CN105867955A

  • Method and device for containerizing application program

    CN108920250A

  • Mirror file management method and system, device, and storage medium

    CN109144880A

  • Method for deploying cloud management platform in micro-service manner

    CN109218091A

  • A component deployment method and device

    CN109597626A