Method for optimizing server upgrading
By comparing the current configuration data of the server with the data to be upgraded, identifying and writing differential data, incremental upgrade of the server is achieved, solving problems such as high time consumption and waste of resources in traditional upgrade methods, and improving upgrade efficiency and system stability.
Patent Information
- Application Number
- CN202510197493.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-20
AI Technical Summary
Traditional server upgrade methods have problems such as high time consumption, waste of resources, delay in startup time and data integrity and security risks, which affect the continuity and availability of servers.
By collecting the current configuration data of the server and the new configuration data to be upgraded, the differential data is identified, and written to the server's flash memory or storage medium in incremental ways to update and upgrade the server.
This method significantly shortens upgrade time, reduces server downtime, saves storage space and bandwidth, and improves system response speed and stability.
Smart Images

Figure CN120179273A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of server upgrades, and particularly relates to a method for optimizing server upgrades. Background Art
[0002] In modern server management, software and firmware upgrades of servers are a routine and crucial operation for fixing vulnerabilities, enhancing performance, and supporting new functions. Traditional server upgrade methods usually involve writing a complete upgrade file or image to the flash memory or other storage media of the server. This method has several problems:
[0003] Time consumption: Traditional full-scale upgrades require writing the entire file or image to the flash memory, which not only takes a long time but also may increase the downtime of the server during the upgrade, affecting the continuity and availability of services.
[0004] Resource waste: Full-scale upgrades overwrite the entire file or image on the server, resulting in waste of storage media resources even if most of the data has not changed.
[0005] Startup time delay: After the upgrade is completed, the server may take a long time to verify and apply the new configuration, extending the startup time after the upgrade and affecting the system's response speed.
[0006] Data integrity and security risks: During the full-scale upgrade process, if the operation is not careful or an interruption occurs, it may lead to data loss, damage, or inconsistency, thereby affecting the stability and security of the system.
[0007] Therefore, how to improve the existing server upgrade process to shorten the full-scale upgrade time and the downtime of the server during the upgrade, reduce the waste of storage media resources, reduce the startup time after the upgrade, and enhance the system's response speed as well as the stability and security of the system is a technical problem that urgently needs to be solved at present. Summary of the Invention
[0008] The purpose of the present invention is to provide a method for optimizing server upgrades to improve the existing server upgrade process, so as to shorten the full-scale upgrade time and the downtime of the server during the upgrade, reduce the waste of storage media resources, reduce the startup time after the upgrade, and enhance the system's response speed as well as the stability and security of the system.
[0009] To solve the above technical problems, the technical solution adopted by the present invention is as follows:
[0010] A method for optimizing server upgrades includes the following steps:
[0011] S1: Collect the current configuration data of the server to obtain the current configuration status of the server;
[0012] S2: Obtain the new configuration data to be upgraded through network download or local storage media;
[0013] S3: Compare and analyze the current configuration data of the server with the new configuration data to be upgraded to identify the difference data between the current configuration data and the new configuration data;
[0014] S4: Locate the storage location to be written for the identified difference data between the current configuration data and the new configuration data;
[0015] S5: Write the identified difference data between the current configuration data and the new configuration data into the flash memory or preset storage medium of the server in an incremental manner;
[0016] S6: Update and upgrade the server based on the data written into the flash memory or preset storage medium of the server, and verify and test the server after the update and upgrade.
[0017] Preferably, the configuration data in step 1 includes the software version number, the content of the configuration file, and the system parameter settings, and the new configuration data to be upgraded includes the new version of the software, the updated configuration file, and the modified system parameters.
[0018] Preferably, the specific process of comparing and analyzing the current configuration data of the server with the new configuration data to be upgraded in step S3 is as follows:
[0019] S31: Let the current configuration data of the server be data block A, and the new configuration data to be upgraded be data block B;
[0020] S32: Calculate the hash value hash_A of data block A and the hash value hash_B of data block B respectively. The specific calculation formula is as follows:
[0021] hash_A = hash(current_config_data);
[0022] hash_B = hash(upgrade_config_data);
[0023] where hash(·) is the hash operation, current_config_data is the current configuration data of the server, and upgrade_config_data is the new configuration data to be upgraded;
[0024] S33: Compare the hash value hash_A of data block A and the hash value hash_B of data block B to generate the difference data.
[0025] Preferably, the hash table hash_A is obtained by traversing the data block A, the data block B is traversed, and each element is checked to see if it is in the hash table hash_A. The elements not in the hash table hash_A are added to the differential hash table hash_B to generate differential data.
[0026] Preferably, after generating the differential data, the specific process of detecting the correctness and consistency of the data in step S5 is as follows:
[0027] S51: Insert node markers at preset positions for the differential data of the storage locations, and divide the differential data into multiple node data according to the node markers;
[0028] S52: Calculate the hash value of each node and the hash value of each data key;
[0029] S53: Map the hash value of the node and the hash value of the data key to a continuous numerical space, and the numerical space is a ring;
[0030] S54: Find the node closest in distance to the hash value of the data key along the ring clockwise or counterclockwise, and store the data on this node;
[0031] S55: Map the hash value of the generated differential data and the hash value of the data key to another continuous numerical space according to steps S51 - S54, that is, establish another ring;
[0032] S55: Overlap the two rings and judge the consistency of the two rings.
[0033] Preferably, the node marker uses the IP address of the node, the host name, or the unique identifier of the machine, and the hash value of the data key is the ID or name of the data.
[0034] Preferably, the specific process of server update and upgrade based on the data in the flash memory or preset storage medium of the writing server is as follows:
[0035] S61: Automatically back up the specified data on the server and analyze the current running state of the server;
[0036] S62: Match the current upgrade strategy according to the current running state of the server, and the upgrade strategy includes the horizontal expansion method or the vertical expansion method;
[0037] S63: Upgrade the hardware components of the server, including the CPU, memory, or storage, according to the horizontal expansion method or the vertical expansion method; or update and upgrade the operating system and application programs;
[0038] S64: Create a new server instance on the cloud platform of the server, and migrate the backed-up data to the newly created server instance;
[0039] S65: Conduct comprehensive testing and verification on the new instance.
[0040] The beneficial effects of the present invention include:
[0041] The method for optimizing server upgrade provided by the present invention includes: collecting the current configuration data of the server to obtain the current configuration status of the server; obtaining the new configuration data to be upgraded through network download or local storage medium; comparing and analyzing the current configuration data of the server with the new configuration data to be upgraded to identify the difference data between the current configuration data and the new configuration data; positioning the storage location to be written for the identified difference data between the current configuration data and the new configuration data; writing the identified difference data between the current configuration data and the new configuration data into the flash memory or preset storage medium of the server in an incremental manner; performing server update and upgrade based on the data written into the flash memory or preset storage medium of the server, and verifying and testing the server after the update and upgrade. By obtaining the difference data, incremental update is achieved, which improves the upgrade efficiency, saves storage space and bandwidth.
[0042] First, by setting the current configuration data of the server as data block A and the new configuration data to be upgraded as data block B, calculating the hash value hash_A of data block A and the hash value hash_B of data block B respectively, and comparing the hash value hash_A of data block A and the hash value hash_B of data block B to generate the difference data, it realizes the efficient acquisition of the difference data between the current configuration data and the configuration data to be upgraded, enabling only the changed part of the data to be processed, effectively reducing the requirements for storage space and bandwidth, and saving valuable resources.
[0043] Second, it is also possible to traverse data block A to obtain the hash table hash_A, traverse data block B, and check whether each element is in the hash table hash_A, and add the elements not in the hash table hash_A to the difference hash table hash_B to generate the difference data, which can also effectively reduce the time and space for writing and storing during the traditional full - scale upgrade file process, improve the upgrade efficiency, and reduce the requirements for storage space and bandwidth. Since only the changed part of the data needs to be processed instead of the entire file, the present invention significantly shortens the execution time of the upgrade. This not only reduces the downtime of the server during the upgrade process but also improves the continuity and availability of the service.
[0044] Again, by inserting the differential data of the storage location into the node markers at the preset location, the differential data is divided into multiple node data according to the node markers; calculate the hash value of each node and the hash value of each data key; map the hash value of the node and the hash value of the data key to a continuous numerical space, and the numerical space is a circular ring; find the node closest in distance along the circular ring in the clockwise or counterclockwise direction for the hash value of the data key, and store the data on this node; map the hash values of the generated differential data and the data key to another continuous numerical space according to steps S51 - S54, that is, establish another circular ring; nest the two circular rings, which can accurately and efficiently judge the consistency of the two circular rings and ensure the accuracy of the upgraded data.
[0045] Finally, automatically back up the specified data on the server and analyze the current running state of the server; match the current upgrade strategy according to the current running state of the server, and the upgrade strategy includes the horizontal expansion method or the vertical expansion method; upgrade the hardware components of the server according to the horizontal expansion method or the vertical expansion method; create a new server instance on the cloud platform of the server, migrate the backed-up data to the newly created server instance, and conduct comprehensive testing and verification on the new instance, which can effectively reduce the risk of data loss and segmentation during the server upgrade process. Brief Description of the Drawings
[0046] Figure 1 It is a schematic diagram of the hash algorithm difference comparison process in the optimized server upgrade of the present invention.
[0047] Figure 2 It is a schematic diagram of the process of the optimized server upgrade method of the present invention.
[0048] Figure 3 It is a schematic diagram of the steps of the optimized server upgrade method of the present invention. Detailed Embodiment
[0049] The following further elaborates on the present invention in conjunction with the attached Figures 1 to 3 For a more detailed description of the present invention:
[0050] Embodiment 1
[0051] Refer to the attached Figure 2 and Figure 3 As shown, a method for optimizing server upgrade includes the following steps:
[0052] S1: Collect the current configuration data of the server to obtain the current configuration state of the server;
[0053] S2: Obtain the new configuration data to be upgraded through network download or local storage medium;
[0054] S3: Compare and analyze the current configuration data of the server with the new configuration data to be upgraded to identify the difference data between the current configuration data and the new configuration data;
[0055] S4: Locate the storage location to which the identified difference data between the current configuration data and the new configuration data is to be written;
[0056] S5: Write the identified difference data between the current configuration data and the new configuration data into the flash memory or a preset storage medium of the server in an incremental manner;
[0057] S6: Update and upgrade the server based on the data written into the flash memory or the preset storage medium of the server, and verify and test the server after the update and upgrade.
[0058] In this embodiment, the configuration data in step 1 includes the software version number, the content of the configuration file, and the system parameter settings, and the new configuration data to be upgraded includes the new version of the software, the updated configuration file, and the modified system parameters.
[0059] The traditional full - scale upgrade method requires writing the entire upgrade file into the server storage medium. However, the present invention, through the incremental upgrade method, only processes the changed part of the data, effectively reducing the requirements for storage space and bandwidth and saving valuable resources. Also, precisely because only the changed data part needs to be processed instead of the entire file, the present invention significantly shortens the execution time of the upgrade. This not only reduces the downtime of the server during the upgrade process but also improves the continuity and availability of the service. After the upgrade is completed, the present invention significantly shortens the startup time delay of the server through an optimized startup time processing method. This is particularly important for those application scenarios that require quick recovery and response.
[0060] Embodiment 2
[0061] Based on Embodiment 1, as shown in Figure 1 The specific process of comparing and analyzing the current configuration data of the server with the new configuration data to be upgraded in step S3 is as follows:
[0062] S31: Let the current configuration data of the server be data block A, and the new configuration data to be upgraded be data block B;
[0063] S32: Calculate the hash value hash_A of data block A and the hash value hash_B of data block B respectively. The specific calculation formula is as follows:
[0064] hash_A = hash(current_config_data);
[0065] hash_B = hash(upgrade_config_data);
[0066] Wherein, hash(·) is a hash operation, current_config_data is the current configuration data of the server, and upgrade_config_data is the new configuration data to be upgraded;
[0067] S33: Compare the hash value hash_A of data block A and the hash value hash_B of data block B to generate differential data.
[0068] In another implementation manner of this embodiment, traverse data block A to obtain hash table hash_A, traverse data block B, and check whether each element is in hash table hash_A. Add the elements not in hash table hash_A to differential hash table hash_B to generate differential data.
[0069] Embodiment 3
[0070] Based on Embodiment 1 or Embodiment 2, after generating differential data, the specific process of detecting the correctness and consistency of the data in step S5 is as follows:
[0071] S51: Insert node markers at preset positions for the differential data of the storage location, and divide the differential data into multiple node data according to the node markers;
[0072] S52: Calculate the hash value of each node and the hash value of each data key;
[0073] S53: Map the hash value of the node and the hash value of the data key to a continuous numerical space, and the numerical space is a ring;
[0074] S54: Find the node closest in distance to the hash value of the data key along the ring clockwise or counterclockwise, and store the data on this node;
[0075] S55: Map the hash value of the generated differential data and the hash value of the data key to another continuous numerical space according to steps S51 - S54, that is, establish another ring;
[0076] S55: Nest the two rings and judge the consistency of the two rings.
[0077] In this embodiment, the node marker uses the IP address of the node, the host name, or the unique identifier of the machine, and the hash value of the data key is the ID or name of the data.
[0078] The specific process of server update and upgrade based on the data written to the flash memory or preset storage medium of the server is as follows:
[0079] S61: Automatically back up the specified data on the server and analyze the current running status of the server;
[0080] S62: Match the current upgrade strategy according to the current running status of the server, where the upgrade strategy includes a horizontal expansion method or a vertical expansion method;
[0081] S63: Upgrade the hardware components of the server, including the CPU, memory, or storage, according to the horizontal expansion method or the vertical expansion method; or update and upgrade the operating system and application programs;
[0082] S64: Create a new server instance on the cloud platform of the server and migrate the backed-up data to the newly created server instance;
[0083] S65: Conduct comprehensive testing and verification on the new instance.
[0084] By means of precise comparison and data writing, the present invention ensures the integrity and security of data during the upgrade process. It avoids the overwriting or damage of irrelevant data and improves the stability and security of system operation. The incremental update strategy adopted by the present invention is not only applicable to the upgrade of software versions, but also can be applied to various types of updates such as configuration files and system parameters, with high flexibility and adaptability.
[0085] In summary, the method for optimizing server upgrade provided by the present invention obtains the current configuration status of the server by collecting the current configuration data of the server; obtains the new configuration data to be upgraded through network download or local storage medium; compares and analyzes the current configuration data of the server with the new configuration data to be upgraded to identify the difference data between the current configuration data and the new configuration data; locates the storage location to be written for the identified difference data between the current configuration data and the new configuration data; writes the identified difference data between the current configuration data and the new configuration data into the flash memory or preset storage medium of the server in an incremental manner; performs server update and upgrade based on the data written into the flash memory or preset storage medium of the server, and conducts verification and testing on the server after the update and upgrade. By obtaining the difference data to achieve incremental update, the upgrade efficiency is improved, and storage space and bandwidth are saved.
[0086] By separately calculating the hash value hash_A of data block A and the hash value hash_B of data block B, and comparing the hash value hash_A of data block A and the hash value hash_B of data block B to generate differential data, it realizes the efficient acquisition of the differential data between the current configuration data and the configuration data to be upgraded, enabling only the parts of the data that have changed to be processed, effectively reducing the requirements for storage space and bandwidth, and saving valuable resources. By traversing data block A to obtain the hash table hash_A, traversing data block B, and checking whether each element is in the hash table hash_A, and adding the elements not in the hash table hash_A to the differential hash table hash_B to generate differential data, it can also effectively reduce the time and space for writing and storing during the traditional full-scale file upgrade process, improve the upgrade efficiency, and reduce the requirements for storage space and bandwidth. Since only the changed parts of the data need to be processed instead of the entire file, the present invention significantly shortens the execution time of the upgrade. This not only reduces the downtime of the server during the upgrade process but also improves the continuity and availability of the service.
[0087] By inserting the differential data of the storage location at a preset location with a node marker, dividing the differential data into multiple node data according to the node marker; calculating the hash value of each node and the hash value of each data key; mapping the hash value of the node and the hash value of the data key to a continuous numerical space, and the numerical space is a ring; finding the node closest in distance along the ring clockwise or counterclockwise according to the hash value of the data key and storing the data on this node; mapping the hash value of the generated differential data and the hash value of the data key to another continuous numerical space according to steps S51 - S54, that is, establishing another ring; nesting the two rings can accurately and efficiently judge the consistency of the two rings and ensure the accuracy of the upgraded data. Automatically backing up the specified data on the server and analyzing the current running state of the server; matching the current upgrade strategy according to the current running state of the server, and the upgrade strategy includes the horizontal expansion method or the vertical expansion method; upgrading the hardware components of the server according to the horizontal expansion method or the vertical expansion method; creating a new server instance on the cloud platform of the server, migrating the backed-up data to the created new server instance, and conducting comprehensive testing and verification on the new instance, which can effectively reduce the risk of data loss and segmentation during the server upgrade process.
Claims
1. A method for optimizing server upgrade, characterized in that: The following steps are involved: S1: Collect the current configuration data of the server and obtain the current configuration status of the server; S2: Obtain new configuration data to be upgraded through network download or local storage medium; S3: Compare and analyze the current configuration data of the server with the new configuration data to be upgraded to identify difference data between the current configuration data and the new configuration data; S4: Locating the storage location to be written of the identified difference data between the current configuration data and the new configuration data; S5: writing the identified difference data between the current configuration data and the new configuration data into the flash memory or a preset storage medium of the server in an incremental manner; S6: Update and upgrade the server based on the data written into the flash memory or the preset storage medium of the server, and verify and test the server after the update and upgrade.
2. A method for optimizing server upgrade according to claim 1, characterized in that: The configuration data in step 1 includes the software version number, the content of the configuration file and the system parameter settings, and the new configuration data to be upgraded includes the new version of the software, the updated configuration file and the modified system parameters.
3. A method for optimizing server upgrade according to claim 1, characterized in that: The specific process of comparing and analyzing the current configuration data of the server with the new configuration data to be upgraded in step S3 is as follows: S31: Let the current configuration data of the server be data block A, and the new configuration data to be upgraded be data block B; S32: Calculate the hash value hash_A of data block A and the hash value hash_B of data block B respectively. The specific calculation formula is as follows: hash_A=hash(current_config_data); hash_B=hash(upgrade_config_data); Wherein, hash(·) is a hash operation, current_config_data is the current configuration data of the server, and upgrade_config_data is the new configuration data to be upgraded; S33: Compare the hash value hash_A of data block A and the hash value hash_B of data block B to generate difference data.
4. The method for optimizing server upgrade according to claim 1, characterized in that: By traversing data block A to obtain hash table hash_A, traversing data block B, and checking whether each element is in hash table hash_A, the elements not in hash table hash_A are added to difference hash table hash_B to generate difference data.
5. A method for optimizing server upgrade according to claim 3, characterized in that: After the difference data is generated, the specific process of checking the correctness and consistency of the data in step S5 is as follows: S51: inserting the difference data at the storage location into a node mark at a preset location, and dividing the difference data into a plurality of node data according to the node mark; S52: Calculate the hash value of each node and the hash value of each data key; S53: Mapping the hash value of the node and the hash value of the data key to a continuous numerical space, where the numerical space is a ring; S54: finding the nearest node along the ring clockwise or counterclockwise based on the hash value of the data key, and storing the data on the node; S55: Mapping the generated hash value of the difference data and the hash value of the data key to another continuous numerical space according to steps S51-S54, that is, establishing another ring; S55: Overlap the two rings to determine the consistency of the two rings.
6. A method for optimizing server upgrade according to claim 5, characterized in that: The node tag uses the node's IP address, host name or unique identifier of the machine, and the hash value of the data key is the ID or name of the data.
7. A method for optimizing server upgrade according to claim 1, characterized in that: The specific process of updating and upgrading a server based on the data written into the server's flash memory or preset storage medium is as follows: S61: automatically backing up designated data on the server and analyzing the current operating status of the server; S62: matching a current upgrade strategy according to a current running state of the server, wherein the upgrade strategy includes a horizontal expansion mode or a vertical expansion mode; S63: Upgrading hardware components of the server, including CPU, memory or storage, according to a horizontal expansion method or a vertical expansion method; or updating and upgrading the operating system and application program; S64: creating a new server instance on the cloud platform of the server, and migrating the backed-up data to the created new server instance; S65: Fully tested and validated on new instances.