Container image construction method and system based on cloud-edge collaboration
Through the cloud-edge collaborative container image construction method, the work log and computing node status of the cloud platform are used to build and push matching container images, which solves the problem of the lack of applications in edge devices during task processing and improves work efficiency and reliability. , avoiding resource waste.
Patent Information
- Application Number
- CN202311794072.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-12-25
AI Technical Summary
The lack of corresponding applications in computing and processing tasks on edge devices results in additional workload and the inability to complete tasks efficiently and accurately, reducing work efficiency and reliability.
Through a method based on cloud-edge collaboration, the cloud platform's work logs and computing node status information are used to determine whether the edge device requires application scheduling, detect the device status, build a matching container image, and push it to the cloud warehouse. According to the task progress information Download and send to edge device.
It improves the work efficiency and reliability of edge devices, avoids repeatedly building unnecessary container images, optimizes resource usage, and ensures stable execution of tasks.
Smart Images

Figure CN117850980B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing, and in particular to a method and system for building a container image based on cloud-edge collaboration. Background Art
[0002] The edge devices of the cloud platform are used to perform task computing and processing, and the corresponding data computing load is large. The edge devices need the cooperation of corresponding applications in the process of computing and processing tasks, but the edge devices themselves do not have corresponding applications installed. For this reason, corresponding container images are usually built inside the edge devices to schedule applications, which will increase the workload of the edge devices and cannot guarantee that the edge devices can complete the corresponding task computing and processing efficiently and accurately, reducing the working efficiency and reliability of the edge devices. Summary of the invention
[0003] The purpose of the present invention is to provide a container image construction method and system based on cloud-edge collaboration, which determines whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform, thereby detecting and obtaining the device status information of the edge device, and providing accurate data support for building the container image; it also determines the computing node that provides image construction services for the edge device based on the working status information of all computing nodes under the cloud platform, and stores the device status information in the corresponding computing node, so as to provide sufficient computing power support for building the container image; processes the device status information stored in the computing node, builds a container image that matches the edge device, and pushes the container image to the container warehouse of the cloud platform, and manages the container image in a unified and centralized manner; based on the task processing progress information of the edge device, downloads the corresponding container image from the container warehouse and sends it to the edge device, so as to ensure the working efficiency and reliability of the edge device.
[0004] The present invention is achieved through the following technical solutions:
[0005] The container image construction method based on cloud-edge collaboration includes:
[0006] Based on the work log of the edge device under the cloud platform, determine whether the edge device needs to perform application scheduling; when the edge device needs to perform application scheduling, perform information detection on the edge device to obtain the device status information of the edge device;
[0007] Obtaining working status information of all computing nodes under the cloud platform, and determining a computing node that provides image building services for the edge device based on the working status information; storing the device status information in the computing node that provides image building services based on the data storage status of the computing node that provides image building services;
[0008] Processing the device status information stored in the computing node, building a container image that matches the edge device, and pushing the container image to the container repository of the cloud platform;
[0009] Based on the task processing progress information of the edge device, the corresponding container image is downloaded from the container warehouse and sent to the edge device; based on the container image download record of the container warehouse, the container image storage status adjustment processing is performed.
[0010] Optionally, based on the work log of the edge device under the cloud platform, it is determined whether the edge device needs to perform application scheduling; when the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain device status information of the edge device, including:
[0011] Analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device, and if the application type information exists in the installed application directory, it is determined that the edge device needs to perform application scheduling;
[0012] When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain task-related file information of the edge device.
[0013] Optionally, comparing the application type information with a directory of installed applications of the edge device includes:
[0014] Step S1: Assume that the application type information is X, and the set of its main functions is X g , assuming that the set of installed application type information of the edge device is Y, then the determination of whether the application type information already exists in the edge device is:
[0015]
[0016] In the above formula (1), f h is a determination of whether the application type information already exists on the edge device. When its value is 1, it indicates that the edge device has installed the application. When its value is 0, it indicates that the application is not found in the installed applications of the edge device. n is the total number of installed applications on the edge device.
[0017] Step S2, when f h When the value is 0, it is calculated whether the installed application i of the edge device is a replaceable application of the application, and the calculation formula is as follows:
[0018]
[0019] In the above formula (2), f i is a value indicating whether the installed application i of the edge device is a replaceable application of the application. When it is 1, it indicates that the installed application i of the edge device is a replaceable application of the application. i A set of main functions of installed applications i of the edge device;
[0020] Step S3, based on the calculation results of the above steps S1 and S2, calculate whether the application type information exists in the installed application directory,
[0021] F = max{f h ,f1,f2,…,f n} (3)
[0022] In the above formula (3), F is a determination value of whether the application type information exists in the installed application directory. When F is 1, it indicates that the application type information exists in the installed application directory. When F is 0, it indicates that the application type information does not exist in the installed application directory.
[0023] Optionally, obtaining working status information of all computing nodes under the cloud platform, and determining a computing node that provides an image building service for the edge device based on the working status information; and storing the device status information in the computing node that provides the image building service based on the data storage status of the computing node that provides the image building service, comprises:
[0024] Obtaining memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determining a computing node with the smallest memory usage as a computing node for providing image building services for the edge device;
[0025] Based on the available data storage interval distribution location information of the computing node providing the image building service, the task-related file information is stored in the storage interval corresponding to the computing node providing the image building service.
[0026] Optionally, processing the device status information stored in the computing node, building a container image matching the edge device, and pushing the container image to a container repository of the cloud platform includes:
[0027] The task-related file information stored in the computing node is parsed and processed, and the container component matching the task-related file is retrieved. Then, based on the container component, a container image matching the edge device is constructed, and the container image is marked and pushed to the container repository of the cloud platform.
[0028] Optionally, based on the task processing progress information of the edge device, downloading the corresponding container image from the container repository and sending it to the edge device; and based on the container image download record of the container repository, performing container image storage state adjustment processing, including:
[0029] Based on the task processing progress information of the edge device, determine whether the edge device currently enters the task processing process that requires the assistance of the container image, and if so, download the corresponding container image from the container repository and package it and send it to the edge device;
[0030] The container image download records of the container repository are analyzed to determine the download frequency of all container images in the container repository; if the download frequency is less than a preset frequency threshold, the corresponding container image is deleted from the container repository.
[0031] The container image building system based on cloud-edge collaboration includes:
[0032] The edge device identification module is used to determine whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform; when the edge device needs to perform application scheduling, the edge device is detected to obtain the device status information of the edge device;
[0033] A computing node determination module, used to obtain working status information of all computing nodes under the cloud platform, and determine a computing node that provides image building services for the edge device based on the working status information;
[0034] A computing node information storage module, used to store the device status information in the computing node providing the image building service based on the data storage status of the computing node providing the image building service;
[0035] A container image building and storage module, used to process the device status information stored in the computing node, build a container image that matches the edge device, and push the container image to the container warehouse of the cloud platform;
[0036] A container image downloading module, configured to download a corresponding container image from the container repository and send the image to the edge device based on the task processing progress information of the edge device;
[0037] The container repository storage adjustment module is used to adjust the storage status of the container image based on the container image download record of the container repository.
[0038] Optionally, the edge device identification module is used to determine whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform; when the edge device needs to perform application scheduling, the edge device is detected to obtain device status information of the edge device, including:
[0039] Analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device, and if the application type information exists in the installed application directory, it is determined that the edge device needs to perform application scheduling;
[0040] When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain task-related file information of the edge device.
[0041] Optionally, the computing node determination module is used to obtain working status information of all computing nodes under the cloud platform, and determine the computing node that provides the image building service for the edge device based on the working status information, including:
[0042] Obtaining memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determining a computing node with the smallest memory usage as a computing node for providing image building services for the edge device;
[0043] The computing node information storage module is used to store the device status information to the computing node providing the image building service based on the data storage status of the computing node providing the image building service, including:
[0044] Based on the available data storage interval distribution location information of the computing node providing the image building service, the task-related file information is stored in the storage interval corresponding to the computing node providing the image building service.
[0045] Optionally, the container image building and storage module is used to process the device status information stored in the computing node, build a container image matching the edge device, and push the container image to the container repository of the cloud platform, including:
[0046] The task-related file information stored in the computing node is parsed and processed, and the container component matching the task-related file is retrieved. Then, based on the container component, a container image matching the edge device is constructed, and the container image is marked and pushed to the container repository of the cloud platform.
[0047] Optionally, the container image downloading module is used to download the corresponding container image from the container repository and send it to the edge device based on the task processing progress information of the edge device, including:
[0048] Based on the task processing progress information of the edge device, determine whether the edge device currently enters the task processing process that requires the assistance of the container image, and if so, download the corresponding container image from the container repository and package it and send it to the edge device;
[0049] The container repository storage adjustment module is used to perform container image storage state adjustment processing based on the container image download record of the container repository, including:
[0050] The container image download records of the container repository are analyzed to determine the download frequency of all container images in the container repository; if the download frequency is less than a preset frequency threshold, the corresponding container image is deleted from the container repository.
[0051] Compared with the prior art, the present invention has the following beneficial effects:
[0052] The container image construction method and system based on cloud-edge collaboration provided in the present application judge whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform, so as to detect and obtain the device status information of the edge device, and provide accurate data support for building the container image; it also determines the computing node that provides image construction service for the edge device based on the working status information of all computing nodes under the cloud platform, and stores the device status information in the corresponding computing node, so as to provide sufficient computing power support for building the container image; processes the device status information stored in the computing node, builds a container image that matches the edge device, and pushes the container image to the container warehouse of the cloud platform, and manages the container image in a unified and centralized manner; based on the task processing progress information of the edge device, downloads the corresponding container image from the container warehouse and sends it to the edge device, so as to ensure the working efficiency and reliability of the edge device. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0054] Figure 1 A flowchart of the container image building method based on cloud-edge collaboration provided by the present invention.
[0055] Figure 2A schematic diagram of the structure of the container image building system based on cloud-edge collaboration provided by the present invention. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. It is understandable that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for ease of description, only some structures related to the present application are shown in the accompanying drawings, rather than all structures. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0057] The terms "including" and "having" and any variations thereof in this application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0059] See also Figure 1 As shown, a container image construction method based on cloud-edge collaboration provided by an embodiment of the present application includes:
[0060] Based on the work log of the edge device under the cloud platform, determine whether the edge device needs to perform application scheduling; if the edge device needs to perform application scheduling, perform information detection on the edge device to obtain the device status information of the edge device;
[0061] Obtaining the working status information of all computing nodes under the cloud platform, and determining the computing node that provides the image building service for the edge device based on the working status information; based on the data storage status of the computing node that provides the image building service, storing the device status information in the computing node that provides the image building service;
[0062] Process the device status information stored in the computing node, build a container image that matches the edge device, and push the container image to the container repository of the cloud platform;
[0063] Based on the task processing progress information of the edge device, the corresponding container image is downloaded from the container warehouse and sent to the edge device; based on the container image download record of the container warehouse, the container image storage status adjustment processing is performed.
[0064] The beneficial effects of the above embodiments are as follows: the container image construction method based on cloud-edge collaboration determines whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform, thereby detecting and obtaining the device status information of the edge device, and providing accurate data support for building the container image; it also determines the computing node that provides image building services for the edge device based on the working status information of all computing nodes under the cloud platform, and stores the device status information in the corresponding computing node, so as to provide sufficient computing power support for building the container image; processes the device status information stored in the computing node, builds a container image that matches the edge device, and pushes the container image to the container warehouse of the cloud platform, and manages the container image in a unified and centralized manner; based on the task processing progress information of the edge device, downloads the corresponding container image from the container warehouse and sends it to the edge device, so as to ensure the working efficiency and reliability of the edge device.
[0065] In another embodiment, based on the work log of the edge device under the cloud platform, it is determined whether the edge device needs to perform application scheduling; when the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain device status information of the edge device, including:
[0066] Analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device. If the application type information exists in the installed application directory, it is determined that the edge device needs to perform application scheduling;
[0067] When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain task-related file information of the edge device.
[0068] The beneficial effect of the above embodiment is to analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device, so as to accurately determine whether the edge device needs to perform application scheduling, and avoid repeatedly building container images that the edge device does not need. When the edge device needs to perform application scheduling, the edge device is detected to obtain the task-related file information of the edge device, providing data support for the subsequent construction of the container image.
[0069] In another embodiment, comparing the application type information with a directory of installed applications of the edge device includes:
[0070] Step S1: Assume that the application type information is X, and the set of its main functions is X g , assuming that the set of installed application type information of the edge device is Y, then the determination of whether the application type information already exists in the edge device is:
[0071]
[0072] In the above formula (1), f h is a determination of whether the application type information already exists on the edge device. When its value is 1, it indicates that the edge device has installed the application. When its value is 0, it indicates that the application is not found in the installed applications of the edge device. n is the total number of installed applications of the edge device.
[0073] Step S2, when f h When the value is 0, it is calculated whether the installed application i of the edge device is a replaceable application of the application. The calculation formula is as follows:
[0074]
[0075] In the above formula (2), f i is the value of whether the installed application i of the edge device is a replaceable application of the application. When it is 1, it indicates that the installed application i of the edge device is a replaceable application of the application. i A collection of main functions of installed applications i on the edge device;
[0076] Step S3, based on the calculation results of the above steps S1 and S2, calculate whether the application type information exists in the installed application directory,
[0077] F = max{f h ,f1,f2,…,f n} (3)
[0078] In the above formula (3), F is a determination value of whether the application type information exists in the installed application directory. When F is 1, it indicates that the application type information exists in the installed application directory. When F is 0, it indicates that the application type information does not exist in the installed application directory.
[0079] The beneficial effect of the above embodiment is that since many applications have replaceable applications, such as WPS and office series, when a table-related application needs to be used, if the specified application is WPS, but the edge device does not have a WPS application, and there is office in the installed application directory, then office can also be used directly to perform related processing without installing WPS. Therefore, when comparing the application type information with the installed application directory of the edge device, in addition to comparing the application name, it is also necessary to consider whether there is a replaceable application in the installed application directory of the edge device, otherwise it will cause repeated installation of applications with the same function in the edge device, resulting in waste of resources of the edge device. By comparing the application type information with the installed application directory of the edge device and comparing the main function of the application with the main function of the installed application of the edge device, it is determined whether the application type information exists in the installed application directory, including whether there is a replaceable application for the application, so as to avoid repeated installation of applications with the same function in the edge device and waste of resources of the edge device.
[0080] In another embodiment, obtaining working status information of all computing nodes under the cloud platform, determining a computing node that provides an image building service for the edge device based on the working status information; and storing the device status information in the computing node that provides the image building service based on the data storage status of the computing node that provides the image building service, includes:
[0081] Obtain memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determine the computing node with the smallest memory usage as the computing node that provides the image building service for the edge device;
[0082] Based on the available data storage interval distribution location information of the computing node providing the image building service, the task-related file information is stored in the storage interval corresponding to the computing node providing the image building service.
[0083] The beneficial effect of the above embodiment is to obtain the memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determine the computing node with the smallest memory usage as the computing node that provides the image building service for the edge device, so as to provide sufficient computing power support for the subsequent construction of the container image. In addition, based on the available data storage interval distribution location information of the computing node that provides the image building service, the task-related file information is stored in the corresponding storage interval of the computing node that provides the image building service, ensuring the safe storage of the task-related file information inside the computing node.
[0084] In another embodiment, processing the device status information stored in the computing node, building a container image matching the edge device, and pushing the container image to the container repository of the cloud platform includes:
[0085] The task-related file information stored in the computing node is parsed and processed, and the container component that matches the task-related file is retrieved. Based on the container component, a container image that matches the edge device is built, and the container image is marked and pushed to the container repository of the cloud platform.
[0086] The beneficial effect of the above embodiment is to parse and process the task-related file information stored in the computing node, retrieve the container component that matches the task-related file, and then build a container image that matches the edge device based on the container component, and then mark the container image and push it to the container repository of the cloud platform, so as to stably store the constructed container image.
[0087] In another embodiment, based on the task processing progress information of the edge device, downloading the corresponding container image from the container repository and sending it to the edge device; and based on the container image download record of the container repository, performing container image storage state adjustment processing, including:
[0088] Based on the task processing progress information of the edge device, determine whether the edge device currently enters the task processing process that requires the assistance of the container image. If so, download the corresponding container image from the container repository and package it and send it to the edge device;
[0089] The container image download records of the container repository are analyzed to determine the download frequency of all container images in the container repository; if the download frequency is less than a preset frequency threshold, the corresponding container image is deleted from the container repository.
[0090] The beneficial effect of the above embodiment is that, based on the task processing progress information of the edge device, it is determined whether the edge device is currently entering the task processing process that requires the assistance of the container image. If so, the corresponding container image is downloaded from the container warehouse and packaged and sent to the edge device, so that the edge device can ensure that the corresponding task is performed normally and stably. In addition, the container image download records of the container warehouse are analyzed to determine the download frequency of all container images in the container warehouse; if the download frequency is less than the preset frequency threshold, the corresponding container image is deleted from the container warehouse, thereby effectively saving the storage space of the container warehouse.
[0091] See also Figure 2 As shown, a container image building system based on cloud-edge collaboration provided by an embodiment of the present application includes:
[0092] The edge device identification module is used to determine whether the edge device needs to be scheduled for application based on the work log of the edge device under the cloud platform; when the edge device needs to be scheduled for application, the edge device is detected to obtain the device status information of the edge device;
[0093] A computing node determination module is used to obtain the working status information of all computing nodes under the cloud platform, and determine the computing node that provides the image building service for the edge device based on the working status information;
[0094] A computing node information storage module, used to store the device status information to the computing node providing the image building service based on the data storage status of the computing node providing the image building service;
[0095] A container image building and storage module is used to process the device status information stored in the computing node, build a container image that matches the edge device, and push the container image to the container repository of the cloud platform;
[0096] A container image downloading module, used to download the corresponding container image from the container repository and send it to the edge device based on the task processing progress information of the edge device;
[0097] The container repository storage adjustment module is used to adjust the storage status of the container image based on the container image download record of the container repository.
[0098] The beneficial effects of the above embodiments are as follows: the container image construction system based on cloud-edge collaboration determines whether the edge device needs application scheduling based on the work log of the edge device under the cloud platform, so as to detect and obtain the device status information of the edge device, and provide accurate data support for building the container image; it also determines the computing node that provides image building services for the edge device based on the working status information of all computing nodes under the cloud platform, and stores the device status information in the corresponding computing node, so as to provide sufficient computing power support for building the container image; it processes the device status information stored in the computing node, builds a container image that matches the edge device, and pushes the container image to the container warehouse of the cloud platform, and manages the container image in a unified and centralized manner; based on the task processing progress information of the edge device, it downloads the corresponding container image from the container warehouse and sends it to the edge device, so as to ensure the working efficiency and reliability of the edge device.
[0099] In another embodiment, the edge device identification module is used to determine whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform; when the edge device needs to perform application scheduling, the edge device is detected to obtain the device status information of the edge device, including:
[0100] Analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device. If the application type information exists in the installed application directory, it is determined that the edge device needs to perform application scheduling;
[0101] When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain task-related file information of the edge device.
[0102] The beneficial effect of the above embodiment is to analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device, so as to accurately determine whether the edge device needs to perform application scheduling, and avoid repeatedly building container images that the edge device does not need. When the edge device needs to perform application scheduling, the edge device is detected to obtain the task-related file information of the edge device, providing data support for the subsequent construction of the container image.
[0103] In another embodiment, the computing node determination module is used to obtain the working status information of all computing nodes under the cloud platform, and determine the computing node that provides the image building service for the edge device based on the working status information, including:
[0104] Obtain memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determine the computing node with the smallest memory usage as the computing node that provides the image building service for the edge device;
[0105] The computing node information storage module is used to store the device status information to the computing node providing the image building service based on the data storage status of the computing node providing the image building service, including:
[0106] Based on the available data storage interval distribution location information of the computing node providing the image building service, the task-related file information is stored in the storage interval corresponding to the computing node providing the image building service.
[0107] The beneficial effect of the above embodiment is to obtain the memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determine the computing node with the smallest memory usage as the computing node that provides the image building service for the edge device, so as to provide sufficient computing power support for the subsequent construction of the container image. In addition, based on the available data storage interval distribution location information of the computing node that provides the image building service, the task-related file information is stored in the corresponding storage interval of the computing node that provides the image building service, ensuring the safe storage of the task-related file information inside the computing node.
[0108] In another embodiment, the container image building and storage module is used to process the device state information stored in the computing node, build a container image matching the edge device, and push the container image to the container repository of the cloud platform, including:
[0109] The task-related file information stored in the computing node is parsed and processed, and the container component that matches the task-related file is retrieved. Based on the container component, a container image that matches the edge device is built, and the container image is marked and pushed to the container repository of the cloud platform.
[0110] The beneficial effect of the above embodiment is to parse and process the task-related file information stored in the computing node, retrieve the container component that matches the task-related file, and then build a container image that matches the edge device based on the container component, and then mark the container image and push it to the container repository of the cloud platform, so as to stably store the constructed container image.
[0111] In another embodiment, the container image download module is used to download the corresponding container image from the container repository and send it to the edge device based on the task processing progress information of the edge device, including:
[0112] Based on the task processing progress information of the edge device, determine whether the edge device currently enters the task processing process that requires the assistance of the container image. If so, download the corresponding container image from the container repository and package it and send it to the edge device;
[0113] The container repository storage adjustment module is used to adjust the container image storage status based on the container image download record of the container repository, including:
[0114] The container image download records of the container repository are analyzed to determine the download frequency of all container images in the container repository; if the download frequency is less than a preset frequency threshold, the corresponding container image is deleted from the container repository.
[0115] The beneficial effect of the above embodiment is that, based on the task processing progress information of the edge device, it is determined whether the edge device is currently entering the task processing process that requires the assistance of the container image. If so, the corresponding container image is downloaded from the container warehouse and packaged and sent to the edge device, so that the edge device can ensure that the corresponding task is performed normally and stably. In addition, the container image download records of the container warehouse are analyzed to determine the download frequency of all container images in the container warehouse; if the download frequency is less than the preset frequency threshold, the corresponding container image is deleted from the container warehouse, thereby effectively saving the storage space of the container warehouse.
[0116] In general, the container image construction method and system based on cloud-edge collaboration determines whether the edge device needs application scheduling based on the work log of the edge device under the cloud platform, so as to detect and obtain the device status information of the edge device, and provide accurate data support for building the container image; it also determines the computing node that provides image building services for the edge device based on the working status information of all computing nodes under the cloud platform, and stores the device status information in the corresponding computing node to provide sufficient computing power support for building the container image; processes the device status information stored in the computing node, builds a container image that matches the edge device, and pushes the container image to the container warehouse of the cloud platform to centrally manage the container image; based on the task processing progress information of the edge device, downloads the corresponding container image from the container warehouse and sends it to the edge device to ensure the working efficiency and reliability of the edge device.
[0117] The above is only a specific implementation of the present invention, and any other improvements made based on the concept of the present invention are considered to be within the protection scope of the present invention.
Claims
1. A container image construction method based on cloud-edge collaboration, characterized in that: include: Based on the work log of the edge device under the cloud platform, determine whether the edge device needs to perform application scheduling; When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain device status information of the edge device; Obtaining working status information of all computing nodes under the cloud platform, and determining a computing node that provides image building services for the edge device based on the working status information; Based on the data storage state of the computing node providing the image building service, storing the device state information in the computing node providing the image building service; Process the device status information stored in the computing node, build a container image that matches the edge device, and push the container image to the container warehouse of the cloud platform; based on the task processing progress information of the edge device, download the corresponding container image from the container warehouse and send it to the edge device; based on the container image download record of the container warehouse, adjust the storage status of the container image; Wherein, based on the work log of the edge device under the cloud platform, it is judged whether the edge device needs to perform application scheduling; when the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain the device status information of the edge device, including: Analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device, and if the application type information exists in the installed application directory, it is determined that the edge device needs to perform application scheduling; When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain task-related file information of the edge device; Wherein, based on the task processing progress information of the edge device, downloading the corresponding container image from the container warehouse and sending it to the edge device; based on the container image download record of the container warehouse, performing container image storage state adjustment processing, including: Based on the task processing progress information of the edge device, determine whether the edge device currently enters the task processing process that requires the assistance of the container image, and if so, download the corresponding container image from the container repository and package it and send it to the edge device; The container image download records of the container repository are analyzed to determine the download frequency of all container images in the container repository; if the download frequency is less than a preset frequency threshold, the corresponding container image is deleted from the container repository.
2. The method for building a container image based on cloud-edge collaboration according to claim 1, characterized in that: Comparing the application type information with a directory of installed applications of the edge device includes: Step S1: Assume that the application type information is X, and the set of its main functions is X g , assuming that the set of installed application type information of the edge device is Y, then the determination of whether the application type information already exists in the edge device is: In the above formula (1), f h is a determination of whether the application type information already exists on the edge device. When its value is 1, it indicates that the edge device has installed the application. When its value is 0, it indicates that the application is not found in the installed applications of the edge device. n is the total number of installed applications on the edge device. Step S2, when f h When the value is 0, it is calculated whether the installed application i of the edge device is a replaceable application of the application, and the calculation formula is as follows: In the above formula (2), f i is a value indicating whether the installed application i of the edge device is a replaceable application of the application. When it is 1, it indicates that the installed application i of the edge device is a replaceable application of the application. i A set of main functions of installed applications i of the edge device; Step S3, based on the calculation results of the above steps S1 and S2, calculate whether the application type information exists in the installed application directory, F=max{f h ,f1,f2,…,f n } (3) In the above formula (3), F is a determination value of whether the application type information exists in the installed application directory. When F is 1, it indicates that the application type information exists in the installed application directory. When F is 0, it indicates that the application type information does not exist in the installed application directory.
3. The method for building a container image based on cloud-edge collaboration according to claim 1, characterized in that: Obtaining working status information of all computing nodes under the cloud platform, and determining a computing node that provides image building services for the edge device based on the working status information; Based on the data storage state of the computing node providing the image building service, storing the device state information in the computing node providing the image building service includes: Obtaining memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determining a computing node with the smallest memory usage as a computing node for providing image building services for the edge device; Based on the available data storage interval distribution location information of the computing node providing the image building service, the task-related file information is stored in the storage interval corresponding to the computing node providing the image building service.
4. The method for building a container image based on cloud-edge collaboration according to claim 3, characterized in that: Processing the device status information stored in the computing node, building a container image matching the edge device, and pushing the container image to the container repository of the cloud platform, including: The task-related file information stored in the computing node is parsed and processed, and the container component matching the task-related file is retrieved. Then, based on the container component, a container image matching the edge device is constructed, and the container image is marked and pushed to the container repository of the cloud platform.
5. A container image building system based on cloud-edge collaboration, characterized by: include: The edge device identification module is used to determine whether the edge device needs to be scheduled for application based on the work log of the edge device under the cloud platform; When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain device status information of the edge device; A computing node determination module, used to obtain working status information of all computing nodes under the cloud platform, and determine a computing node that provides image building services for the edge device based on the working status information; A computing node information storage module, used to store the device status information in the computing node providing the image building service based on the data storage status of the computing node providing the image building service; A container image building and storage module, used to process the device status information stored in the computing node, build a container image matching the edge device, and push the container image to the container warehouse of the cloud platform; A container image downloading module, configured to download a corresponding container image from the container repository and send the image to the edge device based on the task processing progress information of the edge device; A container repository storage adjustment module, used to adjust the storage status of a container image based on the container image download record of the container repository; The edge device identification module is used to determine whether the edge device needs to perform application scheduling based on the work log of the edge device under the cloud platform; when the edge device needs to perform application scheduling, the edge device is detected to obtain the device status information of the edge device, including: Analyze the work log of the edge device under the cloud platform to obtain the application type information that the edge device needs to call during the task processing; compare the application type information with the installed application directory of the edge device, and if the application type information exists in the installed application directory, it is determined that the edge device needs to perform application scheduling; When the edge device needs to perform application scheduling, information detection is performed on the edge device to obtain task-related file information of the edge device; The container image download module is used to download the corresponding container image from the container repository and send it to the edge device based on the task processing progress information of the edge device, including: Based on the task processing progress information of the edge device, determine whether the edge device currently enters the task processing process that requires the assistance of the container image, and if so, download the corresponding container image from the container repository and package it and send it to the edge device; The container repository storage adjustment module is used to perform container image storage state adjustment processing based on the container image download record of the container repository, including: The container image download records of the container repository are analyzed to determine the download frequency of all container images in the container repository; if the download frequency is less than a preset frequency threshold, the corresponding container image is deleted from the container repository.
6. The container image building system based on cloud-edge collaboration as claimed in claim 5, characterized in that: The computing node determination module is used to obtain the working status information of all computing nodes under the cloud platform, and determine the computing node that provides the image building service for the edge device based on the working status information, including: Obtaining memory usage information of all computing nodes under the cloud platform, and based on the memory usage information, determining a computing node with the smallest memory usage as a computing node for providing image building services for the edge device; The computing node information storage module is used to store the device status information to the computing node providing the image building service based on the data storage status of the computing node providing the image building service, including: Based on the available data storage interval distribution location information of the computing node providing the image building service, the task-related file information is stored in the storage interval corresponding to the computing node providing the image building service.
7. The container image building system based on cloud-edge collaboration according to claim 5, characterized in that: The container image building and storage module is used to process the device status information stored in the computing node, build a container image matching the edge device, and push the container image to the container warehouse of the cloud platform, including: The task-related file information stored in the computing node is parsed and processed, and the container component matching the task-related file is retrieved. Then, based on the container component, a container image matching the edge device is constructed, and the container image is marked and pushed to the container repository of the cloud platform.
