System upgrade method, upgrade system, computer equipment and readable storage media

By abstracting the upgrade logic of a distributed system into state file changes, and using a state change framework and upgrade plugins, the problems of complexity and high failure rate in distributed system upgrades are solved, thereby simplifying system upgrades and improving reliability.

CN115373705BActive Publication Date: 2026-05-26QI AN XIN TECHNOLOGY GROUP INC +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QI AN XIN TECHNOLOGY GROUP INC
Filing Date
2021-05-19
Publication Date
2026-05-26

Smart Images

  • Figure CN115373705B_ABST
    Figure CN115373705B_ABST
Patent Text Reader

Abstract

This invention provides a system upgrade method, an upgrade system, a computer device, and a readable storage medium. The method involves obtaining a status file configuration, wherein the status file configuration includes configurations for modifying several status files, where the status files are modifiable system content in the system's operating environment; determining the modification operations to be performed in the status file configuration; and invoking an upgrade plugin based on the type of the status file for which the modification operation is to be performed, so that the upgrade plugin modifies the status file. This invention reduces the complexity and failure rate of system upgrades.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed systems technology, and in particular to a system upgrade method, an upgrade system, a computer device, and a readable storage medium. Background Technology

[0002] When dealing with large and complex distributed systems, various system upgrades are always necessary. With the widespread adoption of distributed, clustered, and modular technologies, the architecture of system operation and deployment is becoming increasingly complex. System upgrades often involve upgrading databases, SQL scripts, configurations, directory files, program files, and so on. They also need to take into account modifications made to the system by on-site maintenance personnel, making the upgrade and rollback logic increasingly complex. Customized upgrade scripts are often required, which seriously affects the success rate. As a result, upgrade rollback has become an essential safeguard mechanism. However, rollback is more complex than upgrade and has inherent reliability and consistency issues.

[0003] In existing technologies, upgrade methods include data-oriented upgrade methods and business process-oriented upgrade methods. The former mainly targets simple file replacement and incremental SQL execution frameworks. These technologies cannot fully cover system upgrades in complex scenarios, such as systems that have been customized, system configurations modified by operations and maintenance, complex data migrations in some business areas, or systems that cannot be upgraded via SQL. For complex systems, the latter, namely the business process-oriented upgrade method, is usually adopted. Specifically, the upgrade program is responsible for upgrading the main process, such as verification, baseline upgrade, and module upgrade, while plugins are used to implement various upgrade sub-processes of the business. Different plugins are customized for different business needs. In this method, the upgrade plugins are highly coupled with the business and environment, requiring customized plugins for each version of the system upgrade. This not only makes the upgrade complex and increases development and maintenance costs, but also makes upgrade failures more likely due to the large amount of plugin code.

[0004] Therefore, how to reduce the complexity and failure rate of system upgrades has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] The purpose of this invention is to provide a system upgrade method, an upgrade system, a computer device, and a readable storage medium to solve the aforementioned technical problems in the prior art.

[0006] On the one hand, in order to achieve the above objectives, the present invention provides a system upgrade method.

[0007] The system upgrade method includes: obtaining a status file configuration, wherein the status file configuration includes a configuration for changing several status files, and the status files are system content that can be modified in the environment in which the system runs; determining the change operations to be performed in the status file configuration; and invoking an upgrade plugin according to the type of the status file for which the change operation is to be performed, so that the upgrade plugin changes the status file.

[0008] Furthermore, the status file includes content modified during database upgrades, content modified during system configuration upgrades, and content modified during program upgrades.

[0009] Furthermore, the system upgrade includes several upgrade transactions; before the step of obtaining the status file configuration, the system upgrade method further includes: parsing the transaction component package of the upgrade transaction, wherein the transaction component package includes the status file configuration and the transaction process configuration, and the transaction process configuration includes the order configuration for executing each of the change operations; the step of determining the change operation to be executed includes: determining the change operation to be executed according to the transaction process configuration.

[0010] Furthermore, the upgrade plugin is also used to generate exception information when the change operation is executed abnormally, and to record the upgrade log when the change operation is executed successfully; the system upgrade method also includes: calling the snapshot plugin to take a snapshot of the state file of the change operation to be executed, and saving the snapshot file; when the exception information is received, traversing the upgrade log, determining the state file of the change operation that has been executed in the upgrade transaction where the exception information is located, and restoring it based on the snapshot file corresponding to the state file of the change operation that has been executed.

[0011] Furthermore, the step of taking a snapshot of the status file for the change operation to be performed includes: when the status file contains content modified during a database upgrade, taking a snapshot using the database checkpoint mechanism; when the status file contains content modified during a system configuration upgrade or a program upgrade, and the status file is less than a preset threshold, taking a snapshot by backing up the status file; when the status file contains content modified during a system configuration upgrade or a program upgrade, and the status file is greater than or equal to a preset threshold, calculating the binary difference of the status file before and after the change operation and taking a snapshot.

[0012] Furthermore, the system upgrade method further includes: obtaining and parsing an upgrade content package before parsing the transaction component package of the upgrade transaction, wherein the upgrade content package includes a global transaction configuration and several transaction component packages, the global transaction configuration being used to configure each of the upgrade transactions; creating a transaction directory based on the global transaction configuration, wherein the upgrade transaction is completed when all the change operations in the transaction component package of the upgrade transaction are executed; and parsing the transaction component package of the next upgrade transaction based on the transaction directory after one upgrade transaction is completed.

[0013] Furthermore, the upgrade content package also includes global verification rules and upgrade result verification configuration, the transaction component package also includes transaction verification rules, and the system upgrade method further includes: after parsing the upgrade content package and before creating a transaction directory according to the global transaction configuration, calling the rule verification plugin to perform verification according to the global verification rules, wherein when the global verification rule verification is successful, the step of creating a transaction directory according to the global transaction configuration is executed; after parsing the transaction component package of the upgrade transaction and before determining the change operation to be executed according to the transaction process configuration, calling the rule verification plugin to perform verification according to the transaction verification rules, wherein when the transaction verification rule verification is successful, the step of determining the change operation to be executed according to the transaction process configuration is executed; after an upgrade transaction is completed, calling the result verification plugin to verify the upgrade result of the upgrade transaction according to the upgrade result verification configuration.

[0014] On the other hand, in order to achieve the above objectives, the present invention provides an upgrade system.

[0015] The upgrade system includes a state change framework and an upgrade plugin. The state change framework is used to obtain state file configuration, determine the change operations to be performed in the state file configuration, and call the upgrade plugin according to the type of the state file to be performed. The state file configuration includes configurations for changing operations on several state files, and the state files are system content that can be modified in the environment in which the system runs. The upgrade plugin is used to change the state files.

[0016] Furthermore, the system upgrade includes several upgrade transactions, and the upgrade system also includes an upgrade framework. The upgrade framework is used to parse the transaction component package of the upgrade transaction and submit the transaction component package to the state change framework. The transaction component package includes the state file configuration and the transaction process configuration. The transaction process configuration includes the order configuration for executing each of the change operations. When the state change framework determines the change operation to be executed, the specific steps it performs include: determining the change operation to be executed according to the transaction process configuration.

[0017] Furthermore, the upgrade system also includes a transaction manager and a snapshot plugin. The snapshot plugin is used to take a snapshot of the state file of the change operation to be performed and submit the snapshot file to the transaction manager. The transaction manager is used to save the snapshot file. The upgrade plugin is also used to generate exception information and submit the exception information to the state change framework when the change operation is executed abnormally, and to submit an upgrade record to the transaction manager when the change operation is executed successfully. The transaction manager is also used to form an upgrade log based on the upgrade record. The state change framework is also used to initiate a transaction rollback to the transaction manager when it receives the exception information. The transaction manager is also used to traverse the upgrade log when it receives the transaction rollback, determine the state file in the upgrade transaction where the exception information is located that has already undergone a change operation, and restore it based on the snapshot file corresponding to the state file that has undergone a change operation.

[0018] Furthermore, the upgrade framework is also used to obtain and parse the upgrade content package, wherein the upgrade content package includes a global transaction configuration and several transaction component packages, the global transaction configuration is used to configure each of the upgrade transactions; the upgrade framework is also used to submit the configuration of each of the upgrade transactions to the transaction manager according to the global transaction configuration; the transaction manager is also used to create a transaction directory according to the configuration of each of the upgrade transactions; the upgrade framework is also used to parse the transaction component package of the next upgrade transaction when one upgrade transaction is completed, wherein the upgrade transaction is completed when all the change operations in the transaction component package of the upgrade transaction are executed.

[0019] Furthermore, the upgrade content package also includes a global verification rule file and an upgrade result verification configuration; the transaction component package also includes a transaction verification rule file; and the upgrade system also includes an upgrade verification framework, a rule verification plugin, an upgrade result inspection framework, and a result verification plugin. The upgrade framework is further configured to, after parsing the upgrade content package and before submitting the configurations of each upgrade transaction to the transaction manager according to the global transaction configuration, submit the global verification rule file to the upgrade verification framework. The upgrade verification framework is configured to call the rule verification plugin; the rule verification plugin is configured to perform verification according to the global verification rule file, obtain a first verification result, and submit the first verification result to the upgrade framework. The upgrade framework is further configured to, when the first verification result is successful, perform further verification according to the global verification rule file. The transaction configuration involves submitting the configurations of each upgrade transaction to the transaction manager. The state change framework is further configured to submit the transaction verification rule file to the upgrade verification framework before obtaining the state file configuration. The rule verification plugin is further configured to perform verification based on the transaction verification rule file, obtain a second verification result, and submit the second verification result to the state change framework. The state change framework is further configured to obtain the state file configuration when the second verification result indicates successful verification. The upgrade framework is further configured to submit the upgrade result verification configuration to the upgrade result inspection framework after an upgrade transaction is completed. The upgrade result inspection framework is configured to call the result verification plugin. The result verification plugin is configured to verify the upgrade result of the upgrade transaction based on the upgrade result verification configuration.

[0020] To achieve the above objectives, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.

[0021] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above method.

[0022] The system upgrade method, upgrade system, computer equipment, and readable storage medium provided by this invention abstract the modifiable system content in the system's operating environment into state files. Before system upgrade, a state file configuration is formed, including configurations for changing several of these state files, and upgrade plugins corresponding to the state file types. During system upgrade, the state file configuration is obtained, the change operations to be performed in the state file configuration are determined, and the upgrade plugin is invoked according to the type of the state file to be changed, so that the upgrade plugin changes the state file. Through this invention, the logic of system upgrade is abstracted into changes to state files, that is, system upgrade is achieved by changing state files. This decouples the system upgrade process from business logic. Regardless of the business logic changes corresponding to the system upgrade, it all boils down to changes to state files, thereby reducing the complexity of system upgrade. At the same time, the same type of state file can reuse the same upgrade plugin without needing to set up plugins for different business changes, reducing plugin code and lowering the failure rate of system upgrade. Attached Figure Description

[0023] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0024] Figure 1 A flowchart of the system upgrade method provided in Embodiment 1 of the present invention;

[0025] Figure 2 This is a schematic diagram illustrating the composition of the upgrade package provided in Embodiment 2 of the present invention;

[0026] Figures 3 to 5 This is a flowchart illustrating the upgrade method provided in Embodiment 2 of the present invention;

[0027] Figure 6 This is a block diagram of the upgrade system provided in Embodiment 3 of the present invention;

[0028] Figure 7 This is a hardware structure diagram of a computer device provided in Embodiment 4 of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without inventive effort are within the scope of protection of this invention.

[0030] Example 1

[0031] This invention provides a system upgrade method, which is a state-oriented upgrade method. It abstracts all modifiable system content in the environment where the system to be upgraded runs into state files, thereby simplifying the complex system upgrade logic into changes to these state files. This allows the system upgrade to transcend the business logic itself, simplifying the upgrade process and reducing its complexity and failure rate. Optionally, the execution entity of this system upgrade method is a program framework, which calls plugins to modify the state files. Specifically, Figure 1 The flowchart of the system upgrade method provided in Embodiment 1 of the present invention is as follows: Figure 1 As shown, the system upgrade method provided in this embodiment includes the following steps S101 to S103.

[0032] Step S101: Obtain the status file configuration.

[0033] The status file configuration includes configurations for changing several status files. The status files are system contents that can be modified in the system's operating environment.

[0034] Optionally, in one embodiment, the status file includes content modified during database upgrades, content modified during system configuration upgrades, and content modified during program upgrades. Specifically, the content modified during database upgrades includes data tables and database table structures; the content modified during system configuration upgrades includes firewall rule configurations, hosts file configurations, component configuration parameter lists, etc.; and the content modified during program upgrades includes program directory structure trees, etc. Each of these specific contents—data tables, firewall rule configurations, program directory structure trees, etc.—can be considered a type of status file.

[0035] In this embodiment, all modifiable system content within the system's operating environment is abstracted as state files. Therefore, when the system is upgraded—that is, when the system content within the operating environment needs modification—the upgrade can be abstracted as a change to the state files, including adding, deleting, and modifying state files. The state file configuration can be used to configure which state files need to be changed and how they should be changed. In this step, the state file configuration is obtained.

[0036] Optionally, in one embodiment, a unified structured configuration window can be provided for each type of status file. Specifically, it can be a structured file or a configuration page, which is used by developers to record the status files targeted for upgrades and the ways in which the status files are changed. Through this configuration window, status file configurations can be formed, which is conducive to unifying the entry point and mode for front-line operation and maintenance and system upgrades to modify system files / configurations and other statuses, and can greatly reduce conflicts between on-site operation and maintenance customization modifications and version upgrades.

[0037] Step S102: Determine the change operations to be performed in the status file configuration.

[0038] When the status file configuration includes configurations for changing operations on two or more status files, this step can be performed multiple times. That is, by traversing the status file configuration, the change operation that needs to be performed is determined, i.e. the change operation to be performed, and then the following step S103 is performed.

[0039] Step S103: Invoke the upgrade plugin according to the type of the status file to be changed, so that the upgrade plugin can change the status file.

[0040] For each type of status file, a corresponding upgrade plugin is pre-configured, allowing status files of the same type to reuse the same upgrade plugin. For example, for a status file representing a data table, an upgrade plugin is set up to change the data table; for a status file representing firewall rule configuration, an upgrade plugin is set up to change the firewall rule configuration. Therefore, in step S103, for each change operation to be performed, the corresponding upgrade plugin is invoked based on the type of the status file to be changed, so that the upgrade plugin modifies the status file. Through the alternating execution of steps S102 and S103, the change to the status file configured in the status file configuration is completed.

[0041] To facilitate understanding of the state file-based system upgrade mechanism of this embodiment, the following table lists the state files corresponding to common system upgrade operations and the types of state file change operations, along with a comparison with the original logic and implementation methods in the prior art:

[0042]

[0043]

[0044] In the system upgrade method provided in this embodiment, the modifiable system content in the system's operating environment is abstracted into state files. Before the system upgrade, state file configurations are formed, including configurations for changing several of these state files, and upgrade plugins corresponding to the state file types. During the system upgrade, the state file configurations are obtained, the change operations to be performed in the state file configurations are determined, and the upgrade plugins are called according to the type of the state file to be changed, so that the upgrade plugins can change the state files. By using the system upgrade method provided in this embodiment, the logic of system upgrade is abstracted into changes to state files, that is, system upgrade is achieved by changing state files. This decouples the system upgrade process from business logic. Regardless of the business logic changes corresponding to the system upgrade, it all boils down to changes to state files, thereby reducing the complexity of system upgrades. At the same time, the same type of state file can reuse the same upgrade plugin without needing to set up plugins for different business changes, reducing plugin code and lowering the failure rate of system upgrades.

[0045] Optionally, in one embodiment, the system upgrade content includes several upgrade transactions; before the step of obtaining the status file configuration, the system upgrade method further includes: parsing the transaction component package of the upgrade transaction, wherein the transaction component package includes the status file configuration and the transaction process configuration, and the transaction process configuration includes the order configuration for executing each change operation; the step of determining the change operation to be executed includes: determining the change operation to be executed according to the transaction process configuration.

[0046] Specifically, to ensure the normal operation of the system after the upgrade, the system upgrade content is logically divided into several upgrade transactions. Each upgrade transaction corresponds to a transaction component package, and the transaction component packages are independent of each other. However, the status file change operations within the same upgrade transaction are interconnected. Status file configuration and transaction flow configuration are set in the transaction component package. The order in which the change operations in the status file configuration are executed is configured through the transaction flow configuration. Based on this, in step S102 above, when determining the change operation to be executed, the determination is made according to the transaction flow configuration.

[0047] Optionally, in one embodiment, the upgrade plugin is further configured to generate exception information when the change operation is executed abnormally, and record the upgrade log when the change operation is executed successfully; the system upgrade method further includes: calling the snapshot plugin to take a snapshot of the state file to be changed and save the snapshot file; when receiving exception information, traversing the upgrade log, determining the state file in the upgrade transaction where the exception information is located that has been changed, and restoring it based on the snapshot file corresponding to the state file that has been changed.

[0048] Specifically, if the called upgrade plugin can complete the change operation normally, that is, the change operation is executed successfully, and an upgrade record is generated and recorded in the upgrade log. If, during the upgrade process, the called upgrade plugin encounters a failure while executing the change operation, that is, the change operation execution is abnormal, an exception message is generated. Upon receiving the exception message, a transaction rollback is performed.

[0049] The snapshot plugin can be used to take a snapshot of the status file to be changed, forming a snapshot file. The exception information may include the transaction ID of the upgrade transaction in which it is located. When the transaction is rolled back, the transaction ID of the upgrade transaction in which it is located is determined by the exception information. Then, the upgrade log is traversed to determine the status file under the transaction ID that has been changed. The snapshot file corresponding to these status files is then obtained, so that the status file under the transaction ID that has been changed can be restored, and the upgrade transaction can be rolled back.

[0050] The system upgrade method provided in this embodiment rolls back the entire upgrade transaction containing the change operation when an exception occurs, further ensuring the normal operation of the system. When the change operation is successfully executed, an upgrade log is recorded, enabling rapid and accurate rollback of the entire upgrade transaction. Furthermore, the snapshot file approach effectively solves the problem of configuration rollback being impossible in existing technologies.

[0051] Optionally, in one embodiment, the step of taking a snapshot of the state file to be subjected to a change operation includes: when the state file contains content modified during a database upgrade, taking a snapshot using the database checkpoint mechanism; when the state file contains content modified during a system configuration upgrade or a program upgrade, and the state file is less than a preset threshold, taking a snapshot by backing up the state file; when the state file contains content modified during a system configuration upgrade or a program upgrade, and the state file is greater than or equal to a preset threshold, calculating the binary difference of the state file before and after the change operation and taking a snapshot.

[0052] Specifically, different snapshot plugins are set up according to the content and size of the status file, so as to use different snapshot implementation methods to complete the snapshot of the status file. These include the following:

[0053] Database snapshot: The database's built-in checkpoint mechanism. Using this snapshot can avoid performing a full backup of the database files, which is beneficial for rapid recovery and avoids unnecessary redundant operations.

[0054] File backup snapshot: A snapshot is created by backing up the state file. It is suitable for smaller configuration or program files and facilitates rapid recovery.

[0055] File Difference Snapshot: Saves the binary differences between the state files before and after the upgrade. It is suitable for large configuration or program files, so that during restoration, the binary difference blocks can be used for reverse replacement.

[0056] Optionally, in one embodiment, the system upgrade method further includes: obtaining and parsing an upgrade content package before parsing the transaction component package of the upgrade transaction, wherein the upgrade content package includes a global transaction configuration and several transaction component packages, the global transaction configuration being used to configure each upgrade transaction; creating a transaction directory based on the global transaction configuration, wherein the upgrade transaction is completed when all change operations in the transaction component package of the upgrade transaction are executed; and parsing the transaction component package of the next upgrade transaction based on the transaction directory after one upgrade transaction is completed.

[0057] Specifically, the system upgrade content is logically divided into several upgrade transactions. By setting global transaction configuration, each upgrade transaction can be configured. A transaction directory, including transaction ID, transaction snapshot directory, and upgrade log, can be created according to the configuration of each upgrade transaction to achieve unified management of each upgrade transaction of the system upgrade.

[0058] Optionally, in one embodiment, the upgrade content package further includes global verification rules and upgrade result verification configuration, the transaction component package further includes transaction verification rules, and the system upgrade method further includes: after parsing the upgrade content package and before creating a transaction directory according to the global transaction configuration, calling the rule verification plugin to perform verification according to the global verification rules, wherein when the global verification rules are successfully verified, the step of creating a transaction directory according to the global transaction configuration is executed; after parsing the transaction component package of the upgrade transaction and before determining the change operation to be performed according to the transaction process configuration, calling the rule verification plugin to perform verification according to the transaction verification rules, wherein when the transaction verification rules are successfully verified, the step of determining the change operation to be performed according to the transaction process configuration is executed; after an upgrade transaction is completed, calling the result verification plugin to verify the upgrade result of the upgrade transaction according to the upgrade result verification configuration.

[0059] Specifically, the upgrade content package encapsulates global verification rules and upgrade result verification configurations, the transaction component package encapsulates transaction verification rules, and rule verification plugins and result verification plugins are pre-configured. Before the system upgrade begins, the rule verification plugins are called to perform pre-upgrade verification according to the global verification rules. Before each upgrade transaction begins, the rule verification plugins are called to perform pre-upgrade verification according to the transaction verification rules. After each upgrade transaction is completed, the result verification plugins are called to perform post-upgrade verification according to the upgrade result verification configurations.

[0060] Example 2

[0061] Based on the above embodiment one, this embodiment two is a preferred embodiment, providing a preferred system upgrade method for upgrading a system, taking the NGSOC system (i.e., situational awareness and security operation platform) as an example. Of course, it can be understood that the system upgrade method provided in this embodiment two is not limited to the NGSOC system. Figure 2 This is a schematic diagram illustrating the composition of the upgrade package provided in Embodiment 2 of the present invention. Figures 3 to 5 This is a flowchart illustrating the upgrade method provided in Embodiment 2 of the present invention.

[0062] like Figures 2 to 5 As shown, the global configuration related to the NGSOC system upgrade and the incremental upgrade content of each module are obtained through the packaging tool, and a file compressed package is generated according to the specified directory structure, which is the upgrade package. The upgrade package includes the upgrade program package and the upgrade content package.

[0063] The upgrade package includes various program frameworks and plugins. The program frameworks parse, verify, execute the upgrade, and check the results of the upgrade content package. Specifically, they include the upgrade framework, state change framework, upgrade verification framework, upgrade result inspection framework, and transaction manager. Plugins include upgrade plugins, snapshot plugins, rule verification plugins, and result verification plugins. The upgrade content package includes global transaction configuration, global verification rules, upgrade result verification configuration, and several transaction component packages. Transaction component packages include state file configuration, transaction process configuration, and transaction verification rules.

[0064] The Upgrade Framework (UF) is the main upgrade process, responsible for controlling the entire upgrade process, including parsing the upgrade content package, parsing the transaction component package, and parsing the transaction process configuration.

[0065] The State Change Framework (SCUF) is responsible for parsing the state file configurations in each transaction component package within the upgrade content package, and sequentially calling the upgrade plugins according to the transaction flow configuration to execute the change operations on the state files in the state file configuration. Program file directories, database tables, ES templates, system configurations, business parameter configurations, etc. can all be regarded as different types of state files. For example, if a program file in the deployment directory needs to be deployed, it can be regarded as a modification of a record in the "directory tree state file".

[0066] The Upgrade Validation Framework (UVF) is responsible for calling the rule validation plugin to perform global validation before the upgrade and validation of different rules for the content of different types of status files before the upgrade transaction.

[0067] The Upgrade Result Inspection Framework (URCF) is responsible for calling the result verification plugin to verify the upgrade results through a series of commands and parameter configurations.

[0068] The transaction manager is responsible for dividing the entire system upgrade process into several independent upgrade transactions according to the global transaction configuration. It performs atomic upgrades and rollbacks on changes to the state files within the upgrade transactions, calls the snapshot plugin to create a snapshot file of the state file before the changes during the upgrade process, and enables quick recovery of operations after an exception occurs.

[0069] The Upgrade Extension Plug-in (UEP) includes upgrade plug-ins, rule verification plug-ins, and result verification plug-ins, which realize content verification, change maintenance, and change record maintenance of various status files. Different upgrade plug-ins are responsible for changes to different types of status files, such as database plug-ins, program file deployment plug-ins, system environment configuration plug-ins, and business configuration parameter maintenance plug-ins. For the same type of status file, a plug-in can be reused.

[0070] The NGSOC system is upgraded by manipulating the contents of the upgrade package through the upgrade program package. The specific process of the system upgrade method is as follows:

[0071] ① The upgrade framework obtains and parses the upgrade content package. If parsing fails, it exits; if parsing succeeds, it continues.

[0072] The upgrade package includes global transaction configuration, several transaction component packages, a global verification rule file, and upgrade result verification configuration. The transaction component packages include status file configuration, transaction flow configuration, and transaction verification rule file. The global transaction configuration is used to configure each upgrade transaction. The status file configuration includes configurations for changing several status files; the status files represent modifiable system content within the system's operating environment. The transaction flow configuration includes the configuration of the order in which each change operation is executed.

[0073] ② The upgraded framework parses the global validation rule file. If parsing fails, it exits; if successful, it continues.

[0074] ③ The upgrade framework submits the global validation rule file to the upgrade validation framework. The upgrade validation framework calls the rule validation plugin to perform the validation. If the validation fails, it exits; if it succeeds, it continues.

[0075] ④ The upgrade framework parses the global transaction configuration; if parsing fails, it exits; if it succeeds, it continues.

[0076] ⑤ The upgrade framework traverses the global transaction configuration, creates transaction objects, and submits the configurations of each upgrade transaction to the transaction manager. The transaction manager creates a transaction snapshot directory, including transaction IDs and execution logs.

[0077] ⑥ Upgrade the framework to parse the transaction component package corresponding to the transaction;

[0078] ⑦ The upgrade framework submits the transaction component package to the state change framework to execute the upgrade transaction. Before executing the upgrade transaction, the state change framework first performs the pre-upgrade verification by calling the rule verification plugin through the upgrade verification framework and performing the verification according to the rules.

[0079] ⑧ After the verification is passed, the state change framework obtains the state file configuration and iterates through the change operations to be executed in the state file configuration.

[0080] ⑨ The state change framework calls the upgrade plugin based on the type of the state file to be changed, in order to change the state file;

[0081] ⑩ The snapshot plugin creates a snapshot of the state file and submits the snapshot to the transaction manager for saving, recording the snapshot history;

[0082] The upgrade plugin modifies the status file and performs the change operation;

[0083] If the upgrade plugin is executed successfully, the upgrade record is committed to the transaction manager so that the transaction manager can record the upgrade log. If an exception occurs, an exception message is generated and committed to the state change framework.

[0084] After the upgrade plugin is successfully executed, the next state file change will continue. Once the state change framework completes the upgrade transaction, it will return to the upgrade framework and continue processing the next upgrade transaction. This continues until all upgrade transactions are completed, which means the system upgrade is complete.

[0085] When an upgrade fails, the state change framework receives the exception information and initiates a transaction rollback to the transaction manager. The transaction manager traverses the upgrade log, obtains snapshot files of the relevant state files, and performs snapshot restoration in sequence until all state files are restored, at which point the transaction rollback is complete.

[0086] Example 3

[0087] Corresponding to Embodiments 1 and 2 above, Embodiment 3 of the present invention provides an upgrade system. The corresponding technical features and effects can be referred to Embodiments 1 and 2 above, and will not be repeated in this embodiment. Figure 6 This is a block diagram of the upgrade system provided in Embodiment 3 of the present invention, as shown below. Figure 6 As shown, the upgrade system includes a state change framework A301 and an upgrade plugin B301.

[0088] The state change framework A301 is used to obtain state file configuration, determine the change operations to be performed in the state file configuration, and call upgrade plugin B301 according to the type of the state file to be performed change operation. The state file configuration includes configuration for performing change operations on several state files, and the state files are system content that can be modified in the environment in which the system runs. The upgrade plugin B301 is used to change the state files.

[0089] Optionally, in one embodiment, the system upgrade includes several upgrade transactions. The upgrade system further includes an upgrade framework A302, which is used to parse the transaction component package of the upgrade transaction and submit the transaction component package to the state change framework A301. The transaction component package includes the state file configuration and the transaction process configuration. The transaction process configuration includes the order configuration for executing each of the change operations. When the state change framework A301 determines the change operation to be executed, the specific steps it performs include: determining the change operation to be executed according to the transaction process configuration.

[0090] Optionally, in one embodiment, the status file includes content modified when implementing database upgrades, content modified when implementing system configuration upgrades, and content modified when implementing program upgrades.

[0091] Optionally, in one embodiment, the upgrade system further includes a transaction manager A303 and a snapshot plugin B302. The snapshot plugin B302 is used to take a snapshot of the state file of the change operation to be performed and submit the snapshot file to the transaction manager A303; the transaction manager A303 is used to save the snapshot file; the upgrade plugin B301 is also used to generate exception information when the change operation execution fails and submit the exception information to the state change framework A301; when the change operation is successfully executed, it submits an upgrade record to the transaction manager A303; the transaction manager A303 is also used to form an upgrade log based on the upgrade record; the state change framework A301 is also used to initiate a transaction rollback to the transaction manager A303 when receiving the exception information; the transaction manager A303 is also used to traverse the upgrade log when receiving the transaction rollback, determine the state file in the upgrade transaction where the exception information is located that has already undergone a change operation, and restore it based on the snapshot file corresponding to the state file that has undergone a change operation.

[0092] Optionally, in one embodiment, when the snapshot plugin B302 takes a snapshot of the state file to be changed, the specific steps include: when the state file contains content modified during a database upgrade, taking a snapshot using the database checkpoint mechanism; when the state file contains content modified during a system configuration upgrade or a program upgrade, and the state file is less than a preset threshold, taking a snapshot by backing up the state file; when the state file contains content modified during a system configuration upgrade or a program upgrade, and the state file is greater than or equal to a preset threshold, calculating the binary difference of the state file before and after the change operation and taking a snapshot.

[0093] Optionally, in one embodiment, the upgrade framework A302 is further configured to acquire and parse an upgrade content package, wherein the upgrade content package includes a global transaction configuration and several transaction component packages, the global transaction configuration being used to configure each of the upgrade transactions; the upgrade framework A302 is further configured to submit the configuration of each of the upgrade transactions to the transaction manager A303 according to the global transaction configuration; the transaction manager A303 is further configured to create a transaction directory according to the configuration of each of the upgrade transactions; the upgrade framework A302 is further configured to parse the transaction component package of the next upgrade transaction after one upgrade transaction is completed, wherein the upgrade transaction is completed when all the change operations in the transaction component package of the upgrade transaction are executed.

[0094] Optionally, in one embodiment, the upgrade content package further includes a global verification rule file and an upgrade result verification configuration, the transaction component package further includes a transaction verification rule file, and the upgrade system further includes an upgrade verification framework A304, a rule verification plugin B303, an upgrade result inspection framework A305, and a result verification plugin B304.

[0095] The upgrade framework A302 is further configured to, after parsing the upgrade content package and before submitting the configuration of each upgrade transaction to the transaction manager A303 according to the global transaction configuration, submit the global verification rule file to the upgrade verification framework A304; the upgrade verification framework A304 is configured to call the rule verification plugin B303; the rule verification plugin B303 is configured to perform verification according to the global verification rule file, obtain a first verification result, and submit the first verification result to the upgrade framework A302; the upgrade framework A302 is further configured to, when the first verification result is successful, submit the configuration of each upgrade transaction to the transaction manager A303 according to the global transaction configuration; the state change framework A301 is further configured to, upon obtaining the... Before configuring the status file, the transaction verification rule file is submitted to the upgrade verification framework A304; the rule verification plugin B303 is also used to perform verification according to the transaction verification rule file, obtain a second verification result, and submit the second verification result to the status change framework A301; the status change framework A301 is also used to obtain the status file configuration when the second verification result is successful; the upgrade framework A302 is also used to submit the upgrade result verification configuration to the upgrade result inspection framework A305 after an upgrade transaction is completed; the upgrade result inspection framework A305 is used to call the result verification plugin B304; the result verification plugin B304 is used to verify the upgrade result of the upgrade transaction according to the upgrade result verification configuration.

[0096] Example 4

[0097] This embodiment also provides a computer device, such as a smartphone, tablet computer, laptop computer, desktop computer, rack server, blade server, tower server, or cabinet server (including a standalone server or a server cluster composed of multiple servers), etc., capable of executing programs. Figure 7 As shown, the computer device 01 in this embodiment includes, but is not limited to, a memory 012 and a processor 011 that can be interconnected via a system bus, such as... Figure 7 As shown. It should be noted that, Figure 7 Only a computer device 01 with component memory 012 and processor 011 is shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0098] In this embodiment, the memory 012 (i.e., the readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 012 may be an internal storage unit of the computer device 01, such as the hard disk or memory of the computer device 01. In other embodiments, the memory 012 may also be an external storage device of the computer device 01, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 01. Of course, the memory 012 may include both the internal storage unit and its external storage device of the computer device 01. In this embodiment, the memory 012 is typically used to store the operating system and various application software installed on the computer device 01, such as the program code of the upgrade system in Embodiment 2. In addition, memory 012 can also be used to temporarily store various types of data that have been output or will be output.

[0099] In some embodiments, processor 011 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. This processor 011 is typically used to control the overall operation of computer device 01. In this embodiment, processor 011 is used to run program code stored in memory 012 or process data, such as system upgrade methods.

[0100] Example 5

[0101] This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, app store, etc., which stores computer programs. When the program is executed by a processor, it implements corresponding functions. The computer-readable storage medium of this embodiment is used to store an upgrade system, and when executed by a processor, it implements the system upgrade method of Embodiment 1.

[0102] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0103] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0104] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0105] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A system upgrade method, characterized by, System upgrades involve several upgrade tasks, and system upgrade methods include: The transaction component package of the upgrade transaction is parsed, wherein the transaction component package includes a status file configuration and a transaction process configuration, and the transaction process configuration includes the order configuration for executing each change operation; Obtain the status file configuration, wherein the status file configuration includes configuration for changing several status files, and the status file is the system content that can be modified in the environment in which the system runs, including the content modified when implementing database upgrade, the content modified when implementing system configuration upgrade, and the content modified when implementing program upgrade; Determine the pending change operations in the status file configuration, wherein the pending change operations are determined according to the transaction flow configuration; and The upgrade plugin is invoked based on the type of the status file for which the change operation is to be performed, so that the upgrade plugin can modify the status file.

2. The system upgrade method according to claim 1, characterized in that, The upgrade plugin is also used to generate exception information when the change operation fails, and to record an upgrade log when the change operation succeeds. The system upgrade method further includes: calling a snapshot plugin to take a snapshot of the status file of the change operation to be performed, and saving the snapshot file; Upon receiving the abnormal information, the upgrade log is traversed to determine the status file in the upgrade transaction where the abnormal information is located that has undergone a change operation, and recovery is performed based on the snapshot file corresponding to the status file that has undergone a change operation.

3. The system upgrade method according to claim 2, characterized in that, The steps for taking a snapshot of the status file for the change operation to be performed include: When the status file contains content that has been modified during a database upgrade, a snapshot is taken using the database checkpoint mechanism. When the status file contains content that was modified during system configuration upgrades or program upgrades, and the status file is smaller than a preset threshold, a snapshot is taken by backing up the status file. When the status file contains content that was modified during system configuration upgrades or program upgrades, and the status file is greater than or equal to a preset threshold, a snapshot is taken by calculating the binary differences between the status files before and after the change operation.

4. The system upgrade method according to claim 2, characterized in that, The system upgrade method also includes: Before parsing the transaction component package of the upgrade transaction, the upgrade content package is obtained and parsed, wherein the upgrade content package includes a global transaction configuration and several transaction component packages, and the global transaction configuration is used to configure each of the upgrade transactions; A transaction directory is created according to the global transaction configuration, wherein the upgrade transaction is completed when all the change operations in the transaction component package of the upgrade transaction are executed; and After one upgrade transaction is completed, the transaction component package of the next upgrade transaction is parsed according to the transaction catalog.

5. The system upgrade method according to claim 4, characterized in that, The upgrade content package also includes global verification rules and upgrade result verification configuration; the transaction component package also includes transaction verification rules; and the system upgrade method further includes: After parsing the upgrade content package and before creating the transaction directory according to the global transaction configuration, the rule verification plugin is invoked to perform verification according to the global verification rules. When the global verification rules are successfully verified, the step of creating the transaction directory according to the global transaction configuration is executed. After parsing the transaction component package of the upgrade transaction, before determining the change operation to be executed according to the transaction process configuration, the rule verification plugin is called to perform verification according to the transaction verification rules. When the transaction verification rule is successfully verified, the step of determining the change operation to be executed according to the transaction process configuration is executed. After an upgrade transaction is completed, the result verification plugin is invoked to verify the upgrade result of the upgrade transaction according to the upgrade result verification configuration.

6. An upgrade system, characterized in that, System upgrades involve several upgrade transactions. Upgrading the system includes a state change framework, upgrade plugins, and an upgrade framework. The upgrade framework is used to parse the transaction component package of the upgrade transaction and submit the transaction component package to the state change framework. The transaction component package includes state file configuration and transaction process configuration. The transaction process configuration includes the order configuration for executing each change operation. The state change framework is used to obtain the state file configuration, determine the change operations to be performed in the state file configuration, and call the upgrade plugin according to the type of the state file to be performed change operation. The state file configuration includes configuration for change operations on several state files. The state files are system content that can be modified in the system's operating environment, including content modified when implementing database upgrades, content modified when implementing system configuration upgrades, and content modified when implementing program upgrades. When the state change framework determines the change operation to be performed, the specific steps it performs include: determining the change operation to be performed according to the transaction flow configuration. The upgrade plugin is used to modify the status file.

7. The upgrade system according to claim 6, characterized in that, The upgrade system also includes a transaction manager and a snapshot plugin. The snapshot plugin is used to take a snapshot of the status file of the change operation to be performed, and submit the snapshot file to the transaction manager; The transaction manager is used to save the snapshot file; The upgrade plugin is also used to generate exception information and submit the exception information to the state change framework when the change operation is executed abnormally, and to submit the upgrade record to the transaction manager when the change operation is executed successfully. The transaction manager is also used to generate an upgrade log based on the upgrade records; The state change framework is also used to initiate a transaction rollback to the transaction manager when the exception information is received; The transaction manager is also used to, upon receiving a transaction rollback, traverse the upgrade log, determine the state file in the upgrade transaction where the exception information is located that has undergone change operations, and restore it based on the snapshot file corresponding to the state file that has undergone change operations.

8. The upgrade system according to claim 7, characterized in that, The upgrade framework is also used to obtain and parse the upgrade content package, wherein the upgrade content package includes a global transaction configuration and several transaction component packages, and the global transaction configuration is used to configure each of the upgrade transactions; The upgrade framework is also used to submit the configuration of each upgrade transaction to the transaction manager according to the global transaction configuration; The transaction manager is also used to create a transaction catalog based on the configuration of each of the upgrade transactions; The upgrade framework is also used to parse the transaction component package of the next upgrade transaction after one upgrade transaction is completed, wherein the upgrade transaction is completed when all the change operations in the transaction component package of the upgrade transaction are executed.

9. The upgrade system according to claim 8, characterized in that, The upgrade content package also includes a global verification rule file and an upgrade result verification configuration; the transaction component package also includes a transaction verification rule file; and the upgrade system also includes an upgrade verification framework, a rule verification plugin, an upgrade result inspection framework, and a result verification plugin. The upgrade framework is also used to submit the global verification rule file to the upgrade verification framework after parsing the upgrade content package and before submitting the configuration of each upgrade transaction to the transaction manager according to the global transaction configuration. The upgrade verification framework is used to call the rule verification plugin; The rule verification plugin is used to perform verification according to the global verification rule file, obtain a first verification result, and submit the first verification result to the upgrade framework; The upgrade framework is also used to submit the configuration of each upgrade transaction to the transaction manager according to the global transaction configuration when the first verification result is successful. The state change framework is also used to submit the transaction verification rule file to the upgrade verification framework before obtaining the state file configuration; The rule verification plugin is also used to perform verification according to the transaction verification rule file, obtain a second verification result, and submit the second verification result to the state change framework; The state change framework is also used to obtain the state file configuration when the second verification result is successful; The upgrade framework is also used to submit the upgrade result verification configuration to the upgrade result inspection framework after an upgrade transaction is completed; The upgrade result inspection framework is used to call the result verification plugin; The result verification plugin is used to verify the upgrade result of the upgrade transaction according to the upgrade result verification configuration.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.