CN114090841A - Mirror image tracing method, device, equipment and medium - Google Patents

Mirror image tracing method, device, equipment and medium Download PDF

Info

Publication number
CN114090841A
CN114090841A CN202111369805.XA CN202111369805A CN114090841A CN 114090841 A CN114090841 A CN 114090841A CN 202111369805 A CN202111369805 A CN 202111369805A CN 114090841 A CN114090841 A CN 114090841A
Authority
CN
China
Prior art keywords
mirror image
image
application
level
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111369805.XA
Other languages
Chinese (zh)
Inventor
孙树民
雷志龙
厉昆
王东帅
尹晓剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Unionpay Co Ltd
Original Assignee
China Unionpay Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Unionpay Co Ltd filed Critical China Unionpay Co Ltd
Priority to CN202111369805.XA priority Critical patent/CN114090841A/en
Publication of CN114090841A publication Critical patent/CN114090841A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Landscapes

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

Abstract

The application discloses a mirror image tracing method, device, equipment and medium, which are used for quickly and accurately tracing and constructing a basic mirror image of an application mirror image. According to the method and the device, for any basic mirror image to be matched, whether the basic mirror image is matched with the application mirror image or not can be judged according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced; if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image, thereby being capable of quickly and accurately tracing the basic mirror image for constructing the application mirror image.

Description

Mirror image tracing method, device, equipment and medium
Technical Field
The present application relates to the field of mirror tracing technologies, and in particular, to a mirror tracing method, apparatus, device, and medium.
Background
When constructing an application image of an application package, one base image may be selected from a plurality of base images, and the application image of the application package may be constructed based on the selected base image. In view of the security of the image, it is often necessary to trace back the base image upon which the application image was built.
At present, when a basic mirror image of an application mirror image is traced and constructed (for convenience of description, referred to as mirror image tracing), the tracing is usually carried out by depending on a version information document of the application mirror image which is manually written by an application mirror image builder. However, the manually written version information document is difficult to avoid the problems of information omission and the like, so that the tracing process is complicated, the accuracy is low, and even the problems that the basic mirror image of the application mirror image cannot be traced can occur.
Therefore, a technical solution for quickly and accurately tracing and constructing a base image of an application image is needed.
Disclosure of Invention
The application provides a mirror image tracing method, device, equipment and medium, which are used for quickly and accurately tracing and constructing a basic mirror image of an application mirror image.
In a first aspect, the present application provides a mirror image tracing method, where the method includes:
for any basic mirror image to be matched, judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced;
and if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image.
In a possible implementation manner, the determining, according to the hierarchy information of each mirror hierarchy included in the base mirror and the hierarchy information of the corresponding mirror hierarchy included in the application mirror to be traced, whether the base mirror matches with the application mirror includes:
for each mirror image level contained in the basic mirror image, judging whether the level information of the mirror image level is the same as the level information of the corresponding mirror image level contained in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a possible implementation manner, before determining whether the base image matches the application image according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced, the method further includes:
and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to a preset hierarchical information naming format.
In one possible embodiment, the preset format includes a string format.
In a possible implementation manner, the determining, according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced, whether the base image matches the application image includes:
if the character string of the hierarchical information of each mirror level contained in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror level contained in the application mirror image, determining that the basic mirror image is matched with the application mirror image;
and if the character string of the hierarchical information of any mirror image level contained in the basic mirror image is not the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a second aspect, the present application provides a mirror image tracing apparatus, the apparatus including:
the matching module is used for judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced;
and the determining module is used for determining the basic mirror image as the basic mirror image for constructing the application mirror image if the basic mirror image is matched with the application mirror image.
In a possible implementation manner, the matching module is specifically configured to determine, for each mirror level included in the base mirror image, whether level information of the mirror level is the same as level information of a corresponding mirror level included in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a possible embodiment, the apparatus further comprises:
and the format conversion module is used for respectively converting the naming format of the level information of each mirror image level contained in the basic mirror image and the naming format of the level information of the corresponding mirror image level contained in the application mirror image into preset formats according to preset level information naming formats.
In one possible embodiment, the preset format includes a string format.
In a possible implementation manner, the matching module is specifically configured to determine that the base image matches the application image if a character string of level information of each image level included in the base image is the same as a character string of level information of a corresponding image level included in the application image;
and if the character string of the hierarchical information of any mirror image hierarchy contained in the basic mirror image is different from the character string of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a third aspect, the present application provides an electronic device, where the electronic device at least includes a processor and a memory, and the processor is configured to implement the steps of the mirror tracing method according to any one of the above descriptions when executing a computer program stored in the memory.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of any one of the mirror image tracing methods described above.
According to the method and the device, for any basic mirror image to be matched, whether the basic mirror image is matched with the application mirror image or not can be judged according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced; if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image, thereby being capable of quickly and accurately tracing the basic mirror image for constructing the application mirror image.
Drawings
In order to more clearly illustrate the embodiments of the present application or the implementation manner in the related art, a brief description will be given below of the drawings required for the description of the embodiments or the related art, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 illustrates a first mirror tracing process diagram provided by some embodiments;
FIG. 2 illustrates a mirror level diagram of an application mirror provided by some embodiments;
FIG. 3 illustrates a second mirror tracing process diagram provided by some embodiments;
FIG. 4 illustrates a third mirror tracing process diagram provided by some embodiments;
FIG. 5 illustrates a fourth mirror tracing process diagram provided by some embodiments;
FIG. 6 illustrates a fifth mirror tracing process diagram provided by some embodiments;
FIG. 7 illustrates a mirror image tracing apparatus according to some embodiments;
fig. 8 shows a schematic structural diagram of an electronic device according to some embodiments.
Detailed Description
In order to quickly and accurately trace and construct a basic mirror image of an application mirror image, the application provides a mirror image tracing method, device, equipment and medium.
To make the purpose and embodiments of the present application clearer, the following will clearly and completely describe the exemplary embodiments of the present application with reference to the attached drawings in the exemplary embodiments of the present application, and it is obvious that the described exemplary embodiments are only a part of the embodiments of the present application, and not all of the embodiments.
It should be noted that the brief descriptions of the terms in the present application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of the present application. These terms should be understood in their ordinary and customary meaning unless otherwise indicated.
The terms "first," "second," "third," and the like in the description and claims of this application and in the above-described drawings are used for distinguishing between similar or analogous objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
The terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements expressly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and/or software code that is capable of performing the functionality associated with that element.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
The foregoing description, for purpose of explanation, has been described with reference to specific embodiments. However, the illustrative discussions above are not intended to be exhaustive or to limit the embodiments to the precise forms disclosed above. Many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles and the practical application, to thereby enable others skilled in the art to best utilize the embodiments and various embodiments with various modifications as are suited to the particular use contemplated.
Example 1:
fig. 1 is a schematic diagram illustrating a first mirror tracing process provided by some embodiments, where the process includes the following steps:
s101: and for any basic mirror image to be matched, judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced.
The mirror image tracing method provided by the embodiment of the application is applied to electronic equipment, and the electronic equipment can be a server, or equipment such as a PC (personal computer) and a mobile terminal.
In one possible implementation, all the base images contained in the cloud container platform may be used as the base images to be matched. Wherein the base image may be a generic native version of the image without any modifications. The application mirror image can be a mirror image constructed by customizing and modifying the basic mirror image on the basis of the basic mirror image according to the service requirement of a client.
Referring to fig. 2, fig. 2 shows a schematic diagram of mirror levels of an application image according to some embodiments, as shown in fig. 2, it is assumed that a base image for constructing the application image includes 3 (layer) mirror levels, and level information of a first layer mirror level is d3a1f33e8a5a, and the size is 188.1 MB; the level information of the second level mirror level is c22013c84729 with the size of 194.5 KB; the level information of the third mirror level is d74508fb6632, which is 1.895KB in size. The first three mirror image levels of the application mirror image constructed based on the base mirror image may be corresponding mirror image levels included in the base mirror image, that is, the first mirror image level of the application mirror image is also the first mirror image level of the base mirror image, and the level information is d3a1f33e8a5 a; the second-level mirror image level of the application mirror image is also the second-level mirror image level of the base mirror image, and the level information is c22013c 84729; the third mirror level of the application mirror is also the third mirror level of the base mirror, and the level information is d74508fb 6632.
For example, referring to fig. 2, when an application image is constructed based on the above-mentioned base image, any one of the first three layers of images (base images) may be modified to form a new writable container layer (image level), and the formed new writable container layer is sequentially arranged after the image level of the base image, referring to fig. 2, the fourth layer of image level of the application image is the new writable container layer. Illustratively, the level information of the fourth level mirror hierarchy may be 91e54dfb1179, and the size may be 0B.
In a possible implementation manner, when a base mirror image of a certain application mirror image is constructed in a tracing manner, a plurality of base mirror images can be used as base mirror images to be matched, and the plurality of base mirror images to be matched are respectively matched with the application mirror image to be traced. If one of the base images matches the application image, the base image may be determined to be the base image from which the application image was constructed. Specifically, for any basic mirror image to be matched, when the basic mirror image is matched with the application mirror image, whether the basic mirror image is matched with the application mirror image to be traced or not may be determined according to the level information of each mirror image level included in the basic mirror image and the level information of the corresponding mirror image level included in the application mirror image to be traced.
For example, assuming that one of the base images includes 3 image levels, the level information of the first (layer) image level included in the base image may be compared with the level information of the first layer image level included in the application image to be traced, the level information of the second layer image level included in the base image may be compared with the level information of the second layer image level included in the application image to be traced, the level information of the third layer image level included in the base image may be compared with the level information of the third layer image level included in the application image to be traced, namely, each mirror image level contained in the base mirror image is respectively compared with the level information of the corresponding mirror image level contained in the application mirror image to be traced, and whether the level information of the mirror image level is the same as the level information of the corresponding mirror image level contained in the application mirror image is respectively judged aiming at each mirror image level contained in the base mirror image. If the level information of each mirror level included in the base image is the same as the level information of the corresponding mirror level included in the application image, it may be determined that the base image matches the application image. And if the level information of any mirror level contained in the base image is not identical to the level information of the corresponding mirror level contained in the application image, it may be determined that the base image does not match the application image.
S102: and if the basic mirror image is matched with the application mirror image, determining the basic mirror image as the basic mirror image for constructing the application mirror image.
In a possible implementation manner, if one of the base images matches the application image to be traced, tracing the application image may be considered successful, and the base image may be determined as the base image for constructing the application image.
According to the method and the device, for any basic mirror image to be matched, whether the basic mirror image is matched with the application mirror image or not can be judged according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced; if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image, thereby being capable of quickly and accurately tracing the basic mirror image for constructing the application mirror image.
Example 2:
in order to quickly and accurately trace back and construct a base mirror image of an application mirror image, in the embodiment of the present application, before determining whether the base mirror image matches with the application mirror image according to level information of each mirror image level included in the base mirror image and level information of a corresponding mirror image level included in the application mirror image to be traced, the method further includes:
and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to a preset hierarchical information naming format.
In a possible implementation manner, in order to quickly and accurately trace back and construct a base mirror image of an application mirror image, before judging whether the base mirror image is matched with the application mirror image to be traced according to the level information of each mirror image level included in the base mirror image and the level information of the corresponding mirror image level included in the application mirror image to be traced, the naming format of the level information of each mirror image level included in the base mirror image and the naming format of the level information of the corresponding mirror image level included in the application mirror image to be traced can be respectively converted into the same preset format according to a preset level information naming format, so that the naming format of the level information of each mirror image level included in the base mirror image is the same as the naming format of the level information of the corresponding mirror image level included in the application mirror image. The preset hierarchical information naming format can be flexibly set according to requirements, and the method is not particularly limited in this application.
In one possible embodiment, the preset format may be a character string format. Taking the preset format as a character string format as an example, the level information of each mirror image level included in the base mirror image may be set as a character string format, or the level information of each mirror image level included in the application mirror image may be set as a character string format. Here, for convenience of description, the hierarchical information set in a character string format is referred to as a character string of the hierarchical information.
In a possible implementation manner, after the naming format of the hierarchy information of each mirror image hierarchy included in the base mirror image and the naming format of the hierarchy information of the corresponding mirror image hierarchy included in the application mirror image are respectively converted into character string formats, when determining whether the base mirror image matches the application mirror image according to the hierarchy information of each mirror image hierarchy included in the base mirror image and the hierarchy information of the corresponding mirror image hierarchy included in the application mirror image to be traced, it may be determined whether the character string of the hierarchy information of each mirror image hierarchy included in the base mirror image is the same as the character string of the hierarchy information of the corresponding mirror image hierarchy included in the application mirror image. If the character string of the hierarchy information of each mirror level included in the base image is the same as the character string of the hierarchy information of the corresponding mirror level included in the application image, it may be determined that the base image matches the application image. And if the character string of the level information of any mirror level contained in the base mirror image is not identical to the character string of the level information of the corresponding mirror level contained in the application mirror image, it may be determined that the base mirror image does not match the application mirror image.
According to the method and the device, the naming format of the hierarchical information of each mirror image level contained in the basic mirror image to be matched and the naming format of the hierarchical information of the mirror image level contained in the application mirror image to be traced can be respectively converted into the same preset format, and on the basis of the same hierarchical information format, whether the basic mirror image is matched with the application mirror image or not can be judged according to the hierarchical information of each mirror image level contained in the basic mirror image and the hierarchical information of the corresponding mirror image level contained in the application mirror image to be traced, the matching accuracy and efficiency can be improved, and therefore the mirror image tracing accuracy and rapidity can be further improved.
In the related art, when performing mirror image tracing, usually, the mirror image tracing can be performed only by performing global search on the version information document of the application mirror image by means of a script written manually based on the version information document of the application mirror image written manually by an application mirror image builder. Because the mirror image tracing mode in the related technology needs to be performed based on manually writing version information documents, scripts and the like of the application mirror image, the automation degree of mirror image tracing is not high. And when the image version information document is missing or has problems such as information omission due to human or other reasons, even the basic image of the application image cannot be traced. In addition, when searching for application version information documents through scripts, the formats of the mirror version information documents of each mirror level need to be completely consistent, and when the format of the mirror version information document of any mirror level is inconsistent with the formats of other mirror version information documents due to human factors and the like, mirror tracing cannot be performed through the unified script, so that the basic mirror image for constructing the application mirror image may not be traced. In addition, in the related art, a mode of tracing the source of the mirror image based on the script is required, the mirror image version information document of each mirror image level needs to be searched in the execution process, a large amount of redundant and invalid operations exist, and when the data volume of the mirror image version information document of the mirror image level is large, the complexity of the tracing process is high, and the requirement of agile development is not met.
Since the hierarchical information is information carried by the mirror image (including the base mirror image and the application mirror image), the hierarchical information does not need to be written by a mirror image builder and the like, and the hierarchical information is designed only to facilitate storage and distribution of the mirror image. The method and the device have the advantages that the hierarchical information can be generated automatically and managed automatically, the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image to be matched and the naming format of the hierarchical information of the mirror image hierarchy contained in the application mirror image to be traced can be converted into the same preset format, and the hierarchical information formats can be consistent. The method and the device have the advantages that the hierarchical information based on the mirror image hierarchy can be automatically generated, automatically managed, consistent in format and the like, when the mirror image tracing is carried out on the hierarchical information based on the mirror image hierarchy, the tracing efficiency is high, the accuracy is high, the system adaptability is strong, the stability is high, the automation degree is high, and the like.
For convenience of understanding, the mirror tracing process provided in the present application is explained below by using a specific embodiment. Fig. 3 is a schematic diagram illustrating a second mirror image tracing process provided by some embodiments, and as shown in fig. 3, the process includes the following steps:
s301: and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image to be traced into preset formats according to a preset hierarchical information naming format.
S302: for any basic mirror image to be matched, judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced; and if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image.
For convenience of understanding, the mirror tracing process provided in the present application is explained below by using a specific embodiment. Fig. 4 is a schematic diagram illustrating a third mirror tracing process provided in some embodiments, and as shown in fig. 4, the process includes the following steps:
s401: and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the base mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image to be traced into preset formats according to a preset hierarchical information naming format.
S402: for any basic mirror image to be matched, judging whether the level information of the mirror image level is the same as the level information of the corresponding mirror image level contained in the application mirror image to be traced;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
if the level information of any mirror level included in the base mirror image is not the same as the level information of the corresponding mirror level included in the application mirror image, it is determined that the base mirror image is not matched with the application mirror image.
The multiple basic images to be matched can be respectively matched with the application images to be traced (for convenience of description, referred to as polling matching) until the basic images matched with the application images are found.
S403: and determining the basic mirror image matched with the application mirror image as the basic mirror image for constructing the application mirror image.
For convenience of description, the polling matching process provided in the embodiments of the present application is explained below by using a specific embodiment. Fig. 5 is a schematic diagram illustrating a fourth mirror tracing process provided by some embodiments, and as shown in fig. 5, the process includes the following steps:
s501: and acquiring a character string of the hierarchical information of the image hierarchy contained in the application image to be traced.
For convenience of description, an array of character strings for storing the hierarchical information of the image hierarchy included in the application image is referred to as a one-dimensional array. The one-dimensional array may be represented by AiWhere i denotes the sequence number of the image level of the application image. In one possible embodiment, i is 0, 1, 2, 3 … …, etc. Wherein the first mirror level of the application mirror can be A0Indicating that the second level of mirroring of the application mirror may be denoted by A1Indicating that the third mirror level of the application mirror can be denoted by A2The other mirror image levels can be analogized in turn, and are not described in detail.
S502: and acquiring character strings of the hierarchy information of the mirror image hierarchy contained in all the base mirrors to be matched.
Since there are usually a plurality of base images to be matched, for convenience of description, an array storing the hierarchical information of the image hierarchy included in all the base images to be matched is referred to as a two-dimensional array. B for the two-dimensional arrayk,jAnd j represents the sequence number of the mirror level of the base mirror. In one possibilityIn the embodiment (2), k is 0, 1, 2, 3 … …, or the like. j is 0, 1, 2, 3 … …, etc.
For example, assuming there are two base images to be matched, the first level of image hierarchy of the first base image may be B0,0Indicating that the second level of mirroring of the first base mirror may be B0,1Indicating that the third mirror level of the first base mirror can be represented by B0,2And (4) showing. The first mirror level of the second base mirror can be B1,0Indicating that the second level of mirroring of the second base mirror may be represented by B1,1Indicating that the third mirror level of the second base mirror can be represented by B1,2The other mirror image levels can be analogized in turn, and are not described in detail.
S503: according to the sequence of indexes of the basic mirror images, sequentially aiming at the basic mirror images to be matched, judging whether character strings of the hierarchical information of each mirror image hierarchy contained in the basic mirror images are the same as character strings of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror images to be traced; if the character string of the hierarchical information of each mirror level included in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror level included in the application mirror image to be traced, determining that the basic mirror image is matched with the application mirror image, and performing S504;
if the character string of the hierarchical information of any mirror level contained in the basic mirror image is not the same as the character string of the hierarchical information of the corresponding mirror level contained in the application mirror image to be traced, determining that the basic mirror image is not matched with the application mirror image, and repeating the step of judging whether the character string of the hierarchical information of each mirror level contained in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror level contained in the application mirror image to be traced for the basic mirror image of the next index.
Illustratively, there are three basic images to be matched, wherein the first basic image has 3 mirror image levels, the second basic image has 5 mirror image levels, and the third basic image has 4 mirror image levels.
Can be judged firstWhether the character strings of the hierarchy information of each mirror level contained in one base mirror image are the same as the character strings of the hierarchy information of the corresponding mirror level contained in the application mirror image to be traced. For example, a first level mirror hierarchy (B) of a first base mirror may be determined0,0) Is mirrored with the application (a)0) If the character strings are the same, then judging the second layer mirror image level (B) of the first basic mirror image0,1) Is mirrored with the application at a second level of mirroring (a)1) If B is the same0,1And A1Is not the same, the first base image may be considered to not match the application image.
Then, it may be determined whether the character strings of the hierarchy information of each mirror level included in the second base mirror image are the same as the character strings of the hierarchy information of the corresponding mirror level included in the application mirror image to be traced. For example, a first level mirror hierarchy (B) of a second base mirror may be determined1,0) Is mirrored with the application (a)0) If the character strings are the same, then judging the second layer mirror image level (B) of the second basic mirror image1,1) Is mirrored with the application at a second level of mirroring (a)1) If the character strings are the same, then judging the third layer of the mirror image level (B) of the second basic mirror image1,2) Of a third layer of mirroring hierarchy (A) of strings and applications2) If the character strings are the same, then judging the fourth layer mirror image level (B) of the second basic mirror image1,3) Is mirrored with the application (a)3) If the character strings are the same, then judging the fifth layer mirror image level (B) of the second basic mirror image1,4) Of a fifth mirror hierarchy (A) of character strings and application mirrors4) If the character strings of the image level hierarchy of the second base image are the same as the character strings of the hierarchy information of the corresponding image level contained in the application image to be traced, the second base image and the corresponding image level hierarchy contained in the application image to be traced can be determinedMirror matching is applied.
And the second basic mirror image is matched with the application mirror image to be traced, so that whether the third basic mirror image is matched with the application mirror image can be judged no longer.
S504: and determining the basic mirror image matched with the application mirror image as the basic mirror image for constructing the application mirror image.
For convenience of description, the polling matching process provided in the embodiments of the present application is explained below by using a specific embodiment. Fig. 6 is a schematic diagram illustrating a fifth mirror tracing process provided by some embodiments, and as shown in fig. 6, the process includes the following steps:
s601: the base mirror container is initialized.
The basic mirror image container can be started in the electronic equipment, and parameter information such as administrator authority and mirror image scanning of the basic mirror image container can be configured. And updating the base mirror image container directory, ensuring the timeliness of the base mirror image (ensuring that the base mirror image is the latest version), and operating the base mirror image container on a physical machine or a virtual machine with sufficient resources (space) to ensure that the relevant container of the base mirror image can normally operate.
S602: and synchronously updating the mirror image information in the MongoDB database in real time, and ensuring the timeliness of the basic mirror image and the current mirror image level information.
The application mirror image and the base mirror image in the MongoDB database can be synchronously updated, the timeliness of the application mirror image and the base mirror image (the base mirror image and the application mirror image are both latest versions) is guaranteed, and normal operation of the application mirror image and the base mirror image is guaranteed.
S603: and acquiring and storing the hierarchy information of the mirror image hierarchy contained in all the basic mirror images, and converting all the hierarchy information into a preset character string format.
In a possible implementation manner, all the base images contained in the cloud container platform can be used as the base images to be matched, and the level information of the image levels contained in all the base images to be matched is determined and stored. The hierarchy information of each mirror image hierarchy contained in the basic mirror image is converted into a preset character string format, so that the integrity and the accuracy of the acquired hierarchy information of the mirror image hierarchy can be ensured.
S604: the method comprises the steps of obtaining and storing the hierarchy information of the mirror image hierarchy contained in the application mirror image to be traced, and converting the hierarchy information of the mirror image hierarchy contained in the application mirror image into a preset character string format.
The hierarchical information of the mirror image hierarchy contained in the application mirror image to be traced is converted into a preset character string format, so that the integrity and the accuracy of the acquired hierarchical information of the mirror image hierarchy can be ensured, meanwhile, the consistency of the hierarchical information of the mirror image hierarchy of the basic mirror image and the format of the hierarchical information of the mirror image hierarchy contained in the application mirror image can be ensured, and the basic mirror image and the application mirror image can be matched quickly and accurately.
S605: for any one of the basic mirror images to be matched, whether the character strings of the hierarchy information of each mirror image hierarchy contained in the basic mirror image are the same as the character strings of the hierarchy information of the corresponding mirror image hierarchy contained in the application mirror image to be traced;
if the character string of the hierarchical information of each mirror image level contained in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image to be traced, determining that the basic mirror image is matched with the application mirror image to be traced;
if the character string of the hierarchical information of any mirror image hierarchy included in the base mirror image is different from the character string of the hierarchical information of the corresponding mirror image hierarchy included in the application mirror image to be traced, it can be determined that the base mirror image is not matched with the application mirror image to be traced.
The plurality of basic images to be matched can be matched with the application images to be traced respectively until the basic images matched with the application images are found.
S606: and determining the basic mirror image matched with the application mirror image as the basic mirror image for constructing the application mirror image.
After the basic mirror image matched with the application mirror image is found, the tracing can be considered to be successful, the identification information such as the name of the matched basic mirror image is output, and the tracing process is ended.
Example 3:
based on the same technical concept, the present application provides a mirror image tracing apparatus, and fig. 7 shows a schematic diagram of a mirror image tracing apparatus provided by some embodiments, as shown in fig. 7, the apparatus includes:
the matching module 71 is configured to, for any basic mirror image to be matched, determine whether the basic mirror image is matched with the application mirror image according to the level information of each mirror image level included in the basic mirror image and the level information of the corresponding mirror image level included in the application mirror image to be traced;
a determining module 72, configured to determine the base image as a base image for constructing the application image if the base image matches the application image.
In a possible embodiment, the matching module 71 is specifically configured to determine, for each mirror level included in the base mirror image, whether level information of the mirror level is the same as level information of a corresponding mirror level included in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a possible embodiment, the apparatus further comprises:
and the format conversion module is used for respectively converting the naming format of the hierarchy information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchy information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to preset hierarchy information naming formats.
In one possible embodiment, the preset format includes a string format.
In a possible embodiment, the matching module 71 is specifically configured to determine that the base image matches the application image if a character string of the level information of each image level included in the base image is the same as a character string of the level information of a corresponding image level included in the application image;
and if the character string of the hierarchical information of any mirror image level contained in the basic mirror image is not the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
Example 3:
based on the same technical concept, the present application further provides an electronic device, and fig. 8 shows a schematic structural diagram of an electronic device provided in some embodiments, as shown in fig. 8, including: the system comprises a processor 81, a communication interface 82, a memory 83 and a communication bus 84, wherein the processor 81, the communication interface 82 and the memory 83 are communicated with each other through the communication bus 84;
the memory 83 has stored therein a computer program which, when executed by the processor 81, causes the processor 81 to perform the steps of:
for any basic mirror image to be matched, judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced;
and if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image.
In a possible implementation manner, the processor 81 is specifically configured to, according to the hierarchy information of each image hierarchy included in the base image and the hierarchy information of the corresponding image hierarchy included in the application image to be traced, determine whether the base image matches the application image, including:
for each mirror image level contained in the basic mirror image, judging whether the level information of the mirror image level is the same as the level information of the corresponding mirror image level contained in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a possible implementation manner, before the determining, by the processor 81, whether the base image matches the application image according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced, the method further includes:
and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to a preset hierarchical information naming format.
In one possible embodiment, the preset format includes a string format.
In a possible implementation manner, the processor 81 is specifically configured to, according to the hierarchy information of each image hierarchy included in the base image and the hierarchy information of the corresponding image hierarchy included in the application image to be traced, determine whether the base image matches the application image, including:
if the character string of the hierarchical information of each mirror level contained in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror level contained in the application mirror image, determining that the basic mirror image is matched with the application mirror image;
and if the character string of the hierarchical information of any mirror image level contained in the basic mirror image is not the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
Because the principle of the electronic device for solving the problems is similar to the mirror image tracing method, the implementation of the electronic device can refer to the implementation of the method, and repeated details are not repeated.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 82 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 5:
based on the same technical concept, embodiments of the present application provide a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to perform the following steps:
for any basic mirror image to be matched, judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced;
and if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image.
In a possible implementation manner, the determining, according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced, whether the base image matches the application image includes:
for each mirror image level contained in the basic mirror image, judging whether the level information of the mirror image level is the same as the level information of the corresponding mirror image level contained in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
In a possible implementation manner, before determining whether the base image matches the application image according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced, the method further includes:
and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to a preset hierarchical information naming format.
In one possible embodiment, the predetermined format comprises a string format.
In a possible implementation manner, the determining, according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced, whether the base image matches the application image includes:
if the character string of the hierarchical information of each mirror level contained in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror level contained in the application mirror image, determining that the basic mirror image is matched with the application mirror image;
and if the character string of the hierarchical information of any mirror image level contained in the basic mirror image is not the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
Because the principle of solving the problem of the computer-readable storage medium is similar to that of the mirror image tracing method, the implementation of the computer-readable storage medium can refer to the implementation of the method, and repeated details are not repeated.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
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 so forth) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A mirror image tracing method is characterized by comprising the following steps:
for any basic mirror image to be matched, judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced;
and if so, determining the basic mirror image as the basic mirror image for constructing the application mirror image.
2. The method according to claim 1, wherein the determining whether the base image matches the application image according to the hierarchy information of each image hierarchy included in the base image and the hierarchy information of the corresponding image hierarchy included in the application image to be traced comprises:
for each mirror image level contained in the basic mirror image, judging whether the level information of the mirror image level is the same as the level information of the corresponding mirror image level contained in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
3. The method according to claim 1 or 2, wherein before determining whether the base image matches the application image according to the hierarchy information of each image hierarchy included in the base image and the hierarchy information of the corresponding image hierarchy included in the application image to be traced, the method further comprises:
and respectively converting the naming format of the hierarchical information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchical information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to a preset hierarchical information naming format.
4. The method of claim 3, wherein the predetermined format comprises a string format.
5. The method according to claim 4, wherein the determining whether the base image matches the application image according to the level information of each image level included in the base image and the level information of the corresponding image level included in the application image to be traced comprises:
if the character string of the hierarchical information of each mirror image level contained in the basic mirror image is the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is matched with the application mirror image;
and if the character string of the hierarchical information of any mirror image level contained in the basic mirror image is not the same as the character string of the hierarchical information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
6. A mirror image tracing apparatus, the apparatus comprising:
the matching module is used for judging whether the basic mirror image is matched with the application mirror image or not according to the level information of each mirror image level contained in the basic mirror image and the level information of the corresponding mirror image level contained in the application mirror image to be traced;
and the determining module is used for determining the basic mirror image as the basic mirror image for constructing the application mirror image if the basic mirror image is matched with the application mirror image.
7. The apparatus according to claim 6, wherein the matching module is specifically configured to determine, for each mirror level included in the base mirror image, whether level information of the mirror level is the same as level information of a corresponding mirror level included in the application mirror image;
if the level information of each mirror image level contained in the base mirror image is the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the base mirror image is matched with the application mirror image;
and if the level information of any mirror image level contained in the basic mirror image is not the same as the level information of the corresponding mirror image level contained in the application mirror image, determining that the basic mirror image is not matched with the application mirror image.
8. The apparatus of claim 6 or 7, further comprising:
and the format conversion module is used for respectively converting the naming format of the hierarchy information of each mirror image hierarchy contained in the basic mirror image and the naming format of the hierarchy information of the corresponding mirror image hierarchy contained in the application mirror image into preset formats according to preset hierarchy information naming formats.
9. An electronic device, characterized in that the electronic device comprises at least a processor and a memory, the processor being configured to implement the steps of the mirror tracing method according to any of claims 1-5 when executing a computer program stored in the memory.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a mirror tracing method according to any one of claims 1 to 5.
CN202111369805.XA 2021-11-17 2021-11-17 Mirror image tracing method, device, equipment and medium Pending CN114090841A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111369805.XA CN114090841A (en) 2021-11-17 2021-11-17 Mirror image tracing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111369805.XA CN114090841A (en) 2021-11-17 2021-11-17 Mirror image tracing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN114090841A true CN114090841A (en) 2022-02-25

Family

ID=80301726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111369805.XA Pending CN114090841A (en) 2021-11-17 2021-11-17 Mirror image tracing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN114090841A (en)

Similar Documents

Publication Publication Date Title
CN110569035B (en) Code compiling method, device, equipment and storage medium of software development project
EP3433732B1 (en) Converting visual diagrams into code
US10146671B2 (en) Testing of software upgrade
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
US11642783B2 (en) Automated generation of robotic computer program code
CN109885299B (en) Template processing method, device, computer equipment and storage medium in model development
US11205138B2 (en) Model quality and related models using provenance data
CN110825395B (en) Multi-plug-in layered deployment system, device and medium
US11099837B2 (en) Providing build avoidance without requiring local source code
CN111984264A (en) Static library generation method and device
US11422917B2 (en) Deriving software application dependency trees for white-box testing
AU2017276243B2 (en) System And Method For Generating Service Operation Implementation
US11151448B2 (en) Location tagging for visual data of places using deep learning
CN114090841A (en) Mirror image tracing method, device, equipment and medium
US20220365778A1 (en) Fast porting of projects
CN114115982A (en) Code issuing method, device, equipment and storage medium
US11449797B1 (en) Secure machine learning workflow automation using isolated resources
CN113867778A (en) Method and device for generating mirror image file, electronic equipment and storage medium
CN114281688A (en) Codeless or low-code automatic case management method and device
US10956517B2 (en) Holistic mapping and relocation of social media assets
CN111858158A (en) Data processing method and device and electronic equipment
US11561979B2 (en) Dynamically detecting and correcting errors in queries
CN115390912B (en) Resource discovery method, device, computer equipment and storage medium
US20240028408A1 (en) Reference implementation of cloud computing resources
CN111726373B (en) Communication link construction method, device and equipment

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