A method, device, computer equipment and medium for processing offline compressed files

CN112860645BActive Publication Date: 2024-10-15EVERSEC BEIJING TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110178485.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-09
Publication Date
2024-10-15
Estimated Expiration
2041-02-09

AI Technical Summary

Technical Problem

In private or confidential networks, the traditional container deployment method has a large amount of data in the image container, which results in long export and import times, takes up a lot of storage resources, affects deployment efficiency, and lacks an automated deployment platform, resulting in labor and time costs. High, and unable to achieve CI/CD continuous update and delivery.

Method used

By obtaining the application identifier in the export environment, generating offline description files, creating offline compressed files based on these files, and using encrypted compressed files to export and import on removable media, application deployment and updates without an Internet connection are achieved.

Benefits of technology

Save storage resources, reduce export and import time, improve deployment efficiency, realize automated container release and rollback, reduce labor and time costs, and ensure deployment security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112860645B_ABST
    Figure CN112860645B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a method, device, computer equipment and medium for processing offline compressed files. The method includes: when an export event is triggered, obtaining an application identifier of a target application to be exported; for each target application, obtaining application information corresponding to the application identifier from an export environment according to the application identifier, and generating offline description files of all target applications according to the application information of each target application; obtaining a deployment file corresponding to the target application according to the file content of the offline description file, and preparing an offline compressed file based on the deployment file. The technical solution of the embodiment of the present invention can solve various problems caused by the large amount of data in the deployment installation package, thereby saving storage resources and reducing export time and import time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to a method, device, computer equipment and medium for processing offline compressed files. Background Art

[0002] With the advent of containerization technology, some excellent Internet technologies such as Docker and Kubernetes have developed rapidly. Almost all major Internet giants are currently promoting containerized platforms. But the problem that follows is that we are becoming more and more dependent on the Internet, and many tasks can only be completed with the Internet. For example, Docker and Kubernetes must install an image server, which, as a central warehouse, needs to be continuously synchronized with the Internet to keep the interrelated and dependent files in the image consistent. Although sometimes, we can prepare all this data manually at one time, and then import it by manually entering cumbersome commands. But if the business system reaches a central scale, the amount of work will become very huge, and manual operations may also result in errors that lead to deployment failures. Especially when the business is constantly iterating, the image needs to be continuously updated and synchronized, and it is difficult to complete the work without the Internet.

[0003] For some specific industries and scenarios, considering security and confidentiality, a dedicated network is selected, and it cannot be directly connected to the Internet. For example, there are strict requirements for private networks or confidential networks, and physical isolation must be performed. Even if there is data that needs to be accessed, it is necessary to apply for special ferry security equipment, such as a three-in-one, one-way isolation network gate to perform one-way data import, and it is impossible to complete any two-way synchronization operations between the internal and external networks. In this case, manual operations are usually used to deploy applications on private networks or confidential networks. However, the current mainstream deployment installation package exports an image container, resulting in a large amount of data in the deployment installation package. After importing the mobile media, it will occupy more storage resources, and due to the large amount of data in the deployment installation package, the export time and import time are both long, affecting the deployment efficiency. Summary of the invention

[0004] The embodiments of the present invention provide a method, device, computer equipment and medium for processing offline compressed files, which can improve the efficiency of application deployment in offline environments such as private networks or confidential networks.

[0005] In a first aspect, an embodiment of the present invention provides a method for processing an offline compressed file, comprising:

[0006] When the export event is triggered, obtain the application identifier of the target application to be exported;

[0007] For each of the target applications, obtaining application information corresponding to the application identifier from the export environment according to the application identifier, and generating offline description files of all target applications according to the application information of each target application, wherein the application identifier is associated with the application information and stored in the export environment, and the application information includes one or more of the deployment information, dependency, configuration information and storage information;

[0008] The deployment file corresponding to the target application is obtained according to the file content of the offline description file, and an offline compressed file is prepared based on the deployment file.

[0009] In a second aspect, an embodiment of the present invention further provides a device for processing an offline compressed file, the device comprising:

[0010] An identification acquisition module, used to acquire the application identification of the target application to be exported when the export event is triggered;

[0011] an information acquisition module, configured to acquire, for each target application, application information corresponding to the application identifier from the export environment according to the application identifier, and generate offline description files of all target applications according to the application information of each target application, wherein the application identifier is associated with the application information and stored in the export environment, and the application information includes one or more of the deployment information, dependency, configuration information and storage information;

[0012] The compressed file preparation module is used to obtain the deployment file corresponding to the target application according to the file content of the offline description file, and prepare an offline compressed file based on the deployment file.

[0013] In a third aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:

[0014] one or more processors;

[0015] a memory for storing one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the offline compressed file processing method as described in any embodiment of the present invention.

[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the offline compressed file processing method as described in any embodiment of the present invention.

[0018] An embodiment of the present invention provides a method, apparatus, computer equipment and medium for processing offline compressed files, which obtains application information corresponding to each target application to be exported from an export environment, generates offline description files of all target applications according to each application information, obtains deployment files corresponding to the target application according to the file content of the offline description file, and prepares offline compressed files based on the deployment file, thereby solving various problems caused by the large amount of data in the deployment installation package, and achieving the effect of saving storage resources and reducing export time and import time. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A flowchart of a method for processing an offline compressed file provided by an embodiment of the present invention;

[0020] Figure 2 A flowchart of another method for processing offline compressed files provided by an embodiment of the present invention;

[0021] Figure 3 A schematic diagram of an offline export process in an offline compressed file processing method provided by an embodiment of the present invention;

[0022] Figure 4 It is a schematic diagram of an offline export application selection interface in the offline export process provided by the present invention;

[0023] Figure 5 It is a schematic diagram of an offline export interface in the offline export process provided by the present invention;

[0024] Figure 6 A schematic diagram of an offline import process in a method for processing offline compressed files provided by an embodiment of the present invention;

[0025] Figure 7 A schematic diagram of an offline import interface provided by an embodiment of the present invention;

[0026] Figure 8 A schematic diagram of a deployment report in a method for processing an offline compressed file provided by an embodiment of the present invention;

[0027] Fig. 9 A structural block diagram of an off-line compressed file processing device provided by an embodiment of the present invention;

[0028] Fig.10 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0030] It should be noted that, in order to facilitate understanding, the terms or abbreviations that may be used in the embodiments of the present invention are explained in the form of a table. Table 1 is a technical term explanation table provided in the embodiments of the present invention.

[0031] Table 1: A table of technical terms.

[0032]

[0033]

[0034] The inventors found in the process of implementing the present invention that the traditional intranet and confidential network deployment are based on the resource installation package prepared in advance and deployed by manual upload. Alternatively, in the network environment of a non-confidential network, the Internet can be temporarily opened when the resource installation package is installed for the first time. Generally, the steps of resource installation package deployment include:

[0035] 1. After developing the application, the R&D personnel write the deployment document.

[0036] 2. Operation and maintenance personnel or confidential personnel shall deploy all documents to decompose resource installation packages and configure the prerequisite environment for each application installation, such as basic software and configuration files on the system.

[0037] 3. Operation and maintenance personnel or confidential personnel write construction work, evaluate update events and rollback plans.

[0038] 4. Manually deploy at the customer site. If any problems or bugs occur, the R&D personnel will return to the company to repackage.

[0039] The above traditional deployment methods of intranet or confidential network not only have high labor costs and time costs, but also all operations in the deployment process are done through manual communication, information asymmetry and uneven technical capabilities of personnel, which will increase the deployment cost. From the above content, it can be seen that there is almost no automated deployment platform for confidential networks in related technologies, let alone intranet systems that implement CI / CD continuous update / continuous delivery.

[0040] To solve the above problems, the embodiments of the present invention establish a cross-network offline export and import channel to achieve synchronization of dependencies, services and configurations of container-based development, testing, pre-release and generation environments, greatly improve the deployment and update efficiency in a secure intranet environment, and achieve DevOps (Development and Operations, a general term for processes, methods and systems)-style automated container release, update and rollback in an intranet environment or a confidential network environment.

[0041] Figure 1 The present invention provides a flowchart of a method for processing offline compressed files. The method can be executed by an offline compressed file processing device. The device can be implemented by software and / or hardware and is usually configured in a computer device. Figure 1 As shown, the method includes:

[0042] Step 110: When the export event is triggered, obtain the application identifier of the target application to be exported.

[0043] Among them, the export event is the event that triggers the export operation in the export environment. For example, in the update and upgrade scenario, the user selects the export application in the export environment interface and clicks export, which triggers the export event. Or, in the initial installation scenario, all applications need to be exported. If the export control is detected to be clicked, the export event is triggered.

[0044] The target application is a general term for the applications to be exported. For example, if the user chooses to export applications A, B, and C, the above applications A, B, and C will be used as target applications. The application identifier is identification information that uniquely identifies the target application. For example, the application identifier can be the application name or the application installation package name.

[0045] Exemplarily, when an export event is triggered, the scenario type corresponding to the user operation that triggers the export event is obtained. For the initial installation scenario, all applications included in the business are used as target applications to be exported, and the application identifiers of the target applications are obtained. For the update and upgrade scenario, the application selected by the user is used as the target application to be exported, and the application identifiers of the target applications are obtained. Thus, by flexibly selecting the online environment, the scope of applications exported by the business is controlled, which not only saves the amount of exported data, but also greatly improves the export efficiency.

[0046] Step 120: For each of the target applications, obtain application information corresponding to the application identifier from the export environment according to the application identifier, and generate offline description files of all target applications according to the application information of each target application.

[0047] The export environment may be an environment such as an application development, test, pre-release or production environment that can be connected to the Internet. The application identifier is associated with the application information and stored in the export environment. The application information is the information required for application deployment that is abstracted based on the deployment characteristics of Kubernetes under the Docker container. For example, the application information includes deployment information, dependencies, configuration information and storage information of the dependent applications, etc. The deployment information may be data such as probe type, probe details, core program image, version, environment variables, and system resource occupancy obtained based on the deployment characteristics of Kubernetes under the Docker container.

[0048] Specifically, the offline description file is a file that describes the type and resources of the target application. For example, the offline description file can be a file that records the type directory of the target application, the information list, and the method for obtaining each information. Among them, the information list represents the list of resources that the target application needs to export. For example, resource information, authorization information, and acquisition location. The acquisition method describes the way to obtain resource information. For example, the acquisition method can be what function is called to obtain resource information.

[0049] It should be noted that when a target application deployment does not need to rely on other applications, the application information stored in association with the application identifier of the target application may not include the dependency relationship and the configuration information of the dependent applications. When a target application does not need to use storage, the application information stored in association with the application identifier of the target application may not include storage information.

[0050] Exemplarily, for each of the target applications, the deployment information of the target application under the docker container is obtained from the export environment according to the application identifier. The dependency of the target application is obtained, and according to the dependency, the configuration information of the data on which the target application depends is obtained. The storage information required by the target application is obtained, wherein the application information includes one or more of the deployment information, dependency, configuration information and storage information. The application information is grouped according to the type of application information corresponding to each target application; each group of application information is abstractly processed to obtain an information list and a method for obtaining each information; and an offline description file containing the information list and the method for obtaining the information is generated.

[0051] Assume that applications A, B, and C need to be exported in batches, and the export operation needs to be performed for each application. For application A, the deployment information of application A in the docker container, such as version information, image size, environment variables, and resource specifications, is obtained from the export environment according to its application identifier. If the deployment of application A depends on application D, the configuration information of application D also needs to be obtained so that application D can be configured in the import environment, thereby ensuring that application A that depends on application D can be deployed successfully. If application A needs to use storage, the storage information such as the size of the storage block required by application A, the storage mount location, and the storage type are obtained so that the storage area that meets the above storage information can be detected through the virtual disk logical volume in the import environment. If the storage area that meets the storage information is not detected, it is automatically created. The configuration file and configuration replacement rule of application A are obtained from the export environment according to its application identifier. At this point, the offline export of application A is completed. Then, it is determined whether all applications to be exported have been exported. Since application B and application C have not been exported, it is determined here that not all applications to be exported have been exported. Application B and application C are exported offline respectively with reference to the steps similar to application A. When all the applications to be exported have been exported, the application information of application A, application B, and application C are grouped based on the type of application information. For each group of application information, the application information with duplicate content is deleted, and the deleted application information is abstracted to obtain an information list and a method for obtaining each information. Based on the above information list and the method for obtaining, an offline description file is generated to describe the information corresponding to the target application and how to obtain the information. Therefore, according to the offline description file, the underlying interface Groovy script is used to perform the operation of obtaining the corresponding deployment file.

[0052] Step 130: Obtain a deployment file corresponding to the target application according to the file content of the offline description file, and prepare an offline compressed file based on the deployment file.

[0053] The offline compressed file may be a resource package of all target applications generated by compression. For example, the target applications may be application A, application B, and application C, and the offline compressed file may be a resource package obtained by compressing the exported data and programs of application A, application B, and application C.

[0054] Exemplarily, a pipeline export mode is adopted to obtain the deployment file corresponding to the target application based on the offline description file, wherein the deployment file includes an installation file, a configuration file, an orchestration file, and a dependency file, etc. A hash signature is generated for each deployment file, and all deployment files with the hash signature are compressed to obtain an offline compressed file. The offline compressed file is encrypted using a preset public key to obtain an encrypted compressed file. In response to an offline compressed file copy instruction, the encrypted compressed file is copied to a corresponding mobile medium, so that the encrypted compressed file is transferred to the import environment through the mobile medium.

[0055] For example, a pipeline export model is used to obtain the deployment file corresponding to the application information according to the specific file content of the offline description file. A hash algorithm is used to generate a hash signature of each deployment file according to the content of each deployment file. All deployment files with hash signatures are packaged into a zip resource package. A hash algorithm is used to calculate the hash value of the zip resource package, and the hash value is used as a public key to encrypt the zip resource package to obtain an encrypted compressed file. In response to an offline compressed file copy instruction, the encrypted compressed file is copied to a corresponding mobile medium, so that the encrypted compressed file is transferred to the import environment through the mobile medium.

[0056] The technical solution of the embodiment of the present invention obtains application information corresponding to each target application to be exported from the export environment, generates offline description files of all target applications according to each application information, obtains deployment files corresponding to the target applications according to the file content of the offline description files, and prepares offline compressed files based on the deployment files, thereby solving various problems caused by the large amount of data in the deployment installation package, thereby achieving the effect of saving storage resources and reducing export time and import time.

[0057] On the basis of the above technical solution, for each application to be exported, when the following conditions are met, the step of obtaining the application information corresponding to the application identifier according to the application identifier is executed: the current application to be exported is in a running state; the container probe and the container health detection process are in a running state; the application to be exported is a normal application type; the type information of the application to be exported is a docker image mode. The advantage of this setting is that it can realize the export of applications of the normal application type of the docker image mode in the running state. If the above conditions are not met, the application will not be exported to avoid application export exceptions.

[0058] Figure 2 This is a flowchart of another offline compressed file processing method provided by an embodiment of the present invention. This embodiment is a further limitation based on the above embodiment and can be applied to application deployment scenarios in offline environments such as private networks, intranets or confidential networks. Figure 2 As shown, the method includes:

[0059] Step 210: When the export event is triggered, obtain the application identifier of the target application to be exported.

[0060] Step 220: For each of the target applications, application information corresponding to the application identifier is obtained from the export environment according to the application identifier, and offline description files of all target applications are generated according to the application information of each target application.

[0061] Step 230: Obtain a deployment file corresponding to the target application according to the file content of the offline description file, and prepare an offline compressed file based on the deployment file.

[0062] Step 240: Use a preset public key to encrypt the offline compressed file to obtain an encrypted compressed file.

[0063] Step 250: In response to the offline compressed file copy instruction, the encrypted compressed file is copied to a corresponding mobile medium, so as to transfer the encrypted compressed file to an import environment via the mobile medium.

[0064] Step 260: When an import event is triggered, obtain the offline compressed file in the mobile medium, decompress the offline compressed file to obtain the deployment file of each target application, and install or update the corresponding application in the import environment based on the deployment file.

[0065] The import environment is an environment that is not connected to the Internet. The import event is an event that triggers the import environment to perform an application import operation. There are many conditions for triggering the import event, which are not specifically limited in the embodiment of the present invention. For example, the import event is triggered when it is detected that the import control in the import environment is clicked. Or, the import event is triggered when it is detected that a mobile medium is connected, etc.

[0066] Exemplarily, a private key corresponding to a preset public key is used to decrypt an encrypted compressed file to obtain an offline compressed file; the offline compressed file is decompressed to obtain deployment files of each target application, wherein the deployment files include installation files, configuration files, orchestration files, and dependency files; the hash signatures of each deployment file are verified; when all deployment files pass the hash signature verification, the corresponding application is restored according to the function and type of each deployment file, so as to install or update the application corresponding to the deployment file in the import environment.

[0067] Specifically, installing or updating the application corresponding to the deployment file in the imported environment can be further refined as follows: sequentially installing or updating the restored application in the imported environment; using an application probe to detect whether the currently installed or updated application is started normally; if so, returning to the execution sequence to install or update the restored application in the imported environment; otherwise, rolling back to the version before the application was installed or updated.

[0068] For example, the import environment imports the zip resource package uploaded via mobile media, unzips the resource package and verifies its integrity and correctness. When the verification passes, the application information contained in the resource package is parsed one by one, such as the Docker image, version, environment variables, system resources, storage information, configuration information and other resources of the core program. For each resource, it is restored according to different functions and types. When there are multiple applications to be imported, the restored applications are deployed (installed or updated) one by one in the import environment, and the application probe is used to detect whether the currently deployed application is started normally. If so, continue to deploy the next application to be imported.

[0069] If the currently deployed application fails to be deployed or fails to start, roll back to the pre-deployment version of the currently deployed application. For example, before importing and restoring, a rollback message is also generated. Generally speaking, the rollback of the program is rolled out through the Kubernetes built-in replica mechanism. The rollback of data is achieved by backing up in advance and generating reverse restore statements through SQL statements. When an import exception occurs, or when the business runs abnormally after the import is successful, you can roll back to the last normal version. The above rollback function is particularly important for some business environments that attach great importance to hot fix applications. Rolling deployment can be used, and the updated application will generate a new copy, while the original application will work normally. Only when the new copy is completely diagnosed as starting normally by the application probe will the original application copy be stopped. In this way, the business will hardly be interrupted during the update process, or the interruption will be switched in seconds, ensuring the stability of the business execution process.

[0070] It should be noted that the present invention is based on the offline export and import of Dockerfile, rather than the application deployment method of the container offline export and import package of the image file. That is, the data exported and imported by the present invention is not the image file, but the Dockerfile, and the image file can be generated based on the Dockerfile in the import environment, thereby making the zip resource package smaller than the traditional image container export and import package, saving storage resources and export and import events. In addition, by exporting the resource package to a mobile medium and manually ferrying it to the import environment through the mobile medium, the installation and update deployment can be completed without the automatic synchronization of the image on the Internet.

[0071] The technical solution of this embodiment obtains application information corresponding to each target application to be exported from the export environment, generates offline description files of all target applications according to each application information, obtains deployment files corresponding to the target applications according to the file content of the offline description file, prepares an offline compressed file based on the deployment file, and when an import event is triggered, obtains the offline compressed file from a mobile medium, decompresses the offline compressed file to obtain the deployment file of each target application, and installs or updates the corresponding application in the import environment based on the deployment file, thereby solving the problem of deployment failure that may result from the inability to automatically deploy or update applications in an offline import environment and the need for manual orchestration, and improves the efficiency of application deployment in offline environments such as private networks or confidential networks.

[0072] Figure 3 A schematic diagram of an offline export process in an offline compressed file processing method provided by an embodiment of the present invention. Figure 3 As shown, the method includes:

[0073] Step 310: Select an offline export application.

[0074] It should be noted that a business generally consists of multiple applications. The initial installation and update and upgrade scenarios are different in terms of selecting offline export applications. The initial installation should include all applications during the first export, while the update and upgrade may only upgrade a single application. Through the flexible selection of the online environment, the scope of applications and services exported by the business can be controlled. This not only saves the amount of exported data, but also greatly improves the export efficiency.

[0075] Figure 4 Schematic diagram of the offline export application selection interface in the offline export process provided by the present invention. Figure 4 As shown, in the application upgrade and update scenario, the user checks the option box corresponding to the application to complete the offline export application selection operation. Optionally, if the application includes multiple services, all services corresponding to the application can also be displayed, and the user checks the option box corresponding to the service to complete the offline export application selection operation.

[0076] Step 320: Determine a single offline export application that performs the export operation as the current application.

[0077] Step 330: Extract application information of the offline exported application.

[0078] Before exporting the current application, sufficient information needs to be parsed. Based on the deployment characteristics of Kubernetes under the Docker container, data such as probe type, probe details, core program image, version, environment variables, and system resource usage can be obtained. The purpose of collecting this information is to prepare resources for subsequent offline import.

[0079] In addition to the above information extraction, the application dependencies also need to be analyzed. For example, if an application must rely on a database before deployment, the database configuration location and configuration information need to be automatically extracted so that they can be readjusted in the import environment. In addition, for special applications, if storage is required, it is also necessary to extract storage information, including the size of the storage block, the storage mount location, the storage type, etc. In the import environment, it will be automatically detected through virtual disk logical volumes, and if no storage space that meets these basic requirements is found, it will be automatically created.

[0080] Specifically, step 330 may further include:

[0081] Step 331: Check whether the offline exported application is in running state, whether the probe and heathcheck are in running state, whether the offline exported application is a normal application type, and whether the offline exported application is in docker images mode (non-zip decompression).

[0082] Step 332: extract version information, image size, environment variables, resource specifications and other information.

[0083] Step 333: Obtain dependency relationships through the service module.

[0084] The service module is used to manage the dependency between services. Since an application may include multiple services, determining the dependency between services also determines the dependency between applications.

[0085] Step 334: Obtain storage information.

[0086] Step 335: Obtain a configuration file and configure replacement rules.

[0087] Step 340: Generate an offline description file.

[0088] In this embodiment, the offline description file is a file describing the structure of the offline exported resource package, wherein the offline exported resource package can also be called an offline compressed file.

[0089] By executing the step of extracting the application information of the offline exported application, sufficient application information has been obtained. However, the application information may be scattered in multiple locations. For example, the application information can be used to generate PV or PVC files, the application information can also be used to process configuration files, and the application information can also be used to pull images to reversely generate deployment deployments, etc. Group the application information according to the application information type. Abstract each group of application information to obtain the information list of each type of application information and the acquisition method of each information, and generate an offline description file according to the information type, information list and corresponding acquisition method. The offline description file abstracts the information list and the acquisition method of the specific file content. The offline description file is transmitted to the lower-level interface Groovy script, and the specific file content is obtained according to the offline description file through the Groovy script. The reason for using the Groovy script is to support the pipeline export mode, which can execute packaging in parallel to achieve faster and more efficient results. The actual packaging is performed by the application resource packager according to the offline description file.

[0090] Specifically, step 340 may further include:

[0091] Step 341 , determine whether the batch application export is completed, if so, execute step 342 , otherwise execute step 320 .

[0092] Step 342: Generate an offline description file.

[0093] Step 343: pass the offline description file to the continuous integration tool Jenkins.

[0094] Step 344, determine whether the version of the offline description file supports offline export, if so, execute step 350, otherwise end the offline export process.

[0095] Step 350: Collect and process application information of offline exported applications according to the offline description file to obtain deployment files of each application.

[0096] For example, offline compressed files are produced through the specific file content of the offline description file. For example, it is determined whether to generate a Dockerfile or directly download the image file. It is determined whether there is storage, where to download the stored file, etc. In the execution process, parallel methods are used as much as possible to shorten the execution time, and the current progress and exported process logs are fed back in real time.

[0097] Figure 5 Schematic diagram of the offline export interface in the offline export process provided by the present invention. Figure 5 As shown in the figure, the offline export interface displays information such as task name, task status, deployment type, and number of files.

[0098] Specifically, step 350 may further include:

[0099] Step 351: Download the configuration file and the configuration replacement rule according to the method for obtaining the configuration file and the configuration replacement rule in the offline description file.

[0100] Step 352: Acquire storage information according to the method for acquiring storage information in the offline description file, and generate description files of pv and pvc according to the storage information.

[0101] Step 353: Obtain the dependency relationship according to the dependency relationship acquisition method in the offline description file, and further process the configuration file through the dependency relationship.

[0102] For example, assuming that the application deployment depends on database A, it is necessary to parse the configuration file according to the dependency relationship to obtain information such as the address or IP or library name of database A.

[0103] Step 354: According to the method for obtaining the configuration information in the offline description file, obtain the image size, environment variables, resource specifications, etc., pull the image and reversely generate the deployment.

[0104] Step 355: decompress the image, extract the jar file, map, and obtain the basic Dockerfile.

[0105] Step 360: Prepare offline compressed files.

[0106] It should be noted that the offline compressed file package is a file that encapsulates and packages the deployment files such as the installation files, configuration files, orchestration files, and dependency files of a single service or a complete project. For each deployment file, the hash value of the corresponding file is calculated based on the file content, and the deployment file and the corresponding hash value are stored in association to prevent the deployment file from being tampered with. Then, through a series of pipelines, a zip offline package containing the deployment files of all applications is generated. A hash signature is randomly generated based on the zip offline package, and the hash signature is used as the public key to encrypt the offline package to obtain an encrypted compressed file, making the imported data more reliable and secure.

[0107] Step 370: In response to the offline compressed file copy instruction, the encrypted compressed file is copied to a corresponding removable medium, so as to transfer the encrypted compressed file to an import environment via the removable medium.

[0108] After the offline package is generated, it needs to be downloaded and manually copied to a mobile medium, where the mobile medium can be a one-way imported three-in-one device or a secure USB flash drive, etc. Since the confidential network will not be connected to the outside world, the offline package must be brought to the target location by manual ferrying.

[0109] Optionally, the package exported another time can also be used as a released product and imported into different customer environments as a product-level universal installation package.

[0110] The embodiment of the present invention is a business system built and running well based on the development / test environment. There is no need for R&D to write or prepare various documents and dependency descriptions. The offline program will automatically generate a zip offline package based on the online business. The embodiment of the present invention not only reduces time costs, communication costs, and labor costs, but also solves various human errors and safety hazards caused by manual operation and arrangement.

[0111] Figure 6 A schematic diagram of an offline import process in an offline compressed file processing method provided by an embodiment of the present invention. Figure 6 As shown, the method includes:

[0112] Step 410: When an import event is detected, the offline compressed file is parsed to automatically generate a Kubernetes deployment installation package.

[0113] Exemplarily, the environment is imported through the three-in-one device access, and the offline exported zip resource package is uploaded. During the import process, the information flow is one-way transmission, so the operation does not violate the regulations of confidential networks. After the upload is completed, the system of the import environment will automatically import the zip resource package and parse the application information contained in the zip resource package one by one. For example, the zip resource package is parsed to obtain the Docker image, version, environment variables, system resources, storage information, configuration information and other resources of the core program. Each resource is restored according to different functions and types to obtain the Kubernetes deployment installation package of each application to be imported.

[0114] Specifically, step 410 may further include:

[0115] Step 411: decrypt the zip resource package.

[0116] For example, if the encryption method of the zip resource package is symmetric encryption, the hash value of the package is used as the private key to decrypt the zip resource package. If the encryption method of the zip resource package is asymmetric encryption, the private key corresponding to the hash value of the package is used to decrypt the zip resource package.

[0117] Step 412: decompress the zip resource package.

[0118] For example, the offline compressed file is decompressed to obtain the deployment file of each target application.

[0119] Step 413: Verify the hash signature of the deployment file.

[0120] By verifying the hash signature of each deployment file, we can avoid deployment failures caused by tampering with the deployment files.

[0121] Step 414: determine whether it is an initialization installation scenario, if so, execute step 415, otherwise execute step 419.

[0122] Step 415: Add application information to the import environment according to the deployment file.

[0123] Step 416: Check dependencies.

[0124] Step 417: Back up the database according to the dependency.

[0125] Step 418: If an error occurs in adding the information, the application version is restored to the version before adding.

[0126] Step 419: Detect the current version.

[0127] For example, check whether the version of the zip resource package is higher than the current version. If so, execute step 417; otherwise, do not update or upgrade.

[0128] Step 4110, check dependencies.

[0129] Step 4111, back up the database according to the dependency.

[0130] Step 4112: If the update information is wrong, the application version is restored to the version before the update.

[0131] Step 4113: Generate an image according to the Dockerfile, and push the generated image to the specified image repository.

[0132] Step 4114: Use Kubernetes' ConfigMap to load images one by one from the image repository.

[0133] Figure 7 Schematic diagram of an offline import interface provided by an embodiment of the present invention. Figure 7 As shown in the figure, before uploading the zip resource package, you need to upload the verification file, verify the information, and create an import task.

[0134] Step 420: Perform installation and deployment according to the deployment file and automatically test to generate a deployment report.

[0135] For example, based on the deployment file, the application corresponding to the business is automatically deployed in the secure intranet. Optionally, the deployed application can also be smoke tested or fully tested in terms of function and performance according to a custom script (provided by the user) to further ensure the reliability of the system.

[0136] In addition, whether it is the import process or the startup process, the background will record detailed logs during the operation and generate a deployment report for operators to analyze or download for evidence collection.

[0137] Optionally, a rollback message is generated before importing and restoring. Generally speaking, the rollback of the program is released in a rolling manner through the Kubernetes built-in replica mechanism. The rollback of data is done by backing up in advance and generating a reverse restore statement through SQL statements. When an import exception occurs, or the business runs abnormally after a successful import, you can roll back to the last normal version.

[0138] Specifically, step 420 may further include:

[0139] Step 421: Start / deploy the loaded image.

[0140] Step 422: Start the application probe.

[0141] Step 423 , using an application probe to detect whether the application corresponding to the loaded image is deployed successfully and started normally, if so, execute step 424 , otherwise execute step 427 .

[0142] Step 424, continue to deploy other applications and return to execute step 4114.

[0143] Step 425: Generate an update report.

[0144] Among them, the update report can be exported by staff and brought back to the development environment.

[0145] Step 426, test.

[0146] For example, you can perform manual overall testing on the deployed application, or you can perform automatic testing on the deployed application using a test script provided by the user.

[0147] Step 427, roll back.

[0148] Figure 8 A schematic diagram of a deployment report in a method for processing offline compressed files provided by an embodiment of the present invention. Figure 8 It shows each application that has been installed or upgraded, as well as a service deployment report.

[0149] Compared with the current mainstream automated deployment platform products, the present invention has the following major advantages:

[0150] 1. It is lightweight. It is implemented through Jenkins Groovy+Java code, provides microservice exposure function, is easy to use and easy to integrate. It is suitable for various scenario platforms due to its easy deployment and non-intrusiveness to business and development.

[0151] 2. Deploy Kubernetes in confidential and intranet environments to easily achieve high availability, high reliability, easy (horizontal) expansion, and automatic rollback capabilities for the internal systems of the intranet.

[0152] 3. Rapid iterative development can be achieved on the intranet without much manual involvement.

[0153] 4. The application supports efficient pipeline deployment, and implements intranet DevOps without hindrance while ensuring security.

[0154] 5. Easy to operate, the threshold for operation and maintenance and deployment personnel is reduced to a minimum, saving manpower and maintenance costs.

[0155] 6. Strictly follow the principle of one-way data ferrying to prevent leakage, making the deployment and upgrade of applications safer.

[0156] 7. The deployment installation package is smaller than the traditional image container. Offline export based on Dockerfile will greatly save storage resources and export and import time.

[0157] It should be noted that the program of the present invention is written in Java+Groovy language, and can also be developed in other languages ​​such as java, c++, c, etc. The present invention has been tested in the Kubernetes environment of Java, but it can be run in more different scenarios, and used in integrated scenarios under private cloud, public cloud platform, and various platforms of industrial Internet. The present invention mainly lies in confidential network and private network environment, and can also be used in ordinary enterprise-level intranet environment. The deployment module of the present invention is more subdivided, and the deployment module can be merged into a whole, and even the deployment process can be ignored, such as data backup before import and application rollback after failure. Losing these functions will only reduce the overall reliability.

[0158] Fig. 9 This is a structural block diagram of an offline compressed file processing device provided by an embodiment of the present invention. The device can be implemented by software and / or hardware and is usually integrated into a computer device. The device improves the application deployment efficiency in offline environments such as private networks or confidential networks by executing the offline compressed file processing method of any embodiment of the present invention. Fig. 9 As shown, the device comprises:

[0159] The identification acquisition module 910 is used to acquire the application identification of the target application to be exported when the export event is triggered;

[0160] An information acquisition module 920 is used to acquire, for each target application, application information corresponding to the application identifier from the export environment according to the application identifier, and generate offline description files of all target applications according to the application information of each target application, wherein the application identifier is associated with the application information and stored in the export environment, and the application information includes one or more of the deployment information, dependency, configuration information and storage information;

[0161] The compressed file preparation module 930 is used to obtain the deployment file corresponding to the target application according to the file content of the offline description file, and prepare an offline compressed file based on the deployment file.

[0162] Optionally, the device further comprises:

[0163] A file export module 940, configured to export the offline compressed file to a mobile medium after preparing the offline compressed file based on the deployment file;

[0164] The file import module 950 is used to obtain the offline compressed file in the mobile medium when the import event is triggered, decompress the offline compressed file to obtain the deployment file of each target application, and install or update the corresponding application in the import environment based on the deployment file, wherein the import environment is an environment that is not connected to the Internet.

[0165] Optionally, the file export module 940 is specifically used for:

[0166] Using a preset public key to encrypt the offline compressed file to obtain an encrypted compressed file;

[0167] In response to the offline compressed file copy instruction, the encrypted compressed file is copied to a corresponding mobile medium, so as to transfer the encrypted compressed file to an import environment through the mobile medium.

[0168] Optionally, the file import module 950 is specifically used for:

[0169] Decrypt the encrypted compressed file using the private key corresponding to the preset public key to obtain an offline compressed file;

[0170] Decompressing the offline compressed file to obtain deployment files of each target application, wherein the deployment files include installation files, configuration files, arrangement files and dependency files;

[0171] Verify the hash signature of each deployment file;

[0172] When all deployment files pass hash signature verification, the corresponding applications are restored according to the functions and types of the deployment files, so as to install or update the applications corresponding to the deployment files in the import environment.

[0173] Optionally, the file import module 950 is further used for:

[0174] sequentially installing or updating the restored applications in the imported environment;

[0175] Use application probes to detect whether the currently installed or updated application is started normally;

[0176] If so, returning to the execution order to install or update the application steps after restoration in the import environment;

[0177] Otherwise, roll back to the version before the app was installed or updated.

[0178] Optionally, the device further includes a condition judgment module, configured to, for each of the target applications, execute the step of acquiring application information corresponding to the application identifier from the export environment according to the application identifier when the following conditions are met:

[0179] The current target application is in running state;

[0180] The container probe and container health detection processes are running;

[0181] The target application is a normal application type;

[0182] The type information of the target application is Docker image mode.

[0183] Optionally, acquiring application information corresponding to the application identifier from the export environment according to the application identifier includes:

[0184] Obtaining deployment information of the target application in the Docker container from the export environment according to the application identifier;

[0185] Obtaining the dependency relationship of the target application, and obtaining configuration information of the data on which the target application depends according to the dependency relationship;

[0186] Acquire storage information required by the target application.

[0187] Optionally, the information acquisition module 920 is specifically used for:

[0188] grouping the application information of all target applications according to the types of the application information corresponding to each of the target applications;

[0189] Abstract each group of application information to obtain an information list and a method for obtaining each piece of information;

[0190] An offline description file including the information list and the acquisition method is generated.

[0191] Optionally, the compressed file preparation module 930 is specifically used for:

[0192] Adopting a pipeline export mode, obtaining a deployment file corresponding to the target application based on the file content of the offline description file;

[0193] A hash signature is generated for each deployment file, and all deployment files with the hash signature are compressed to obtain an offline compressed file.

[0194] The offline compressed file processing device provided in the embodiment of the present invention can execute the offline compressed file processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0195] Fig.10 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention is shown in FIG. Fig.10 As shown, the computer device includes a processor 100, a memory 101, an input device 102, an output device 103 and an input / output I / O interface 104; the number of processors 100 in the computer device can be one or more. Fig.10 A processor 100 is taken as an example; the processor 100, the memory 101, the input device 102, the output device 103 and the I / O interface 104 in the computer device can be connected through a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0196] The memory 101, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the offline compressed file processing method in the embodiment of the present invention (for example, for the export environment, the memory 101 stores the identification acquisition module 910, the information acquisition module 920, the compressed file preparation module 930 and the file export module 940, and for the import environment, the memory 101 stores the file import module 950). The processor 100 executes various functional applications and data processing of the computer device by running the software programs, instructions and modules stored in the memory 101, that is, realizes the above-mentioned offline compressed file processing method.

[0197] The memory 101 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 101 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 101 may further include a memory remotely arranged relative to the processor 100, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0198] The input device 102 may be used to receive input digital or character information and generate key signal input related to user settings and function control of the computer device. The output device 103 may include display devices such as a display screen. The I / O interface 104 is used to access mobile media.

[0199] An embodiment of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a method for processing an offline compressed file when executed by a computer processor, the method comprising:

[0200] When the export event is triggered, obtain the application identifier of the target application to be exported;

[0201] For each of the target applications, obtaining application information corresponding to the application identifier from the export environment according to the application identifier, and generating offline description files of all target applications according to the application information of each target application, wherein the application identifier is associated with the application information and stored in the export environment, and the application information includes one or more of the deployment information, dependency, configuration information and storage information;

[0202] The deployment file corresponding to the target application is obtained according to the file content of the offline description file, and an offline compressed file is prepared based on the deployment file.

[0203] Of course, the computer executable instructions of a storage medium containing computer executable instructions provided by an embodiment of the present invention are not limited to the method operations described above, and can also execute related operations in the offline compressed file processing method provided by any embodiment of the present invention.

[0204] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0205] It is worth noting that in the embodiment of the above-mentioned offline compressed file processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0206] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for processing offline compressed files, characterized in that: include: When the export event is triggered, obtain the application identifier of the target application to be exported; For each of the target applications, obtaining application information corresponding to the application identifier from the export environment according to the application identifier, and grouping the application information of all the target applications according to the types of the application information corresponding to each of the target applications; Abstract each group of application information to obtain an information list and a method for obtaining each piece of information; Generate an offline description file including the information list and the acquisition method; wherein the application identifier is associated with the application information and stored in the export environment, and the application information includes one or more of deployment information, dependency, configuration information and storage information; Acquire a deployment file corresponding to the target application according to the file content of the offline description file, and prepare an offline compressed file based on the deployment file; Among them, obtaining application information corresponding to the application identifier from the export environment according to the application identifier includes: obtaining deployment information of the target application under the Docker container from the export environment according to the application identifier; obtaining the dependency relationship of the target application, and according to the dependency relationship, obtaining configuration information of the data on which the target application depends; and obtaining storage information required by the target application.

2. The method according to claim 1, characterized in that: After preparing the offline compressed file based on the deployment file, the method further includes: Exporting the offline compressed file to a mobile medium; When an import event is triggered, the offline compressed file in the mobile medium is obtained, the offline compressed file is decompressed to obtain the deployment file of each target application, and the corresponding application is installed or updated in the import environment based on the deployment file, wherein the import environment is an environment that is not connected to the Internet.

3. The method according to claim 2, characterized in that The exporting of the offline compressed file to a mobile medium comprises: Using a preset public key to encrypt the offline compressed file to obtain an encrypted compressed file; In response to the offline compressed file copy instruction, the encrypted compressed file is copied to a corresponding mobile medium, so as to transfer the encrypted compressed file to an import environment through the mobile medium.

4. The method according to claim 2, characterized in that: Decompressing the offline compressed file to obtain the deployment file of each target application, and installing or updating the corresponding application in the import environment based on the deployment file, includes: Decrypt the encrypted compressed file using the private key corresponding to the preset public key to obtain an offline compressed file; Decompressing the offline compressed file to obtain deployment files of each target application, wherein the deployment files include installation files, configuration files, arrangement files and dependency files; Verify the hash signature of each deployment file; When all deployment files pass hash signature verification, the corresponding applications are restored according to the functions and types of the deployment files, so as to install or update the applications corresponding to the deployment files in the import environment.

5. The method according to claim 4, characterized in that The step of installing or updating the application corresponding to the deployment file in the import environment includes: sequentially installing or updating the restored applications in the imported environment; Use application probes to detect whether the currently installed or updated application is started normally; If so, returning to the execution order to install or update the application steps after restoration in the import environment; Otherwise, roll back to the version before the app was installed or updated.

6. The method according to claim 1, characterized in that For each of the target applications, when the following conditions are met, the step of acquiring application information corresponding to the application identifier from the export environment according to the application identifier is performed: The current target application is in running state; The container probe and container health detection processes are running; The target application is a normal application type; The type information of the target application is Docker image mode.

7. The method according to claim 1, characterized in that The step of obtaining a deployment file corresponding to the target application according to the file content of the offline description file, and preparing an offline compressed file based on the deployment file includes: Adopting a pipeline export mode, obtaining a deployment file corresponding to the target application based on the file content of the offline description file; A hash signature is generated for each deployment file, and all deployment files with the hash signature are compressed to obtain an offline compressed file.

8. A device for processing offline compressed files, characterized in that: include: An identification acquisition module, used to acquire the application identification of the target application to be exported when the export event is triggered; An information acquisition module, configured to acquire, for each target application, application information corresponding to the application identifier from the export environment according to the application identifier, and group the application information of all target applications according to the type of application information corresponding to each target application; Abstract each group of application information to obtain an information list and a method for obtaining each piece of information; Generate an offline description file including the information list and the acquisition method; wherein the application identifier is associated with the application information and stored in the export environment, and the application information includes one or more of deployment information, dependency, configuration information and storage information; A compressed file preparation module, used to obtain a deployment file corresponding to the target application according to the file content of the offline description file, and prepare an offline compressed file based on the deployment file; Among them, obtaining application information corresponding to the application identifier from the export environment according to the application identifier includes: obtaining deployment information of the target application under the Docker container from the export environment according to the application identifier; obtaining the dependency relationship of the target application, and according to the dependency relationship, obtaining configuration information of the data on which the target application depends; and obtaining storage information required by the target application.

9. A computer device, characterized in that: The computer device comprises: one or more processors; a memory 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 offline compressed file processing method as described in any one of claims 1-7.

10. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the offline compressed file processing method as described in any one of claims 1-7.