CN116107991A - Container label database construction method and device, storage medium and electronic equipment - Google Patents

Container label database construction method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN116107991A
CN116107991A CN202111325645.9A CN202111325645A CN116107991A CN 116107991 A CN116107991 A CN 116107991A CN 202111325645 A CN202111325645 A CN 202111325645A CN 116107991 A CN116107991 A CN 116107991A
Authority
CN
China
Prior art keywords
fingerprint
tag
information
container
label
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111325645.9A
Other languages
Chinese (zh)
Inventor
严丽云
何震苇
杨新章
黄丹池
林园致
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202111325645.9A priority Critical patent/CN116107991A/en
Publication of CN116107991A publication Critical patent/CN116107991A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure relates to the field of cloud computing containers, in particular to a container label database construction method, a container label database construction device, a storage medium and electronic equipment. The method for constructing the container label database comprises the following steps: generating fingerprint information with a fingerprint category according to preset fingerprint categories and application data of a container; based on the fingerprint category of the fingerprint information, carrying out label processing on the fingerprint information to obtain label information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag; constructing a container label database for storing label information of the container corresponding to the target container. The method for constructing the container label database can uniformly analyze, extract and store the container labels.

Description

Container label database construction method and device, storage medium and electronic equipment
Technical Field
The disclosure relates to the field of cloud computing containers, in particular to a container label database construction method, a container label database construction device, a storage medium and electronic equipment.
Background
In a computer, container (Container) is a lighter, more flexible way of virtualizing, and it packages all that is needed by an application. The application scene of the container label after extraction is various, for example, an index monitoring system based on a time sequence and the like.
The label extraction of the prior art container mainly comes from the extraction of label fields in the configuration file of the container, has single source, and the quantity and quality of the container labels are all mastered in the hands of container operation and maintenance personnel, so that the characteristics of the container cannot be fully expressed,
the containers of different levels are usually maintained by different departments or personnel, which may cause inconsistency of container label configuration and the characteristic of decentralized management, which determines the difficulty of container label management and maintenance, and makes it difficult to implement cross-application and cross-resource-level association analysis.
It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The disclosure aims to provide a container label database construction method, a container label database construction device, a storage medium and electronic equipment, and aims to solve the problem of unified analysis, extraction and storage of container labels.
Other features and advantages of the present disclosure will be apparent from the following detailed description, or may be learned in part by the practice of the disclosure.
According to an aspect of the embodiments of the present disclosure, there is provided a container tag database construction method, including: generating fingerprint information with a fingerprint category according to preset fingerprint categories and application data of a container; based on the fingerprint category of the fingerprint information, carrying out label processing on the fingerprint information to obtain label information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag; constructing a container label database for storing label information of the container corresponding to the target container.
According to some embodiments of the disclosure, based on the foregoing aspects, the fingerprint categories include one or more of a software fingerprint category, a configuration fingerprint category, a resource fingerprint category, and a topology fingerprint category.
According to some embodiments of the disclosure, based on the foregoing solution, the application data includes an image file, a configuration file, and a topological relation, and the generating fingerprint information with the fingerprint category according to the application data of the container includes: when the fingerprint category is a software fingerprint category, extracting a target hash code of a mirror image layer in the mirror image file to obtain a software fingerprint; when the fingerprint category is a configuration fingerprint category, extracting configuration information and/or environment variables in the configuration file to obtain a configuration fingerprint; when the fingerprint category is a resource fingerprint category, extracting resource configuration information and/or resource demand information in the configuration file to obtain a resource fingerprint; and when the fingerprint category is a topological fingerprint category, extracting one or more of service dependence, service chain and flow characteristics in the topological relation to obtain the topological fingerprint.
According to some embodiments of the disclosure, based on the foregoing solution, when the fingerprint category is a software fingerprint category, the performing label processing on the fingerprint information to obtain label information includes: and inquiring a software tag corresponding to the target hash code according to the software Ha Xiku.
According to some embodiments of the present disclosure, based on the foregoing approach, the method further includes pre-building the software Ha Xiku, the pre-building the software Ha Xiku includes: extracting the software type and version information of a software package with a known software type as a software tag of the software package; encrypting the software package by adopting an encryption algorithm to obtain a hash value of the software package; the software Ha Xiku for storing the software tag and the hash value corresponding to the software tag is constructed.
According to some embodiments of the disclosure, based on the foregoing solution, when the fingerprint category is a configuration fingerprint category, a resource fingerprint category, or a topology fingerprint category, the performing label processing on the fingerprint information to obtain label information includes: preprocessing the fingerprint information; and inputting the preprocessed fingerprint information into a multi-label prediction model to output a target prediction label as the label information.
According to some embodiments of the disclosure, based on the foregoing scheme, the method further comprises pre-creating the multi-label prediction model, the pre-creating the multi-label prediction model comprising: performing feature analysis on the historical fingerprint information to obtain a mapping relation between the fingerprint information and the tag information; performing model training by utilizing the historical fingerprint information and the mapping relation to obtain an initial multi-label prediction model; inputting the test fingerprint information into the initial multi-label prediction model to output test label information; and when the test tag information meets the evaluation condition, taking the initial multi-tag prediction model as the multi-tag prediction model.
According to some embodiments of the disclosure, based on the foregoing scheme, the method further comprises: and providing a query interface of the container label database for calling the query interface to query label information corresponding to the container.
According to a second aspect of embodiments of the present disclosure, there is provided a container tag database construction apparatus, including: the fingerprint module is used for generating fingerprint information with a preset fingerprint category according to the application data of the container; the tag module is used for performing tag processing on the fingerprint information based on the fingerprint category of the fingerprint information to obtain tag information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag; and the storage module is used for constructing a container label database for storing label information corresponding to the container and the target container.
According to a third aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a container label database method as in the above embodiments.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic device, including: one or more processors; and storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the container tag database method as in the above embodiments.
Exemplary embodiments of the present disclosure may have some or all of the following advantages:
in the technical schemes provided by some embodiments of the present disclosure, fingerprint information of different categories of containers is generated according to preset fingerprint categories, then the fingerprint information is subjected to label processing to obtain label information, and finally a container label database is constructed. On the one hand, by presetting fingerprints of various types, application data of the container in various dimensions can be obtained in an all-around manner, one or more kinds of label information including a software label, a configuration label, a resource label and a topology label are obtained, a single acquisition source from the configuration file is avoided, and the extracted labels can also have consistency; on the other hand, by adopting a unified label conversion method, cross-application and cross-resource-level association analysis between labels of containers can be realized, and unified label management and maintenance on different containers are facilitated.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure. It will be apparent to those of ordinary skill in the art that the drawings in the following description are merely examples of the disclosure and that other drawings may be derived from them without undue effort. In the drawings:
FIG. 1 schematically illustrates a flow diagram of a method of constructing a container label database in an exemplary embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow diagram of a method of constructing software Ha Xiku in an exemplary embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow diagram of a method of creating a multi-label predictive model in an exemplary embodiment of the disclosure;
FIG. 4 schematically illustrates a schematic diagram of a container tag database construction system in an exemplary embodiment of the present disclosure;
FIG. 5 schematically illustrates a schematic composition of a container label database building apparatus in an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure;
fig. 7 schematically illustrates a structural diagram of a computer system of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the disclosed aspects may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
Implementation details of the technical solutions of the embodiments of the present disclosure are set forth in detail below.
Fig. 1 schematically illustrates a flowchart of a container tag database construction method in an exemplary embodiment of the present disclosure. As shown in fig. 1, the container tag database construction method includes steps S101 to S103:
step S101, generating fingerprint information with a preset fingerprint category according to application data of a container;
Step S102, based on the fingerprint category of the fingerprint information, carrying out label processing on the fingerprint information to obtain label information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag;
step S103, constructing a container label database for storing label information corresponding to the container and the target container.
In the technical schemes provided by some embodiments of the present disclosure, fingerprint information of different categories of containers is generated according to preset fingerprint categories, then the fingerprint information is subjected to label processing to obtain label information, and finally a container label database is constructed. On the one hand, by presetting fingerprints of various types, application data of the container in various dimensions can be obtained in an all-around manner, one or more kinds of label information including a software label, a configuration label, a resource label and a topology label are obtained, a single acquisition source from the configuration file is avoided, and the extracted labels can also have consistency; on the other hand, by adopting a unified label conversion method, cross-application and cross-resource-level association analysis between labels of containers can be realized, and unified label management and maintenance on different containers are facilitated.
Hereinafter, each step of the container tag database construction method in the present exemplary embodiment will be described in more detail with reference to the accompanying drawings and examples.
In step S101, fingerprint information having a predetermined fingerprint category is generated from application data of a container according to the fingerprint category.
Specifically, fingerprint categories of fingerprint information can be preset, and targeted information collection can be performed on the Container (Container). Wherein, the container is a "lightweight" virtualization, and its purpose is to create an "isolated environment" as is the case with a virtual machine.
In one embodiment of the present disclosure, the fingerprint categories include one or more of a software fingerprint category, a configuration fingerprint category, a resource fingerprint category, and a topology fingerprint category. Correspondingly, fingerprint information such as software fingerprints, configuration fingerprints, resource fingerprints, topology fingerprints and the like can be generated.
Software fingerprints refer to software information contained in the container application, such as which software packages, software package version information are included; configuration fingerprints refer to information related to the configuration files of the container application, such as the deployment category, deployment environment, etc. of the container; the resource fingerprint refers to information such as resource configuration in a configuration file of a container application, for example, whether the container is CPU intensive or I/O intensive; the topology fingerprint may characterize the relationship between the container application and other container applications, such as dependencies, service chains, etc.
Based on the method, various types of fingerprint information are preset, on one hand, the container multi-label information can be obtained based on rich and various fingerprint information, and the singleness of a label field extraction method in a configuration file of a container is avoided; on the other hand, the defects of inconsistent configuration of the label information, difficult control of quantity and quality and the like in the decentralized operation of the container can be avoided.
In step S102, performing label processing on the fingerprint information based on the fingerprint category of the fingerprint information to obtain label information; wherein the tag information includes one or more of a software tag, a configuration tag, a resource tag, and a topology tag.
In one embodiment of the present disclosure, the method of converting the tag is different for different categories of fingerprint information. For example, the software tags can extract data from the software information and directly convert the data, while configuration tags, resource tags, and topology tags need to be converted using a predictive model based on fingerprint information.
Likewise, the tag information corresponding to the category is obtained after the fingerprints of different categories are converted, and the tag information can comprise types such as software tags, configuration tags, resource tags, topology tags and the like.
In step S103, a container label database for storing label information of the container corresponding to the target container is constructed.
Specifically, for different containers, information of all aspects of the containers is collected in a unified mode to extract and convert label information, so that container labels corresponding to the containers are obtained, and then the converted container labels are stored in a unified mode, and original container data can be stored at the same time to prevent label deletion.
For example, each container may be assigned a container ID, and the container ID and the label corresponding to the container may be stored. For software tags, the storage format is for example { container ID: pack agetype1=value, pack ageversion 1=value, …, pack agetypen=value, pack ageversion n=value }; for configuration tags, resource tags, or topology tags, the storage format is for example: { Container ID: label1=value, …, labeln=value }.
In one embodiment of the present disclosure, the application data includes an image file, a configuration file, and a topological relationship.
The image file is a file similar to a rar or zip compressed file, and a specific series of files are manufactured into a single file according to a certain format for downloading by a user. The system image file contains an operating system file, a boot file, partition table information, and the like, and is used for installing and repairing a system, and the system image file can be understood to be a clone file for installing all data of an optical disc for the whole system, such as a microsoft original edition system, or can be a backup file of an operating system partition, such as a ghost system image. Common system image files are, for example, the Manifest description file, index. Jason, layers, etc.
A configuration file is essentially a file containing the information required for a successful operation of a program, which information is structured in a specific way. They are not hard coded in the program, but are user configurable, typically stored in plain text files. The configuration file contains information such as Lable fields, environment attributes, resource variables and the like.
Topological relations refer to interrelationships between spatial data that satisfy the principle of topological geometry. The term "dependency relationship" is used herein to refer mainly to information such as service dependency, link, and traffic among containers in a service.
In an exemplary embodiment of the present disclosure, when step S101 is performed, the process of generating fingerprint information is different from fingerprint categories. Specifically, the generating fingerprint information with the fingerprint category according to the application data of the container is as follows:
(1) And when the fingerprint category is a software fingerprint category, extracting a target hash code of the mirror image layer in the mirror image file to obtain a software fingerprint.
In particular, the software fingerprint is used to characterize the software information contained in the container application. When generating the software fingerprint, the hash codes (hash codes) of each image layer in the image file of the container need to be extracted and analyzed to obtain a hash Code set, and then the software fingerprint is generated based on the hash Code set. The hash code is an algorithm of a data structure, and is a value of an int type calculated by jdk (java development kit ) according to an address or a character string or digits of an object.
(2) And when the fingerprint category is a configuration fingerprint category, extracting and/or environment variables in the configuration file to obtain a configuration fingerprint.
In particular, the configuration fingerprint is used to characterize information about the container application configuration file, and may be derived from configuration information or environment variables in the configuration file, or a combination of both, such as environment attributes in the configuration file, etc., when the configuration fingerprint is generated.
(3) And when the fingerprint category is a resource fingerprint category, extracting resource configuration information and/or resource demand information in the configuration file to obtain a resource fingerprint.
In particular, the resource fingerprint is used to characterize the resource configuration information of the container application, and thus the resource configuration information and/or the resource requirement information that may be obtained generates a resource fingerprint, e.g., a resource variable in a configuration file, etc.
(4) And when the fingerprint category is a topological fingerprint category, extracting one or more of service dependence, service chain and flow characteristics in the topological relation to obtain the topological fingerprint.
In particular, topology fingerprints are used to characterize the topology information of the container application, requiring the topology fingerprints to be generated using one or more of service dependencies, service chains, traffic characteristics.
In an exemplary embodiment of the present disclosure, the process of converting to tag information is slightly different from the fingerprint category when step S102 is performed. Specifically, the tag processing is performed on the fingerprint information based on the fingerprint category of the fingerprint information to obtain tag information as follows:
(1) When the fingerprint category is a software fingerprint category, the processing the fingerprint information to obtain tag information includes: and inquiring a software tag corresponding to the target hash code according to the software Ha Xiku.
Specifically, the hash code in the software fingerprint extracted from the container is matched and inquired with the existing software hash library, so that a software-level label corresponding to the hash code in the hash library is obtained. The software tags may include category tags and version tags for the software.
Thus, the method further comprises pre-building the software Ha Xiku prior to the tagging of the fingerprint information.
Fig. 2 schematically illustrates a flow diagram of a method of constructing software Ha Xiku in an exemplary embodiment of the present disclosure. As shown in fig. 2, the specific process of the method for constructing the software Ha Xiku includes:
step S201, extracting the software type and version information of a software package with a known software type as a software tag of the software package;
Step S202, encrypting the software package by adopting an encryption algorithm to obtain a hash value of the software package;
in step S203, the software Ha Xiku for storing the software tag and the hash value corresponding to the software tag is constructed.
Specifically, in step S201, all software packages of all known software types are first acquired while type and version information of these software packages are extracted as software tags, respectively.
In step S202, the software packages are encrypted one by one to generate unique hash value identifiers. The Hash function encryption Algorithm (Hash Algorithm) can be adopted for encryption, no key is needed, and the Hash function encryption Algorithm is mainly used for providing integrity and anti-counterfeiting support for parts needing to be protected in the encryption process of the two, and is common in Hash encryption Algorithm: MD5, SHA-1, SHA-2, SHA-256, SHA-X (series).
It should be noted that, the encryption algorithm may also adopt symmetric encryption according to the need, that is, the encryption system adopting the symmetric key adopts the same key in the encryption and decryption processes, and both communication parties must obtain the key at the same time to perform encryption and decryption operations, so that common symmetric encryption: DES, 3DES, AES, etc.; asymmetric encryption may also be employed, where the encryption and decryption keys employed by the asymmetric encryption system are different, the encryption being referred to as the public key and the decryption as the private key. Public key encryption private key decryption, private key signature public key verification, common asymmetric algorithm: RSA, DSA, ECC, etc.
In step S203, the tag of the software package and the corresponding hash code are stored in the software Ha Xiku in a format similar to that of the software package: { hash code: packageType=value, packageversion=value }, the stored software tags include category tags and version tags.
(2) When the fingerprint category is a configuration fingerprint category, a resource fingerprint category or a topology fingerprint category, the processing the fingerprint information to obtain tag information includes: preprocessing the fingerprint information; and inputting the preprocessed fingerprint information into a multi-label prediction model to output a target prediction label as the label information.
Specifically, when performing label conversion on configuration fingerprints, resource fingerprints, and topology fingerprints, mapping based on a unified model is required.
First, the fingerprint information is preprocessed. The preprocessing process is, for example, summarizing, deduplicating, grammar correcting, etc. fingerprint information. And then, converting fingerprint information into label information by utilizing the multi-label predictive model which is trained in advance, and outputting the predictive label of the container.
Thus, the method further comprises creating the multi-label predictive model in advance of label converting configuration fingerprints, resource fingerprints, and topology fingerprints.
Fig. 3 schematically illustrates a flow diagram of a method of creating a multi-label predictive model in an exemplary embodiment of the disclosure. As shown in fig. 3, the specific process of creating the multi-label prediction model method includes:
step S301, performing feature analysis on the historical fingerprint information to obtain a mapping relation between the fingerprint information and the tag information;
step S302, performing model training by using the historical fingerprint information and the mapping relation to obtain an initial multi-label prediction model;
step S303, inputting test fingerprint information into the initial multi-label prediction model to output test label information;
and step S304, when the test tag information meets the evaluation condition, taking the initial multi-tag prediction model as the multi-tag prediction model.
Specifically, in step S301, first, analysis is required based on a large number of fingerprint data features, so as to obtain a corresponding suitable label. Table 1 shows a mapping relationship between fingerprint information and tag information.
Table 1 mapping relationship between fingerprint information and tag information
Figure BDA0003347005580000101
Figure BDA0003347005580000111
Referring to table 1, taking the configuration tag as an example, the development environment, the test environment, the dockercompose, the helm and other tag information in the configuration tag can be obtained through environment variables and configuration information.
In step S302, after obtaining a mapping relationship according to the feature analysis of the historical fingerprint information, a training sample including fingerprint information and tag information is created for model input, and a multi-tag algorithm is adopted to perform machine learning in combination with training data, so as to obtain an initial multi-tag prediction model.
In order to evaluate the accuracy of model predictions, the present disclosure validates the prediction results of the multi-label prediction model.
Step S303 is first executed, where the test fingerprint information is input into the trained initial multi-label prediction model, and the test label information is output.
And then executing step S304, presetting an evaluation function, outputting the current model into a final multi-label prediction model if the test label information meets the evaluation function requirement, and continuing model training and adjusting model parameters if the test label information does not meet the evaluation function requirement.
Therefore, the conversion process of the configuration tag is: inputting the configuration fingerprint into the multi-label predictive model to output configuration labels, which may include container deployment category labels, deployment environment labels, and the like.
The conversion process of the resource tag is as follows: inputting the resource fingerprint into the multi-label predictive model to output the resource label may include storing I/O intensive, CPU computationally intensive, GPU computationally intensive, low network latency, and the like.
The topology label conversion process comprises the following steps: the topology fingerprint input multi-label prediction model outputs topology labels, which can comprise a multi-layer architecture, a bus architecture and a star network.
Based on the method, a multi-label prediction model is introduced to perform label prediction on the extracted original data of the container, so that unified labeling of container application is realized, the problem that the container application labels are stored in a plurality of entities in a scattered manner and are difficult to maintain is solved, unified analysis and extraction of the labels can be realized, and more effective label information is automatically extracted. In addition, the unified standardization of the tag information can also facilitate the maintenance and management of the tag database.
In one embodiment of the present disclosure, after the step S103 is performed to obtain the container tag database, a query interface of the database may also be provided, so as to facilitate data searching of the container tag information. The method further comprises the steps of: and providing a query interface of the container label database for calling the query interface to query label information corresponding to the container.
For example, if each container in the container tag database has a container ID, a third party application tag query interface, such as Prometheus, loki, may be provided, and the container ID may be entered to obtain the container tag set.
Fig. 4 schematically illustrates a structural diagram of a container tag database construction system in an exemplary embodiment of the present disclosure. Referring to fig. 4, the system includes a data acquisition module 401, a fingerprint extraction module 402, a tag extraction module 403, a tag database 404, and a query interface 405.
The data collection module 401 is configured to collect container data of a target container, including an image file, a configuration file, a topology structure, and the like. The fingerprint extraction module 402 is configured to extract fingerprint information according to the collection result of the data collection module. The tag extraction module 403 is configured to extract tag information according to fingerprint information of the fingerprint extraction module. The tag database 404 stores tag information corresponding to the container. The query interface 405 is used for query access to a database of data.
Based on the method, compared with the prior art, on one hand, single configuration file label extraction is avoided, and multidimensional container information is extracted through a plurality of sources, so that a label acquisition technology of software, configuration, resources and topology dimensions is provided; on the other hand, a multi-label prediction model is introduced to conduct label prediction on the extracted original data of the container, unified label representation is provided, and maintenance and management on the container label are facilitated.
Fig. 5 schematically illustrates a schematic composition of a container tag database construction apparatus in an exemplary embodiment of the present disclosure, and as shown in fig. 5, the container tag database construction apparatus 500 may include a fingerprint module 501, a tag module 502, and a storage module 503. Wherein:
the fingerprint module 501 is configured to generate fingerprint information with a fingerprint category according to a preset fingerprint category and application data of a container;
the tag module 502 is configured to perform tag processing on the fingerprint information based on the fingerprint category of the fingerprint information to obtain tag information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag;
and the storage module 503 is used for constructing a container label database for storing label information of the container corresponding to the target container.
According to an exemplary embodiment of the present disclosure, the fingerprint categories include one or more of a software fingerprint category, a configuration fingerprint category, a resource fingerprint category, and a topology fingerprint category.
According to an exemplary embodiment of the present disclosure, the application data includes an image file, a configuration file, and a topological relation, and the fingerprint module 501 is configured to extract a target hash code of an image layer in the image file to obtain a software fingerprint when the fingerprint class is a software fingerprint class; when the fingerprint category is a configuration fingerprint category, extracting configuration information and/or environment variables in the configuration file to obtain a configuration fingerprint; when the fingerprint category is a resource fingerprint category, extracting resource configuration information and/or resource demand information in the configuration file to obtain a resource fingerprint; and when the fingerprint category is a topological fingerprint category, extracting one or more of service dependence, service chain and flow characteristics in the topological relation to obtain the topological fingerprint.
According to an exemplary embodiment of the present disclosure, when the fingerprint category is a software fingerprint category, the tag module 502 is configured to query, according to software Ha Xiku, a software tag corresponding to the target hash code.
According to an exemplary embodiment of the present disclosure, the tag module 502 further includes a Ha Xiku unit for extracting software type and version information of a software package of a known software type as a software tag of the software package; encrypting the software package by adopting an encryption algorithm to obtain a hash value of the software package; the software Ha Xiku for storing the software tag and the hash value corresponding to the software tag is constructed.
According to an exemplary embodiment of the present disclosure, when the fingerprint category is a configuration fingerprint category, a resource fingerprint category, or a topology fingerprint category, the tag module 502 is configured to pre-process the fingerprint information; and inputting the preprocessed fingerprint information into a multi-label prediction model to output a target prediction label as the label information.
According to an exemplary embodiment of the present disclosure, the tag module 502 further includes a model unit, where the model unit is configured to perform feature analysis on the historical fingerprint information to obtain a mapping relationship between the fingerprint information and the tag information; performing model training by utilizing the historical fingerprint information and the mapping relation to obtain an initial multi-label prediction model; inputting the test fingerprint information into the initial multi-label prediction model to output test label information; and when the test tag information meets the evaluation condition, taking the initial multi-tag prediction model as the multi-tag prediction model.
According to an exemplary embodiment of the present disclosure, the storage module 503 further includes an interface unit, where the interface unit is configured to provide a query interface of the container tag database, and is configured to invoke the query interface to query tag information corresponding to a container.
The details of each module in the above-mentioned container tag database construction apparatus 500 are described in detail in the corresponding container tag database construction method, so that the details are not repeated here.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
In an exemplary embodiment of the present disclosure, a storage medium capable of implementing the above method is also provided. Fig. 6 schematically illustrates a schematic diagram of a computer-readable storage medium in an exemplary embodiment of the present disclosure, as shown in fig. 6, depicting a program product 600 for implementing the above-described method according to an embodiment of the present disclosure, which may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a cell phone. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided. Fig. 7 schematically illustrates a structural diagram of a computer system of an electronic device in an exemplary embodiment of the present disclosure.
It should be noted that, the computer system 700 of the electronic device shown in fig. 7 is only an example, and should not impose any limitation on the functions and the application scope of the embodiments of the present disclosure.
As shown in fig. 7, the computer system 700 includes a central processing unit (Central Processing Unit, CPU) 701 that can perform various appropriate actions and processes according to a program stored in a Read-Only Memory (ROM) 702 or a program loaded from a storage section 708 into a random access Memory (Random Access Memory, RAM) 703. In the RAM 703, various programs and data required for the system operation are also stored. The CPU 701, ROM702, and RAM 703 are connected to each other through a bus 704. An Input/Output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including a Cathode Ray Tube (CRT), a liquid crystal display (Liquid Crystal Display, LCD), and the like, a speaker, and the like; a storage section 708 including a hard disk or the like; and a communication section 709 including a network interface card such as a LAN (Local Area Network ) card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. The drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read therefrom is mounted into the storage section 708 as necessary.
In particular, according to embodiments of the present disclosure, the processes described below with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 709, and/or installed from the removable medium 711. When executed by a Central Processing Unit (CPU) 701, performs the various functions defined in the system of the present disclosure.
It should be noted that, the computer readable medium shown in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-Only Memory (ROM), an erasable programmable read-Only Memory (Erasable Programmable Read Only Memory, EPROM), flash Memory, an optical fiber, a portable compact disc read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware, and the described units may also be provided in a processor. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present disclosure also provides a computer-readable medium that may be contained in the electronic device described in the above embodiments; or may exist alone without being incorporated into the electronic device. The computer-readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. A method of constructing a container tag database, comprising:
generating fingerprint information with a fingerprint category according to preset fingerprint categories and application data of a container;
based on the fingerprint category of the fingerprint information, carrying out label processing on the fingerprint information to obtain label information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag;
constructing a container label database for storing label information of the container corresponding to the target container.
2. The container tag database construction method of claim 1, wherein the fingerprint categories include one or more of a software fingerprint category, a configuration fingerprint category, a resource fingerprint category, and a topology fingerprint category.
3. The container tag database construction method according to claim 1 or 2, wherein the application data includes an image file, a configuration file, and a topological relation, and the generating fingerprint information having the fingerprint category from the application data of the container includes:
when the fingerprint category is a software fingerprint category, extracting a target hash code of a mirror image layer in the mirror image file to obtain a software fingerprint;
when the fingerprint category is a configuration fingerprint category, extracting configuration information and/or environment variables in the configuration file to obtain a configuration fingerprint;
when the fingerprint category is a resource fingerprint category, extracting resource configuration information and/or resource demand information in the configuration file to obtain a resource fingerprint;
and when the fingerprint category is a topological fingerprint category, extracting one or more of service dependence, service chain and flow characteristics in the topological relation to obtain the topological fingerprint.
4. A method of constructing a container tag database according to claim 3, wherein when the fingerprint category is a software fingerprint category, the performing tag processing on the fingerprint information to obtain tag information includes:
And inquiring a software tag corresponding to the target hash code according to the software Ha Xiku.
5. The container tag database construction method of claim 4, further comprising pre-constructing the software Ha Xiku, the pre-constructing the software Ha Xiku comprising:
extracting the software type and version information of a software package with a known software type as a software tag of the software package;
encrypting the software package by adopting an encryption algorithm to obtain a hash value of the software package;
the software Ha Xiku for storing the software tag and the hash value corresponding to the software tag is constructed.
6. The method for constructing a container tag database according to claim 1 or 2, wherein when the fingerprint category is a configuration fingerprint category, a resource fingerprint category or a topology fingerprint category, the performing tag processing on the fingerprint information to obtain tag information includes:
preprocessing the fingerprint information;
and inputting the preprocessed fingerprint information into a multi-label prediction model to output a target prediction label as the label information.
7. The container label database construction method of claim 6, further comprising pre-creating the multi-label predictive model, the pre-creating the multi-label predictive model comprising:
Performing feature analysis on the historical fingerprint information to obtain a mapping relation between the fingerprint information and the tag information;
performing model training by utilizing the historical fingerprint information and the mapping relation to obtain an initial multi-label prediction model;
inputting the test fingerprint information into the initial multi-label prediction model to output test label information;
and when the test tag information meets the evaluation condition, taking the initial multi-tag prediction model as the multi-tag prediction model.
8. The container tag database construction method of claim 1, further comprising:
and providing a query interface of the container label database for calling the query interface to query label information corresponding to the container.
9. A container label database construction apparatus, comprising:
the fingerprint module is used for generating fingerprint information with a preset fingerprint category according to the application data of the container;
the tag module is used for performing tag processing on the fingerprint information based on the fingerprint category of the fingerprint information to obtain tag information; wherein the tag information comprises one or more of a software tag, a configuration tag, a resource tag and a topology tag;
And the storage module is used for constructing a container label database for storing label information corresponding to the container and the target container.
10. A computer readable storage medium having stored thereon a computer program which when executed by a processor implements the container label database construction method according to any one of claims 1 to 8.
11. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which when executed by the one or more processors cause the one or more processors to implement the container label database construction method of any one of claims 1 to 8.
CN202111325645.9A 2021-11-10 2021-11-10 Container label database construction method and device, storage medium and electronic equipment Pending CN116107991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111325645.9A CN116107991A (en) 2021-11-10 2021-11-10 Container label database construction method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111325645.9A CN116107991A (en) 2021-11-10 2021-11-10 Container label database construction method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116107991A true CN116107991A (en) 2023-05-12

Family

ID=86266027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111325645.9A Pending CN116107991A (en) 2021-11-10 2021-11-10 Container label database construction method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116107991A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116522002A (en) * 2023-06-27 2023-08-01 交通运输部水运科学研究所 Container recommendation method and system of navigation service system based on machine learning

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116522002A (en) * 2023-06-27 2023-08-01 交通运输部水运科学研究所 Container recommendation method and system of navigation service system based on machine learning
CN116522002B (en) * 2023-06-27 2023-09-08 交通运输部水运科学研究所 Container recommendation method and system of navigation service system based on machine learning

Similar Documents

Publication Publication Date Title
US11562304B2 (en) Preventative diagnosis prediction and solution determination of future event using internet of things and artificial intelligence
US11805136B2 (en) Scanning container images and objects associated with building the container images
CN105339924A (en) Efficient data compression and analysis as a service
CN110825363B (en) Intelligent contract acquisition method and device, electronic equipment and storage medium
CN109542459A (en) Application program packaging method and device, computer installation and computer storage medium
CN110532165B (en) Application program installation package characteristic detection method, device, equipment and storage medium
US11178022B2 (en) Evidence mining for compliance management
US10318621B2 (en) Collating and intelligently sequencing installation documentation
CN109977014A (en) Code error recognition methods, device, equipment and storage medium based on block chain
WO2022127474A1 (en) Providing explainable machine learning model results using distributed ledgers
US20200336542A1 (en) Blockchain based data transformation
CN113704781A (en) File secure transmission method and device, electronic equipment and computer storage medium
US20210174216A1 (en) Signaling concept drift during knowledge base population
CN111260080A (en) Process optimization method, device, terminal and storage medium based on machine learning
CN116107991A (en) Container label database construction method and device, storage medium and electronic equipment
US11762758B2 (en) Source code fault detection
CN111046010A (en) Log storage method, device, system, electronic equipment and computer readable medium
CN114138243A (en) Function calling method, device, equipment and storage medium based on development platform
CN113609008A (en) Test result analysis method and device and electronic equipment
CN111295648A (en) Job management in a data processing system
CN116205764A (en) Purchase contract generation method, device, equipment and medium
CN112235409A (en) File uploading method and device, electronic equipment and computer readable storage medium
CN115002062B (en) Message processing method, device, equipment and readable storage medium
CN110457318A (en) The update method of data field, device, medium, electronic equipment in block chain
CN115203674A (en) Automatic login method, system, device and storage medium for application program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination