Container mounting device monitoring method, device, equipment and storage medium

By deploying multiple application modules on the host machine, collecting and integrating the operational data and identifiers of hardware devices, the flexibility and cost issues of monitoring hardware devices mounted on different types of containers in existing technologies are solved, enabling flexible and low-cost monitoring of different types of hardware devices.

CN115658429BActive Publication Date: 2026-08-04BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2022-10-17
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing technologies struggle to flexibly monitor different types of container-mounted hardware devices, especially those without an open-source ecosystem or SDK, and monitoring costs are high.

Method used

By deploying the first and second applications on the host machine to collect the operating data and device identifiers of the hardware devices respectively, and using the third application to fuse this information, the operating data of the hardware devices mounted on the target container can be determined. This avoids the need to integrate hardware device SDKs and enables flexible monitoring of different types of hardware devices.

Benefits of technology

It enables flexible monitoring of different types of hardware devices, is more adaptable, reduces monitoring costs, and can obtain operational data of container-mounted devices more accurately.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115658429B_ABST
    Figure CN115658429B_ABST
Patent Text Reader

Abstract

The present disclosure provides a container mounting device monitoring method and device, equipment and storage medium, relates to the technical field of computers, specifically relates to the technical field of application containerization, software interaction, data monitoring and the like, and can be applied to scenarios such as container data analysis, container fault prediction and container optimization. The specific implementation scheme comprises the following steps: collecting running data of a hardware device running on a host computer where a target container is located and device identification of the hardware device running on the host computer; collecting device identification of a hardware device mounted by the target container; and determining running data of the hardware device mounted by the target container according to the device identification of the hardware device mounted by the target container, the running data of the hardware device running on the host computer and the device identification of the hardware device running on the host computer. The present disclosure can more flexibly monitor running data of different types of hardware devices mounted by a container, has stronger adaptability to different types of hardware devices, and has lower monitoring cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, specifically to the fields of application containerization, software interaction, and data monitoring, and can be applied to scenarios such as container data analysis, container fault prediction, and container optimization. In particular, it relates to a method, apparatus, device, and storage medium for monitoring container mounted devices. Background Technology

[0002] Application containerization refers to packaging an application's software code and all its required components (such as libraries, frameworks, and other dependencies) together, isolating the application's software code and all its required components within a corresponding container for execution. Application containerization enables applications to move and run consistently across any runtime environment and any infrastructure, unaffected by the operating system of the runtime environment or infrastructure.

[0003] When an application runs in a containerized manner, the operational data of the hardware devices (or mounted devices) attached to the application's container can be monitored. By analyzing the monitoring data, the container's load and bottlenecks can be understood.

[0004] Currently, the main methods for monitoring hardware devices mounted on containers include: running a monitoring service on the container host; embedding the software development kit (SDK) of the hardware device mounted on the container into the monitoring service; and obtaining all containers running on the host machine through the container runtime interface (CRI). For each container, when the monitoring service detects that the container has mounted a hardware device, it uses the built-in SDK of that hardware device to obtain runtime data such as the device's usage rate and memory usage as monitoring data. Summary of the Invention

[0005] This disclosure provides a method, apparatus, device, and storage medium for monitoring container-mounted devices, which can more flexibly monitor the operating data of different types of hardware devices mounted on containers, has stronger adaptability to different types of hardware devices, and has lower monitoring costs.

[0006] According to a first aspect of this disclosure, a method for monitoring container-mounted devices is provided, the method comprising:

[0007] Collect the operational data of the hardware devices running on the host machine where the target container is located, as well as the device identifiers of the hardware devices running on the host machine; collect the device identifiers of the hardware devices mounted on the target container; and determine the operational data of the hardware devices mounted on the target container based on the device identifiers of the hardware devices mounted on the target container, the operational data of the hardware devices running on the host machine, and the device identifiers of the hardware devices running on the host machine.

[0008] According to a second aspect of this disclosure, a container mounting device monitoring device is provided, the device comprising: a first acquisition unit, a second acquisition unit, and an indicator fusion unit.

[0009] The first acquisition unit is used to acquire the operating data of the hardware devices running on the host machine where the target container is located, as well as the device identifier of the hardware devices running on the host machine; the second acquisition unit is used to acquire the device identifier of the hardware devices mounted on the target container; the indicator fusion unit is used to determine the operating data of the hardware devices mounted on the target container based on the device identifier of the hardware devices mounted on the target container, the operating data of the hardware devices running on the host machine, and the device identifier of the hardware devices running on the host machine.

[0010] According to a third aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in the first aspect.

[0011] According to a fourth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the method described in the first aspect.

[0012] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method according to the first aspect.

[0013] According to a sixth aspect of this disclosure, a container monitoring system is provided, including electronic devices as described in the third aspect.

[0014] This disclosure collects the operational data of the hardware devices running on the host machine where the target container resides, the device identifiers of the hardware devices running on the host machine, and the device identifiers of the hardware devices mounted on the target container. Based on the device identifiers of the hardware devices mounted on the target container, the operational data of the hardware devices running on the host machine, and the device identifiers of the hardware devices running on the host machine, the operational data of the hardware devices mounted on the target container is determined. This allows for more flexible monitoring of the operational data of different types of hardware devices mounted on the container, has stronger adaptability to different types of hardware devices, and has lower monitoring costs.

[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0016] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0017] Figure 1 A flowchart illustrating the container mounting device monitoring method provided in this embodiment of the disclosure;

[0018] Figure 2 This is another flowchart illustrating the container mounting device monitoring method provided in this embodiment of the disclosure;

[0019] Figure 3 A schematic diagram illustrating the principle of monitoring the container mounting device provided in this embodiment of the disclosure;

[0020] Figure 4 This is yet another flowchart illustrating the container mounting device monitoring method provided in this embodiment of the disclosure;

[0021] Figure 5 This is a schematic diagram of the composition of the container mounting equipment monitoring device provided in the embodiments of this disclosure;

[0022] Figure 6 This is another schematic diagram of a container mounting equipment monitoring device provided in an embodiment of this disclosure;

[0023] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0024] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0025] It should be understood that in the embodiments of this disclosure, the character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated.

[0026] Application containerization refers to packaging an application's software code and all its required components (such as libraries, frameworks, and other dependencies) together, isolating the application's software code and all its required components within a corresponding container for execution. Application containerization enables applications to move and run consistently across any runtime environment and any infrastructure, unaffected by the operating system of the runtime environment or infrastructure.

[0027] When an application runs in a containerized manner, the operational data of the hardware devices (or mounted devices) attached to the application's container can be monitored. By analyzing the monitoring data, the container's load and bottlenecks can be understood.

[0028] Currently, the main methods for monitoring hardware devices mounted on containers include: running a monitoring service on the container host; embedding the software development kit (SDK) of the hardware device mounted on the container into the monitoring service; and obtaining all containers running on the host machine through the container runtime interface (CRI). For each container, when the monitoring service detects that the container has mounted a hardware device, it uses the built-in SDK of that hardware device to obtain runtime data such as the device's usage rate and memory usage as monitoring data.

[0029] For example, in related technologies, the monitoring service could be cAdvisor, and the hardware device mounted on the container could be an Nvidia graphics processing unit (GPU). cAdvisor can have the Nvidia GPU SDK built-in. When cAdvisor discovers that a container has an Nvidia GPU mounted, it can use the built-in Nvidia GPU SDK to obtain runtime data such as Nvidia GPU usage and memory usage as monitoring data for the Nvidia GPU.

[0030] However, current methods for monitoring container-mounted hardware devices are only suitable for monitoring certain hardware devices with strong open-source ecosystems, such as Nvidia GPUs, which provide SDKs. Many manufacturers' hardware devices may not have strong open-source ecosystems, or may not provide SDKs for other reasons (such as closed-source or security considerations). Therefore, current methods for monitoring container-mounted hardware devices are not applicable, and there is currently no effective way to monitor the operational data of such hardware devices.

[0031] In other words, the current methods for monitoring the hardware devices mounted on containers are not very flexible in terms of monitoring the operational data of these devices and cannot be well applied to different types of hardware devices.

[0032] In addition, current methods for monitoring hardware devices mounted on containers often involve embedding the hardware device's SDK into the monitoring service (such as cAdvisor), which may result in the monitoring service integrating SDKs for multiple hardware devices, leading to higher costs.

[0033] Against this background, this disclosure provides a method for monitoring devices mounted on containers, which can more flexibly monitor the operating data of different types of hardware devices mounted on containers, has stronger adaptability to different types of hardware devices, and has lower monitoring costs.

[0034] In some embodiments, the execution entity of the method can be the host machine where the container (or target container) resides. The host machine can be a computer or server, or it can be other devices with data processing capabilities.

[0035] In other embodiments, the execution entity of the method may also be a container monitoring system, which may include a host machine, or a container monitoring service running on the host machine. This disclosure does not limit the execution entity of the method.

[0036] Optionally, the server can be a single server, or it can be a server cluster consisting of multiple servers. In some embodiments, the server cluster can also be a distributed cluster. This disclosure does not limit the specific implementation of the server.

[0037] The following is an illustrative example of the method for monitoring the device mounted on the container.

[0038] Figure 1 This is a flowchart illustrating the container mounting device monitoring method provided in an embodiment of this disclosure. Figure 1 As shown, the method may include:

[0039] S101. Collect the operating data of the hardware devices running on the host machine where the target container is located, as well as the device identifier of the hardware devices running on the host machine.

[0040] For example, a target container can be a containerized version of a target application. For instance, the software code of the target application and all necessary components (e.g., libraries, frameworks, and other dependencies) can be packaged together, allowing the software code and all required components to run in isolation within the target container corresponding to the target application. Target containers enable the target application to move and run consistently across any runtime environment and infrastructure, unaffected by the operating system of the runtime environment or infrastructure.

[0041] The platform on which the target container runs or is deployed can be called the host machine of the target container. The host machine can be a server, computer, or other device; there are no restrictions on the type of host machine.

[0042] The host machine can deploy multiple (e.g., at least two) hardware devices, such as GPUs, dedicated processors, accelerator cards, FPGAs, graphics computing cards, etc.

[0043] When a target container runs on a host machine, it can mount hardware devices deployed on the host machine to utilize the hardware devices' resources (such as computing resources) to execute the target application's functions. The host machine can have N hardware devices running on it, where N is an integer greater than 1. The target container can mount one or more of these N hardware devices.

[0044] S101 can collect operational data of all hardware devices running on the host machine where the target container resides, as well as the device identifiers of all hardware devices. For example, operational data may include the utilization rate of hardware devices, and device identifiers may include the device name, device number, etc.

[0045] Understandably, device identifiers are used to uniquely distinguish the identity of hardware devices, and different hardware devices have different device identifiers.

[0046] S102. Collect the device identifier of the hardware device mounted on the target container.

[0047] The device identifier described in S102 can be referenced from the device identifier of the hardware device described in S101. For the same host machine, each hardware device in the host machine has a unique device identifier.

[0048] In S102, the device identifiers of the hardware devices mounted on the target container can be collected. Unlike the device identifiers of the hardware devices running on the host machine collected in S101, which can be used to determine which hardware devices are running on the host machine, the device identifiers collected in S102 can be used to determine which hardware devices on the host machine are mounted on the target container.

[0049] S103. Determine the operating data of the hardware device mounted on the target container based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

[0050] As described in embodiment S101, the hardware devices running on the host machine may include N devices. The hardware devices mounted on the target container may include one or more of the N hardware devices. In S103, based on the device identifiers of the hardware devices mounted on the target container and the device identifiers of the hardware devices running on the host machine, the operating data of the hardware devices mounted on the target container can be obtained from the operating data of the hardware devices running on the host machine.

[0051] For example, assuming the hardware devices running on the host machine include device 1, device 2, and device 3, and the target container is equipped with device 1 and device 2, then in S101, the operating data and device identifier of device 1, device 2, and device 3 can be collected. In S102, the device identifiers of device 1 and device 2 can be collected. In S103, based on the device identifiers of device 1 and device 2, the operating data of device 1 and device 2 can be filtered from the operating data and device identifiers of device 1, device 2, and device 3 to obtain the operating data of device 1 and device 2.

[0052] This embodiment of the disclosure collects the operating data of the hardware devices running on the host machine where the target container is located, the device identifier of the hardware devices running on the host machine, and the device identifier of the hardware devices mounted on the target container. Based on the device identifier of the hardware devices mounted on the target container, the operating data of the hardware devices running on the host machine, and the device identifier of the hardware devices running on the host machine, the operating data of the hardware devices mounted on the target container is determined. This allows for more flexible monitoring of the operating data of different types of hardware devices mounted on the container, has stronger adaptability to different types of hardware devices, and has lower monitoring costs.

[0053] For example, the container mounting device monitoring method provided in this disclosure can be applied not only to monitoring hardware devices with a strong open-source ecosystem, such as Nvidia GPUs, that provide SDKs, but also to monitoring hardware devices that do not have a strong open-source ecosystem, or that cannot provide SDKs for other considerations (such as closed-source or security). It can also be applied to monitoring hardware devices in scenarios where both types of hardware devices are used interchangeably. This method offers good flexibility and adaptability for different types of hardware devices.

[0054] For example, currently, embedding hardware device SDKs into monitoring services (such as cAdvisor) can lead to high costs due to the integration of multiple hardware device SDKs. However, this embodiment eliminates the need to integrate hardware device SDKs to monitor hardware device operational data, resulting in lower costs.

[0055] In some embodiments, S101 may include: collecting the operating data of the hardware devices running on the host machine and the device identifier of the hardware devices running on the host machine through a first application deployed on the host machine where the target container is located; the first application is related to the hardware devices running on the host machine, and each hardware device running on the host machine corresponds to a first application.

[0056] The above S102 may include: collecting the device identifier of the hardware device mounted on the target container through a second application deployed on the host machine.

[0057] The above-mentioned S103 may include: sending the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application; sending the device identifier of the hardware device mounted on the target container to the third application through the second application; and determining the operating data of the hardware device mounted on the target container based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine through the third application.

[0058] For example, Figure 2 This is another flowchart illustrating the container mounting device monitoring method provided in this embodiment of the disclosure. Figure 2 As shown, the method may include:

[0059] S201, The first application collects the operating data of the hardware devices running on the host machine, as well as the device identifiers of the hardware devices running on the host machine.

[0060] The first application is deployed on the host machine where the target container resides. The first application is associated with the hardware devices running on the host machine, and each hardware device running on the host machine corresponds to one first application.

[0061] For example, the first application can be a software program provided by the manufacturer of the hardware device running on the host machine, specifically designed to collect operational data from the hardware device provided by that manufacturer. The first application used to monitor different hardware devices can be provided by the manufacturers of those different hardware devices.

[0062] In other examples, the first application may also be a software program configured for each hardware device, depending on the hardware device, without limitation.

[0063] S202, the first application sends the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application.

[0064] Alternatively, the third application can be deployed on the host machine.

[0065] S203, The second application collects the device identifier of the hardware device mounted on the target container.

[0066] The second application is deployed on the host machine.

[0067] For example, the second application can be a manually configured software program with the ability to interact with the container runtime interface (CRI) of the target container. The second application can interact with the CRI to obtain which hardware devices are mounted on the target container and collect the device identifiers of these hardware devices.

[0068] S204. The second application sends the device identifier of the hardware device mounted on the target container to the third application.

[0069] Optionally, S203 and S204 may also be executed before S201 and S202. This disclosure does not restrict the execution order.

[0070] S205. The third application determines the operating data of the hardware device mounted on the target container based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

[0071] S205 can be found in S103, and will not be repeated here.

[0072] In this embodiment, the first application collects the operating data and device identifiers of the hardware devices running on the host machine, the second application collects the device identifiers of the hardware devices mounted on the target container, and the third application determines the operating data of the hardware devices mounted on the target container. This allows the monitoring of container-mounted devices to be implemented through three independent application modules, resulting in a simpler implementation and a more intuitive understanding of the relationships between the data. The first application is associated with the hardware devices running on the host machine, and each hardware device corresponds to a separate first application. This allows for dedicated monitoring of the operating data of each hardware device through an independent first application, making the method more flexible in adapting to different types of container-mounted devices and obtaining more accurate operating data for the container-mounted devices.

[0073] In some embodiments, the third application described above can also be deployed on a server that communicates with the host machine. Distinguished from the server used to implement the host machine, the server communicating with the host machine in this embodiment can be referred to as a remote server or a monitoring server.

[0074] This monitoring server can be used to analyze the operating data of container-mounted devices to achieve functions such as fault warning and container optimization.

[0075] In this embodiment, by deploying the third application on a server that is connected to the host machine, the server's computing power can be used to determine the operating data of the hardware devices mounted on the target container more quickly, and the server can also more conveniently analyze the operating data of the hardware devices mounted on the target container.

[0076] For example, consider a third application deployed on a server that communicates with the host machine. Figure 3 This is a schematic diagram illustrating the principle of monitoring container mounting equipment provided in an embodiment of this disclosure. Figure 3 As shown, assume the host machine is "host01", the target container is container "container01" on the host machine, and container "container01" is mounted with hardware devices "device1" and "device2" on the host machine "host01"; the host machine "host01" is connected to the monitoring server, and container device acquisition program and host device acquisition program are deployed on the host machine "host01", and indicator fusion program is deployed on the monitoring server.

[0077] Therefore, in this embodiment of the disclosure, the host device acquisition program can be used as the first application, the container device acquisition program can be used as the second application, and the metric fusion program can be used as the third application. The host device acquisition program is related to the hardware device running on the host machine, and each hardware device corresponds to one host device acquisition program. For example, the host device acquisition program corresponding to device1 is application 1, the host device acquisition program corresponding to device2 is application 2, and so on.

[0078] The host device acquisition program can collect the operating data of all hardware devices running on the host machine "host01" (including "device1" and "device2", and may also include other hardware devices such as "device3", "device4", etc.), as well as the device identifiers of all hardware devices running on the host machine (such as "device1", "device2", etc. are device identifiers), and send the operating data of all hardware devices running on the host machine "host01" and the device identifiers of all hardware devices running on the host machine to the indicator fusion program.

[0079] The container device acquisition program can collect the device identifiers of the hardware devices "device1" and "device2" mounted on container "container01" and send the device identifiers of the hardware devices "device1" and "device2" mounted on container "container01" to the indicator fusion program.

[0080] For example, Figure 3 The “Container Management Service” shown in the figure can be the Container Runtime Interface (CRI). The container device acquisition program can interact with the CRI to collect the device identifiers of the hardware devices “device1” and “device2” mounted on the container “container01”.

[0081] The metrics fusion program can determine the operating data of the hardware devices "device1" and "device2" mounted on the container "container01" based on the device identifiers of the hardware devices "device1" and "device2" mounted on the container "container01", the operating data of all hardware devices running on the host machine "host01", and the device identifiers of all hardware devices running on the host machine "host01".

[0082] In some embodiments, the method further includes: acquiring the host identifier of the host machine through a first application; and acquiring the container identifier and host identifier of the target container through a second application.

[0083] The steps described above, which involve sending the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application, include: establishing a first association relationship between the host identifier and the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine through the first application; and sending the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application based on the first association relationship.

[0084] The above-mentioned step of sending the device identifier of the hardware device mounted on the target container to the third application through the second application includes: establishing a second association relationship between the container identifier and the host identifier and the device identifier of the hardware device mounted on the target container through the second application; and sending the device identifier of the hardware device mounted on the target container to the third application based on the second association relationship through the second application.

[0085] For example, the first association relationship can represent that the hardware device's operating data belongs to the operating data of the hardware device on the host machine corresponding to the host identifier, and the hardware device's hardware representation belongs to the device identifier of the hardware device on the host machine corresponding to the host identifier. For example, the first association relationship can include: the correspondence between the host identifier and the operating data of the hardware device running on the host machine corresponding to the host identifier, and the device identifier of the hardware device running on the host machine. Based on the first association relationship, sending the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application can include: sending the host identifier, the operating data of the hardware device running on the host machine corresponding to the host identifier, and the device identifier of the hardware device running on the host machine corresponding to the host identifier to the third application.

[0086] Optionally, the second association may indicate that the device identifier of the hardware device belongs to the device identifier of the hardware device mounted on the target container corresponding to the container identifier, and the target container is on the host machine corresponding to the host identifier. For example, the second association may include: the correspondence between the container identifier and the device identifier of the hardware device mounted on the target container corresponding to the container identifier, and the correspondence between the container identifier and the host identifier of the host machine where the target container is located. Based on the second association, sending the device identifier of the hardware device mounted on the target container to the third application may include: sending the container identifier, the host identifier of the host machine where the target container is located corresponding to the container identifier, and the device identifier of the hardware device mounted on the target container corresponding to the container identifier to the third application.

[0087] For example, taking the utilization rate (or device utilization rate) of hardware device operation data as an example, assuming that the device identifier of a certain hardware device "device1" is "device01"; the hardware device "device1" runs on the host machine "host01", and the host identifier of the host machine "host01" is "host01"; then, when the utilization rate of hardware device "device1" is 50%, the monitoring data related to hardware device "device1" sent by the first application to the third application may include: "deviceUtility(deviceId=device01, hostId=host01)=50%".

[0088] Among them, deviceUtility represents the utilization rate of hardware device "device1", which is 50%; deviceId="device01" indicates that the device identifier of hardware device "device1" is "device01"; hostId="host01" indicates that the host machine's host identifier is "host01".

[0089] The third application can determine, based on (deviceId="device01", hostId="host01"), that deviceUtility is the utilization rate of the hardware device with device identifier "device01", which is 50%, and that the hardware device with device identifier "device01" is running on the host machine with host identifier "host01".

[0090] For example, taking the target container "container01" as the same as mounting the aforementioned hardware device "device1", the monitoring data related to the hardware device "device1" sent by the second application to the third application may include: containerDevice(containerId="container01", deviceId="device01", hostId="host01") = 1.

[0091] Wherein, containerId="container01" indicates that the target container's container identifier is "container01"; deviceId="device01" indicates that the hardware device "device1" has the device identifier "device01"; hostId="host01" indicates that the host machine's host identifier is "host01".

[0092] Similarly, based on containerDevice(containerId=container01, deviceId=device01, hostId=host01=1), the third application can analyze that: the target container with container identifier "container01" is mounted with hardware device identifier "device01", and the hardware device with device identifier "device01" is running on the host machine with host identifier "host01".

[0093] As described above, based on the data sent by the first application, the third application can determine that the hardware device with device identifier "device01" has a utilization rate of 50%, and that the hardware device with device identifier "device01" is running on the host machine with host identifier "host01"; based on the data sent by the second application, it can determine that the target container with container identifier "container01" has mounted the hardware device with device identifier "device01", and that the hardware device with device identifier "device01" is running on the host machine with host identifier "host01".

[0094] The third application merges the two results to determine that the target container with container identifier "container01" is mounted with hardware device identifier "device01", and the utilization rate of hardware device with device identifier "device01" is 50%.

[0095] For example, a third application can obtain the operating data of the target container mount device through the following formula (1).

[0096] containerDeviceUtil =

[0097] deviceUtilit+on(device_id, host_id)containerDevice*0 formula (1)

[0098] Here, containerDeviceUtility represents the runtime data of the device mounted on the target container; deviceUtili represents the runtime data of the hardware device running on the host machine where the target container resides; containerDevice represents the hardware identifier of the hardware device mounted on the target container; on(device_id, host_id) means that the device identifier of the hardware device corresponding to deviceUtil and containerDevice, as well as the host identifier of the host machine, are the same.

[0099] Optionally, taking the above example, containerDeviceUtility can have a label (containerId="container01", deviceId="device01", hostId="host01"). Based on this label, it can be seen intuitively that containerDeviceUtility means: the target container with container identifier "container01" is mounted with a hardware device with device identifier "device01", and the hardware device with device identifier "device01" runs on the host machine with host identifier "host01".

[0100] In this embodiment, the first application collects the host identifier of the host machine and, based on the first association relationship between the host identifier and the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine, sends the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application; and the second application collects the container identifier and host identifier of the target container and, based on the second association relationship between the container identifier and host identifier, and the device identifier of the hardware device mounted on the target container, sends the device identifier of the hardware device mounted on the target container to the third application. This allows the third application to more easily filter out the operating data of the hardware device mounted on the target container through the host identifier and container identifier.

[0101] For example, when a third application monitors different containers on multiple different hosts, or different containers on the same host, it can effectively improve monitoring efficiency.

[0102] In some embodiments, the operational data of the hardware device mounted on the target container may include at least one of the following: utilization, video memory, temperature, and power consumption. This disclosure does not limit the specific type or quantity of operational data.

[0103] By using the container mounting device monitoring method provided in this disclosure, developers can obtain the operating data of the hardware devices mounted on the container. Based on this operating data, developers can perform targeted optimization of the container.

[0104] For example, Figure 4 This is yet another flowchart illustrating the container mounting device monitoring method provided in this disclosure. Figure 4 As shown, in some embodiments, the method may include:

[0105] S401. Collect the operating data of the hardware devices running on the host machine where the target container is located, as well as the device identifier of the hardware devices running on the host machine.

[0106] S402. Collect the device identifier of the hardware device mounted on the target container.

[0107] S403. Determine the operating data of the hardware device mounted on the target container based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

[0108] S401-S403 can be referred to S101-S103, and will not be repeated here.

[0109] S404. Expand or shrink the target container based on the operating data of the hardware devices mounted on the target container.

[0110] For example, taking the hardware device mounted on the target container as an accelerator card, the operating data of the accelerator card may include the video memory usage rate. When the video memory usage rate of the accelerator card exceeds a certain first threshold (such as 90%), it indicates that the video memory load of the accelerator card is too high. The target container can be expanded to reduce the video memory load of the accelerator card. For example, a target container can be added, or the number of target containers can be doubled.

[0111] When the memory utilization of the accelerator card is less than a certain second threshold (such as 20%), it indicates that the memory load of the accelerator card is very low and the resources may be redundant. The target container can be scaled down to improve resource utilization. For example, one target container can be reduced, or the number of target containers can be halved.

[0112] It should be understood that the first threshold and the second threshold mentioned above are merely illustrative examples, and this disclosure does not impose any limitations on the size of the first threshold and the second threshold.

[0113] Alternatively, in other examples, a pre-trained AI model can be used to predict whether the target container needs to be expanded or shrunk based on the operating data of the hardware devices mounted on the target container. There are no restrictions on the implementation method here.

[0114] In this embodiment, by expanding or shrinking the target container according to the operating data of the hardware device mounted on the target container, the target container can run more stably and without consuming too much hardware device resources.

[0115] In some embodiments, the step of expanding the target container based on the operating data of the hardware device mounted on the target container may further include: obtaining information on the changes in the operating data of the hardware device mounted on the target container within a preset time period; predicting a first target time when the operating data of the hardware device mounted on the target container reaches its operating peak based on the information on the changes in the operating data of the hardware device mounted on the target container within the preset time period; and expanding the target container based on the operating peak before the first target time is reached at the current time.

[0116] For example, the preset duration can be 1 day, 1 week, 1 month, etc., and there is no limit to the size of the preset duration.

[0117] The change information of the operating data of the hardware device mounted on the target container within a preset time period can refer to the trend of the change of the operating data of the hardware device mounted on the target container within the preset time period. For example, this change information can be represented by a change curve of the operating data of the hardware device mounted on the target container. Based on the change information of the operating data of the hardware device mounted on the target container within the preset time period, the future trend of the operating data of the hardware device mounted on the target container can be predicted to determine when the operating data of the hardware device mounted on the target container will reach the operating peak (i.e., the maximum value) in the future. This time can be used as the first target time mentioned above. Here, the operating peak is a preset value. For example, the operating data can be the video memory usage rate, and the operating peak can be the maximum video memory usage rate, etc.

[0118] The aforementioned expansion of the target container based on the operational peak value before the current time reaches the first target time can include: expanding the target container based on the operational peak value at the time corresponding to the first duration before the current time reaches the first target time. Alternatively, expanding the target container based on the operational peak value at the time corresponding to the time when the operational data is less than the operational peak value and the difference between the operational data and the operational peak value is equal to a preset difference value before the current time reaches the first target time.

[0119] For example, the first duration could be 1 day. If the first target time is 12:00 noon on September 22, then when the current time reaches 12:00 noon on September 21, the target container can be expanded based on the peak operating time.

[0120] For example, the running data could be the video memory usage rate, and the peak running value could be the maximum video memory usage rate. The preset difference could be 5%. Before reaching the first target time, at the moment when the video memory usage rate is less than the maximum video memory usage rate, and the difference between the video memory usage rate and the maximum video memory usage rate is equal to 5%, the target container can be expanded based on the peak running value.

[0121] In some implementations, the step of scaling up the target container based on the peak operating time may include: determining the number of target containers corresponding to the peak operating time based on the pre-defined correspondence between standard operating data and the number of standard containers, and increasing the number of target containers to reach the number of target containers corresponding to the peak operating time.

[0122] The standard operating data and the standard number of containers are both preset values, indicating that when the number of target containers is the same as the number of standard containers, the operating data of the hardware devices mounted on the target containers can maintain the standard operating data, and the operating performance of the target containers is good.

[0123] In this implementation, increasing the number of target containers to the number corresponding to the peak operating time can reduce the operating data of the hardware devices mounted on the target containers from the peak operating time to the standard operating data, thus enabling the target containers to operate better.

[0124] In this embodiment, before reaching the first target time, the target container is expanded based on the peak operating time. This allows for advance expansion of the target container before the peak business period to meet the resource demands during peak periods. Furthermore, expanding the target container based on the peak operating time enables flexible expansion and avoids resource waste.

[0125] Similar to scaling up, in some other embodiments, the step of scaling down the target container based on the operating data of the hardware device mounted on the target container may further include: obtaining information on the changes in the operating data of the hardware device mounted on the target container within a preset time period; predicting a second target time when the operating data of the hardware device mounted on the target container reaches a running trough based on the information on the changes in the operating data of the hardware device mounted on the target container within the preset time period; and scaling down the target container based on the running trough before the second target time is reached at the current time.

[0126] For example, the preset duration can also be 1 day, 1 week, 1 month, etc., and there is no limitation on the size of the preset duration.

[0127] The changes in the operating data of the hardware devices mounted on the target container within a preset time period can be found in the aforementioned embodiments and will not be repeated here. Based on these changes, the future trend of the operating data can be predicted to determine when the operating data will reach its lowest point (i.e., the minimum value). This lowest point can be used as the second target time mentioned above. The lowest point is a preset value, such as memory usage or a preset minimum memory usage.

[0128] The aforementioned scaling down of the target container based on the operational trough before the current time reaches the second target time can include: scaling down the target container based on the operational trough at the time corresponding to the second duration before the current time reaches the second target time. Alternatively, scaling down the target container based on the operational trough at the time corresponding to the moment before the current time reaches the second target time when the running data is greater than the operational trough and the difference between the running data and the operational trough is equal to a preset difference (which can be the same as or different from the difference corresponding to the aforementioned operational peak).

[0129] The second duration is similar to the first duration, and can also be 1 day, 2 days, etc. For example, if the second duration is 1 day, and the second target time is 12:00 noon on September 22, then when the current time reaches 12:00 noon on September 21, the target container can be reduced in size according to the running valley value.

[0130] For example, the running data could be memory usage, and the running valley value could be the minimum memory usage. The preset difference could be 25%. Before reaching the second target time, at the moment when the memory usage is greater than the minimum memory usage and the difference between the memory usage and the minimum memory usage is equal to 25%, the target container can be shrunk based on the running valley value.

[0131] In some implementations, the step of scaling down the target container based on the running valley value may include: determining the number of target containers corresponding to the running valley value based on the preset correspondence between standard running data and standard container quantity, and increasing the number of target containers to reach the number of target containers corresponding to the running valley value.

[0132] The standard operating data and the standard number of containers can be referred to in the previous embodiments and will not be repeated here. In this implementation, when the number of target containers is increased to the number of target containers corresponding to the operating valley value, the operating data of the hardware devices mounted on the target containers can be increased from the operating valley value to the standard operating data, thus avoiding waste of target container resources.

[0133] In this embodiment, before the second target time is reached at the current time, the target container is scaled down according to the running valley value. This can achieve the scaling down of the target container in advance before the business off-peak period, so as to avoid wasting too much target container resources.

[0134] In an exemplary embodiment, this disclosure also provides a container mounting device monitoring apparatus, which can be used to implement the container mounting device monitoring method as described in the foregoing embodiments. Figure 5 This is a schematic diagram illustrating the composition of the container mounting equipment monitoring device provided in an embodiment of this disclosure. Figure 5As shown, the device may include: a first acquisition unit 501, a second acquisition unit 502, and an indicator fusion unit 503.

[0135] The first acquisition unit 501 is used to acquire the operating data of the hardware devices running on the host machine where the target container is located, as well as the device identifier of the hardware devices running on the host machine.

[0136] The second acquisition unit 502 is used to acquire the device identifier of the hardware device mounted on the target container.

[0137] The indicator fusion unit 503 is used to determine the operating data of the hardware device mounted on the target container based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

[0138] Optionally, the first acquisition unit 501 is specifically used to acquire the running data of the hardware devices running on the host machine and the device identifier of the hardware devices running on the host machine through a first application deployed on the host machine where the target container is located; the first application is related to the hardware devices running on the host machine, and each hardware device running on the host machine corresponds to a first application.

[0139] The second acquisition unit 502 is specifically used to acquire the device identifier of the hardware device mounted on the target container through a second application deployed on the host machine.

[0140] The first acquisition unit 501 is also used to send the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application.

[0141] The second acquisition unit 502 is also used to send the device identifier of the hardware device mounted on the target container to the third application through the second application.

[0142] The indicator fusion unit 503 is specifically used to determine the operating data of the hardware device mounted on the target container through a third application, based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

[0143] Optionally, the third application is deployed on a server that communicates with the host machine.

[0144] Optionally, the first acquisition unit 501 is also used to acquire the host identifier of the host machine through the first application.

[0145] The second acquisition unit 502 is also used to acquire the container identifier and host identifier of the target container through the second application.

[0146] The first acquisition unit 501 is specifically used to establish a first association relationship between the host identifier and the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine, through the first application; and to send the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application based on the first association relationship.

[0147] The second acquisition unit 502 is specifically used to establish a second association relationship between the container identifier and the host identifier and the device identifier of the hardware device mounted on the target container through the second application; and to send the device identifier of the hardware device mounted on the target container to the third application based on the second association relationship through the second application.

[0148] Optionally, the operating data of the hardware devices mounted on the target container includes at least one of the following: utilization, video memory, temperature, and power consumption.

[0149] Figure 6 This is another schematic diagram of a container mounting equipment monitoring device provided in an embodiment of this disclosure. (See diagram below.) Figure 6 As shown, the device may also include a container management unit 504.

[0150] The container management unit 504 is used to expand or shrink the target container based on the operating data of the hardware devices mounted on the target container.

[0151] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0152] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, a computer program product, and a container monitoring system.

[0153] In an exemplary embodiment, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiments. The electronic device may be the computer or server described above.

[0154] In an exemplary embodiment, the readable storage medium may be a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the above embodiments.

[0155] In an exemplary embodiment, the computer program product includes a computer program that, when executed by a processor, implements the method described in the above embodiments.

[0156] In an exemplary embodiment, the container monitoring system includes the electronic device described in the foregoing embodiments. For example, the electronic device may be the host machine where the target container resides. As another example, the container monitoring system may also include a server communicatively connected to the host machine.

[0157] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0158] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0159] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of displays, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0160] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as the container mounting device monitoring method. For example, in some embodiments, the container mounting device monitoring method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the container mounting device monitoring method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the container mounting device monitoring method by any other suitable means (e.g., by means of firmware).

[0161] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0162] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0163] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0164] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0165] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0166] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0167] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0168] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for monitoring container-mounted equipment, the method comprising: The first application, deployed on the host machine where the target container is located, collects the operating data of the hardware devices running on the host machine and the device identifiers of the hardware devices running on the host machine; the first application is related to the hardware devices running on the host machine, and each hardware device running on the host machine corresponds to one first application; The device identifier of the hardware device mounted on the target container is collected by a second application deployed on the host machine. The first application sends the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application. The device identifier of the hardware device mounted on the target container is sent to the third application through the second application. The third application determines the operating data of the hardware device mounted on the target container based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

2. The method according to claim 1, wherein the third application is deployed on a server that is communicatively connected to the host machine.

3. The method according to claim 1, further comprising: The host identifier of the host machine is collected through the first application; The second application collects the container identifier and the host identifier of the target container. The step of sending the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application includes: Through the first application, a first association relationship is established between the host identifier and the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine; Through the first application, based on the first association relationship, the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine are sent to the third application. The step of sending the device identifier of the hardware device mounted on the target container to the third application through the second application includes: Through the second application, a second association relationship is established between the container identifier and the host identifier, and the device identifier of the hardware device mounted on the target container; Through the second application, based on the second association, the device identifier of the hardware device mounted on the target container is sent to the third application.

4. The method according to claim 1, wherein the operating data of the hardware device mounted on the target container includes at least one of the following: utilization rate, video memory, temperature, and power consumption.

5. The method according to claim 1, wherein after determining the operating data of the hardware device mounted on the target container, the method further comprises: Based on the operating data of the hardware devices mounted on the target container, the target container is expanded or reduced in size.

6. A container mount apparatus monitoring device, the device comprising: The system comprises a first data acquisition unit, a second data acquisition unit, and an indicator fusion unit. The first acquisition unit is used to acquire the running data of the hardware devices running on the host machine and the device identifier of the hardware devices running on the host machine through a first application deployed on the host machine where the target container is located; the first application is related to the hardware devices running on the host machine, and each hardware device running on the host machine corresponds to one first application; The second acquisition unit is used to acquire the device identifier of the hardware device mounted on the target container through a second application deployed on the host machine; The first acquisition unit is also used to send the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application. The second acquisition unit is also used to send the device identifier of the hardware device mounted on the target container to the third application through the second application; The indicator fusion unit is specifically used to determine the operating data of the hardware device mounted on the target container through the third application, based on the device identifier of the hardware device mounted on the target container, the operating data of the hardware device running on the host machine, and the device identifier of the hardware device running on the host machine.

7. The apparatus of claim 6, wherein the third application is deployed on a server that is communicatively connected to the host machine.

8. The apparatus according to claim 6, wherein the first acquisition unit is further configured to acquire the host identifier of the host machine through the first application; The second acquisition unit is further configured to acquire the container identifier of the target container and the host identifier through the second application; The first acquisition unit is specifically used to establish a first association relationship between the host identifier and the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine through the first application; and to send the operating data of the hardware device running on the host machine and the device identifier of the hardware device running on the host machine to the third application through the first application based on the first association relationship. The second acquisition unit is specifically used to establish a second association relationship between the container identifier and the host identifier and the device identifier of the hardware device mounted on the target container through the second application; and to send the device identifier of the hardware device mounted on the target container to the third application based on the second association relationship through the second application.

9. The apparatus according to claim 6, wherein the operating data of the hardware device mounted on the target container includes at least one of the following: utilization rate, video memory, temperature, and power consumption.

10. The apparatus of claim 6, further comprising: Container management unit; The container management unit is used to expand or shrink the target container based on the operating data of the hardware devices mounted on the target container.

11. An electronic device, comprising: At least one processor; and a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the method according to any one of claims 1-5.

12. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to any one of claims 1-5.

13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-5.

14. A container monitoring system, comprising the electronic device as claimed in claim 11.