Automatic upgrading method and system in network isolation scene

Through automated upgrade methods and systems, the configuration and database upgrade problems of CI/CD processes in network isolation scenarios are solved, automatic upgrades of configuration files and databases are realized, manual intervention is reduced, and online upgrade efficiency and system stability are improved.

CN118656103APending Publication Date: 2024-09-17CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410847987.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the scenario of network isolation between test and production environments, the traditional CI/CD process cannot achieve accurate release of configuration files and accurate database upgrades, resulting in the need for a large amount of manual intervention and a return to the original manual atomic upgrade deployment.

Method used

Provide an automated upgrade method and system in a network isolation scenario. By receiving the changed code, packaging and generating a code package to be deployed, pulling the database and configuration information of the test environment, generating the database and configuration package to be deployed, and performing a comparative upgrade of the target database. and configuration updates, and deploy the code in the target system.

Benefits of technology

It realizes the continuous integration and continuous release of configuration files, databases and codes, adapts to heterogeneous production environments, reduces manual intervention, improves the efficiency of online upgrades, reduces error rates, and ensures the system operating environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656103A
    Figure CN118656103A
Patent Text Reader

Abstract

The invention provides an automatic upgrading method and system under a network isolation scene, and the method comprises the steps: receiving a change code, and packaging the change code to obtain a to-be-deployed code package; communicating a test environment corresponding to the change code, and generating a to-be-deployed database package according to a database file of the test environment of the to-be-deployed code package; pulling configuration information in the test environment to obtain a to-be-deployed configuration packet; and performing comparison upgrading of the target database according to the to-be-deployed database package, performing configuration updating of the target system according to the to-be-deployed configuration package, and performing code deployment of the target system according to the to-be-deployed code package. According to the method and the device, the automatic upgrade online process in a network isolation environment can be realized, the online upgrade efficiency can be improved, and the error rate can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of software upgrade, and in particular relates to an automatic upgrade method and system in a network isolation scenario. Background Art

[0002] The commonly used software delivery process CI / CD is applicable to various Internet software delivery scenarios and can greatly improve delivery efficiency. However, it exposes some problems in special scenarios where the test and production environment networks are isolated:

[0003] When there are many heterogeneous production environments and different environment information, such as IP addresses, domain name information, and service ports, the traditional CI / CD process cannot accurately publish configuration files.

[0004] The database upgrade that is bound to occur during the upgrade and launch process involves the upgrade and change of the database table structure and database data. The traditional CI / CD process cannot accurately upgrade the database.

[0005] In scenarios where the test environment and production environment are separated and the network is isolated, the traditional CI / CD process cannot cover it, resulting in the need for a lot of manual intervention or even a return to the most primitive manual atomic upgrade deployment level. Summary of the invention

[0006] In view of the above deficiencies in the prior art, the object of the invention is to provide an automated upgrade method and system in a network isolation scenario.

[0007] A first aspect of the present invention provides an automatic upgrade method in a network isolation scenario, comprising:

[0008] S1: receiving the changed code, and packaging the changed code to obtain a code package to be deployed;

[0009] S2: Connecting to the test environment corresponding to the changed code, and generating a database package to be deployed according to the database file of the test environment of the code package to be deployed;

[0010] S3: Pull the configuration information in the test environment to obtain the configuration package to be deployed;

[0011] S4: performing comparison upgrade and data import of the target database according to the database package to be deployed, performing configuration update of the target system according to the configuration package to be deployed, and performing code deployment of the target system according to the code package to be deployed.

[0012] According to an automatic upgrade method in a network isolation scenario provided by the present invention, step S1 further includes:

[0013] S11: Pull the latest changed code from the test environment repository;

[0014] S12: Matching the service package corresponding to the changed code with the packaging script, and packaging to obtain the image file to be deployed;

[0015] S13: Push the image file to be deployed to the image warehouse to obtain the code package to be deployed.

[0016] According to an automatic upgrade method in a network isolation scenario provided by the present invention, in step S2, the step of obtaining the database file of the test environment of the code package to be deployed further includes:

[0017] S211: Matching a database branch of the test environment;

[0018] S212: Pull the current database file of the database branch;

[0019] S213: Replace the current database file according to the change code to obtain an updated change database service.

[0020] According to an automatic upgrade method in a network isolation scenario provided by the present invention, in step S2, the step of generating the database package to be deployed further includes:

[0021] S221: Matching the database branch to be deployed corresponding to the code package to be deployed;

[0022] S222: Pull the database file to be deployed from the database remote warehouse according to the database branch to be deployed;

[0023] S223: Packaging the database files to be deployed to obtain a database package to be deployed.

[0024] According to an automated upgrade method in a network isolation scenario provided by the present invention, the database package to be deployed in step S2 includes: table structure data to be deployed, database static data, and database incremental storage process.

[0025] According to an automatic upgrade method in a network isolation scenario provided by the present invention, step S3 further includes:

[0026] S31: Save key-value pair information corresponding to all configuration information in the test environment;

[0027] S32: updating the key-value pair information according to the change code to obtain changed key-value pair information;

[0028] S33: Pull the current version configuration file in the change environment, and package the to-be-deployed MD5 value and the change key-value pair information corresponding to the current version configuration file to obtain a to-be-deployed configuration package.

[0029] According to an automatic upgrade method in a network isolation scenario provided by the present invention, in step S4, the step of performing a comparison upgrade and data import of a target database according to the database package to be deployed further includes:

[0030] S411: Receive the database package to be deployed;

[0031] S412: Perform a full database backup on the target database to obtain a backup table structure;

[0032] S413: Compare the backup table structure with the table structure data to be deployed, and obtain table structure update SQL;

[0033] S414: Execute the table structure update SQL, import the database static data, and import the database incremental stored procedure.

[0034] According to an automatic upgrade method in a network isolation scenario provided by the present invention, in step S4, the step of updating the configuration of the target system according to the configuration package to be deployed further includes:

[0035] S421: Receive the configuration package to be deployed;

[0036] S422: parsing the current MD5 value of the configuration file in the environment of the target system;

[0037] S423: Compare the current MD5 value with the MD5 value to be deployed to obtain a difference item;

[0038] S424: Update the difference item according to the MD5 value to be deployed, and synchronously change the key-value pair information.

[0039] According to an automatic upgrade method in a network isolation scenario provided by the present invention, in step S4, the step of performing code deployment on the target system according to the code package to be deployed further includes:

[0040] S431: Receive the code package to be deployed;

[0041] S432: deploying the image file to be deployed to a target server of a target system;

[0042] S433: Pull up the container of the target server through other images;

[0043] S434: Monitoring and testing are performed through the container.

[0044] A second aspect of the present invention further provides an automated upgrade system in a network isolation scenario, for executing an automated upgrade method in a network isolation scenario as described in any one of the above items, comprising:

[0045] A publishing center, comprising: a database integrated publishing module, a configuration file integrated publishing module, and a code integrated publishing module;

[0046] The database integrated publishing module includes: a database branch management unit for matching the database corresponding to the current test environment, and a data publishing unit for generating a database package to be deployed; the configuration file integrated publishing module includes: a configuration unit for updating the current configuration information key-value pair information, and a configuration publishing unit for generating a configuration package to be deployed; the code integrated publishing module includes a unit for packaging the changed code to obtain the code package to be deployed;

[0047] A deployment center, comprising: a database integrated deployment module, a configuration file integrated deployment module, and a code integrated deployment module;

[0048] The database integrated deployment module is used to compare and upgrade the target database and import data according to the database package to be deployed; the configuration file integrated deployment module is used to update the configuration of the target system according to the configuration package to be deployed; the code integrated deployment module is used to deploy the code of the target system according to the code package to be deployed.

[0049] The beneficial effects of the present invention are as follows:

[0050] The present invention provides an automated upgrade method and system in a network isolation scenario. Based on the traditional CI / CD capabilities, it solves the problem of multi-environment online adaptation of configuration files, can adapt to various heterogeneous online production environments, and realizes automated upgrade and release of configuration files. It also solves the problems of chaotic database table structure upgrades, data upgrade conflicts, and various storage process exceptions, and realizes automated upgrade and release of databases during the online process. As for the network isolation problem, the present invention solves the problem that the test environment and the production environment are separated, and the CI / CD process cannot be executed normally, and realizes a de-manualized automated upgrade online process. On the whole, it realizes the continuous integration of configuration files, databases, and codes, and the continuous release requirements, and splits the traditional CI / CD process into loosely coupled CI and CD processes, which is suitable for scenarios where the test and production environments are isolated from each other, and can improve the online upgrade efficiency, reduce the error rate, and ensure the system operation environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0052] Figure 1 A schematic diagram of a flow chart of an automated upgrade method in a network isolation scenario provided by an embodiment of the present invention;

[0053] Figure 2 A schematic diagram of the structure of an automated upgrade system in a network isolation scenario provided by an embodiment of the present invention.

[0054] Reference numerals:

[0055] 100, publishing center; 110, database integrated publishing module; 111, database branch management unit; 112, data publishing unit; 120, configuration file integrated publishing module; 121, configuration unit; 122, configuration publishing unit; 130, code integrated publishing module;

[0056] 200. Deployment center; 210. Database integrated deployment module; 220. Configuration file integrated deployment module; 230. Code integrated deployment module. DETAILED DESCRIPTION

[0057] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0058] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0059] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0060] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0061] In order to better understand the present invention, the technical terms appearing in the present invention are explained below.

[0062] CI / CD: A method of frequently delivering applications to customers by introducing automation in the application development phase. The core concepts of CI / CD are continuous integration, continuous delivery, and continuous deployment. As a solution for development and operations teams, it mainly targets problems caused by integrating new code, allowing continuous automation and continuous monitoring throughout the entire life cycle of the application, from the integration and testing phase to delivery and deployment.

[0063] Combine the following Figure 1 to Figure 2 Embodiments of the present invention are described.

[0064] like Figure 2 As shown, the present invention provides an automatic upgrade system in a network isolation scenario, comprising:

[0065] A publishing center 100, the publishing center 100 includes: a database integrated publishing module 110, a configuration file integrated publishing module 120, and a code integrated publishing module 130;

[0066] The database integrated publishing module 110 includes: a database branch management unit 111 for matching the database corresponding to the current test environment, and a data publishing unit 112 for generating a database package to be deployed; the configuration file integrated publishing module 120 includes: a configuration unit 121 for updating the current configuration information key-value pair information, and a configuration publishing unit 122 for generating a configuration package to be deployed; the code integrated publishing module 130 includes a unit for packaging the changed code to obtain the code package to be deployed;

[0067] Furthermore, the release center (Hybrid-prepare) is deployed in the test environment to complete the release process of the online service package, in which various components are integrated in the release center. The release center includes three main modules: database integration release module, configuration file integration release module, and code package integration release module. The code package integration release module coordinates the general integration process, including compilation, code scanning, security scanning, and automated testing; the database integration release module has an embedded database branch management tool, which matches different database branches according to code branches, and counts database table structure data, database static data, and database stored procedure incremental data; the configuration integration module has an embedded configuration center, which generates different configuration files according to code branches and environmental information. The configuration file is divided into general configuration and environment variable parts.

[0068] After receiving the release request, the release center will match the corresponding production environment template and generate an upgrade deployment package that is a set of database, configuration files, and code packages that conform to the production environment version for the deployment center to perform upgrade deployment.

[0069] The deployment center 200 includes: a database integrated deployment module 210, a configuration file integrated deployment module 220, and a code integrated deployment module 230;

[0070] The database integrated deployment module 210 is used to compare and upgrade the target database and import data according to the database package to be deployed; the configuration file integrated deployment module 220 is used to update the configuration of the target system according to the configuration package to be deployed; the code integrated deployment module 230 is used to deploy the code of the target system according to the code package to be deployed.

[0071] Furthermore, the deployment center inputs the upgrade materials released by the release center to complete the online deployment work. Corresponding to the release center, it is also divided into three main modules: database integrated deployment module, configuration file integrated deployment module, and code package integrated deployment module.

[0072] The deployment center is deployed in each production environment. The database integrated deployment module ensures the upgrade and update of data files during the online process, including database backup and restoration, database table structure comparison and upgrade, database static data import and database stored procedure execution; the configuration file integrated deployment module completes the configuration file comparison and variable rendering to ensure the accuracy and completeness of the configuration; the code deployment integration module completes the code deployment, operation and monitoring work to realize the automatic upgrade of the upgrade code package.

[0073] like Figure 1 As shown, the present invention also provides an automatic upgrade method in a network isolation scenario, which is implemented based on the automatic upgrade system in a network isolation scenario as described above, and includes:

[0074] S1: receiving the changed code, and packaging the changed code to obtain a code package to be deployed;

[0075] Step S1 integrates the traditional CI process, with the purpose of executing the packaging, testing, and release processes to generate a code package for online deployment.

[0076] Wherein, step S1 further comprises:

[0077] S11: Pull the latest changed code from the test environment repository;

[0078] S12: Matching the service package corresponding to the changed code with the packaging script, and packaging to obtain the image file to be deployed;

[0079] S13: Push the image file to be deployed to the image warehouse to obtain the code package to be deployed.

[0080] In steps S11 to S13, the R&D personnel first submit the code changes to the test environment warehouse, and then submit the release task. The released task then triggers the corresponding pipeline to perform the release operation. Next, the code integration and release module pulls the latest code, executes the configured packaging script process, matches the service package and the packaging script in the warehouse, executes the packaging, packages the code into an image, and finally pushes the image to the image warehouse.

[0081] S2: Connecting to the test environment corresponding to the changed code, and generating a database package to be deployed according to the database file of the test environment of the code package to be deployed;

[0082] In step S2, the database branch management is completed first. The database supported in this embodiment is the MySQL 5.7 database. By associating with the code library and connecting to the test environment, the branch of the test environment database can be flexibly switched according to the branch, and the code version of the current test environment can be matched in real time. Then, according to the data branch to be released and the preset database release strategy, three parts of materials are generated: database table structure data, database static data, and database incremental storage process.

[0083] Among them, in step S2, the step of obtaining the database file of the test environment of the code package to be deployed further includes:

[0084] S211: Matching a database branch of the test environment;

[0085] S212: Pull the current database file of the database branch;

[0086] S213: Replace the current database file according to the change code to obtain an updated change database service.

[0087] In steps S211 to S213, first, the database branch management of the test environment is performed on the data branch management end, and the branch to be switched is selected. Secondly, the database file under the branch is pulled to the data server through the database remote warehouse, and then the database server pushes the database file of the current branch to the warehouse. Subsequently, the required branch file is obtained through the database server to replace the database file. After the database branch switch is completed, the database service of the replaced database branch is provided.

[0088] Wherein, in step S2, the step of generating the database package to be deployed further includes:

[0089] S221: Matching the database branch to be deployed corresponding to the code package to be deployed;

[0090] S222: Pull the database file to be deployed from the database remote warehouse according to the database branch to be deployed;

[0091] S223: Packaging the database files to be deployed to obtain a database package to be deployed, wherein the database package to be deployed includes: table structure data to be deployed, database static data, and database incremental storage process.

[0092] In steps S221 to S223, first obtain the branch ID to be output, pull the database file from the database remote warehouse according to the branch ID, and then separate the table structure data, database static data, and database incremental storage process data from the database file according to the preset database online configuration file, and package them into a database online update package.

[0093] S3: Pull the configuration information in the test environment to obtain the configuration package to be deployed;

[0094] In step S3, the configuration unit completes the automatic pulling configuration of the configuration file and stores a set of key-value pair information. The configuration center updates the configuration at the first run according to the actual environment information or each business service pulls the configuration of the configuration center for real-time dynamic update. Then, the configuration publishing unit publishes the online configuration package according to the code version to be released, which includes two parts of materials: the MD5 value of each configuration file and the key-value pair information of the configuration file.

[0095] Wherein, step S3 further comprises:

[0096] S31: Save key-value pair information corresponding to all configuration information in the test environment;

[0097] S32: updating the key-value pair information according to the change code to obtain changed key-value pair information;

[0098] S33: Pull the current version configuration file in the change environment, and package the to-be-deployed MD5 value and the change key-value pair information corresponding to the current version configuration file to obtain a to-be-deployed configuration package.

[0099] The system saves all key-value pair information in the environment, involving various configuration information of the test environment;

[0100] In steps S31 to S33, the configuration unit first completes the unified change of the configuration by modifying the key-value pair: when each application service is started for the first time, the configuration information is pulled from the configuration center. During the application startup process, if the configuration changes, the key-value pair is modified and the change information is dynamically sent to each service. Each service obtains the latest configuration information and refreshes the service.

[0101] Secondly, the configuration publishing unit pulls the configuration key-value pair information of the configuration center of the online code version, obtains the MD5 value of the current version of the configuration file, and finally publishes the MD5 value and the corresponding file and key-value pair information as the configuration file online upgrade package.

[0102] S4: performing comparison upgrade and data import of the target database according to the database package to be deployed, performing configuration update of the target system according to the configuration package to be deployed, and performing code deployment of the target system according to the code package to be deployed.

[0103] Among them, in step S4, the step of comparing and upgrading the target database and importing data according to the database package to be deployed further includes:

[0104] S411: Receive the database package to be deployed;

[0105] S412: Perform a full database backup on the target database to obtain a backup table structure;

[0106] S413: Compare the backup table structure with the table structure data to be deployed, and obtain table structure update SQL;

[0107] S414: Execute the table structure update SQL, import the database static data, and import the database incremental stored procedure.

[0108] In steps S411 to S414, the purpose is to complete the database online upgrade work through the database integrated deployment module, mainly through five processes: database backup, database table structure comparison and upgrade, database static data import, database stored procedure import, and database rollback to complete the database online upgrade work.

[0109] The specific process is to first input the database online update package released by the data integration publishing module, perform a full database backup, then compare the table structure of the update package with the table structure of the online environment, generate the table structure update SQL, and finally execute the table structure update SQL, import the database static data, and import the database incremental stored procedure data.

[0110] The above SQL generation process is specifically as follows: first, the SQL is split into executable SQLs, different matches are performed according to whether it is insert or create, the SQL is parsed into fields and indexes, and finally the update SQL is generated.

[0111] Among them, in step S4, the step of updating the configuration of the target system according to the configuration package to be deployed further includes:

[0112] S421: Receive the configuration package to be deployed;

[0113] S422: parsing the current MD5 value of the configuration file in the environment of the target system;

[0114] S423: Compare the current MD5 value with the MD5 value to be deployed to obtain a difference item;

[0115] S424: Update the difference item according to the MD5 value to be deployed, and synchronously change the key-value pair information.

[0116] In steps S421 to S424, the purpose is to complete the online upgrade of the configuration file through the configuration file integrated deployment module, and the configuration file update and upgrade work is completed through four processes: obtaining the MD5 value of the current environment configuration file, comparing the MD5 values ​​of the configuration files of the current environment and the configuration release module, generating the current environment variables, and replacing the configuration file variables.

[0117] The specific process is as follows: first, import the configuration file online upgrade package generated by the configuration file integration and release module; second, parse the MD5 value of the configuration file of the current environment; compare the configuration file in the online upgrade package with the MD5 value of the current environment; find out the differences; then update the difference configuration; obtain static information according to the current environment; finally, automatically modify the key-value pair information in the configuration file online package; and uniformly release the configuration files of the current production environment.

[0118] Among them, in step S4, the step of deploying the code of the target system according to the code package to be deployed further includes:

[0119] S431: Receive the code package to be deployed;

[0120] S432: deploying the image file to be deployed to a target server of a target system;

[0121] S433: Pull up the container of the target server through other images;

[0122] S434: Monitoring and testing are performed through the container.

[0123] The purpose of steps S431 to S434 is to complete the online upgrade of the code through the code integration deployment module, and to complete the update and upgrade of the code through code package deployment, code package operation, and code package monitoring.

[0124] The specific steps are as follows: first, import the code image file released by the code integration and release module, deploy the code image file to the corresponding server, and finally use the new image to pull up the container on the corresponding server to monitor and test the container operation.

[0125] In one embodiment, the present invention is applied in the online change process of Tianyi Hybrid Cloud Management. Tianyi Hybrid Cloud Management is deployed in hundreds of user environments. Each user environment and test environment is physically isolated and network isolated. There are more than 10 major branch versions in the user's software version. Each change involves database changes, configuration file changes, and code package changes. Before the application of this solution, there were frequent problems such as missing tables and fields in the database; configuration file configuration errors, mismatch between code version and online version, and various human errors, resulting in a long and inefficient online change process. After the application of this invention, one-click export of change packages and one-click completion of changes are achieved, eliminating unnecessary manual operations and improving work efficiency. Therefore, the present invention is highly applicable in scenarios where the network is isolated and there are frequent database and configuration file changes. The efficiency of change implementation in this case is significantly improved.

[0126] The present invention provides an automated upgrade method and system in a network isolation scenario, which solves the problems of complex and cumbersome database changes that are prone to chain accidents during the project launch process, strong dependence on manual execution and errors caused by manual execution, greatly simplifies the database upgrade process and reduces unnecessary database failures; it also solves the problems of complex and changeable configuration files and strong dependence on manual execution under the diversity of production environments, reduces the problem of repeated configuration of configuration files that is prone to errors, and greatly optimizes the deployment process; it also solves the problem of inability to apply assembly line operations in test environments and production environments due to physical network isolation, and ensures the smoothness and accuracy of the launch process by publishing and deploying programs.

[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.

Claims

1. An automated upgrade method in a network isolation scenario. It is characterized in that include: S1: receiving the changed code, and packaging the changed code to obtain a code package to be deployed; S2: Connecting to the test environment corresponding to the changed code, and generating a database package to be deployed according to the database file of the test environment of the code package to be deployed; S3: Pull the configuration information in the test environment to obtain the configuration package to be deployed; S4: performing comparison upgrade and data import of the target database according to the database package to be deployed, performing configuration update of the target system according to the configuration package to be deployed, and performing code deployment of the target system according to the code package to be deployed.

2. According to the automatic upgrade method in a network isolation scenario according to claim 1, It is characterized in that Step S1 further comprises: S11: Pull the latest changed code from the test environment repository; S12: Matching the service package corresponding to the changed code with the packaging script, and packaging to obtain the image file to be deployed; S13: Push the image file to be deployed to the image warehouse to obtain the code package to be deployed.

3. According to the automatic upgrade method in a network isolation scenario according to claim 1, It is characterized in that In step S2, the step of obtaining the database file of the test environment of the code package to be deployed further includes: S211: Matching a database branch of the test environment; S212: Pull the current database file of the database branch; S213: Replace the current database file according to the change code to obtain an updated change database service.

4. According to claim 3, the automatic upgrade method in a network isolation scenario, It is characterized in that In step S2, the step of generating the database package to be deployed further includes: S221: Matching the database branch to be deployed corresponding to the code package to be deployed; S222: Pull the database file to be deployed from the database remote warehouse according to the database branch to be deployed; S223: Packaging the database files to be deployed to obtain a database package to be deployed.

5. According to claim 1, the automatic upgrade method in a network isolation scenario, It is characterized in that The database package to be deployed in step S2 includes: table structure data to be deployed, database static data, and database incremental storage process.

6. According to claim 1, the automatic upgrade method in a network isolation scenario, It is characterized in that Step S3 further comprises: S31: Save key-value pair information corresponding to all configuration information in the test environment; S32: updating the key-value pair information according to the change code to obtain changed key-value pair information; S33: Pull the current version configuration file in the change environment, and package the to-be-deployed MD5 value and the change key-value pair information corresponding to the current version configuration file to obtain a to-be-deployed configuration package.

7. According to claim 5, the automatic upgrade method in a network isolation scenario, It is characterized in that In step S4, the step of comparing and upgrading the target database and importing data according to the database package to be deployed further includes: S411: Receive the database package to be deployed; S412: Perform a full database backup on the target database to obtain a backup table structure; S413: Compare the backup table structure with the table structure data to be deployed, and obtain table structure update SQL; S414: Execute the table structure update SQL, import the database static data, and import the database incremental stored procedure.

8. According to claim 6, the automatic upgrade method in a network isolation scenario, It is characterized in that In step S4, the step of updating the configuration of the target system according to the configuration package to be deployed further includes: S421: Receive the configuration package to be deployed; S422: parsing the current MD5 value of the configuration file in the environment of the target system; S423: Compare the current MD5 value with the MD5 value to be deployed to obtain a difference item; S424: Update the difference item according to the MD5 value to be deployed, and synchronously change the key-value pair information.

9. According to claim 2, the automatic upgrade method in a network isolation scenario, It is characterized in that In step S4, the step of deploying the code of the target system according to the code package to be deployed further includes: S431: Receive the code package to be deployed; S432: deploying the image file to be deployed to a target server of a target system; S433: Pull up the container of the target server through other images; S434: Monitoring and testing are performed through the container.

10. An automated upgrade system in a network isolation scenario, used to execute an automated upgrade method in a network isolation scenario as claimed in any one of claims 1 to 9, It is characterized in that include: A publishing center, comprising: a database integrated publishing module, a configuration file integrated publishing module, and a code integrated publishing module; The database integrated publishing module includes: a database branch management unit for matching the database corresponding to the current test environment, and a data publishing unit for generating a database package to be deployed; the configuration file integrated publishing module includes: a configuration unit for updating the current configuration information key-value pair information, and a configuration publishing unit for generating a configuration package to be deployed; the code integrated publishing module includes a unit for packaging the changed code to obtain the code package to be deployed; A deployment center, comprising: a database integrated deployment module, a configuration file integrated deployment module, and a code integrated deployment module; The database integrated deployment module is used to compare and upgrade the target database and import data according to the database package to be deployed; the configuration file integrated deployment module is used to update the configuration of the target system according to the configuration package to be deployed; the code integrated deployment module is used to deploy the code of the target system according to the code package to be deployed.

Citation Information

Cited By

  • Multi-provincial customization method and system applied to terminal equipment and automatic deployment method of multi-provincial customization system

    CN120848946A