A container image tag automatic matching method and device and computer equipment

By automatically extracting external and internal software feature information from container images and generating feature information files, the problem of inconsistent and redundant image tag information in existing technologies is solved, thereby improving the accuracy and precision of image retrieval.

CN115964060BActive Publication Date: 2026-07-21NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NAT UNIV OF DEFENSE TECH
Filing Date
2022-12-26
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

The lack of a unified standard for building existing container image tags leads to information redundancy or missing information, making it difficult to meet the needs of image retrieval and management.

Method used

The external and internal software feature information of the image is extracted using automated methods, generating external and internal feature key-value sequences, which are then concatenated into an image feature information file and stored in a database.

Benefits of technology

It improves the accuracy and precision of container image retrieval, meeting users' image retrieval quality requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115964060B_ABST
    Figure CN115964060B_ABST
Patent Text Reader

Abstract

The application relates to a container image label automatic matching method and device and computer equipment. The method comprises the following steps: obtaining a to-be-analyzed image in a local image warehouse according to a retrieval condition; the to-be-analyzed image comprises image feature information and software feature information; identifying the image ID and external software feature information of the to-be-analyzed image according to the image feature information, and generating an external feature key-value sequence; extracting internal description information in the image layer of the to-be-analyzed image, analyzing the internal description information to obtain internal software feature information of each to-be-analyzed image, and generating an internal feature key-value sequence; the internal software feature information is the latest software feature information when the image layer of the to-be-analyzed image is updated; splicing the external feature key-value sequence and the internal feature key-value sequence to obtain an image feature information file, naming the image feature information file with the image ID, and storing the image feature information file in a database. The method improves the precision and accuracy of software feature information extraction in the image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a method, apparatus and computer device for automated matching of container image labels. Background Technology

[0002] With the rapid development of cloud computing and intelligent technologies, Docker-based containerization technology has been widely used in the development, deployment, and operation of intelligent models. Container images have become a standardized packaging method for various intelligent model software runtime environments. As container technology has rapidly developed, enterprises and open-source communities have accumulated a large number of image files, which are centrally stored in public or private image repositories (such as Docker Hub, Harbor, Sona Type Nexus, etc.). While this has brought abundant reusable software image resources, it has also brought significant challenges to efficient and convenient image retrieval and management. To manage the massive number of image resources, some image repositories have introduced tag systems to describe the content of software images. However, existing image tag construction mainly relies on manual writing. Due to the lack of a unified tag description standard, manual tag writing is highly arbitrary, easily leading to discrepancies between image tag information and actual image content, as well as multiple different tags for the same image. Therefore, manually defining tags to describe image content results in serious information redundancy or missing information, making it difficult to meet the needs of image retrieval and management based on tag descriptions. Large-scale image management faces a severe lack of tools. Summary of the Invention

[0003] Therefore, it is necessary to provide a method, apparatus, and computer device for automated matching of container image labels to address the aforementioned technical problems.

[0004] A method for automatically matching container image tags, the method comprising:

[0005] Retrieve the images to be analyzed from the local image repository based on the search criteria. The images to be analyzed include image feature information and software feature information.

[0006] Based on the image feature information, the image ID and external software feature information of the image to be analyzed are identified, and an external feature key value sequence is generated based on the image ID and external software feature information of the image to be analyzed.

[0007] The internal description information of each image layer in the image to be analyzed is extracted. This internal description information is then parsed to obtain the internal software feature information of each image. Based on this internal software feature information, an internal feature key-value sequence is generated. The internal software feature information is the latest software feature information obtained when the image layer of the image to be analyzed is updated.

[0008] The external feature key value sequence and the internal feature key value sequence are concatenated to obtain the mirror feature information file. The mirror feature information file is named with the mirror ID and stored in the database.

[0009] In one embodiment, the method further includes: retrieving a local image repository based on search criteria input by the user, and extracting the image to be analyzed corresponding to the search criteria from the local image repository.

[0010] If the search criteria entered by the user do not have a corresponding image to be analyzed in the local image repository, the cloud image repository is invoked, and the image to be analyzed corresponding to the search criteria in the cloud image repository is extracted using the image pull command of the container system and stored in the local image repository.

[0011] In one embodiment, the method further includes: filtering the image to be analyzed using regular expressions when scanning the image using a pre-set noise library.

[0012] By calling the application programming interface within the container system, the Env command information and Label command information of the image to be analyzed are extracted to obtain the image feature information of the image to be analyzed. Based on the noise library, the image feature information is filtered using regular expressions. The filtered image feature information is then identified to obtain the image ID and external software feature information of the image to be analyzed.

[0013] In one embodiment, the method further includes: constructing a feature key value sequence for each image to be analyzed based on the image ID and external software feature information of each image to be analyzed, and concatenating the feature key value sequences of each image to be analyzed to generate an external feature key value sequence.

[0014] The external software feature information includes: a list of external software and the software version information corresponding to the external software list, wherein the software version information corresponding to the external software list is the latest software version information when each image to be analyzed is updated.

[0015] In one embodiment, the method further includes: decomposing the image to be analyzed into multiple image layers; extracting the container file of each image layer to obtain the creation command information corresponding to the image layer; and filtering the creation command information using regular expressions based on a pre-set noise library to obtain the internal description information within the image layer.

[0016] In one embodiment, the method further includes: parsing the internal description information to extract the installation command information within each image layer, using regular expressions to match the installation command information strings in the installation command information to obtain the software feature information within each image layer, concatenating the software feature information within each image layer, and generating the internal software feature information of each image to be analyzed.

[0017] Internal software feature information includes: internal software and its corresponding version information. Based on the internal software feature information of each image to be analyzed, a feature key value sequence of the image layer in each image to be analyzed is constructed. The feature key value sequences of the image layers are then concatenated to generate the internal feature key value sequence of the image to be analyzed.

[0018] In one embodiment, the method further includes: sorting the version information corresponding to the internal software in the internal software feature information according to the time when the installation command is executed in the image layer of the image to be analyzed, with the version information ranked later covering the version information ranked earlier adjacent to it, and iterating in this way to obtain the latest version information corresponding to the internal software, and constructing the latest software feature information based on the internal software and the latest version information corresponding to the internal software.

[0019] In one embodiment, the method further includes: concatenating an external feature key value sequence and an internal feature key value sequence based on the software feature information to obtain a mirror ID and the latest software feature information; generating a mirror feature information file based on the mirror ID and the latest software feature information; naming the mirror feature information file with the mirror ID in the mirror feature information file; and storing it in the mirror database.

[0020] An automated container image label matching device, the device comprising:

[0021] The image extraction module is used to retrieve images to be analyzed from the local image repository based on search criteria. The images to be analyzed include image feature information and software feature information.

[0022] External sequence generation module: It is used to identify the image ID and external software feature information of the image to be analyzed based on the image feature information, and generate an external feature key value sequence based on the image ID and external software feature information of the image to be analyzed.

[0023] Internal sequence generation module: This module extracts internal description information from the image layers within the image to be analyzed, parses the internal description information to obtain the internal software feature information of each image to be analyzed, and generates an internal feature key-value sequence based on the internal software feature information of the image to be analyzed. The internal software feature information is the latest software feature information when the image layer of the image to be analyzed is updated.

[0024] The splicing module is used to splice the external feature key value sequence and the internal feature key value sequence to obtain a mirror feature information file, name the mirror feature information file with the mirror ID, and store it in the database.

[0025] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0026] Retrieve the images to be analyzed from the local image repository based on the search criteria. The images to be analyzed include image feature information and software feature information.

[0027] Based on the image feature information, the image ID and external software feature information of the image to be analyzed are identified, and an external feature key value sequence is generated based on the image ID and external software feature information of the image to be analyzed.

[0028] The internal description information of each image layer in the image to be analyzed is extracted. This internal description information is then parsed to obtain the internal software feature information of each image. Based on this internal software feature information, an internal feature key-value sequence is generated. The internal software feature information is the latest software feature information obtained when the image layer of the image to be analyzed is updated.

[0029] The external feature key value sequence and the internal feature key value sequence are concatenated to obtain the mirror feature information file. The mirror feature information file is named with the mirror ID and stored in the database.

[0030] Compared with the prior art, the present invention can achieve the following technical effects:

[0031] An automated container image tag matching method, apparatus, and computer device are employed. This method retrieves local image repositories based on search criteria, extracting images that match those criteria. Because container systems have varying permissions to modify software feature information, the images to be analyzed possess both external and internal software feature information. Therefore, the software feature information of the images to be analyzed is extracted progressively from the whole to the part, thereby uncovering both external and internal software feature information. Furthermore, considering the temporal relationship affecting changes in software feature information, the overall software feature information of the images to be analyzed is updated to generate an external key-value feature sequence containing external software feature information and the image ID, as well as an internal key-value feature sequence composed of internal software feature information. These two sequences are then concatenated to obtain an image feature information file matching the image ID. This approach meets users' requirements for image retrieval quality and improves the accuracy and precision of software retrieval within container images. Attached Figure Description

[0032] Figure 1 This is a flowchart illustrating an automated container image tag matching method in one embodiment;

[0033] Figure 2 This is a schematic diagram of the process for automatically matching container image tags based on image files in one embodiment;

[0034] Figure 3 This is a structural block diagram of an automated container image label matching device in one embodiment;

[0035] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0037] This application provides an automated container image tag matching method, applied in an environment where the container system version is the Docker API version, specifically including the following steps:

[0038] Step 102: Obtain the images to be analyzed from the local image repository according to the search criteria. The images to be analyzed include image feature information and software feature information.

[0039] Based on the search criteria entered by the user via keyboard or other means, and depending on the user's search habits, the input search criteria can include image ID, image name, and image tags. The system searches the local image repository based on these criteria to retrieve the images to be analyzed that match the search conditions. Specifically, the image feature information within the image to be analyzed includes image name, image tags, image ID, environment variables, and external software feature information, while the software feature information refers to the internal features of the image.

[0040] Step 104: Based on the image feature information, identify the image ID and external software feature information of the image to be analyzed, and generate an external feature key value sequence based on the image ID and external software feature information of the image to be analyzed.

[0041] External software feature information refers to software feature information affected by image feature information. Since internet image feature information is open source, users can change image feature information through Docker instructions, such as inserting new software into the image feature information, which in turn changes the external software feature information. However, the image ID attribute value will not change. Therefore, this invention achieves automated identification and matching of external feature information of images by matching the image ID with external software feature information to form an external feature key value sequence.

[0042] Step 106: Extract the internal description information within the image layers of the image to be analyzed. Parse the internal description information to obtain the internal software feature information of each image to be analyzed. Based on the internal software feature information of the image to be analyzed, generate an internal feature key-value sequence. The internal software feature information is the latest software feature information when the image layers of the image to be analyzed are updated.

[0043] An image to be analyzed comprises multiple image layers. Each image layer's internal description information includes software feature information and image layer attribute information. By parsing instructions in the Docker system related to changes in the internal description information, the software feature information corresponding to each image layer is obtained. The feature information of all image layers is combined to obtain the internal software feature information of the image to be analyzed. This internal software feature information changes over time, and an internal feature key-value sequence is generated based on the latest internal software feature information. Therefore, for feature extraction from an image, the image to be analyzed is first hierarchically structured, then the internal description information within each image layer is parsed, enabling automated extraction of internal software feature information and updating it to the latest software feature information, thereby improving the accuracy of the software feature extraction process.

[0044] Step 108: Concatenate the external feature key value sequence and the internal feature key value sequence to obtain the mirror feature information file, name the mirror feature information file with the mirror ID, and store it in the database.

[0045] The image ID, external software feature information, and internal software feature information are concatenated. When the external and internal software feature information contain information with the same software feature, the software feature information most recent to the retrieval time is retained, thus obtaining the latest software feature information matching the image ID. The image ID and the latest software feature information are combined into an image feature information file. If multiple images are retrieved simultaneously, multiple image feature files will be generated. To improve the efficiency of subsequent image retrievals, the image feature information files are stored in the image database. Therefore, in the process of retrieving an image and its corresponding software feature information by image ID, manual extraction and matching are unnecessary. By fully utilizing the two metric dimensions of changing software features—instructions and time—this invention improves the quality and efficiency of image retrieval. Furthermore, by concatenating internal and external software features, the accuracy of retrieving image software feature information is further enhanced.

[0046] The aforementioned automated container image tag matching method employs a container image tag matching method, apparatus, and computer equipment. It can search the local image repository based on search criteria, extracting images to be analyzed that match the search criteria. Because container systems have different permissions to modify software feature information, the images to be analyzed possess both external and internal software feature information. Therefore, the software feature information of the images to be analyzed is extracted step-by-step from the whole to the part, thereby mining both external and internal software feature information. Furthermore, considering the time relationship affecting changes in software feature information, the overall software feature information of the images to be analyzed is updated to generate an external key-value feature sequence containing external software feature information and the image ID, and an internal key-value feature sequence composed of internal software feature information. The external and internal key-value feature sequences are then concatenated to obtain an image feature information file matching the image ID. This satisfies users' requirements for image retrieval quality and improves the accuracy and precision of software retrieval within container images.

[0047] In one embodiment, a local image repository is searched based on user-input search criteria, and the image to be analyzed corresponding to the search criteria is extracted from the local image repository. If no corresponding image to be analyzed is found in the local image repository for the user-input search criteria, a cloud image repository is invoked, and the image to be analyzed corresponding to the search criteria is extracted from the cloud image repository using the container system's image pull instructions, and then stored in the local image repository.

[0048] The mirror ID in the user's search criteria is used as the basis for retrieving images from the local mirror repository. Depending on the user's search habits, multiple mirror IDs may be identified from the search criteria. It is worth noting that, for example... Figure 2 As shown, firstly, an image file containing multiple image IDs is submitted to the local image repository. The image IDs in the image file are separated by line. The local image repository reads the image ID file line by line and determines whether the image ID to be searched is stored in the local image repository. If the image searched by the user is stored in the local image repository, it can be directly extracted from the local image repository and output as the current image to be analyzed for automatic tag matching. Otherwise, the original Image Pull operation of the containerized software needs to be used to pull the corresponding image from the cloud image repository and output it as the current image to be analyzed for automatic tag matching.

[0049] Furthermore, after the image to be analyzed completes automatic tag matching, the image feature information file is output to the local image repository and the user search results interface. At the same time, the image feature information file is stored in the local image repository. Based on this, by identifying the number of image IDs N in the image file and the number of tags n in the current image feature information file, it is determined whether all images in the image file have completed tag matching. When n is less than N, it means that there are images in the image file that have not completed tag matching. Then, the next line of information in the image file is read to search for the next image ID. When n = N, it means that all image IDs have completed tag matching, and the process ends.

[0050] Therefore, considering the diversity of search characters input by users, packaging the search characters and processing them line by line avoids information overlap during subsequent mirror tag matching, thus ensuring the accuracy of the extraction of mirror feature information and software feature information from the mirror extraction end.

[0051] In one embodiment, when scanning the image to be analyzed, a pre-set noise library is used to filter the image using regular expressions. By calling the application programming interface within the container system, the Env command information and Label command information of the image to be analyzed are extracted to obtain the image feature information of the image to be analyzed. The image feature information is then filtered using regular expressions based on the noise library, the filtered image feature information is identified, and the image ID and external software feature information of the image to be analyzed are obtained.

[0052] The noise library consists of useless items that need to be filtered during the scanning of image information. Regular expressions are used to filter the images to be analyzed. Useless items refer to instructions and instruction information that are unrelated to changes in software feature information and tag matching. It's worth noting that, firstly, the image feature information of the image to be analyzed is scanned, and some useless items are removed using regular expressions. Information such as the image ID, image environment variables, and external software features are extracted. Then, since the overall Env command information of the image to be analyzed contains environment variables and some software feature information, while the Label command information contains some custom image tags added by the image creator, to reduce the complexity of subsequent tag matching and avoid interference from useless items, the Docker Engine API documentation is called to extract the Env and Label command information from the overall image to be analyzed. Then, regular expressions are used again to filter out useless items such as environment variables and custom image tags, obtaining the image feature information. Finally, the image feature information is identified, retaining only the image ID, the list of external software, and the corresponding software version information. The list of external software and the corresponding software version information are used as the external software feature information of the image to be analyzed. Additionally, the external software list includes software dependencies and the software within those dependencies.

[0053] Therefore, by making full use of regular expressions and noise libraries in an open-source mirror retrieval environment, and by filtering out useless items in the mirror feature information, the instruction information content related to software features is extracted and retained, further narrowing the data range for mirror ID tag matching. On the basis of automated feature information extraction, the accuracy of extraction and subsequent tag matching is guaranteed.

[0054] In one embodiment, a feature key-value sequence for each image to be analyzed is constructed based on its image ID and external software feature information. These feature key-value sequences are then concatenated to generate an external feature key-value sequence. The external software feature information includes an external software list and the software version information corresponding to the external software list, wherein the software version information corresponding to the external software list is the latest software version information when each image to be analyzed is updated.

[0055] It's worth noting that the external software list, which includes software dependencies, is paired with their corresponding version information to form key-value pairs. Each software key can correspond to multiple software version information values. To ensure that the values ​​retrieved from the image are better suited to the current container or application environment, when extracting external software feature information, if the same software key is encountered, the value most recent to the current retrieval time is retained, replacing the earlier value. This process is iterated to obtain the latest version information of the software, which is then used to form the latest external software feature information. The key-value pairs within this latest external software feature information are matched with the image ID to form external tags, generating a feature key-value sequence for the image to be analyzed. When there are multiple image IDs, the feature key-value sequences of each image to be analyzed are concatenated to obtain the external feature key-value sequence corresponding to the image description file.

[0056] Therefore, by updating the software version information, the software feature information within the image corresponding to the image ID can better meet the user's current search needs.

[0057] In one embodiment, the image to be analyzed is decomposed into multiple image layers. By extracting the container file of each image layer, the creation command information corresponding to the image layer is obtained. The creation command information is filtered using regular expressions based on a pre-set noise library to obtain the internal description information within the image layer.

[0058] It's worth noting that methods like Extract Image Layers are used to decompose the current image to be analyzed, resulting in tar packages, JSON files, and a manifest.json file for the entire image, representing multiple image layers. The JSON file for each image layer is extracted and analyzed to extract the creation commands from its original Dockerfile, thus obtaining the creation command information for the current image layer. Furthermore, regular expressions and a noise library are used to filter the creation command information for each image layer, revealing its internal description.

[0059] In one embodiment, the internal description information is parsed to extract the installation command information within each image layer. Regular expressions are used to match the strings within the installation command information to obtain the software feature information within each image layer. This software feature information is then concatenated to generate the internal software feature information for each image to be analyzed. The internal software feature information includes the internal software and its corresponding version information. Based on the internal software feature information of each image to be analyzed, a feature key-value sequence for each image layer is constructed. These feature key-value sequences are then concatenated to generate the internal feature key-value sequence for the image to be analyzed.

[0060] It is worth noting that the internal description information includes RUN command information and other instruction information unrelated to software feature information. The RUN command information is extracted from the internal description information. Among them, the operation commands after the RUN command in each layer of the image all start with the && instruction. The RUN command information includes the RUN command and the command information starting with &&. The RUN command information of the image layer is decomposed and separated by line according to the "\" symbol. The RUN command in each line of command string is decomposed at the semantic level.

[0061] Specifically, the strings include pip, yum, and apt-get commands. For pip commands, the method of separating "==" is used to record the software including its dependencies and their corresponding version information. For yum and apt-get commands, regular expressions are used to match the command information and parse the "-" in the subsequent two strings of command information parameters to obtain the software including its dependencies and their corresponding version information. For the software feature information within each image layer, key-value pairs consisting of the software key and its value are used to form external tags. After concatenating the image layer and the image to be analyzed, an internal feature key-value sequence of the image to be analyzed is generated. When there is no corresponding version information for the software key, the value is assigned an empty value.

[0062] Therefore, by hierarchically analyzing the build commands of each layer of the image based on its internal details, the software dependency packages and their version information contained in each layer can be extracted. By combining regular expression methods with operations using a unified string format, the extraction process of software feature information can be further optimized, thereby improving the accuracy of image tag matching, increasing the accuracy of image IDs and their corresponding image software feature information, eliminating redundant string matching processes, saving a lot of internal image resources, and meeting users' needs for image retrieval efficiency.

[0063] In one embodiment, based on the time when the installation command is executed in the image layer of the image to be analyzed, the version information corresponding to the internal software in the internal software feature information is sorted, and the version information ranked later overwrites the version information ranked earlier next to it. This process is repeated iteratively to obtain the latest version information corresponding to the internal software. The latest software feature information is then constructed based on the internal software and the latest version information corresponding to the internal software.

[0064] It is worth noting that the updated internal software feature information and the updated external software feature information have different numbers of bits in the software value due to the different control commands they are subject to. For example, for the overall software version update, the value can be updated from 1.0 to 2.0, while for the optimization of the internal software modules, the value can be updated from 1.0 to 1.1 or even 2.1. Therefore, it is necessary to iteratively update the internal software feature information and the external software feature information separately.

[0065] In one embodiment, an external feature key value sequence and an internal feature key value sequence are concatenated based on the software feature information to obtain the image ID and the latest software feature information. Based on the image ID and the latest software feature information, an image feature information file is generated. The image ID in the image feature information file is named the image feature information file and stored in the image database.

[0066] It is worth noting that the key-value pairs within the external and internal feature key-value sequences are concatenated. During the concatenation process, the internal tags are matched with the external tags. When software with the same key value is matched, the value is updated in chronological order, with the value generated later overwriting the value generated earlier, thus obtaining the latest software features. This generates a mirror tag that includes the mirror ID, the software key value, and its value. This tag and the information it carries are written into the mirror feature information file. Each mirror ID corresponds to one mirror feature information file. After naming the file with the mirror ID, it is stored in the mirror database.

[0067] Therefore, since the updates of internal software feature information are relatively independent of those of external software feature information, software key-value pairs are used as key tags for software feature information. Machine extraction is used instead of manual extraction to extract and match tag information from both the external and internal aspects of the image. Regular expressions are fully utilized to eliminate useless items in the entire implementation process, realizing the automated generation of tags for open-source software information and image environments. This improves the accuracy of user image retrieval and further enhances the retrieval accuracy of software in container images.

[0068] It should be understood that, although Figure 1-2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1-3At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0069] In one embodiment, such as Figure 3 As shown, an automated container image label matching device is provided, including: an image extraction module, an external sequence generation module, an internal sequence generation module, and a splicing module, wherein:

[0070] The image extraction module is used to retrieve the image to be analyzed from the local image repository based on the image ID. The image to be analyzed includes image feature information and software feature information. The software feature information includes external software feature information and internal software feature information.

[0071] External sequence generation module: It is used to identify the image ID and external software feature information of the image to be analyzed based on the image feature information, and generate an external feature key value sequence based on the image ID and external software feature information of the image to be analyzed.

[0072] Internal sequence generation module: This module extracts internal description information from the image layers within the image to be analyzed, parses the internal description information to obtain the internal software feature information of each image to be analyzed, and generates an internal feature key-value sequence based on the internal software feature information of the image to be analyzed. The internal software feature information is the latest software feature information when the image layer of the image to be analyzed is updated.

[0073] The splicing module is used to splice the external feature key value sequence and the internal feature key value sequence to obtain a mirror feature information file, name the mirror feature information file with the mirror ID, and store it in the database.

[0074] In one embodiment, a local image repository is searched based on user-input search criteria, and the image to be analyzed corresponding to the search criteria is extracted from the local image repository. If no image to be analyzed corresponds to the user-input search criteria in the local image repository, a cloud image repository is invoked, and the image to be analyzed corresponding to the search criteria in the cloud image repository is extracted using the container system's image pull instructions and stored in the local image repository.

[0075] In one embodiment, when scanning the image to be analyzed, a pre-set noise library is used to filter the image using regular expressions. By calling the application programming interface within the container system, the Env and Label command information of the image to be analyzed is extracted to obtain the image feature information. Based on the noise library, regular expressions are used to filter the image feature information, identify the filtered image feature information, and obtain the image ID and external software feature information of the image to be analyzed.

[0076] In one embodiment, a feature key-value sequence for each image to be analyzed is constructed based on its image ID and external software feature information. These feature key-value sequences are then concatenated to generate an external feature key-value sequence. The external software feature information includes a list of external software and the corresponding software version information, wherein the software version information corresponding to the external software list is the latest software version information when each image to be analyzed is updated.

[0077] In one embodiment, the image to be analyzed is decomposed into multiple image layers. By extracting the container file of each image layer, the creation command information corresponding to the image layer is obtained. The creation command information is filtered using regular expressions based on a pre-set noise library to obtain the internal description information within the image layer.

[0078] In one embodiment, the internal description information is parsed to extract the installation command information within each image layer. Regular expressions are used to match the strings within the installation command information to obtain the software feature information within each image layer. This software feature information is then concatenated to generate the internal software feature information for each image to be analyzed. The internal software feature information includes the internal software and its corresponding version information. Based on the internal software feature information of each image to be analyzed, a feature key-value sequence for each image layer is constructed. These feature key-value sequences are then concatenated to generate the internal feature key-value sequence for the image to be analyzed.

[0079] In one embodiment, based on the time when the installation command is executed in the image layer of the image to be analyzed, the version information corresponding to the internal software in the internal software feature information is sorted, and the version information ranked later overwrites the version information ranked earlier adjacent to it. This process is repeated iteratively to obtain the latest version information corresponding to the internal software. The latest software feature information is then constructed based on the internal software and the latest version information corresponding to the internal software.

[0080] In one embodiment, the external feature key value sequence and the internal feature key value sequence are concatenated according to the software feature information to obtain the image ID and the latest software feature information. Based on the image ID and the latest software feature information, an image feature information file is generated. The image ID in the image feature information file is named the image feature information file and stored in the image database.

[0081] For specific limitations regarding the automated container image label matching device, please refer to the limitations of the automated container image label matching method described above, which will not be repeated here. Each module in the aforementioned automated container image label matching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0082] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an automated matching method for container image labels. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0083] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0084] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to perform the following steps:

[0085] Retrieve the images to be analyzed from the local image repository based on the search criteria. The images to be analyzed include image feature information and software feature information.

[0086] Based on the image feature information, the image ID and external software feature information of the image to be analyzed are identified, and an external feature key value sequence is generated based on the image ID and external software feature information of the image to be analyzed.

[0087] The internal description information of each image layer in the image to be analyzed is extracted. This internal description information is then parsed to obtain the internal software feature information of each image. Based on this internal software feature information, an internal feature key-value sequence is generated. The internal software feature information is the latest software feature information obtained when the image layer of the image to be analyzed is updated.

[0088] The external feature key value sequence and the internal feature key value sequence are concatenated to obtain the mirror feature information file. The mirror feature information file is named with the mirror ID and stored in the database.

[0089] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0090] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0091] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for automatically matching container image tags, characterized in that, The method includes: The images to be analyzed are retrieved from the local image repository based on the search criteria; the images to be analyzed include image feature information and software feature information. Based on the image feature information, the image ID and external software feature information of the image to be analyzed are identified. Based on the image ID and external software feature information of the image to be analyzed, an external feature key value sequence is generated. When scanning the image to be analyzed, a regular expression method is used to filter the image to be analyzed using a pre-set noise library. By calling the application programming interface within the container system, the Env command information and Label command information of the image to be analyzed are extracted to obtain the image feature information of the image to be analyzed. The image feature information is filtered using regular expressions based on the noise library. The filtered image feature information is identified, and only the image ID, the list of external software and the software version information corresponding to the external software are retained. The list of external software and the software version information corresponding to the external software are used as the external software feature information of the image to be analyzed. The external software feature information includes: an external software list and software version information corresponding to the external software list, wherein the software version information corresponding to the external software list is the latest software version information when each image to be analyzed is updated; internal description information is extracted from the image layers of the image to be analyzed, and the internal description information is parsed to obtain the internal software feature information of each image to be analyzed; an internal feature key-value sequence is generated based on the internal software feature information of the image to be analyzed; the internal software feature information is the latest software feature information when the image layers of the image to be analyzed are updated; the internal software feature information includes: internal software and version information corresponding to the internal software; The external feature key sequence and the internal feature key sequence are concatenated to obtain a mirror feature information file. The mirror feature information file is named with the mirror ID and stored in the database.

2. The method according to claim 1, characterized in that, The steps for retrieving the image to be analyzed from the local image repository based on the search criteria include: The local image repository is retrieved based on the search criteria input by the user, and the image to be analyzed corresponding to the search criteria is extracted from the local image repository. If the search criteria entered by the user do not have a corresponding image to be analyzed in the local image repository, the cloud image repository is invoked, and the image to be analyzed corresponding to the search criteria in the cloud image repository is extracted using the image pull command of the container system and stored in the local image repository.

3. The method according to claim 2, characterized in that, Based on the image ID of the image to be analyzed and the external software feature information, an external feature key-value sequence is generated, including: Based on the image ID and external software feature information of each image to be analyzed, a feature key value sequence is constructed for each image to be analyzed. The feature key value sequences of each image to be analyzed are then concatenated to generate an external feature key value sequence.

4. The method according to claim 3, characterized in that, Extracting the internal description information of the image layer in the image to be analyzed also includes: The image to be analyzed is decomposed into multiple image layers. By extracting the container file of each image layer, the creation command information corresponding to the image layer is obtained. The creation command information is filtered using regular expressions based on a pre-set noise library to obtain the internal description information within the image layer.

5. The method according to claim 4, characterized in that, Parsing the internal description information yields the internal software feature information of each image to be analyzed. Based on the internal software feature information of the image to be analyzed, an internal feature key-value sequence is generated, including: The internal description information is parsed to extract the installation command information within each image layer. The installation command information is matched with strings in the installation command information using regular expressions to obtain the software feature information within each image layer. The software feature information within each image layer is concatenated to generate the internal software feature information of each image to be analyzed. Based on the internal software feature information of each image to be analyzed, a feature key value sequence of the image layer in each image to be analyzed is constructed, and the feature key value sequences of the image layers are concatenated to generate the internal feature key value sequence of the image to be analyzed.

6. The method according to claim 5, characterized in that, The steps to obtain the latest software feature information of the image layer being analyzed when it is updated include: Based on the time when the installation command was executed in the image layer of the image to be analyzed, the version information corresponding to the internal software in the internal software feature information is sorted. The version information ranked later overwrites the adjacent version information ranked earlier. This process is repeated iteratively to obtain the latest version information corresponding to the internal software. The latest software feature information is then constructed based on the internal software and the latest version information corresponding to the internal software.

7. The method according to claim 6, characterized in that, The external feature key sequence and the internal feature key sequence are concatenated to obtain a mirror feature information file. The mirror feature information file is named with the mirror ID and stored in a database, including: By concatenating the external feature key sequence and the internal feature key sequence according to the software feature information, the mirror feature information and the latest software feature information are obtained. Based on the mirror ID and the latest software feature information, a mirror feature information file is generated. The mirror feature information file is named with the mirror ID in the mirror feature information file and stored in the mirror database.

8. An automated container image label matching device, characterized in that, The device includes: The image extraction module is used to retrieve images to be analyzed from the local image repository by inputting search criteria; the images to be analyzed include image feature information and software feature information. External sequence generation module: This module identifies the image ID and external software feature information of the image to be analyzed based on the image feature information. It filters the image using regular expressions while scanning it with a pre-set noise library. It extracts the Env and Label command information of the image to be analyzed by calling the application programming interface (API) within the container system to obtain the image feature information. It then filters this image feature information using regular expressions based on the noise library, identifying the filtered image feature information and retaining only the image ID, the list of external software, and the corresponding software version information. This list of external software and the corresponding software version information are then used as the external software feature information of the image to be analyzed. Based on the image ID and the external software feature information of the image to be analyzed, an external feature key-value sequence is generated. The external software feature information includes the list of external software and the corresponding software version information, where the software version information corresponding to the external software list is the latest software version information for each image to be analyzed when it is updated. Internal sequence generation module: used to extract internal description information within the image layers of the image to be analyzed, parse the internal description information to obtain internal software feature information of each image to be analyzed, and generate an internal feature key-value sequence based on the internal software feature information of the image to be analyzed; the internal software feature information is the latest software feature information when the image layer of the image to be analyzed is updated; the internal software feature information includes: internal software and the version information corresponding to the internal software; The splicing module is used to splice the external feature key value sequence and the internal feature key value sequence to obtain a mirror feature information file, name the mirror feature information file with the mirror ID, and store it in the database.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.