CN111240794A - Container mirror image extraction method and device and container mirror image testing method and device - Google Patents

Container mirror image extraction method and device and container mirror image testing method and device Download PDF

Info

Publication number
CN111240794A
CN111240794A CN201811432732.2A CN201811432732A CN111240794A CN 111240794 A CN111240794 A CN 111240794A CN 201811432732 A CN201811432732 A CN 201811432732A CN 111240794 A CN111240794 A CN 111240794A
Authority
CN
China
Prior art keywords
mirror image
feature
mirror
container
image
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.)
Granted
Application number
CN201811432732.2A
Other languages
Chinese (zh)
Other versions
CN111240794B (en
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201811432732.2A priority Critical patent/CN111240794B/en
Publication of CN111240794A publication Critical patent/CN111240794A/en
Application granted granted Critical
Publication of CN111240794B publication Critical patent/CN111240794B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45591Monitoring or debugging support
    • 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)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Processing Or Creating Images (AREA)
  • Facsimiles In General (AREA)

Abstract

The application discloses a container mirror image extraction method, which comprises the following steps: screening container application records conforming to a screening strategy from the applied container application records in a centralized manner; mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted; classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass; and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass. According to the container mirror image extraction method, the extracted characteristic mirror image is from the actual application service, is more typical and better fits the actual application service scene, so that the mirror image test performed on the basis of the characteristic mirror image is more effective and comprehensive, the problem of the application service can be quickly found, and the large-scale fault brought by the fact that the characteristic mirror image is released on line is avoided.

Description

Container mirror image extraction method and device and container mirror image testing method and device
Technical Field
The application relates to the field of internet, in particular to a container mirror image extraction method. The application also relates to a container mirror image extraction device, a container mirror image testing method and device, two electronic devices and two computer readable storage media.
Background
With the rapid development of internet technology and cloud computing, a container technology has become a widely recognized and applied server resource sharing mode, a developer can deploy an application to any machine supporting a container through the container technology, the container can be used for a unified platform for building, distributing and running the application, and automatic installation, deployment and upgrading of the application can be realized. The container mirror image is a special file system obtained by carrying out standardized encapsulation on codes of an application program and an operating environment thereof, the container mirror image generally comprises an operating system file, an application file, a software package and a library file which are depended by the application, and provides files such as programs, libraries, resources, configuration parameters and the like required by the operation of the container, and the container mirror image can be directly operated in any operating system provided with the container.
At present, service change scenes such as new service online and service upgrade are often accompanied in the operation process of a container service, and in order to avoid the influence of the service change scenes on the container service, a container mirror image related to the service change scenes needs to be tested. The traditional container mirror image testing method can only test a few typical container mirror images, however, in practical application, the container mirror images constructed by a business application party are all five doors, and meanwhile, container software also needs to face the problems of backward compatibility and the like, and the complex conditions can not be covered by a small number of test cases and can not cover the problems possibly caused by the container mirror images of massive businesses.
Disclosure of Invention
The application provides a container mirror image extraction method to solve the defects in the prior art. The application also relates to a container mirror image extraction device, a container mirror image testing method and device, two electronic devices and two computer readable storage media.
The application provides a container mirror image extraction method, which comprises the following steps:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
Optionally, after the step of extracting the feature image for performing the image test on the application in the image subclass is executed, the method includes:
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass includes:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the constructing a feature vector according to the mirror image feature of the mirror image includes:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, the step of extracting the feature mirror image for performing the mirror image test on the application in the mirror image sub-class includes, when the feature mirror image is extracted in the mirror image sub-class, extracting according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The present application further provides a container mirror image extraction element, includes:
the container application record screening unit is used for screening container application records which accord with a screening strategy from an applied container application record set;
the mirror image characteristic information extraction unit is used for extracting mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record;
the mirror image classification unit is used for classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and the characteristic mirror image extraction unit is used for extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
The application also provides a container mirror image testing method, which comprises the following steps:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
Optionally, the testing the operation supported by the feature image in the image subclass includes:
extracting a characteristic mirror image for performing mirror image test on the application in the mirror image subclass;
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
The present application further provides a container mirror image testing device, including:
the record screening unit is used for screening the container application records meeting the screening strategy from the applied container application records in a centralized manner;
the mirror image feature extraction unit is used for extracting mirror image feature information of a mirror image corresponding to the mirror image identification contained in the container application record;
the mirror image classification unit is used for classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and the test unit is used for testing the operation supported by the feature mirror in the mirror subclass.
The present application further provides an electronic device, comprising:
a memory and a processor; the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
The present application further provides an electronic device, comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
The present application further provides a computer readable storage medium having stored thereon computer instructions that, when read and executed by a processor, are operable to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
The present application further provides a computer readable storage medium having stored thereon computer instructions that, when read and executed by a processor, are operable to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
Compared with the prior art, the method has the following advantages:
the application provides a container mirror image extraction method, which comprises the following steps: screening container application records conforming to a screening strategy from the applied container application records in a centralized manner; mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted; classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass; and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
The application provides a container mirror image extraction method, in the extraction process of container mirror image, at first in container application record centralized screening close to the container application record of practical application business, further extract the mirror image characteristic information of the container application record corresponding mirror image that screens, and the characteristic similarity through mirror image characteristic information is right the mirror image is categorised, at last on the basis of mirror image classification result take be used for carrying out the characteristic mirror image that mirror image test used to the application, the characteristic mirror image of extraction derives from practical application business, more has typicality and more laminates practical application business scene, thereby make the mirror image test of going on the characteristic mirror image basis more effective and comprehensive, can discover the problem of application business fast, avoid issuing the large-scale trouble that brings on-line.
Drawings
FIG. 1 is a process flow diagram of an embodiment of a container mirror extraction method provided herein;
FIG. 2 is a schematic diagram of a container mirror extraction process provided herein;
FIG. 3 is a schematic view of an embodiment of a container mirror image extraction device provided herein;
FIG. 4 is a process flow diagram of an embodiment of a container mirror testing method provided herein;
FIG. 5 is a schematic view of an embodiment of a container mirror image testing apparatus provided herein;
FIG. 6 is a schematic diagram of an electronic device provided herein;
fig. 7 is a schematic diagram of an electronic device provided by the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The application provides a container mirror image extraction method, and also provides a container mirror image extraction device, a container mirror image testing method and device, two electronic devices and two computer readable storage media. The following detailed description and the description of the steps of the method are individually made with reference to the drawings of the embodiments provided in the present application.
The embodiment of the container mirror image extraction method provided by the application is as follows:
referring to fig. 1, a flow chart of a container mirroring method provided by the present application is shown, and referring to fig. 2, a schematic diagram of a container mirroring process provided by the present application is shown.
And step S101, screening container application records meeting the screening strategy from the applied container application record set.
Container software of an enterprise can often support deployment and operation of application containers in million levels, faults are easy to occur due to complexity and high order of magnitude of container services in the upgrading or replacing process of the container software, container mirror image tests are needed to avoid the influence of the faults on application service release, and large-scale faults caused by release on line are avoided. Meanwhile, in the container mirror image testing process, the problems of container mirror image construction environment, backward compatibility of container mirror images and the like are fully considered, a test case which is closer to actual application service and has test typicality is obtained as far as possible, container mirror image testing with higher coverage is realized, and therefore the probability of application service faults is reduced.
The container mirror image extraction method provided by the application is characterized in that in a database for storing application container historical data, massive application container historical data stored in the database are cleaned, the historical data recorded with mirror image identification is screened by combining service characteristics of practical application services, and the extracted characteristic mirror image for carrying out mirror image test is derived from the practical application services, so that the extracted characteristic mirror image has typicality and is more fit with practical application service scenes, the mirror image test based on the extracted characteristic mirror image is more effective and comprehensive, the problem of the application services is quickly found according to the mirror image test carried out by the extracted characteristic mirror image, and large-scale faults brought on line are avoided.
In practical application, the container application records submitted by each application of the application service to the container are stored in the database, so that massive container application records are formed in the database, therefore, when the container application records are screened in the database, a corresponding screening strategy needs to be formulated, the container application records conforming to the screening strategy are screened from the massive container application records, and on the basis, the mirror image extraction is further carried out depending on the mirror image identification recorded in the container application records. In a preferred embodiment, the screening policy for screening container application records from a container application record set (i.e., a mass of container application records stored in a database) includes at least one of the following: selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
The screening strategy fully combines the actual service scene of the application service, wherein the actual service factor considered by the screening strategy is that the container application record of which the container application is successful is selected: the container request initiated by the application service fails due to the problem of the application service with a certain probability, for example, the application service cancels the request for the container, so that only the container application record which is successfully applied by the container needs to be concerned, and the influence of the container application record which is failed in container application can be avoided by selecting the screening strategy of the container application record which is successfully applied by the container.
The practical business factors considered by the screening strategy for selecting the container application records containing the application time within the range of the set time threshold are as follows: because the mirror image needs to be updated every time the application is released, the reuse probability of the previous mirror image is low, and therefore, only the container application record corresponding to the latest mirror image needs to be concerned, for example, only the container application record of which the application time is within the last 30 days needs to be extracted.
The actual business factors considered by the screening strategy of selecting the container application record generated by the application container associated with the business change domain are as follows: since there may be multiple application services applying for the container in one container, only the container application records generated by the application container associated with the service change domain need to be concerned. For example, in a scenario of performing a mirror image test on application service upgrade, only a container application record generated by an upper application container associated with a deployment domain to be upgraded needs to be paid attention to.
The practical business factors considered by the screening strategy of selecting the container application record with the latest application time from the applied plurality of container application records are as follows: in extracting container application records according to a currently specified application name, the specified application may apply for containers multiple times in a historical time period, so as to generate multiple container application records, and for the specified application, only the container currently applied by the specified application or the container recently applied by the specified application is needed to be concerned, and the container previously applied by the specified application is likely to be abandoned, for example, a latest container application record is selected and applied.
And step S102, extracting mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record.
In the step S101, container application records conforming to the screening policy are screened from the container application record set, and this step depends on the screened container application records, and each container application record records a mirror image identifier (for example, a mirror image name) corresponding to a mirror image, so that a mirror image set formed by mirror images corresponding to the mirror image identifiers recorded in each of the screened container application records can be determined, and for each mirror image in the mirror image set, mirror image feature information of the mirror image is extracted according to the characteristics of the mirror image. Preferably, the mirror image feature information includes at least one of: format, size, number of layers, packaging machine, packaging container.
Step S103, classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass.
The method comprises the following steps of determining the characteristic similarity between the mirror images contained in the mirror image set by calculation based on the respective mirror image characteristic information of the mirror images contained in the mirror image set, classifying the mirror images contained in the mirror image set according to the characteristic similarity, obtaining a plurality of mirror image subclasses after classification, wherein each mirror image subclass contains one or more mirror images, and the classification aims to enable the characteristic mirror image extraction based on the mirror image subclasses in the subsequent step to be more typical, so that the mirror image test based on the extracted characteristic mirror images for application is more effective, and the container mirror image test with higher coverage is realized.
In an embodiment of the present application, in a preferred implementation manner, the mirror images (mirror images included in the mirror image set) are classified based on feature similarity of mirror image feature information of the mirror images, and at least one mirror image subclass is obtained, which is specifically implemented by:
1) constructing a feature vector according to the mirror image feature information of the mirror image;
here, constructing a feature vector according to the mirror image feature of the mirror image is preferably implemented in the following manner: determining the feature dimension of the mirror image feature information of the mirror image; constructing a feature vector of the mirror image according to the feature dimension; wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
2) Constructing a feature matrix of the mirror image according to the feature vector;
3) calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
in specific implementation, the feature similarity between the mirror images may be obtained by using a cosine similarity algorithm, an euclidean distance algorithm, or a pearson correlation coefficient algorithm, or may be obtained by using other similarity algorithms, which is not limited in this embodiment.
4) And classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
It should be noted that, the feature similarity between the images belonging to the same mirror subclass should be greater than the feature similarity between the images belonging to different mirror subclasses, in other words, the mirror feature information of the images belonging to the same mirror subclass has more similarity.
And step S104, extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
In an embodiment of the present application, when extracting a feature mirror image for performing a mirror image test on an application from a subset of mirror images obtained by classification, the feature mirror image is extracted according to at least one of the following extraction rules: preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
It should be noted that, here, the mirror image with the earlier application time in the mirror image subclass is preferentially extracted according to the application time, and the purpose is that the validity of the extracted feature mirror image is stronger, so that the mirror image test performed on the application based on the feature mirror image obtained by extraction can be more effective, and thus the fault of the application service can be found more timely. And preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image subclass according to the feature similarity, so as to improve the typicality of feature mirror image extraction, thereby enabling the mirror image test based on the feature mirror images obtained by extraction to be more effective aiming at the application and realizing the container mirror image test with higher coverage.
In specific implementation, after the feature image for performing the image test on the application is extracted, the image test can be performed on the basis of the extracted feature image, and preferably, the operation supported by the feature image can be tested in at least one image test dimension. Wherein the mirror test dimension preferably comprises at least one of: the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
In an embodiment of the present application, the testing of the operation supported by the feature image in the image testing dimension specifically includes the following steps:
1) detecting whether the characteristic mirror image supports downloading from a mirror image warehouse to the local or not in the mirror image downloading dimension, if so, continuing the detection of the mirror image checking dimension; if not, the characteristic image to be tested at present cannot be downloaded from the image warehouse to the local, and a prompt that the characteristic image to be tested at present cannot be downloaded is sent.
2) Detecting whether the feature mirror image supports being checked or not in the mirror image checking dimension, and if so, continuing the detection of the mirror image starting dimension; if not, the mirror image viewing command of the currently tested feature mirror image is not available, and a prompt that the mirror image viewing command of the currently tested feature mirror image is not available is sent.
3) Detecting whether the feature mirror image supports being started or not in the mirror image starting dimension, and if so, continuing detecting the mirror image deleting dimension; if not, indicating that the starting of the feature mirror image to be tested fails, and sending a prompt of the starting failure of the feature mirror image to be tested.
4) Detecting whether the feature mirror image supports deletion or not in the mirror image deletion dimension, and/or detecting whether residual information is removed or not after the feature mirror image is deleted, and if so, confirming that the feature mirror image passes a mirror image test; if not, the current tested feature mirror image cannot be deleted, a prompt that the deletion of the current tested feature mirror image fails is sent, and/or a prompt for clearing residual information is sent after the current tested feature mirror image is deleted.
In addition, the operations supported by the feature image are tested according to any one or more image testing dimensions of the provided image downloading dimension, image viewing dimension, image starting dimension and image deleting dimension. For example, detecting whether residual information is removed after the characteristic mirror image is deleted in the mirror image deletion dimension, and if so, confirming that the characteristic mirror image passes a mirror image test; if not, the residual information exists after the currently tested feature mirror image is deleted, and a prompt for clearing the residual information is sent. For another example, whether the feature image supports downloading from an image warehouse to the local is detected in the image downloading dimension, if not, the currently tested feature image cannot be downloaded from the image warehouse to the local, and a prompt that the currently tested feature image cannot be downloaded is sent; if so, detecting whether the feature mirror image supports being started or not in the mirror image starting dimension, and if so, confirming that the feature mirror image passes a mirror image test; if not, indicating that the starting of the feature mirror image to be tested fails, and sending a prompt of the starting failure of the feature mirror image to be tested.
The container mirror extraction process is further illustrated by an example below:
as shown in fig. 2, all the container application records of the application container are stored in the database, and first, according to the actual service characteristics of the application, a screening policy for screening container application records matching the actual application characteristics of the application from the massive container application records stored in the database is determined, that is: the method is closer to the container application records of the application service, and specifically, the screening strategy for screening the container application records from the massive container application records stored in the database comprises the following aspects: the method comprises the steps of firstly screening container application records of successful application of a container, secondly screening container application records of which the application time is within the last 30 days, thirdly screening container application records generated by application containers associated with a deployment domain to be upgraded, and fourthly screening only the latest container application record of the application container for one application.
After the container application records are screened out according to the screening strategy, a mirror image set consisting of mirror images corresponding to mirror images recorded in the container application records is determined according to mirror image names corresponding to the mirror images recorded in the container application records, and mirror image characteristic information of the mirror images in N characteristic dimensions, such as format, size, layer number, packaging machine, packaging container and the like, is extracted according to the characteristics of the mirror images for each mirror image in the mirror image set.
The characteristic information of the mirror image of each mirror image is processed, and the mirror is constructed on the basis of the characteristic information of the mirror imageAn image N-dimensional feature vector, and constructing an image N-dimensional feature matrix according to the image N-dimensional feature vector, setting D as a set containing a group of images, and setting D as a setiD ═ D1, D2, …, Dm }, which is the eigenvector of the ith mirror; wherein D isi=(di1,di2,…,din),i=1,2,…,m;Dij(i-1, 2, …, m; j-1, 2, …, n) is DiThe characteristic value of the jth characteristic tj.
And then calculating the similarity between the N-dimensional feature matrixes of the mirror images by adopting a cosine similarity algorithm so as to obtain the feature similarity between the mirror images, and dividing the mirror images contained in the determined mirror image set into a plurality of mirror image subclasses according to the feature similarity.
And finally, extracting the latest n mirror images in each mirror image subclass to serve as characteristic mirror images used for carrying out mirror image test on the application.
In summary, in the container mirror image extraction method, in the container mirror image extraction process, container application records close to the actual application service are firstly screened in a container application record set, the mirror image feature information of the mirror image corresponding to the screened container application records is further extracted, the mirror image is classified according to the feature similarity of the mirror image feature information, and finally, a feature mirror image used for performing mirror image test on the application is extracted on the basis of a mirror image classification result, wherein the extracted feature mirror image is from the actual application service, has typicality and better fits the actual application service scene, so that the mirror image test performed on the basis of the feature mirror image is more effective and comprehensive, the problem of the application service can be quickly found, and the large-scale fault brought by the fact that the application service is released on line is avoided.
The embodiment of a container mirror image extraction element that this application provided is as follows:
in the above embodiment, a container mirror image extracting method is provided, and correspondingly, the application also provides a container mirror image extracting device, which is described below with reference to the accompanying drawings.
Referring to fig. 3, a schematic diagram of an embodiment of a container mirror image extraction device provided by the present application is shown.
Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to the corresponding description of the method embodiments provided above for relevant portions. The device embodiments described below are merely illustrative.
The application provides a container mirror image extraction element includes:
a container application record screening unit 301, configured to screen container application records meeting a screening policy from an applied container application record set;
a mirror image feature information extracting unit 302, configured to extract mirror image feature information of a mirror image corresponding to a mirror image identifier included in the container application record;
a mirror image classification unit 303, configured to classify the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
a feature mirror image extracting unit 304, configured to extract a feature mirror image for performing a mirror image test on the application in the mirror image subclass.
Optionally, the container mirror image extracting apparatus further includes:
and the mirror image testing unit is used for testing the operation supported by the feature mirror image in at least one mirror image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the image testing unit is specifically configured to detect, for any one feature image, in the image downloading dimension, whether the feature image supports downloading from an image repository to the local, if yes, detect, in the image checking dimension, whether the feature image supports checking, if yes, detect, in the image starting dimension, whether the feature image supports starting, if yes, detect, in the image deleting dimension, whether the feature image supports deleting, and/or detect, after deleting the feature image, whether residual information is removed, and if yes, confirm that the feature image passes the image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the mirror image classification unit 303 includes:
the characteristic vector constructing subunit is used for constructing a characteristic vector according to the mirror image characteristic information of the mirror image;
a feature matrix construction subunit, configured to construct a feature matrix of the mirror image according to the feature vector;
the characteristic similarity calculation operator unit is used for calculating the characteristic similarity between the mirror images based on the characteristic matrix of the mirror images;
and the classification subunit is used for classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the feature vector constructing subunit includes:
the characteristic dimension determining submodule is used for determining the characteristic dimension of the mirror image characteristic information of the mirror image;
the feature vector construction submodule is used for constructing the feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, when the feature mirror image extraction unit 304 extracts the feature mirror image in the mirror image sub-class, the feature mirror image is extracted according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The embodiment of the container mirror image testing method provided by the application is as follows:
in the above embodiment, a container mirror image extraction method is provided, and in addition, a container mirror image testing method is provided in the present application, which is described below with reference to the accompanying drawings.
Referring to fig. 4, a flow chart illustrating the implementation of an embodiment of the container mirror image testing method provided in the present application is shown.
Because the container mirror image testing method embodiment has a part of contents which are similar to those of the container mirror image extracting method embodiment, the description is simple, and related parts can be referred to the corresponding description of the container mirror image extracting method embodiment provided above. The embodiments described below are merely illustrative.
Step S401, container application records which accord with a screening strategy are screened from an applied container application record set;
step S402, extracting mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record;
step S403, classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
step S404, testing the operation supported by the feature mirror in the mirror subclass.
Optionally, the testing the operation supported by the feature image in the image subclass includes:
extracting a characteristic mirror image for performing mirror image test on the application in the mirror image subclass;
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass includes:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the constructing a feature vector according to the mirror image feature of the mirror image includes:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, the sub-step of extracting the feature mirror image for performing the mirror image test on the application in the mirror image sub-class is performed according to at least one of the following extraction rules when the feature mirror image is extracted in the mirror image sub-class:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The embodiment of the container mirror image testing device provided by the application is as follows:
in the above embodiments, a container mirror image testing method is provided, and correspondingly, the present application also provides a container mirror image testing apparatus, which is described below with reference to the accompanying drawings.
Referring to fig. 5, a schematic diagram of an embodiment of a container mirror image testing apparatus provided by the present application is shown.
Since the apparatus embodiments are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to the corresponding description of the method embodiments provided above for relevant portions. The device embodiments described below are merely illustrative.
The application provides a container mirror image testing arrangement, includes:
a record screening unit 501, configured to screen container application records meeting a screening policy from an applied container application record set;
a mirror image feature extraction unit 502, configured to extract mirror image feature information of a mirror image corresponding to the mirror image identifier included in the container application record;
a mirror image classification unit 503, configured to classify the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
a testing unit 504, configured to test an operation supported by the feature image in the image subclass.
Optionally, the testing unit 504 includes:
the extraction subunit is used for extracting a characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass;
a test subunit for testing the operations supported by the feature image in at least one image test dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the test subunit is specifically configured to, for any one feature image, perform the following operations:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the mirror image classification unit 503 includes:
the characteristic vector constructing subunit is used for constructing a characteristic vector according to the mirror image characteristic information of the mirror image;
a feature matrix construction subunit, configured to construct a feature matrix of the mirror image according to the feature vector;
the characteristic similarity calculation operator unit is used for calculating the characteristic similarity between the mirror images based on the characteristic matrix of the mirror images;
and the classification subunit is used for classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the feature vector constructing subunit includes:
the characteristic dimension determining submodule is used for determining the characteristic dimension of the mirror image characteristic information of the mirror image;
the feature vector construction submodule is used for constructing the feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, when the extracting subunit extracts the feature mirror image in the mirror image sub-class, the extracting subunit extracts the feature mirror image according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The embodiment of the electronic equipment provided by the application is as follows:
in the foregoing embodiment, a container mirror image extraction method is provided, and in addition, the present application also provides an electronic device for implementing the container mirror image extraction method, which is described below with reference to the accompanying drawings.
Referring to fig. 6, a schematic diagram of an electronic device provided in the present embodiment is shown.
The embodiment of the electronic device provided by the application is relatively simple to describe, and for related parts, reference may be made to the corresponding description of the embodiment of the container mirror image extraction method provided above. The embodiments described below are merely illustrative.
The application provides an electronic device, including:
a memory 601 and a processor 602;
the memory 601 is configured to store computer-executable instructions, and the processor 602 is configured to execute the following computer-executable instructions:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
Optionally, after the feature image instruction for performing the image test on the application is extracted from the image subclass, the processor 602 is further configured to execute the following computer-executable instructions: :
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass includes:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the constructing a feature vector according to the mirror image feature of the mirror image includes:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, the feature mirror image instruction for performing the mirror image test on the application is extracted from the mirror image sub-class, and when the feature mirror image is extracted from the mirror image sub-class, the feature mirror image is extracted according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The embodiment of the electronic equipment provided by the application is as follows:
in the foregoing embodiment, a container mirror image testing method is provided, and in addition, the present application also provides an electronic device for implementing the container mirror image testing method, which is described below with reference to the accompanying drawings.
Referring to fig. 7, a schematic diagram of an electronic device provided in the present embodiment is shown.
The embodiment of the electronic device provided by the application is relatively simple to describe, and relevant portions can refer to the corresponding description of the embodiment of the container mirror image testing method provided by the application. The embodiments described below are merely illustrative.
The application provides an electronic device, including:
a memory 701 and a processor 702;
the memory 701 is configured to store computer-executable instructions, and the processor 702 is configured to execute the following computer-executable instructions:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
Optionally, the testing the operation supported by the feature image in the image subclass includes:
extracting a characteristic mirror image for performing mirror image test on the application in the mirror image subclass;
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass includes:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the constructing a feature vector according to the mirror image feature of the mirror image includes:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, in the process of executing the feature mirror image instruction for performing the mirror image test on the application in the mirror image sub-class, when the feature mirror image is extracted in the mirror image sub-class, the feature mirror image is extracted according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The embodiment of a computer-readable storage medium provided by the application is as follows:
in the above embodiments, a container image extraction method is provided, and a computer-readable storage medium is provided.
The embodiments of the computer-readable storage medium provided in the present application are described more simply, and for related portions, reference may be made to the corresponding descriptions of the embodiments of the container mirror image extraction method provided above. The embodiments described below are merely illustrative.
The present application provides a computer-readable storage medium comprising:
the computer readable storage medium stores computer instructions that when read executed by a processor are operable to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
Optionally, after the feature mirroring instruction for performing the mirroring test on the application is extracted from the mirroring subclass and executed, the method includes:
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass includes:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the constructing a feature vector according to the mirror image feature of the mirror image includes:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, in the process of executing the feature mirror image instruction for performing the mirror image test on the application in the mirror image sub-class, when the feature mirror image is extracted in the mirror image sub-class, the feature mirror image is extracted according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
The embodiment of a computer-readable storage medium provided by the application is as follows:
in the embodiment, a container mirror image testing method is provided, and a computer-readable storage medium is provided.
The embodiments of the computer-readable storage medium provided in the present application are described more simply, and for related portions, reference may be made to the corresponding descriptions of the embodiments of the container mirror image testing method provided above. The embodiments described below are merely illustrative.
The present application provides a computer-readable storage medium comprising:
the computer readable storage medium stores computer instructions that when read executed by a processor are operable to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
Optionally, the testing the operation supported by the feature image in the image subclass includes:
extracting a characteristic mirror image for performing mirror image test on the application in the mirror image subclass;
testing operations supported by the feature image in at least one image testing dimension.
Optionally, the mirror test dimension includes at least one of the following:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
Optionally, the testing the operation supported by the feature image in at least one image testing dimension includes:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
Optionally, the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
Optionally, the classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass includes:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
Optionally, the constructing a feature vector according to the mirror image feature of the mirror image includes:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
Optionally, in the process of executing the feature mirror image instruction for performing the mirror image test on the application in the mirror image sub-class, when the feature mirror image is extracted in the mirror image sub-class, the feature mirror image is extracted according to at least one of the following extraction rules:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
Optionally, the feature similarity is obtained by calculating with at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
Optionally, the image characteristic information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
Although the present application has been described with reference to the preferred embodiments, it is not intended to limit the present application, and those skilled in the art can make variations and modifications without departing from the spirit and scope of the present application, therefore, the scope of the present application should be determined by the claims that follow.
In a typical configuration, a computing device includes one or more processors, input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

Claims (20)

1. A method of container mirroring, comprising:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
2. The container mirror extraction method according to claim 1, wherein after the step of extracting the feature mirror for performing the mirror test on the application in the mirror subclass is performed, the method comprises:
testing operations supported by the feature image in at least one image testing dimension.
3. The container mirror extraction method of claim 2, wherein the mirror test dimension comprises at least one of:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
4. The container image extraction method of claim 3, wherein the testing the operations supported by the feature image in at least one image testing dimension comprises:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
5. The container image extraction method according to claim 1, wherein the screening policy includes at least one of:
selecting a container application record with successful container application, selecting a container application record with application time in a set time threshold range, selecting a container application record generated by an application container associated with a service change domain, and selecting a container application record with the latest application time in a plurality of applied container application records.
6. The method for extracting a container mirror image according to claim 1, wherein the classifying the mirror image based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass comprises:
constructing a feature vector according to the mirror image feature information of the mirror image;
constructing a feature matrix of the mirror image according to the feature vector;
calculating feature similarity between the mirror images based on the feature matrix of the mirror images;
and classifying the mirror images according to the similarity calculation result to obtain the mirror image subclasses.
7. The container mirror image extraction method according to claim 6, wherein the constructing a feature vector according to the mirror image features of the mirror image comprises:
determining the feature dimension of the mirror image feature information of the mirror image;
constructing a feature vector of the mirror image according to the feature dimension;
wherein the feature dimension number of the mirror image feature information is the same as the vector dimension number of the feature vector of the mirror image.
8. The container mirror image extraction method according to claim 6, wherein the step of extracting the feature mirror image for performing the mirror image test on the application in the mirror image sub-class is performed according to at least one of the following extraction rules when extracting the feature mirror image in the mirror image sub-class:
preferentially extracting the mirror images with earlier application time in the mirror image sub-class, and preferentially extracting the mirror images with smaller feature similarity between the mirror images in the mirror image sub-class.
9. The container mirror image extraction method according to claim 6, wherein the feature similarity is calculated using at least one of the following similarity algorithms:
cosine similarity calculation, Euclidean distance algorithm, and Pearson correlation coefficient algorithm.
10. The container mirror image extraction method according to claim 1, wherein the mirror image feature information includes at least one of:
format, size, number of layers, packaging machine, packaging container.
11. A container mirror image extraction device, comprising:
the container application record screening unit is used for screening container application records which accord with a screening strategy from an applied container application record set;
the mirror image characteristic information extraction unit is used for extracting mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record;
the mirror image classification unit is used for classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and the characteristic mirror image extraction unit is used for extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
12. A method of container mirror testing, comprising:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
13. The container mirroring test method according to claim 12, wherein the testing the operations supported by the feature mirroring in the mirroring subclass comprises:
extracting a characteristic mirror image for performing mirror image test on the application in the mirror image subclass;
testing operations supported by the feature image in at least one image testing dimension.
14. The container mirror testing method of claim 13, wherein the mirror testing dimension comprises at least one of:
the system comprises a mirror image downloading dimension, a mirror image checking dimension, a mirror image starting dimension and a mirror image deleting dimension.
15. The container mirroring test method of claim 14, wherein the testing the operations supported by the feature mirroring in at least one mirroring test dimension comprises:
for any one feature image, the following operations are performed:
detecting whether the feature mirror image supports local downloading from a mirror image warehouse or not in the mirror image downloading dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image checking dimension, if so, detecting whether the feature mirror image supports local downloading from the mirror image warehouse or not in the mirror image starting dimension, if so, detecting whether the feature mirror image supports local downloading or not in the mirror image deleting dimension and/or detecting whether residual information is removed after the feature mirror image is deleted or not, and if so, confirming that the feature mirror image passes the mirror image test.
16. A container mirror image testing apparatus, comprising:
the record screening unit is used for screening the container application records meeting the screening strategy from the applied container application records in a centralized manner;
the mirror image feature extraction unit is used for extracting mirror image feature information of a mirror image corresponding to the mirror image identification contained in the container application record;
the mirror image classification unit is used for classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and the test unit is used for testing the operation supported by the feature mirror in the mirror subclass.
17. An electronic device, comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
18. An electronic device, comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
19. A computer readable storage medium having stored thereon computer instructions that when read by a processor are operable to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and extracting the characteristic mirror image for carrying out mirror image test on the application in the mirror image subclass.
20. A computer readable storage medium having stored thereon computer instructions that when read by a processor are operable to:
screening container application records conforming to a screening strategy from the applied container application records in a centralized manner;
mirror image characteristic information of a mirror image corresponding to the mirror image identification contained in the container application record is extracted;
classifying the mirror images based on the feature similarity of the mirror image feature information to obtain at least one mirror image subclass;
and testing the operation supported by the feature image in the image subclass.
CN201811432732.2A 2018-11-28 2018-11-28 Container mirror image extraction method and device and container mirror image test method and device Active CN111240794B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811432732.2A CN111240794B (en) 2018-11-28 2018-11-28 Container mirror image extraction method and device and container mirror image test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811432732.2A CN111240794B (en) 2018-11-28 2018-11-28 Container mirror image extraction method and device and container mirror image test method and device

Publications (2)

Publication Number Publication Date
CN111240794A true CN111240794A (en) 2020-06-05
CN111240794B CN111240794B (en) 2023-06-13

Family

ID=70863679

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811432732.2A Active CN111240794B (en) 2018-11-28 2018-11-28 Container mirror image extraction method and device and container mirror image test method and device

Country Status (1)

Country Link
CN (1) CN111240794B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113111353A (en) * 2021-04-13 2021-07-13 上海交通大学 Container mirror library security evaluation system and method based on dependency relationship
CN113239353A (en) * 2021-04-15 2021-08-10 上海交通大学 Content difference-based container software security detection system and method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005274285A (en) * 2004-03-24 2005-10-06 Olympus Corp Defect classification dictionary teaching apparatus
US20090026118A1 (en) * 2007-07-25 2009-01-29 Ottmar Kechel Process and device for sorting of goods
CN102736972A (en) * 2011-03-30 2012-10-17 国际商业机器公司 Processing method of test case of application to be tested and system
CN103620550A (en) * 2011-06-28 2014-03-05 微软公司 Virtual machine image analysis
CN104820610A (en) * 2015-05-14 2015-08-05 华中科技大学 Method for updating virtual machine image in cloud environment
CN105701010A (en) * 2015-12-31 2016-06-22 北京元心科技有限公司 Method and device for accelerating software testing
TW201839402A (en) * 2017-04-21 2018-11-01 鴻勁精密股份有限公司 Electronic component operation device and testing categorizing equipment using the same including a carrier mechanism and a test carrier

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005274285A (en) * 2004-03-24 2005-10-06 Olympus Corp Defect classification dictionary teaching apparatus
US20090026118A1 (en) * 2007-07-25 2009-01-29 Ottmar Kechel Process and device for sorting of goods
CN102736972A (en) * 2011-03-30 2012-10-17 国际商业机器公司 Processing method of test case of application to be tested and system
CN103620550A (en) * 2011-06-28 2014-03-05 微软公司 Virtual machine image analysis
CN104820610A (en) * 2015-05-14 2015-08-05 华中科技大学 Method for updating virtual machine image in cloud environment
CN105701010A (en) * 2015-12-31 2016-06-22 北京元心科技有限公司 Method and device for accelerating software testing
TW201839402A (en) * 2017-04-21 2018-11-01 鴻勁精密股份有限公司 Electronic component operation device and testing categorizing equipment using the same including a carrier mechanism and a test carrier

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
梁小宇: "面向云数据中心的虚拟机镜像去重性能优化方法研究" *
耿朋;陈伟;魏峻;: "面向Dockerfile的容器镜像构建工具" *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113111353A (en) * 2021-04-13 2021-07-13 上海交通大学 Container mirror library security evaluation system and method based on dependency relationship
CN113111353B (en) * 2021-04-13 2022-06-28 上海交通大学 Container mirror library security evaluation system and method based on dependency relationship
CN113239353A (en) * 2021-04-15 2021-08-10 上海交通大学 Content difference-based container software security detection system and method

Also Published As

Publication number Publication date
CN111240794B (en) 2023-06-13

Similar Documents

Publication Publication Date Title
US20190370471A1 (en) Systems and methods for patching vulnerabilities
CN111240794B (en) Container mirror image extraction method and device and container mirror image test method and device
WO2015131643A1 (en) Software detection method and device
CN113642004A (en) Container mirror image security scanning and repairing method, device and equipment
CN112860507B (en) Control method and device for sampling rate of distributed link tracking system
CN107766354A (en) A kind of method and apparatus for being used to ensure data correctness
CN111831554B (en) Code checking method and device
US20210208872A1 (en) Automated test authorization management
CN116483605A (en) Data processing method, device, system, storage medium and electronic equipment
CN116166615A (en) Data archiving method, equipment and medium for business system
CN111427863A (en) Data migration method, device and equipment based on domain model
CN115174158B (en) Cloud product configuration checking method based on multi-cloud management platform
CN110928941A (en) Data fragment extraction method and device
CN114978963A (en) Network system monitoring analysis method and device, electronic equipment and storage medium
CN115373885A (en) Fault repairing method and device, storage medium and electronic equipment
CN105765908B (en) A kind of multi-site automatic update method, client and system
US11157583B2 (en) Software detection based on user accounts
CN111813379B (en) Application deployment method and device, electronic equipment and computer readable storage medium
CN110275863A (en) File moving method, device and storage medium
CN112114837B (en) Firmware updating method and camera
CN116679965A (en) Database client upgrading method and system
CN118132136A (en) Automatic packaging method and device for application program
CN116756158A (en) Data exchange method, device and medium
CN115758377A (en) Container vulnerability processing method and device, storage medium and electronic equipment
CN116301931A (en) Deployment method and device of software package

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
GR01 Patent grant
GR01 Patent grant