Software resource management method, device, storage medium and computer equipment

By building a mirror warehouse in the Docker environment, creating containers based on image management strategies, performing network connections and data management, as well as real-time monitoring and resource adjustment, the problems of resource allocation imbalance, management complexity and inefficiency in large-scale software resource management are solved, and efficient and flexible software resource management is achieved.

CN119759378APending Publication Date: 2025-04-04GUANGZHOU SAITE INTELLIGENCE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510052998.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

Docker technology faces problems such as resource allocation imbalance, surge in management complexity and inefficient deployment when dealing with large-scale software resources, resulting in greater limitations in software resource management.

Method used

By deploying the target Docker environment and building a mirror warehouse, the software images corresponding to the custom configuration files are pulled from the warehouse based on the image management strategy for container creation, network communication components are used for network connection between containers, and data management is carried out through digital volumes, and the container status is monitored in real time and resources are adjusted.

Benefits of technology

It realizes the rapid pulling and use of software images, improves resource reusability and management efficiency, avoids resource waste, improves the speed and flexibility of software deployment, and improves resource utilization through dynamic optimization of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759378A_ABST
    Figure CN119759378A_ABST
Patent Text Reader

Abstract

The software resource management method, device, storage medium and computer equipment provided by the present application first deploy a target Docker environment when performing software resource management, and build an image repository based on the environment to centrally manage software images of various types and versions; then, based on the image management strategy, pull the software image corresponding to the custom configuration file from the image repository to allocate software resources on demand to create containers, thereby improving the speed and flexibility of software management; then, use network communication components to establish network connections between containers, and manage data for each container through digital volumes, thereby promoting the collaborative work between different service components under the microservice architecture, and further enhancing the flexibility and security of software resource management; finally, the operating status of each container can be monitored in real time, and software resources can be dynamically adjusted according to the monitoring results to improve resource utilization, thereby improving the application efficiency of Docker technology in software resource management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a software resource management method, device, storage medium and computer equipment. Background Art

[0002] With the continuous evolution of cloud computing and virtualization technology, software containerization technology has become the mainstream trend in the industry. Among them, Docker, as a popular open source application container engine, plays a core role in the entire life cycle of software development, from coding, testing to deployment and operation and maintenance, with its lightweight architecture, high portability and convenient management features.

[0003] However, in practical applications, especially when dealing with large-scale software resources, Docker technology faces problems such as unbalanced resource allocation, increased management complexity, and low deployment efficiency. This not only affects the comprehensive promotion of containerization technology, but also puts higher requirements on the effective management and optimization of software resources, resulting in greater limitations of Docker technology in software resource management. Summary of the invention

[0004] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defects that the Docker technology in the prior art faces such as unbalanced resource allocation, increased management complexity and low deployment efficiency, which leads to great limitations in software resource management.

[0005] The present application provides a software resource management method, the method comprising:

[0006] Deploy a target Docker environment and build an image repository based on the target Docker environment; the image repository stores multiple different types of software images;

[0007] Pulling the software image corresponding to the custom configuration file from the image warehouse based on the image management strategy to create a container, thereby obtaining multiple Docker containers;

[0008] Use network communication components to establish network connections between various Docker containers, and manage data for each Docker container through digital volumes;

[0009] Monitor the running status of each Docker container in real time, and adjust the software resources of the target Docker environment according to the monitoring results.

[0010] Optionally, the deployment target Docker environment includes:

[0011] Determine the target virtual system and environment configuration script file;

[0012] The dependent libraries in the environment configuration script file are configured and installed in the target virtual system to obtain a target Docker environment.

[0013] Optionally, building an image repository based on the target Docker environment includes:

[0014] Configure the image acceleration service based on the target Docker environment and build an empty initial warehouse;

[0015] Downloading from the image source through the image acceleration service to obtain multiple software images, and determining the image version of each software image;

[0016] Label each software image based on each image version, and add each labeled software image to the initial warehouse to obtain an image warehouse.

[0017] Optionally, the step of pulling a software image corresponding to a custom configuration file from the image repository based on an image management policy to create a container, to obtain multiple Docker containers, includes:

[0018] Perform image parsing on the custom configuration file entered by the user, and directly pull the corresponding software image from the image repository based on the parsing result;

[0019] Start the same number of container instances as the pulled software images, and use each pulled software image to initialize each container instance in turn;

[0020] After the software resources are allocated to each initialized container instance, it is started and runs to form multiple Docker containers.

[0021] Optionally, the adopting of a network communication component to establish a network connection between the various Docker containers includes:

[0022] Create a Flannel configuration file; the Flannel configuration file is set with subnet information of each Docker container;

[0023] Execute the Flannel configuration file to convert each subnet information into startup parameters of each Docker container;

[0024] The Docker operation parameter file is edited based on each startup parameter, and the network configuration of the target Docker environment is restarted based on the Docker operation parameter file, so that network connections are established between each Docker container.

[0025] Optionally, managing data of each Docker container by using a digital volume includes:

[0026] Data volumes are used to persist and share data between Docker containers, and data is mounted and synchronized for each Docker container.

[0027] Optionally, adjusting the software resources of the target Docker environment according to the monitoring result includes:

[0028] Determine whether there is abnormal data in the monitoring result;

[0029] If so, determining the performance indicator corresponding to the abnormal data and the resource adjustment strategy corresponding to the performance indicator, and adjusting the software resources of the target Docker environment based on the resource adjustment strategy;

[0030] If not, continue to monitor the running status of each Docker container.

[0031] The present application also provides a software resource management device, comprising:

[0032] An environment deployment module is used to deploy a target Docker environment and build an image repository based on the target Docker environment; the image repository stores multiple different types of software images;

[0033] A container creation module is used to pull the software image corresponding to the custom configuration file from the image warehouse based on the image management policy to create a container, thereby obtaining multiple Docker containers;

[0034] A data management module, used to establish network connections between various Docker containers using network communication components, and to manage data of various Docker containers through digital volumes;

[0035] The resource adjustment module is used to monitor the running status of each Docker container in real time and adjust the software resources of the target Docker environment according to the monitoring results.

[0036] The present application also provides a storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the software resource management method as described in any one of the above embodiments.

[0037] The present application also provides a computer device, comprising: one or more processors, and a memory;

[0038] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the software resource management method described in any one of the above embodiments are performed.

[0039] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0040] The software resource management method, device, storage medium and computer equipment provided by the present application can first deploy a standardized and highly isolated target Docker environment when performing software resource management, and build an image warehouse based on the target Docker environment to centrally manage various types of software images, so that software images can be quickly pulled and used later, thereby improving the reusability and management efficiency of software resources; then, based on the image management strategy, the software image corresponding to the custom configuration file can be pulled from the image warehouse to create a container, and multiple Docker containers can be obtained. Here, the image management strategy can be used to allocate software resources on demand during the container creation process, thereby avoiding resource waste and improving the speed and flexibility of software deployment. After the container is created, network communication components can be used to establish network connections between Docker containers, and digital volumes can be used to manage data for each Docker container, allowing containers to communicate efficiently and securely, promoting collaboration between different service components under the microservice architecture, and further enhancing the flexibility and security of software resource management; finally, the running status of each Docker container can be monitored in real time, and the software resources of the target Docker environment can be adjusted according to the monitoring results, so as to improve resource utilization by dynamically optimizing software resource allocation, thereby improving the application efficiency of Docker technology in software resource management. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] 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 of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0042] Figure 1 A flowchart of a software resource management method provided in an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a process for building an image repository provided in an embodiment of the present application;

[0044] Figure 3 A schematic diagram of a process for creating a Docker container provided in an embodiment of the present application;

[0045] Figure 4 A schematic diagram of the structure of a software resource management device provided in an embodiment of the present application;

[0046] Figure 5 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] 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.

[0048] In practical applications, especially when dealing with large-scale software resources, Docker technology faces problems such as unbalanced resource allocation, increased management complexity, and low deployment efficiency. This not only affects the comprehensive promotion of containerization technology, but also puts higher requirements on the effective management and optimization of software resources, resulting in greater limitations of Docker technology in software resource management.

[0049] Based on this, this application proposes the following technical solutions, see below for details:

[0050] In one embodiment, Figure 1 As shown, Figure 1 A flowchart of a software resource management method provided in an embodiment of the present application; the present application provides a software resource management method, which specifically includes the following:

[0051] S110: deploy a target Docker environment, and build an image repository based on the target Docker environment; the image repository stores multiple different types of software images.

[0052] In this step, when managing software resources, the computer device can first deploy a standardized and highly isolated target Docker environment, and build an image warehouse based on the target Docker environment to centrally store and manage various types of software images, so that the software images can be quickly pulled and used later, thereby improving the reusability and management efficiency of software resources.

[0053] Specifically, in the process of software resource management, the computer device can first deploy a standardized and highly isolated target Docker environment to ensure that various types of application software deployed and installed subsequently can run in this independent and interference-free environment, effectively avoiding conflicts between software dependencies and environment configurations. Based on the target Docker environment, the computer device can further build an efficient image warehouse for centralized storage and management of different types of software images. As a centralized storage platform, the image warehouse can store various operating system images, application images and their corresponding dependent libraries and tool chains, ensuring that all software resources are uniformly managed in a controllable environment.

[0054] It is understandable that through this centralized software resource management method, the present application can realize the rapid pulling and use of software images, allowing users to easily obtain the required image version, avoiding the tedious process of repeated downloading and configuration, while improving the reusability of software resources and greatly improving management efficiency. In addition, this method can also achieve image consistency throughout the development, testing, production and other different stages, ensuring that the application performs consistently in various environments, thereby further improving the stability and reliability of the system.

[0055] S120: Pull the software image corresponding to the custom configuration file from the image repository based on the image management policy to create a container, thereby obtaining multiple Docker containers.

[0056] In this step, after the image repository is constructed through step S110, the computer device can pull the software image corresponding to the custom configuration file from the image repository based on the image management policy to create a container, and obtain multiple Docker containers, so as to allocate software resources on demand during the container creation process through the image management policy, avoid resource waste, and improve the speed and flexibility of software deployment.

[0057] Among them, the image management strategy refers to a set of rules and processes for managing, controlling and optimizing image pulling, storage, use and updating, including specific requirements on how to select and use images, image version management, image lifecycle management, and how to effectively allocate and utilize software resources. Its core purpose is to ensure efficient use of images, avoid resource waste, and improve the flexibility and efficiency of system deployment. Custom profiles refer to user-defined profiles based on specific needs or application scenarios, which are used to set and adjust applications and their corresponding software resource allocations. Unlike default profiles, custom profiles allow users to adjust software resources according to actual conditions to meet personalized needs or optimize system performance.

[0058] It is understandable that computer devices can achieve accurate allocation of required software resources while creating containers according to the image management strategy, ensuring that the resource requirements of each Docker container strictly correspond to the custom configuration file, thereby avoiding redundancy and waste in resource allocation, and avoiding performance bottlenecks or excessive resource consumption caused by unreasonable resource allocation. At the same time, this precise resource management can also effectively improve the speed and flexibility of software deployment, allowing users to quickly respond to real-time changing needs. In addition, through on-demand allocation of software resources, computer devices can start multiple containers in a short period of time, quickly expand or reduce the scale of application services, and meet the elastic expansion requirements in high-concurrency scenarios. While ensuring efficient use of resources, it also greatly improves the maintainability and scalability of the system, thereby accelerating the efficiency of overall software lifecycle management.

[0059] S130: Use a network communication component to establish a network connection between the various Docker containers, and manage data of the various Docker containers through digital volumes.

[0060] In this step, after multiple Docker containers are created through step S120, the computer device can use network communication components to establish network connections between various Docker containers, and manage data for each Docker container through digital volumes, so that the containers can communicate efficiently and securely, thereby promoting the collaborative work between different service components under the microservice architecture, and further enhancing the flexibility and security of software resource management.

[0061] Among them, network communication components refer to a class of tools or technologies used to achieve network connection and communication between containers. They are usually used in containerized environments, such as Docker, Kubernetes, etc., to ensure that containers can access and interact with each other on the network.

[0062] It is understandable that, since each container in the containerized environment runs in an isolated network space, the present application can use network communication components to build a network between containers to ensure that data transmission and communication can be carried out smoothly and safely. Specifically, computer devices can use network communication components, such as Flannel, Calico and other plug-ins to achieve network connections between various Docker containers, thereby building an efficient and reliable container network, allocating independent network space for containers, ensuring that containers can access and communicate with each other, and can support container communication across hosts and data centers, breaking the limitations of physical networks, and providing a stable network environment for distributed applications. At the same time, computer devices can also manage data for each container through digital volumes, such as Docker Volume, Data Volume Containers, etc., so that the container can persist data during operation, and can maintain data consistency and persistence when the container is restarted or migrated, thereby ensuring high availability of container data, and can also support cross-container and cross-host data sharing, further enhancing the flexibility of the containerized environment.

[0063] S140: Monitor the running status of each Docker container in real time, and adjust the software resources of the target Docker environment according to the monitoring results.

[0064] In this step, after the network connection and data management of each Docker container are realized through step S130, the computer device can also monitor the running status of each Docker container in real time, and adjust the software resources of the target Docker environment according to the monitoring results, so as to improve resource utilization by dynamically optimizing software resource allocation, thereby improving the application efficiency of Docker technology in software resource management.

[0065] Specifically, the computer device can monitor the running status of each Docker container in real time, obtain key performance indicators such as container memory, CPU usage, network bandwidth and disk IO, so as to provide comprehensive running status information of the target Docker environment and determine the resource consumption of each container and the change of application load. If the monitoring data fluctuates abnormally, the computer device can dynamically adjust and optimize the software resources in the target Docker environment, such as automatically adjusting the resource quota of the container, reallocating computing resources, adjusting the priority of the container or automatically scaling the container, so as to accurately meet the resource requirements of the container application, avoid resource waste or over-allocation, and further improve the overall utilization of software resources.

[0066] It can be understood that through the dynamic management method of software resources, the present application can not only improve the operating efficiency of Docker containers, but also ensure that the performance of containers is always maintained in the best state in high concurrency and large-scale deployment environments. Moreover, in this process, by continuously optimizing the allocation of software resources, the application efficiency of Docker technology in software resource management can be effectively improved, and it can quickly respond to changes in application load, thereby ensuring that containerized applications always maintain an efficient and stable operating state.

[0067] In the above embodiment, when performing software resource management, a standardized and highly isolated target Docker environment can be deployed first, and an image warehouse can be built based on the target Docker environment to centrally manage various types of software images, so that the software images can be quickly pulled and used later, which improves the reusability and management efficiency of software resources; then, the software image corresponding to the custom configuration file can be pulled from the image warehouse based on the image management strategy to create a container, and multiple Docker containers can be obtained. Here, the software resources can be allocated on demand during the container creation process through the image management strategy, avoiding resource waste and improving the speed and flexibility of software deployment. After the container is created, a network communication component can be used to connect the network between each Docker container, and the data of each Docker container can be managed through a digital volume, so that the containers can communicate efficiently and securely, promoting the collaborative work between different service components under the microservice architecture, and further enhancing the flexibility and security of software resource management; finally, the running status of each Docker container can be monitored in real time, and the software resources of the target Docker environment can be adjusted according to the monitoring results, so as to improve resource utilization by dynamically optimizing software resource allocation, thereby improving the application efficiency of Docker technology in software resource management.

[0068] In one embodiment, the process of deploying the target Docker environment in step S110 may include:

[0069] S111: Determine the target virtual system and environment configuration script file.

[0070] S112: configuring and installing the dependent libraries in the environment configuration script file in the target virtual system to obtain a target Docker environment.

[0071] In this embodiment, when deploying the target Docker environment, the computer device can determine the target virtual system and the environment configuration script file, and then configure and install the dependent libraries in the environment configuration script file in the target virtual system to obtain the target Docker environment.

[0072] The target virtual system refers to an operating system or virtual machine running on a physical or virtualized platform, which can provide a basic operating environment for the Docker container. In this application, the Linux system can be used. The environment configuration script file refers to a script file used to automatically configure various dependent libraries and environment variables in the target virtual system to ensure that the Docker environment can be deployed and run smoothly.

[0073] Specifically, when deploying the target Docker environment, the computer device can first determine the target virtual system suitable for running Docker as the host environment of the containerized application, and provide the necessary computing resources, storage and network environment for the deployment and operation of the Docker container. Next, the computer device can confirm the environment configuration script file configured in advance by the user in the target virtual system, including yum-utils, device-mapper-persistent-data, lvm2, etc., which is intended to install and configure the required dependency libraries, tools and environment variables for the target virtual system; wherein the dependency library may include the Docker engine, the kernel module required for the container runtime, the network settings, the system resource restrictions, etc., to ensure that the target virtual system can smoothly support the operation of the Docker container. Then, by executing the environment configuration script file, the computer device can automatically complete these configuration tasks in the target virtual system, avoid manual intervention, and ensure the consistency of the environment and the accuracy of the configuration. Finally, the target virtual system will be configured as a complete and fully functional Docker operating environment, making the subsequent containerized application deployment more efficient and reliable.

[0074] In one embodiment, Figure 2 As shown, Figure 2 A schematic diagram of a process for building an image repository provided in an embodiment of the present application; Figure 2 In step S110, the process of building an image repository based on the target Docker environment may include:

[0075] S113: Configure the image acceleration service based on the target Docker environment and build an empty initial warehouse.

[0076] S114: Download from the image source through the image acceleration service to obtain multiple software images, and determine the image version of each software image.

[0077] S115: Label each software image based on each image version, and add each labeled software image to the initial warehouse to obtain an image warehouse.

[0078] In this embodiment, when creating an image warehouse, the computer device can first configure the image acceleration service based on the target Docker environment and build an empty initial warehouse, and then download from the image source through the image acceleration service to obtain multiple software images and determine the image version of each software image. Then, the computer device can label each software image based on each image version, and add each labeled software image to the initial warehouse to obtain an image warehouse.

[0079] Specifically, when creating an image repository, the computer device can configure the image acceleration service by adding the cloud image acceleration address to the configuration file of the Docker daemon in the target Docker environment to ensure that the computer device can obtain a faster speed and a more stable connection when downloading the image. Here, the image acceleration service can reduce the delay and bandwidth bottleneck when downloading the image from the remote warehouse by connecting to the local image source, thereby greatly improving the efficiency of image pulling. At the same time, the computer device can build an empty initial warehouse as a basic platform for storing and managing software images. Next, the computer device can use the image acceleration service to quickly download the required multiple software images from the image source. These images include different versions of operating system images, application images, and their related dependent software to ensure that the needs of different application scenarios can be met. After the download is completed, the computer device can further determine the version number of each software image to ensure that the version of each image is consistent with its required functions and compatibility requirements. In order to more conveniently manage and use these images, the computer device can add corresponding label annotations to each image based on the version information of each image. These labels contain key information such as the name, version, and applicable scenario of the image. It can not only improve the identifiability of the image, but also facilitate the update, query, and management of subsequent images. Finally, the computer device can add all the labeled software images to the initial repository to build an image repository, which contains multiple images that have been versioned and labeled and can be used to quickly and flexibly deploy containerized applications, greatly improving the management efficiency of software images and the reusability of resources.

[0080] In one embodiment, Figure 3 As shown, Figure 3 A schematic diagram of a process for creating a Docker container provided in an embodiment of the present application; Figure 3 In step S120, the process of pulling the software image corresponding to the custom configuration file from the image repository based on the image management policy to create a container and obtaining multiple Docker containers may include:

[0081] S121: performing image parsing on the custom configuration file input by the user, and directly pulling the corresponding software image from the image warehouse according to the parsing result.

[0082] S122: Start the container instances with the same number as the pulled software images, and use each pulled software image to initialize each container instance in sequence.

[0083] S123: Allocate software resources to each initialized container instance and start running to form multiple Docker containers.

[0084] In this embodiment, when creating a container, the computer device can perform image parsing on the custom configuration file input by the user, and directly pull the corresponding software image from the image repository based on the parsing result, and then start the container instance with the same number of pulled software images, and use each pulled software image to initialize each container instance in turn. Finally, the computer device can allocate software resources to each initialized container instance and start running it to form multiple Docker containers.

[0085] It is understandable that since the custom configuration file contains the user's personalized requirements for the container creation process, such as the required image version, environment variables, resource quotas, etc., the computer device can parse the specific software image and related parameters required from the custom configuration file, and after the parsing is completed, directly pull the corresponding software image from the image repository and ensure that each image meets the required version and environment requirements.

[0086] Specifically, after pulling the software image, the computer device can start the corresponding container instance according to the pulled software image. Here, each container instance will be initialized according to the pulled image, including loading the application environment, configuration files, dependent libraries and other contents in the image, to ensure that the container can have the required operating environment when it is started. After the initialization is completed, the computer device can allocate software resources to each container instance based on the resource allocation strategy specified in the configuration file. These software resources include container memory, CPU usage, network bandwidth and disk IO, etc. The computer device can dynamically adjust resource allocation according to actual needs to ensure that each container obtains sufficient computing resources during operation to avoid resource waste or shortage. Finally, after the resource configuration is completed, the container instance will be started and enter the running state, and multiple Docker containers will start to execute their respective tasks at the same time, making full use of the corresponding software resources for parallel computing and task processing.

[0087] In one embodiment, the process of using the network communication component to establish network connections between various Docker containers in step S130 may include:

[0088] S131: Create a Flannel configuration file; the Flannel configuration file is configured with subnet information of each Docker container.

[0089] S132: Execute the Flannel configuration file to convert each subnet information into a startup parameter of each Docker container.

[0090] S133: Editing a Docker running parameter file based on each startup parameter, and restarting the network configuration of the target Docker environment based on the Docker running parameter file, so that each Docker container is connected to the network.

[0091] In this embodiment, after the container is created, the computer device can also create a Flannel configuration file, which is set with the subnet information of each Docker container. Therefore, after the computer device executes the Flannel configuration file, the various subnet information therein can be converted into startup parameters for each Docker container, and then the Docker running parameter file can be edited based on the various startup parameters, and the network configuration of the target Docker environment can be restarted based on the Docker running parameter file to enable network connection between various Docker containers.

[0092] Among them, the Flannel configuration file refers to a configuration file used to define network-related settings in a containerized environment. Through a container network plug-in, a unique subnet is assigned to each container to ensure that containers can communicate across hosts. The Docker runtime parameter file refers to a file used to define various parameters of the Docker container runtime, including network configuration, resource restrictions, mount points, environment variables, port mappings, etc. It is usually referenced when the container is started to specify the container's behavior and environment settings.

[0093] It is understandable that when the Docker runtime parameter file is used in conjunction with the Flannel configuration file, the Docker runtime parameter file can set the network configuration of each container according to the subnet information defined in Flannel, ensuring that each container is assigned to the correct network when it is started and communicates through the corresponding subnet information. Based on the Docker runtime parameter file, the computer device can restart the network configuration of the target Docker environment so that each container can connect according to the preset network policy, thereby achieving efficient and isolated network communication between containers.

[0094] In one embodiment, the process of managing data of each Docker container through a digital volume in step S130 may include:

[0095] S134: Data persistence and data sharing are performed between various Docker containers through data volumes, and data mounting and data synchronization backup are performed on various Docker containers.

[0096] In this embodiment, when the computer device manages data for containers, it can use Docker data volumes (DataVolumes) or data volume containers (Data Volume Containers) to persist and share data between various Docker containers, and can also mount the host directory of the target virtual system into each Docker container to achieve real-time synchronization and backup of data.

[0097] Among them, Docker data volumes refer to dedicated volumes used for persistent storage in Docker. They can exist independently outside the life cycle of the container, so that data will not be lost when the container is restarted or destroyed. By mounting Docker data volumes, computer devices can store data in an independent location outside the container, thereby achieving data persistence and high availability. Data Volume Containers refers to a container used to manage and share data volumes. It can serve as a data sharing center between multiple containers, allowing different containers to access the same data volume, ensuring that data can be shared efficiently and securely between different containers. Through data volumes, this application can enable multiple instances of containerized applications to use shared data, which not only facilitates data management, but also improves the utilization efficiency of software resources.

[0098] In addition, the computer device can also mount the host directory of the target virtual system directly into the Docker container, thereby realizing real-time synchronization and backup of data. By mounting the host directory, the computer device can share the file system between the container and the host, so that the data in the container and the data on the host can be automatically synchronized, providing a more flexible storage solution for the container, especially suitable for application scenarios that require frequent reading and writing of data or need to persist data in the host file system. By mounting the host directory into the container, the data can be transparently accessed and backed up across containers and hosts, improving the security and reliability of the data, while also simplifying the operations of data backup and recovery, making data management in a containerized environment more efficient and reliable.

[0099] In one embodiment, the process of adjusting the software resources of the target Docker environment according to the monitoring result in step S140 may include:

[0100] S141: Determine whether there is abnormal data in the monitoring results.

[0101] S142: If yes, determine the performance indicator corresponding to the abnormal data and the resource adjustment strategy corresponding to the performance indicator, and adjust the software resources of the target Docker environment based on the resource adjustment strategy.

[0102] S143: If not, continue to monitor the running status of each Docker container.

[0103] In this embodiment, after the computer device monitors the running status of each Docker container in real time, it can determine whether there is abnormal data in the monitoring results according to a preset frequency, and if there is abnormal data, determine the performance indicator corresponding to the abnormal data, and the resource adjustment strategy corresponding to the performance indicator, and adjust the software resources of the target Docker environment based on the resource adjustment strategy.

[0104] Specifically, the computer device can collect the operation data monitored by each Docker container in real time at a preset frequency, and analyze and determine whether there are any abnormalities in the monitoring data. The abnormal data here can include resource usage exceeding expectations, response time being too long, container crash, etc., which are not limited here. When there is abnormal data, the computer device can further analyze the abnormal data and identify performance indicators related to the abnormal data, such as excessive CPU load, memory leakage, increased network latency, etc.; then determine the corresponding resource adjustment strategy based on different performance indicators to adjust the software resources of the target Docker environment.

[0105] For example, if it is detected that the CPU usage of a container is continuously high, the computer device can adjust the CPU resource quota of the container or migrate the container to a physical node with idle resources; if it is detected that the memory usage of a container has increased abnormally, the computer device can adjust the memory limit of the container or increase the container memory quota to avoid memory overflow and performance degradation; if it is detected that the disk space of a container is insufficient, the computer device can automatically execute the corresponding resource allocation strategy to solve the problem by increasing storage capacity or migrating storage paths.

[0106] It is understandable that, based on the resource adjustment strategy corresponding to each performance indicator, the computer device can dynamically adjust the software resources of the target Docker environment, so as to respond to the changes in the running state of the container in real time, avoid the emergence of performance bottlenecks, and ensure that the containerized application can maintain the best running state under the changing load. In addition, the dynamic adjustment of software resources in this application can also be carried out without interrupting the application, ensuring the high availability and flexibility of the container environment, thereby improving the reliability, stability and overall utilization of software resources of the system, and thus improving the application efficiency of Docker technology in software resource management.

[0107] The software resource management device provided in an embodiment of the present application is described below. The software resource management device described below and the software resource management method described above can be referenced to each other.

[0108] In one embodiment, Figure 4 As shown, Figure 4 A schematic diagram of the structure of a software resource management device provided in an embodiment of the present application; the present application also provides a software resource management device, including an environment deployment module 210, a container creation module 220, a data management module 230 and a resource adjustment module 240, specifically including the following:

[0109] The environment deployment module 210 is used to deploy the target Docker environment and build an image repository based on the target Docker environment; the image repository stores multiple different types of software images.

[0110] The container creation module 220 is used to pull the software image corresponding to the custom configuration file from the image repository based on the image management policy to create a container, thereby obtaining multiple Docker containers.

[0111] The data management module 230 is used to establish network connections between various Docker containers using network communication components, and to manage data of various Docker containers through digital volumes.

[0112] The resource adjustment module 240 is used to monitor the running status of each Docker container in real time and adjust the software resources of the target Docker environment according to the monitoring results.

[0113] In the above embodiment, when performing software resource management, a standardized and highly isolated target Docker environment can be deployed first, and an image warehouse can be built based on the target Docker environment to centrally manage various types of software images, so that the software images can be quickly pulled and used later, which improves the reusability and management efficiency of software resources; then, the software image corresponding to the custom configuration file can be pulled from the image warehouse based on the image management strategy to create a container, and multiple Docker containers can be obtained. Here, the software resources can be allocated on demand during the container creation process through the image management strategy, avoiding resource waste and improving the speed and flexibility of software deployment. After the container is created, a network communication component can be used to connect the network between each Docker container, and the data of each Docker container can be managed through a digital volume, so that the containers can communicate efficiently and securely, promoting the collaborative work between different service components under the microservice architecture, and further enhancing the flexibility and security of software resource management; finally, the running status of each Docker container can be monitored in real time, and the software resources of the target Docker environment can be adjusted according to the monitoring results, so as to improve resource utilization by dynamically optimizing software resource allocation, thereby improving the application efficiency of Docker technology in software resource management.

[0114] In one embodiment, the environment deployment module 210 may include:

[0115] The script configuration submodule is used to determine the target virtual system and environment configuration script file.

[0116] The environment installation submodule is used to configure and install the dependent libraries in the environment configuration script file in the target virtual system to obtain the target Docker environment.

[0117] In one embodiment, the environment deployment module 210 may further include:

[0118] The service configuration submodule is used to configure the image acceleration service based on the target Docker environment and build an empty initial repository.

[0119] The image download submodule is used to download from the image source through the image acceleration service, obtain multiple software images, and determine the image version of each software image.

[0120] The image adding submodule is used to label each software image based on each image version, and add each labeled software image to the initial warehouse to obtain the image warehouse.

[0121] In one embodiment, the container creation module 220 may include:

[0122] The image pulling submodule is used to parse the custom configuration file input by the user, and directly pull the corresponding software image from the image repository based on the parsing result.

[0123] The container initialization submodule is used to start the same number of container instances as the pulled software images, and to initialize each container instance in turn using each pulled software image.

[0124] The resource allocation submodule is used to allocate software resources to each initialized container instance and then start running to form multiple Docker containers.

[0125] In one embodiment, the data management module 230 may include:

[0126] The information setting submodule is used to create a Flannel configuration file; the Flannel configuration file is set with the subnet information of each Docker container.

[0127] Submodule, used to execute the Flannel configuration file to convert each subnet information into startup parameters for each Docker container.

[0128] The network connection submodule is used to edit the Docker run parameter file based on various startup parameters, and restart the network configuration of the target Docker environment based on the Docker run parameter file to enable network connection between various Docker containers.

[0129] In one embodiment, the data management module 230 may further include:

[0130] The data management submodule is used to persist and share data between various Docker containers through data volumes, as well as to mount and synchronize data for each Docker container.

[0131] In one embodiment, the resource adjustment module 240 may include:

[0132] The data judgment submodule is used to judge whether there is abnormal data in the monitoring results.

[0133] The first determination submodule is used to determine the performance indicator corresponding to the abnormal data and the resource adjustment strategy corresponding to the performance indicator when there is abnormal data in the monitoring result, and adjust the software resources of the target Docker environment based on the resource adjustment strategy.

[0134] The second determination submodule is used to continue monitoring the running status of each Docker container when there is no abnormal data in the monitoring result.

[0135] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the software resource management method as described in any of the above embodiments.

[0136] In one embodiment, the present application further provides a computer device having computer-readable instructions stored therein. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the software resource management method as described in any one of the above embodiments.

[0137] Indicatively, Figure 5 As shown, Figure 5 This is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. The computer device 300 may be provided as a server. Figure 5, the computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301, for storing instructions that can be executed by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 302 is configured to execute instructions to perform the software resource management method of any of the above embodiments.

[0138] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, Free BSD TM, or the like.

[0139] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0140] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0141] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.

[0142] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A software resource management method, characterized in that: The method comprises: Deploy a target Docker environment and build an image repository based on the target Docker environment; the image repository stores multiple different types of software images; Pulling the software image corresponding to the custom configuration file from the image warehouse based on the image management strategy to create a container, thereby obtaining multiple Docker containers; Use network communication components to establish network connections between various Docker containers, and manage data for each Docker container through digital volumes; Monitor the running status of each Docker container in real time, and adjust the software resources of the target Docker environment according to the monitoring results.

2. The software resource management method according to claim 1, characterized in that: The deployment target Docker environment includes: Determine the target virtual system and environment configuration script file; The dependent libraries in the environment configuration script file are configured and installed in the target virtual system to obtain a target Docker environment.

3. The software resource management method according to claim 1, characterized in that: The step of building an image repository based on the target Docker environment includes: Configure the image acceleration service based on the target Docker environment and build an empty initial warehouse; Downloading from the image source through the image acceleration service to obtain multiple software images, and determining the image version of each software image; Label each software image based on each image version, and add each labeled software image to the initial warehouse to obtain an image warehouse.

4. The software resource management method according to claim 1, characterized in that: Pulling the software image corresponding to the custom configuration file from the image warehouse based on the image management strategy to create a container, and obtaining multiple Docker containers, including: Perform image parsing on the custom configuration file entered by the user, and directly pull the corresponding software image from the image repository based on the parsing result; Start the same number of container instances as the pulled software images, and use each pulled software image to initialize each container instance in turn; After the software resources are allocated to each initialized container instance, it is started and runs to form multiple Docker containers.

5. The software resource management method according to claim 1, characterized in that: The network communication component is used to establish a network connection between the various Docker containers, including: Create a Flannel configuration file; the Flannel configuration file is set with subnet information of each Docker container; Execute the Flannel configuration file to convert each subnet information into startup parameters of each Docker container; The Docker operation parameter file is edited based on each startup parameter, and the network configuration of the target Docker environment is restarted based on the Docker operation parameter file, so that network connections are established between each Docker container.

6. The software resource management method according to claim 1, characterized in that: The data management of each Docker container through digital volumes includes: Data volumes are used to persist and share data between Docker containers, and data can be mounted and synchronized and backed up for each Docker container.

7. The software resource management method according to claim 1, characterized in that: The adjusting the software resources of the target Docker environment according to the monitoring result includes: Determine whether there is abnormal data in the monitoring result; If so, determining the performance indicator corresponding to the abnormal data and the resource adjustment strategy corresponding to the performance indicator, and adjusting the software resources of the target Docker environment based on the resource adjustment strategy; If not, continue to monitor the running status of each Docker container.

8. A software resource management device, characterized in that: include: An environment deployment module, used to deploy a target Docker environment and build an image repository based on the target Docker environment; The image warehouse stores multiple different types of software images; A container creation module, used to pull a software image corresponding to a custom configuration file from the image repository based on an image management strategy to create a container, thereby obtaining multiple Docker containers; A data management module, used to establish network connections between various Docker containers using network communication components, and to manage data of various Docker containers through digital volumes; The resource adjustment module is used to monitor the running status of each Docker container in real time and adjust the software resources of the target Docker environment according to the monitoring results.

9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the software resource management method according to any one of claims 1 to 7.

10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the software resource management method according to any one of claims 1 to 7 are performed.

Citation Information

Cited By

  • Document generation method and device, equipment, storage medium and program product

    CN120429009A