Method, device, equipment and storage medium for automatically generating incremental mirror image data packet

文档序号:152891 发布日期:2021-10-26 浏览:23次 中文

阅读说明:本技术 增量镜像数据包的自动生成方法、装置、设备及存储介质 (Method, device, equipment and storage medium for automatically generating incremental mirror image data packet ) 是由 王飞 刘城 王龙 叶成 李虎 梁广泽 郑东 倪杨 吴金鑫 侯立冬 孟宝权 王杰 于 2021-07-28 设计创作,主要内容包括:本发明实施例公开了一种增量镜像数据包的自动生成方法、装置、设备及存储介质。增量镜像数据包的自动生成方法,包括:获取与目标软件的新版本匹配的全量镜像数据包,其中,全量镜像数据包中,按照预设的分层目录形式存储有分层文件;对全量镜像数据包进行数据结构的解析,获取分层文件的文件标识,并在目标设备本地缓存的历史数据中,获取与目标软件关联的文件标识集合;将各分层文件的文件标识与文件标识集合进行匹配,获取重复文件标识;从全量镜像数据包中,筛除各重复文件标识对应的重复分层文件,形成与目标软件的新版本匹配的增量镜像数据包。本发明实施例的技术方案能够对接持续集成的自动化方案,降低镜像包的部署耗时。(The embodiment of the invention discloses an automatic generation method, device, equipment and storage medium of an incremental mirror image data packet. The automatic generation method of the incremental mirror image data packet comprises the following steps: acquiring a full-volume mirror image data packet matched with the new version of the target software, wherein layered files are stored in the full-volume mirror image data packet according to a preset layered directory form; analyzing the data structure of the full-volume mirror image data packet to obtain the file identification of the layered file, and obtaining a file identification set associated with the target software from the history data locally cached by the target equipment; matching the file identification of each layered file with the file identification set to obtain a repeated file identification; and screening out the repeated layered files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software. The technical scheme of the embodiment of the invention can be used for docking a continuous integrated automation scheme, and the time consumption for deploying the mirror image package is reduced.)

1. An automatic generation method of an incremental mirror data packet is characterized by comprising the following steps:

acquiring a full-volume mirror image data packet matched with a new version of target software, wherein a plurality of layered files are stored in the full-volume mirror image data packet according to a preset layered directory form;

analyzing the data structure of the full-volume mirror image data packet to obtain the file identification of each hierarchical file, and obtaining a file identification set associated with target software from the local cached historical data of the target equipment;

matching the file identification of each layered file with the file identification set to obtain at least one repeated file identification;

and screening out the repeated layered files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software.

2. The method of claim 1, wherein analyzing the data structure of the full volume mirror image data package to obtain the file identifier of each hierarchical file comprises:

analyzing a data structure of a full-volume mirror image data packet to obtain a target mirror image file in the full-volume mirror image data packet;

and acquiring each difference identifier included in the difference identifier set in the target image file as the file identifier of each hierarchical file.

3. The method of claim 1, wherein obtaining a set of file identifiers associated with the target software from the history data cached locally at the target device comprises:

acquiring a local cache directory associated with target software from historical data of local cache of target equipment;

and acquiring a file identification set associated with the target software under the local cache directory.

4. The method of claim 3, wherein obtaining a local cache directory associated with the target software from the history data locally cached by the target device comprises:

and acquiring the local cache directory by using a container configuration file or a container data query instruction.

5. The method of claim 3, wherein obtaining, under the local cache directory, a set of file identifiers associated with the target software comprises:

analyzing a data structure of the local cache directory to obtain a tree structure root directory corresponding to the local cache directory;

and traversing the tree structure root directory according to the file identifier to obtain a file identifier set associated with the target software.

6. The method of claim 1, wherein screening out duplicate hierarchical files corresponding to each duplicate file identifier from the full volume mirror package comprises:

positioning the storage positions of the repeated layered files under the layered directory according to the repeated file identifications in the mirror image package description file;

and deleting the repeated layered file according to the storage position of the repeated layered file under the layered directory.

7. The method of claim 1, wherein obtaining a full volume mirrored package that matches a new version of target software comprises:

responding to a software upgrading request of target equipment to target software, and acquiring a full amount of mirror image data packets matched with a new version of the target software;

after forming the incremental mirror data package matched with the new version of the target software, the method further comprises the following steps:

and sending the incremental mirror image data packet to equipment to be deployed so as to indicate the equipment to be deployed to locally deploy the incremental mirror image data packet.

8. An apparatus for automatically generating incremental mirror packets, comprising:

the system comprises a full mirror image data package obtaining module, a full mirror image data package obtaining module and a full mirror image data package matching with a new version of target software, wherein a plurality of layered files are stored in the full mirror image data package according to a preset layered directory form;

the file identification set acquisition module is used for analyzing the data structure of the full-volume mirror image data packet, acquiring the file identification of each hierarchical file, and acquiring a file identification set associated with target software in the history data locally cached by the target equipment;

the repeated file identification acquisition module is used for matching the file identification of each layered file with the file identification set to acquire at least one repeated file identification;

and the increment mirror image data packet generation module is used for screening out the repeated layered files corresponding to the repeated file identifications from the full mirror image data packet to form an increment mirror image data packet matched with the new version of the target software.

9. An electronic device, characterized in that the electronic device comprises:

one or more processors;

storage means for storing one or more programs;

when executed by the one or more processors, cause the one or more processors to implement a method for automatic generation of an incremental mirror data package as recited in any of claims 1-7.

10. A computer storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements a method for automatic generation of incremental mirror packets according to any of claims 1-7.

Technical Field

The embodiment of the invention relates to the technical field of computers, in particular to an automatic generation method, device, equipment and storage medium of an incremental mirror image data packet.

Background

At present, the container technology brings great benefits to software technologies in multiple aspects of continuous integration, cross-platform support, environment standardization, version control, resource isolation, resource utilization rate and the like, so that the container technology is widely used in more and more technical teams. For companies or teams with privatized deployment requirements, the update iteration of the software version is generally realized by making a new version of software image into an image package to be installed offline or online. When the software is deployed privately based on the container, because the image packet data volume of the software is large (hundreds of megabits for a single micro-service software image packet), version iteration is generally realized by constructing and deploying an incremental image packet for a project with a large scale or frequent updating.

The existing method for constructing and deploying the incremental mirror package specifically comprises the following steps: firstly, an updating difference file and a mirror image description file corresponding to a mirror image package to be updated are prepared, a container file is compiled according to the updating difference file and the mirror image description file, and then the incremental mirror image package is constructed and deployed through the container file.

In the process of implementing the invention, the inventor finds that the following defects exist in the existing software version iteration using the incremental mirror package: (1) the updated difference file can be obtained only by manual analysis and processing, and the automatic schemes such as continuous integration and the like are difficult to realize. (2) When the version of the software is iterated, even if the device stores the relevant data in the incremental image package, the data needs to be repeatedly acquired from the incremental image package for local replacement, and the repeatedly downloaded data can affect the deployment time of the incremental image package.

Disclosure of Invention

The embodiment of the invention provides an automatic generation method, device, equipment and storage medium of an incremental mirror image data packet, which can be used for docking a continuous integrated automation scheme and reducing the time consumption for deploying the mirror image packet.

In a first aspect, an embodiment of the present invention provides an automatic generation method for an incremental mirror data packet, including:

acquiring a full-volume mirror image data packet matched with a new version of target software, wherein a plurality of layered files are stored in the full-volume mirror image data packet according to a preset layered directory form;

analyzing the data structure of the full-volume mirror image data packet to obtain the file identification of each hierarchical file, and obtaining a file identification set associated with target software from the local cached historical data of the target equipment;

matching the file identification of each layered file with the file identification set to obtain at least one repeated file identification;

and screening out the repeated hierarchical files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software.

In a second aspect, an embodiment of the present invention further provides an apparatus for automatically generating an incremental mirror data packet, where the apparatus includes:

the system comprises a full mirror image data package obtaining module, a full mirror image data package obtaining module and a full mirror image data package matching with a new version of target software, wherein a plurality of layered files are stored in the full mirror image data package according to a preset layered directory form;

the file identification set acquisition module is used for analyzing the data structure of the full-volume mirror image data packet, acquiring the file identification of each hierarchical file, and acquiring a file identification set associated with target software in the history data locally cached by the target equipment;

the repeated file identification acquisition module is used for matching the file identification of each layered file with the file identification set to acquire at least one repeated file identification;

and the increment mirror image data packet generation module is used for screening out the repeated layered files corresponding to the repeated file identifications from the full mirror image data packet to form an increment mirror image data packet matched with the new version of the target software.

In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:

one or more processors;

storage means for storing one or more programs;

when the one or more programs are executed by the one or more processors, the one or more processors implement the method for automatically generating the incremental mirror data package according to any embodiment of the present invention.

In a fourth aspect, an embodiment of the present invention further provides a computer storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for automatically generating an incremental mirror data packet according to any embodiment of the present invention.

According to the technical scheme of the embodiment, a full-volume mirror image data packet which is matched with a new version of target software and stores a plurality of layered files according to a preset layered directory form is obtained to analyze the data structure of the full-volume mirror image data packet, file identifiers of the layered files are obtained, and a file identifier set associated with the target software is obtained from the history data locally cached by target equipment. The file identification of each hierarchical file and the acquisition of the file identification set can be automatically extracted without manual intervention. After the file identification and the file identification set of each hierarchical file are obtained, the file identification of each hierarchical file is matched with the file identification set, at least one repeated file identification is obtained, repeated hierarchical files corresponding to the repeated file identifications are further screened out from the full-scale mirror image data package, and an incremental mirror image data package matched with the new version of the target software is formed. Since the set of file identifications associated with the target software may include file identifications outside of the set of textual identifications of the historical version of the target software but associated with the historical version of the target software. The set of file identifications associated with the target software is therefore larger in amount than the set of text identifications of the historical version of the target software. The method has the advantages that the file identification set associated with the target software is matched with the file identification of each hierarchical file, a large number of repeated text identifications can be obtained, so that the screened repeated hierarchical files are more in the full-volume mirror image data packet, the maximum compression of the incremental mirror image data packet is further realized, the efficient deployment of the incremental mirror image data packet is facilitated, the problems that in the prior art, when software is upgraded, the difference files of new and old versions are searched manually, the automatic scheme which is continuously integrated cannot be docked according to the difference files in the software upgrading process, even if existing data in equipment needs to be obtained through the incremental mirror image data packet, the mirror image packet deployment time is long are solved, the automatic scheme which is continuously integrated can be docked, and the deployment time consumption of the mirror image packet is reduced.

Drawings

Fig. 1 is a flowchart of a method for automatically generating an incremental mirror data packet according to an embodiment of the present invention;

fig. 2 is a flowchart of a method for automatically generating an incremental mirror data packet according to a second embodiment of the present invention;

fig. 3 is a schematic flowchart of automatic generation of an incremental mirror data packet according to a second embodiment of the present invention;

fig. 4 is a schematic diagram of an apparatus for automatically generating an incremental mirror data packet according to a third embodiment of the present invention;

fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention.

It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.

Example one

Fig. 1 is a flowchart of an automatic generation method for an incremental mirror data package according to an embodiment of the present invention, where this embodiment is applicable to a case of rapid deployment of the incremental mirror data package, and the method may be executed by an automatic generation apparatus for an incremental mirror data package, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. Accordingly, as shown in fig. 1, the method comprises the following operations:

and S110, acquiring a full mirror image data packet matched with the new version of the target software.

The target software may be software that needs to be upgraded according to the image package. The full image package may be an image package that includes all installation package metadata as well as installation files. And storing a plurality of hierarchical files in the full-volume mirror image data package according to a preset hierarchical directory form. Hierarchical directories may be used to characterize the order of hierarchical files as well as the names of hierarchical files. The hierarchical file may be used to upgrade the target software.

In the embodiment of the invention, when the target software is upgraded, the full amount of mirror image data packets matched with the new version of the target software, which are required by upgrading the target software, can be obtained firstly.

And S120, analyzing the data structure of the full-volume mirror image data packet, acquiring the file identifier of each hierarchical file, and acquiring a file identifier set associated with the target software from the history data locally cached in the target equipment.

The file identifier may be a mark for identifying a hierarchical file, and a hierarchical file has a unique file identifier. The target device may be a device that needs to generate an incremental mirror packet from the full mirror packet. The set of file identifications may be a set of file identifications cached locally by the target device.

In the embodiment of the invention, the data structure analysis can be carried out on the acquired full mirror image data packet matched with the new version of the target software, so that each layered file existing in the full mirror image data packet is acquired, and the file identifier uniquely matched with each layered file is determined according to each layered file. After the file identifiers of the hierarchical files are obtained, historical data of local cache of the target equipment can be further obtained, and then the historical data of the local cache of the target equipment is analyzed to obtain a file identifier set associated with the target software. Wherein the set of file identifications associated with the target software may include a set of file identifications of historical versions of all software cached locally by the target device.

S130, matching the file identification of each layered file with the file identification set to obtain at least one repeated file identification.

Wherein, the duplicate file identifier may be a file identifier of a plurality of hierarchical files and a simultaneous identifier in the file identifier set.

In the embodiment of the invention, the obtained file identification and the file identification set of each layered file can be matched, so that at least one repeated file identification is obtained, and the duplicate removal processing is carried out on the full-volume mirror image data packet according to the repeated file identification.

S140, screening out the repeated layered files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software.

Wherein, the repeated layered file can be a layered file marked by the repeated file identification.

In the embodiment of the invention, the repeated layered files corresponding to the repeated file identifications can be determined according to the obtained at least one repeated file identification, and then the repeated layered files corresponding to the repeated file identifications are screened out from the full-volume mirror image data packet, so that an incremental mirror image data packet matched with the new version of the target software is formed according to the residual data in the full-volume mirror image data packet. It should be noted that when the number of versions of the full mirror data packet is large, the number of versions of the full mirror data packet is also large, and the full mirror data packet is determined manually through the versions, which easily causes a problem that the generated incremental mirror data packet has data errors. According to the scheme, the repeated layered files corresponding to the repeated file identifications are screened out from the full-volume mirror image data packet to form the increment mirror image data packet matched with the new version of the target software, and the data accuracy of the generated increment mirror image data packet can be guaranteed.

According to the technical scheme of the embodiment, a full-volume mirror image data packet which is matched with a new version of target software and stores a plurality of layered files according to a preset layered directory form is obtained to analyze the data structure of the full-volume mirror image data packet, file identifiers of the layered files are obtained, and a file identifier set associated with the target software is obtained from the history data locally cached by target equipment. The file identification of each hierarchical file and the acquisition of the file identification set can be automatically extracted without manual intervention. After the file identification and the file identification set of each hierarchical file are obtained, the file identification of each hierarchical file is matched with the file identification set, at least one repeated file identification is obtained, repeated hierarchical files corresponding to the repeated file identifications are further screened out from the full-scale mirror image data package, and an incremental mirror image data package matched with the new version of the target software is formed. Since the set of file identifications associated with the target software may include file identifications outside of the set of textual identifications of the historical version of the target software but associated with the historical version of the target software. The set of file identifications associated with the target software is therefore larger in amount than the set of text identifications of the historical version of the target software. The method has the advantages that the file identification set associated with the target software is matched with the file identification of each hierarchical file, a large number of repeated text identifications can be obtained, so that more repeated hierarchical files can be screened from the full-volume mirror image data packet, the maximum compression of the incremental mirror image data packet is further realized, the efficient deployment of the incremental mirror image data packet is facilitated, the problems that in the prior art, when software is upgraded, the updated difference files of new and old versions are manually searched, the automatic scheme which is continuously integrated cannot be docked according to the updated difference files are solved, the problem that the mirror image packet deployment is long due to the fact that even existing data in equipment need to be obtained through the incremental mirror image data packet is solved, the automatic scheme which is continuously integrated can be docked, and the time consumed for deploying the mirror image packet is reduced.

Example two

Fig. 2 is a flowchart of an automatic generation method of an incremental mirror data package according to a second embodiment of the present invention, which is embodied based on the foregoing embodiments, and in this embodiment, a specific optional implementation scheme is provided for analyzing a data structure of a full mirror data package, obtaining file identifiers of respective hierarchical files, obtaining a file identifier set associated with target software in history data locally cached in a target device, and filtering out duplicate hierarchical files corresponding to respective duplicate file identifiers from the full mirror data package, and accordingly, as shown in fig. 2, the method includes the following operations:

and S210, acquiring a full amount of mirror image data packets matched with the new version of the target software.

S220, analyzing the data structure of the full mirror image data packet to obtain a target mirror image file in the full mirror image data packet.

The target image file can be a file in a full-volume image data package and is used for storing a file identifier of the hierarchical file.

In the embodiment of the invention, the target device can analyze the data structure of the acquired full mirror image data packet matched with the new version of the target software to obtain the target mirror image file in the full mirror image data packet.

For example, if the device receiving the full volume mirror package and the device loading the incremental mirror package are the same device, the target image file may be the mirror package configuration file. If the device receiving the full volume mirror image data package and the device loading the incremental mirror image data package are different devices, the target mirror image file may be a mirror image package description file. For example, the image package description file may be a file with a filename of manifest.

S230, acquiring each difference identifier included in the difference identifier set in the target image file as the file identifier of each hierarchical file.

Wherein the set of difference identifiers may be a set of file identifiers included in the target image file. The difference identity may be an identity in a set of difference identities.

In the embodiment of the invention, the target image file can be analyzed to obtain the difference identification set and each difference identification in the difference identification set, and each difference identification is further used as the file identification of each layered file.

For example, when the target image file is an image package description file, the difference identifier may be a layerID. When the target image file is an image package configuration file, the difference identifier may be a diffID. The layerID is data obtained by performing compression calculation on the mirror-image pull content. diffID is data obtained by compressing and decompressing the image pull content. It should be noted that, when the identification type of the differential identifier is a layerID, the identification type of the file identification set is also a layerID. When the identification type of the differential identification is diffID, the identification type of the file identification set is also diffID. That is, when the types of identifiers are the same, the file identifiers of the layered files and the file identifier sets can be matched.

S240, obtaining a local cache directory associated with the target software from the historical data of the local cache of the target equipment.

The local cache directory may be used to characterize a directory of locally cached data.

In the embodiment of the invention, the historical data of the local cache of the target equipment can be analyzed, and then the local cache directory associated with the target software is obtained from the historical data.

In an optional embodiment of the present invention, obtaining the local cache directory associated with the target software from the history data locally cached by the target device may include: and acquiring the local cache directory by using the container configuration file or the container data query instruction.

Wherein the container configuration file may be a configuration file when the container creates the image. The container data query instructions may be for querying data included in the container.

In the embodiment of the present invention, the container configuration file or the container data query instruction may be used to search the local cache directory in the history data locally cached by the target device.

For example, the container configuration file may be stored in a/ect/docker/daemon.json file, and the container data query instruction may be a docker info instruction. The embodiment of the invention does not limit the file types stored in the container configuration file and the specific instruction form of the container data query instruction.

And S250, acquiring a file identification set associated with the target software under the local cache directory.

In the embodiment of the invention, the local cache directory can be analyzed, the subdirectory corresponding to the file identifier of the layered file is determined, and the file identifier set associated with the target software is further obtained according to the subdirectory.

In an optional embodiment of the present invention, acquiring, under the local cache directory, a file identifier set associated with the target software may include: analyzing a data structure of the local cache directory to obtain a tree structure root directory corresponding to the local cache directory; and traversing the tree structure root directory according to the file identifiers to obtain a file identifier set associated with the target software.

The tree structure root directory may be a cache directory of a tree structure.

In the embodiment of the present invention, the data structure of the local cache directory may be first analyzed to obtain a tree-structured root directory corresponding to the local cache directory, and then the tree-structured root directory is traversed according to the file identifier of the hierarchical file, so that a subdirectory corresponding to the file identifier of the hierarchical file may be obtained in the tree-structured root directory, and a file identifier set associated with the target software may be further obtained according to the subdirectory.

Illustratively, the diffID set may be obtained by traversing the/home/docker/image/overlay 2/layerdb/sha 256/diff file in the subdirectory corresponding to the file identifier of the hierarchical file.

S260, matching the file identification of each layered file with the file identification set to obtain at least one repeated file identification.

S270, screening out the repeated layered files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software.

In an optional embodiment of the present invention, the screening out duplicate hierarchical files corresponding to each duplicate file identifier from the full volume mirror data package may include: positioning storage positions of repeated layered files under a layered directory according to the repeated file identifications in the mirror image package description file; and deleting the repeated layered files according to the storage positions of the repeated layered files in the layered directory.

In the embodiment of the invention, after the repeated hierarchical identifier is obtained, the mirror image package description file can be obtained from the full mirror image data package, and then the storage position of the hierarchical file under the hierarchical directory is positioned in the mirror image package description file according to each repeated file identifier, so that the repeated hierarchical file can be obtained according to the storage position of the repeated hierarchical file under the hierarchical directory, and the repeated hierarchical file can be further deleted.

In an optional embodiment of the present invention, obtaining the full volume mirror image data package matching with the new version of the target software may include: responding to a software upgrading request of target equipment to target software, and acquiring a full amount of mirror image data packets matched with a new version of the target software; after forming the incremental mirror data package matched with the new version of the target software, the method further comprises the following steps: and sending the incremental mirror image data packet to the equipment to be deployed so as to indicate the equipment to be deployed to locally deploy the incremental mirror image data packet.

The software upgrading request may be a request sent by the target device when the target device needs to upgrade the target software of the device to be deployed. The device to be deployed may be a device that needs to upgrade the target software according to the incremental mirror data package, and the target software is configured on the device to be deployed.

In the embodiment of the present invention, when the target device needs to update the target software of the device to be deployed, the target device may respond to a software update request of the target device for the target software, and obtain the full amount of mirror image data packets matched with the new version of the target software. After the increment mirror image data packet matched with the new version of the target software is obtained, the increment mirror image data packet can be sent to the equipment to be deployed so as to indicate the equipment to be deployed to locally deploy the increment mirror image data packet in the equipment to be deployed.

It should be noted that after the file identifier set in the history data locally cached by the target device is matched with the file identifiers of the hierarchical files of the full volume mirror image data package, the repeated hierarchical file corresponding to the determined repeated file identifier exists locally in the target device, and in the case that the target device is the device to be deployed, the incremental mirror image data package is obtained according to the history data locally cached by the device to be deployed, so that the incremental mirror image data package and the device to be deployed have a one-to-one relationship and need to be deployed one-to-one. When the target device is not the device to be deployed, for example, when the target device is a mirror warehouse, since the history data cached by the mirror warehouse is different from the device to be deployed, the obtained incremental mirror data package may be deployed in batch when the target device is the mirror warehouse.

Fig. 3 is a schematic flowchart of automatic generation of an incremental mirror data packet according to a second embodiment of the present invention, and an automatic generation process of the incremental mirror data packet is described by taking as an example that a device that receives a full mirror data packet and a device that loads the incremental mirror data packet are the same device. As shown in fig. 3, a full volume mirror image data package matched with a new version of target software may be downloaded according to a docker save instruction, and then the data structure of the full volume mirror image data package is analyzed to obtain a mirror image package description file and a mirror image package configuration file. Because the arrangement sequence of the hierarchical files of the image package description file has a mapping relation with the arrangement sequence of the hierarchical file identification diffID in the image package configuration file, after the arrangement sequence of the hierarchical files in the image package description file is obtained, the diffID of each hierarchical file can be determined in the image package configuration file according to the arrangement sequence of the hierarchical files. Illustratively, the arrangement order of the hierarchical files of the mirror package description file is hierarchical file 1, hierarchical file 2 and hierarchical file 3. The arrangement sequence of the hierarchical file identification diffID in the mirror package configuration file is the diffID of the hierarchical file 1, the diffID of the hierarchical file 2 and the diffID of the hierarchical file 3, namely the hierarchical file and the file identification of the hierarchical file are stored in a one-to-one corresponding sequence. In the history data of the local cache of the target device, a local cache directory associated with the target software is acquired, and a diffID set (file identification set) is acquired according to the local cache directory. And matching the diffID of each hierarchical file with a diffID set in the history data locally cached by the target equipment to obtain at least one repeated diffID. And repeating the layered files corresponding to the repeating diffIDs in the full mirror image data packet to form an incremental mirror image data packet, and further deploying the incremental mirror image data packet locally. Compared with a full-volume mirror image data packet, the size of the file can be reduced to 1% -20% of the full-volume mirror image data packet, so that seamless Integration with an automatic system of CI (Continuous Integration) and CD (Continuous Delivery) such as Jenkins (open source, an Integration tool) is realized.

According to the technical scheme of the embodiment, a full-volume mirror image data packet which is matched with a new version of target software and stores a plurality of layered files according to a preset layered directory form is obtained to analyze the data structure of the full-volume mirror image data packet, file identifiers of the layered files are obtained, and a file identifier set associated with the target software is obtained from the history data locally cached by target equipment. The file identification of each hierarchical file and the acquisition of the file identification set can be automatically extracted without manual intervention. After the file identification and the file identification set of each hierarchical file are obtained, the file identification of each hierarchical file is matched with the file identification set, at least one repeated file identification is obtained, repeated hierarchical files corresponding to the repeated file identifications are further screened out from the full-scale mirror image data package, and an incremental mirror image data package matched with the new version of the target software is formed. Since the set of file identifications associated with the target software may include file identifications outside of the set of textual identifications of the historical version of the target software but associated with the historical version of the target software. The set of file identifications associated with the target software is therefore larger in amount than the set of text identifications of the historical version of the target software. The method has the advantages that the file identification set associated with the target software is matched with the file identification of each hierarchical file, a large number of repeated text identifications can be obtained, so that more repeated hierarchical files can be screened from the full-volume mirror image data packet, the maximum compression of the incremental mirror image data packet is further realized, the efficient deployment of the incremental mirror image data packet is facilitated, the problems that in the prior art, when software is upgraded, the updated difference files of new and old versions are manually searched, the automatic scheme which is continuously integrated cannot be docked according to the updated difference files are solved, the problem that the mirror image packet deployment is long due to the fact that even existing data in equipment need to be obtained through the incremental mirror image data packet is solved, the automatic scheme which is continuously integrated can be docked, and the time consumed for deploying the mirror image packet is reduced.

It should be noted that any permutation and combination between the technical features in the above embodiments also belong to the scope of the present invention.

EXAMPLE III

Fig. 4 is a schematic diagram of an apparatus for automatically generating an incremental mirror data packet according to a third embodiment of the present invention, as shown in fig. 4, the apparatus includes: a full mirror image data packet obtaining module 310, a file identifier set obtaining module 320, a duplicate file identifier obtaining module 330, and an incremental mirror image data packet generating module 340, wherein:

a full mirror image data package obtaining module 310, configured to obtain a full mirror image data package matched with a new version of target software, where a plurality of hierarchical files are stored in the full mirror image data package according to a preset hierarchical directory form;

the file identifier set acquisition module 320 is configured to analyze a data structure of the full-volume mirror image data packet, acquire a file identifier of each hierarchical file, and acquire a file identifier set associated with the target software from the history data locally cached by the target device;

a duplicate file identifier obtaining module 330, configured to match a file identifier of each hierarchical file with the file identifier set, and obtain at least one duplicate file identifier;

and the incremental mirror image data package generation module 340 is configured to screen out duplicate hierarchical files corresponding to the duplicate file identifications from the full mirror image data package, so as to form an incremental mirror image data package matched with the new version of the target software.

According to the technical scheme of the embodiment, a full-volume mirror image data packet which is matched with a new version of target software and stores a plurality of layered files according to a preset layered directory form is obtained to analyze the data structure of the full-volume mirror image data packet, file identifiers of the layered files are obtained, and a file identifier set associated with the target software is obtained from the history data locally cached by target equipment. The file identification of each hierarchical file and the acquisition of the file identification set can be automatically extracted without manual intervention. After the file identification and the file identification set of each hierarchical file are obtained, the file identification of each hierarchical file is matched with the file identification set, at least one repeated file identification is obtained, repeated hierarchical files corresponding to the repeated file identifications are further screened out from the full-scale mirror image data package, and an incremental mirror image data package matched with the new version of the target software is formed. Since the set of file identifications associated with the target software may include file identifications outside of the set of textual identifications of the historical version of the target software but associated with the historical version of the target software. The set of file identifications associated with the target software is therefore larger in amount than the set of text identifications of the historical version of the target software. The method has the advantages that the file identification set associated with the target software is matched with the file identification of each hierarchical file, a large number of repeated text identifications can be obtained, so that more repeated hierarchical files can be screened from the full-volume mirror image data packet, the maximum compression of the incremental mirror image data packet is further realized, the efficient deployment of the incremental mirror image data packet is facilitated, the problems that in the prior art, when software is upgraded, the updated difference files of new and old versions are manually searched, the automatic scheme which is continuously integrated cannot be docked according to the updated difference files are solved, the problem that the mirror image packet deployment is long due to the fact that even existing data in equipment need to be obtained through the incremental mirror image data packet is solved, the automatic scheme which is continuously integrated can be docked, and the time consumed for deploying the mirror image packet is reduced.

Optionally, the file identifier set obtaining module 320 is specifically configured to: analyzing a data structure of a full-volume mirror image data packet to obtain a target mirror image file in the full-volume mirror image data packet; and acquiring each difference identifier included in the difference identifier set in the target image file as the file identifier of each hierarchical file.

Optionally, the file identifier set obtaining module 320 is specifically configured to: acquiring a local cache directory associated with target software from historical data of local cache of target equipment; and acquiring a file identification set associated with the target software under the local cache directory.

Optionally, the file identifier set obtaining module 320 is specifically configured to: and acquiring the local cache directory by using a container configuration file or a container data query instruction.

Optionally, the file identifier set obtaining module 320 is specifically configured to: analyzing a data structure of the local cache directory to obtain a tree structure root directory corresponding to the local cache directory; and traversing the tree structure root directory according to the file identifier to obtain a file identifier set associated with the target software.

Optionally, the incremental mirror data packet generating module 340 is specifically configured to: positioning the storage positions of the repeated layered files under the layered directory according to the repeated file identifications in the mirror image package description file; and deleting the repeated layered file according to the storage position of the repeated layered file under the layered directory.

Optionally, the full mirror image data packet obtaining module 310 is specifically configured to: and responding to a software upgrading request of the target device to the target software, and acquiring a full amount of mirror image data packets matched with the new version of the target software.

Optionally, the apparatus for automatically generating an incremental mirror data packet further includes a local deployment module, configured to send the incremental mirror data packet to the device to be deployed, so as to instruct the device to be deployed to locally deploy the incremental mirror data packet.

The automatic generation device of the incremental mirror image data packet can execute the automatic generation method of the incremental mirror image data packet provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For details of the technique not described in detail in this embodiment, reference may be made to the method for automatically generating the incremental mirror data packet according to any embodiment of the present invention.

Since the above-described automatic generation device for an incremental mirror data packet is a device that can execute the automatic generation method for an incremental mirror data packet in the embodiment of the present invention, based on the automatic generation method for an incremental mirror data packet described in the embodiment of the present invention, those skilled in the art can understand the specific implementation manner and various variations of the automatic generation device for an incremental mirror data packet in the embodiment of the present invention, and therefore, how the automatic generation device for an incremental mirror data packet implements the automatic generation method for an incremental mirror data packet in the embodiment of the present invention is not described in detail here. As long as those skilled in the art implement the apparatus used in the method for automatically generating an incremental mirror data packet in the embodiment of the present invention, the apparatus is within the scope of the present application.

Example four

Fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 5 illustrates a block diagram of an electronic device 412 suitable for use in implementing embodiments of the present invention. The electronic device 412 shown in fig. 5 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present invention. The electronic device 412 may be, for example, a computer device or a server device, etc.

As shown in fig. 5, the electronic device 412 is in the form of a general purpose computing device. The components of the electronic device 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.

Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

Electronic device 412 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 412 and includes both volatile and nonvolatile media, removable and non-removable media.

Storage 428 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 430 and/or cache Memory 432. The electronic device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 5, commonly referred to as a "hard drive"). Although not shown in FIG. 5, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk-Read Only Memory (CD-ROM), a Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Storage 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.

Program 436 having a set (at least one) of program modules 426 may be stored, for example, in storage 428, such program modules 426 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination may comprise an implementation of a network environment. Program modules 426 generally perform the functions and/or methodologies of embodiments of the invention as described herein.

The electronic device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, camera, display 424, etc.), with one or more devices that enable a user to interact with the electronic device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the electronic device 412 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 422. Also, the electronic device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via the Network adapter 420. As shown, network adapter 420 communicates with the other modules of electronic device 412 over bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 412, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.

The processor 416 executes various functional applications and data processing by running programs stored in the storage device 428, for example, implementing the automatic generation method of the incremental mirror data packet provided by the above embodiment of the present invention: acquiring a full-volume mirror image data packet matched with a new version of target software, wherein a plurality of layered files are stored in the full-volume mirror image data packet according to a preset layered directory form; analyzing the data structure of the full-volume mirror image data packet to obtain the file identification of each hierarchical file, and obtaining a file identification set associated with target software from the local cached historical data of the target equipment; matching the file identification of each layered file with the file identification set to obtain at least one repeated file identification; and screening out the repeated hierarchical files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software.

According to the technical scheme of the embodiment, a full-volume mirror image data packet which is matched with a new version of target software and stores a plurality of layered files according to a preset layered directory form is obtained to analyze the data structure of the full-volume mirror image data packet, file identifiers of the layered files are obtained, and a file identifier set associated with the target software is obtained from the history data locally cached by target equipment. The file identification of each hierarchical file and the acquisition of the file identification set can be automatically extracted without manual intervention. After the file identification and the file identification set of each hierarchical file are obtained, the file identification of each hierarchical file is matched with the file identification set, at least one repeated file identification is obtained, repeated hierarchical files corresponding to the repeated file identifications are further screened out from the full-scale mirror image data package, and an incremental mirror image data package matched with the new version of the target software is formed. Since the set of file identifications associated with the target software may include file identifications outside of the set of textual identifications of the historical version of the target software but associated with the historical version of the target software. The set of file identifications associated with the target software is therefore larger in amount than the set of text identifications of the historical version of the target software. The method has the advantages that the file identification set associated with the target software is matched with the file identification of each hierarchical file, a large number of repeated text identifications can be obtained, so that more repeated hierarchical files can be screened from the full-volume mirror image data packet, the maximum compression of the incremental mirror image data packet is further realized, the efficient deployment of the incremental mirror image data packet is facilitated, the problems that in the prior art, when software is upgraded, the updated difference files of new and old versions are manually searched, the automatic scheme which is continuously integrated cannot be docked according to the updated difference files are solved, the problem that the mirror image packet deployment is long due to the fact that even existing data in equipment need to be obtained through the incremental mirror image data packet is solved, the automatic scheme which is continuously integrated can be docked, and the time consumed for deploying the mirror image packet is reduced.

EXAMPLE five

An embodiment of the present invention further provides a computer storage medium storing a computer program, where the computer program is executed by a computer processor to perform the method for automatically generating an incremental mirror data packet according to any one of the above embodiments of the present invention: acquiring a full-volume mirror image data packet matched with a new version of target software, wherein a plurality of layered files are stored in the full-volume mirror image data packet according to a preset layered directory form; analyzing the data structure of the full-volume mirror image data packet to obtain the file identification of each hierarchical file, and obtaining a file identification set associated with target software from the local cached historical data of the target equipment; matching the file identification of each layered file with the file identification set to obtain at least one repeated file identification; and screening out the repeated hierarchical files corresponding to the repeated file identifications from the full-volume mirror image data package to form an incremental mirror image data package matched with the new version of the target software.

Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM) or flash Memory), an optical fiber, a portable compact disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.

A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.

Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).

It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:项目处理方法、装置、电子设备及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!