System and method for upgrading and deploying intelligent software
By adopting an intelligent software upgrade and deployment system using P2P network technology in a distributed system, the problems of low software upgrade efficiency and high risk of misoperation in distributed systems are solved, achieving fast and efficient software upgrades and reducing operation and maintenance risks.
Patent Information
- Application Number
- CN202411402708.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The prior art is difficult to achieve efficient software upgrades in distributed systems, especially when manual operations are required, which can easily lead to low operation and maintenance efficiency, high risk of misoperation, and affect business continuity.
An intelligent software upgrade deployment system is designed, which uses P2P network technology to realize rapid distribution and parallel upgrade of software upgrade packages through automated communication between upgrade terminal devices and nodes in the distributed system, and supports online and offline upgrades.
It realizes fast and efficient software upgrade in distributed systems, reduces the risk of manual operation errors, and improves operation and maintenance efficiency and business reliability.
Smart Images

Figure CN119342057A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of distributed systems, and in particular relates to a system and method for intelligent software upgrade deployment. Background Art
[0002] As the demand for information technology services continues to grow, the scale of distributed systems is increasing, and their deployment and upgrade work is becoming increasingly complex, increasing the difficulty of efficient operation and maintenance. In non-virtualized scenarios, distributed systems are built on physical hardware devices, and the operation and maintenance of the entire distributed system mainly relies on manual serial operations by operation and maintenance personnel. If the operation and maintenance time is long, it will affect the normal operation of the business.
[0003] In addition, most software system upgrades can be performed directly without interrupting business operations, while some upgrades are similar to redeployment and require business suspension. In the traditional manual operation and maintenance model, efficiency is often affected by manpower limitations and individual proficiency. Since a large number of repetitive tasks need to be performed manually, such as monitoring system status, updating software, and handling faults, operation and maintenance personnel may become fatigued due to long hours of work, resulting in distraction and decreased reaction speed. In addition, human factors can easily lead to misoperation, such as negligence in configuration changes, data input, or script execution. These errors may cause system failures, data loss, or security vulnerabilities, thereby increasing operation and maintenance costs and the risk of business interruption. With the development of technology, the application of automated and intelligent operation and maintenance tools can effectively reduce these risks and improve the efficiency and accuracy of operation and maintenance.
[0004] P2P (Peer-to-Peer) technology, or peer-to-peer network technology, is a decentralized network architecture that allows nodes in the network to communicate and share resources directly with each other without going through a central server. This network architecture improves efficiency and scalability, and its applications include but are not limited to distributed computing and content distribution networks (CDN). Summary of the invention
[0005] 1. Technical issues to be resolved
[0006] The technical problem to be solved by the present invention is: to propose a system and method for intelligent software upgrade deployment to realize parallel upgrade of each node in a distributed system, which can not only ensure fast and efficient upgrades, but also reduce the risk of errors in manual operations through automated operations.
[0007] (II) Technical solution
[0008] In order to solve the above technical problems, the present invention provides a system for intelligent software upgrade deployment, including multiple servers and an upgrade terminal device;
[0009] Distributed system node services are run on multiple servers simultaneously to form a distributed system;
[0010] Each server supports two operating modes: business mode and upgrade mode;
[0011] Business mode: In this mode, the server enters the operating system running the distributed system business and executes the business;
[0012] Upgrade mode: In this mode, the server enters a lightweight operating system for offline server upgrades;
[0013] The business mode and upgrade mode run on two different operating systems, and these two operating systems are deployed on the same hard disk of the server. The upgrade mode uses a lightweight operating system, which is used to perform software upgrades in an environment where distributed system node services are running in non-business mode. The business mode runs the software of the distributed system. When the server starts the system, it can find the boot program GRUB through UEFI and load different partitions to switch the operating system.
[0014] In a normally functioning distributed system, each server operates in business mode;
[0015] The upgrade terminal device runs the software upgrade tool. When the distributed system needs to upgrade the software, the upgrade terminal device is used to perform the operation.
[0016] The present invention also provides a software upgrade method based on the system. When the distributed system requires each server to perform software upgrade, the management system of the distributed system is entered, and the IP acquisition mode of the management network port of the server is set to automatic acquisition;
[0017] The prepared software upgrade package is made into a torrent seed in the upgrade terminal device; the software upgrade package includes the upgrade file, the upgrade script and the upgrade configuration file; the upgrade configuration file includes the type of this upgrade, the upgraded version and the description of the relevant upgrade files, and the upgrade type includes online upgrade and offline upgrade;
[0018] Before making a torrent seed, upgrade the terminal device to configure the BitTorrent tracker to maintain the user information table; the user information table contains the IP and port information of all active users related to the torrent seed;
[0019] After the BitTorrent tracker is started, create the torrent seed, that is, create a file list, configure seed properties and generate a seed file;
[0020] A software upgrade agent is run on the server to communicate with the upgrade terminal device; the upgrade terminal device distributes the torrent seeds to each server through the SFTP protocol, and the software upgrade agent verifies the torrent seeds and feeds back the distribution results to the upgrade terminal device;
[0021] The server that has successfully distributed the content will open the torrent and download the software upgrade package.
[0022] (III) Beneficial effects
[0023] The software upgrade solution provided by the present invention adopts a P2P network download mode, which can quickly distribute software upgrade packages, and the more nodes that are upgraded simultaneously in a distributed system, the faster the software upgrade package distribution speed is. Compared with the multicast mode that can also realize data distribution, P2P does not require network devices (such as routers) to support special functions, while the multicast function requires network device support, otherwise multicast communication cannot be realized. In addition, the present invention can support the automated operation of online upgrades and offline upgrades, which is convenient and fast, and reduces the probability of erroneous operations. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is an architecture diagram of the software upgrade deployment system of the present invention;
[0025] Figure 2 This is a schematic diagram of software upgrade package distribution of the present invention;
[0026] Figure 3 This is a schematic diagram of peer-to-peer transmission of a software upgrade package in a local area network according to the present invention;
[0027] Figure 4 This is a flowchart of the software upgrade package upgrade of the present invention.
[0028] in:
[0029] 1 Server 2 Upgrade terminal equipment
[0030] 3 Management network port 4 Software upgrade package
[0031] 5Torrent Seeds 6BitTorrent Tracker
[0032] 7 User information table 8 Software upgrade agent. DETAILED DESCRIPTION
[0033] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.
[0034] The present invention provides a software upgrade deployment system, the overall scheme is as follows:
[0035] The system is implemented through a software upgrade server and an upgrade terminal device. In the method, the upgrade terminal device deployed with the software upgrade server is connected to the management network port of each node in the distributed system through Ethernet.
[0036] Each node in the distributed system contains two operating systems, corresponding to the business mode and upgrade mode respectively:
[0037] 1) Business model, that is, entering the business system and running the distributed system;
[0038] 2) Upgrade mode: After entering this mode, you can perform offline upgrade operations.
[0039] The software upgrade of distributed systems is divided into two types: online upgrade and offline upgrade:
[0040] 1) Online upgrade: In the business mode, the software upgrade package can directly modify and upgrade the business system by overwriting files and executing scripts;
[0041] 2) Offline upgrade: In the upgrade mode, after the nodes in the distributed system download the software upgrade package, the upgrade terminal device sends an upgrade instruction. After the instruction is issued, the distributed system modifies the system startup item, changes the system startup item to enter the upgrade mode after the system starts, and then executes the distributed system upgrade operation.
[0042] The operation and maintenance personnel configure the upgrade task by upgrading the terminal device, and distribute the software upgrade package and perform the software upgrade operation. The entire process of distributing the software upgrade package and performing the software upgrade is divided into two stages:
[0043] 1) The steps to distribute the software upgrade package are as follows:
[0044] a) Configure the management network port of the node to be upgraded in the distributed system to automatically obtain IP addresses, enable the DHCP server on the upgrade terminal device, and assign IP addresses to the node to be upgraded;
[0045] b) Make the software upgrade package into a torrent seed;
[0046] c) Distribute the torrent seeds to the nodes to be upgraded in the distributed system through the local area network using the SFTP protocol;
[0047] d) The node to be upgraded opens the torrent seed and downloads the software upgrade package.
[0048] 2) Software upgrade:
[0049] Subsequent upgrade operations are performed according to the upgrade type information in the software upgrade package. The upgrade operations are divided into online upgrades that do not require restarting the node, and offline upgrades that require restarting the node.
[0050] Specifically, the hardware platform required by the system consists of multiple servers 1 and an upgrade terminal device 2. Figure 1 As shown:
[0051] Distributed system node services are run on multiple servers 1 at the same time, forming a distributed system, such as a distributed computing system, a distributed storage system, etc. In order to ensure the reliability and stability of the distributed system, the operating system and software versions running on most nodes in the distributed system, that is, on each server 1, should be consistent. Therefore, the system consists of a distributed system that needs to be upgraded and an upgrade terminal device. The distributed system and the upgrade terminal device are in the same local area network, and the upgrade terminal device runs a DHCP server. The management network port in the distributed system can automatically obtain the IP assigned by the upgrade terminal device through DHCP.
[0052] The server 1 of the present invention supports two operation modes: a business mode and an upgrade mode.
[0053] Business mode: In this mode, server 1 enters the operating system running the distributed system business and executes the business;
[0054] Upgrade mode: In this mode, server 1 enters a lightweight operating system for offline upgrade of server 1.
[0055] The business mode and upgrade mode run on two different operating systems, and these two operating systems are deployed on the same hard disk of the server. The upgrade mode uses a lightweight operating system, whose main function is to perform software upgrades in an environment where distributed system node services are running in non-business mode; while the business mode uses a general operating system to run distributed system software. When the system starts, Server 1 can find the boot program GRUB through UEFI and load different partitions to switch the operating system (mode).
[0056] In a normally operating distributed system, each server 1 operates in a service mode.
[0057] The upgrade terminal device 2 can be a desktop computer or a server, and runs a software upgrade tool. When the distributed system needs to perform software upgrade, the upgrade terminal device 2 is used to perform the operation.
[0058] When the distributed system requires each server 1 to perform a software upgrade, the operation and maintenance personnel need to enter the management system of the distributed system and set the IP acquisition mode of the management network port 3 of the server to automatic acquisition;
[0059] The upgrade terminal device 2 and the management network port 3 of the distributed system are connected to the same local area network, and the DHCP server is started to allocate IP addresses to the management network ports 3 of each server 1 that needs to be upgraded in the local area network.
[0060] The operation and maintenance personnel make the prepared software upgrade package 4 into a torrent seed 5 in the upgrade terminal device 2; the software upgrade package 4 includes the upgrade file, upgrade script and upgrade configuration file; the upgrade configuration file includes the type of this upgrade (online upgrade / offline upgrade), the upgraded version and the description of the relevant upgrade files.
[0061] The following is a sample upgrade configuration file:
[0062] #Upgrade package metadata
[0063] metadata:
[0064] name:"software-upgrade"
[0065] version:1.2.3
[0066] type:"online"
[0067] releaseDate:"2024-09-11"
[0068] description: "This is a software upgrade package that includes bugfixes and new features."
[0069] #Pre-installation check
[0070] preInstall:
[0071] -"Checkcurrentsoftwareversion"
[0072] -"Ensure sufficientdiskspace"
[0073] #Installation steps
[0074] install:
[0075] -"Stop distributed system service"
[0076] -"Copyold filesto / opt / system / backup"
[0077] -"Copy newfiles in software upgrade packagetospecified directory"
[0078] -"Setappropriatefile permissions"
[0079] -"Restart distributed system service"
[0080] #Configuration File
[0081] config:
[0082] -"file:config / settings.yml"
[0083] options:
[0084] timeout:30
[0085] logging:"verbose"
[0086] #Start the script
[0087] scripts:
[0088] postInstall:"scripts / post_install.sh"
[0089] preUninstall:"scripts / pre_uninstall.sh"
[0090] #Rollback strategy
[0091] rollback:
[0092] -"Stop distributed system service"
[0093] -"Copyold files in / opt / system / backuptooriginal directory"
[0094] -"Setappropriatefile permissions"
[0095] -"Restart distributed system service"
[0096] #Upgrade package file list
[0097] files:
[0098] -"bin / serviced"
[0099] -"config / settings.yml"
[0100] -"scripts / install.sh"
[0101] -"scripts / rollback.sh"
[0102] Before making a torrent seed 5, the upgrade terminal device 2 needs to configure a BitTorrent tracker 6 for maintaining a user information table 7; the user information table 7 contains the IP and port information of all active users (servers 1) related to the torrent seed 5, ensuring that the BitTorrent clients in the server 1 can discover each other, so as to exchange file blocks and perform data transmission. In the present invention, the BitTorrent tracker 6 adopts a centralized tracker, which is hosted by the upgrade terminal device 2.
[0103] After the BitTorrent tracker 6 is started, a torrent seed is created 5, that is, a file list is created, seed properties are configured, and a seed file is generated.
[0104] like Figure 3 As shown, a software upgrade agent 8 runs on the server 1 for communicating with the upgrade terminal device 2; the upgrade terminal device 2 distributes the torrent seed 5 to each server 1 through the SFTP protocol, and the software upgrade agent 8 verifies the torrent seed 5 and feeds back the distribution result to the upgrade terminal device 2.
[0105] The server 1 that has successfully distributed the content will open the torrent seed 5 and download the software upgrade package 4.
[0106] like Figure 3 As shown, during the process of server 1 downloading software upgrade package 4, BitTorrent tracker 6 updates all servers 1 connected to it and records their IP addresses, port numbers and other related information; when a new server 1 connects to BitTorrent tracker 6, BitTorrent tracker 6 will provide a list of other downloaders and uploaders of the current software upgrade package 4. In this way, the servers 1 can exchange data of software upgrade package 4 with each other.
[0107] After server 1 downloads software upgrade package 4, it will be upgraded according to the content of the upgrade configuration file. For online upgrade, it only needs to deploy the upgrade file directly in the business mode and restart the distributed system service. For offline upgrade, the server needs to automatically enter the upgrade mode, deploy the software upgrade package, and then restart to enter the business mode to complete the entire upgrade. Figure 4 shown.
[0108] The following will explain the upgrade steps based on the two types of online upgrade and offline upgrade:
[0109] 1) Online upgrade: This type of upgrade mainly involves the update and upgrade of configuration files and service files (service files refer to executable files of specific services) in some distributed systems. These files can be replaced during the operation of the distributed system and the business service can be restarted. Therefore, this type of upgrade requires the following steps:
[0110] a) Back up the files to be overwritten (upgrade configuration files and service files);
[0111] b) Stop relevant business services;
[0112] c) Place the new file in the specified path;
[0113] d) Start relevant business services;
[0114] e) Delete the backup file.
[0115] 2) Offline upgrade: This type of upgrade mainly involves the version update and upgrade of the distributed system and the operating system kernel upgrade of server 1. It requires server 1 to process the files on the file system when the operating system is not started in the business mode; therefore, this type of upgrade requires the following steps:
[0116] a) After all the relevant servers 1 have completed receiving the software upgrade package 4, the distributed system service is stopped;
[0117] b) Modify the service mode operating system startup item of server 1 and switch the service mode to upgrade mode;
[0118] c) Restart server 1 and enter upgrade mode;
[0119] d) In the upgrade mode, mount the disk partition where the business mode operating system is located, and according to the requirements of the software upgrade package 4, back up the files to be overwritten and place the new files in the specified path;
[0120] e) After the operation is completed, modify the upgrade mode operating system startup item of server 1 to switch the upgrade mode to the business mode;
[0121] f) Restart server 1;
[0122] g) Delete the backup file.
[0123] During the distribution of the software upgrade package, the software upgrade package is downloaded and saved in the business mode operating system. Therefore, after the software upgrade is completed, the operation and maintenance personnel can configure whether server 1 continues to provide the software upgrade package upload service. If it continues to provide, the user information table 7 in the BitTorrent tracker 6 will continue to retain the information of the server 1; if it is no longer provided, the relevant information of the server 1 in the user information table 7 in the BitTorrent tracker 6 will be deleted, and the configuration of automatic acquisition of the management network port IP will be closed.
[0124] If the software fails to upgrade, you can roll back the software to the state before the upgrade. The rollback operations for online and offline upgrades are described as follows:
[0125] 1) Rollback operation of online upgrade:
[0126] a) Stop relevant business services;
[0127] b) Place the backup file in the specified path;
[0128] c) Restart relevant business services;
[0129] d) Delete the backup file.
[0130] 2) Rollback operation of offline upgrade:
[0131] a) Modify the service mode operating system startup item of server 1 and switch it to upgrade mode;
[0132] b) Restart server 1 and enter upgrade mode;
[0133] c) In the upgrade mode, mount the disk partition where the business mode operating system is located, and copy the backed-up files to the specified path according to the modified content of the software upgrade package 4;
[0134] d) After the operation is completed, modify the upgrade mode operating system startup item of server 1 and switch to business mode;
[0135] e) Restart server 1;
[0136] f) After the service mode of server 1 is successfully started, the backup file is deleted.
[0137] It can be seen that the present invention provides a system and method for intelligent software upgrade deployment, which is implemented based on multiple devices to be upgraded in a local area network and is particularly suitable for distributed systems. The present invention distributes the upgrade package to all devices to be upgraded in a P2P manner; the devices can be upgraded online and offline; the online upgrade automatically updates the software when the business system on the device is running normally; the offline upgrade requires entering the upgrade mode, in which the upgrade package is used to upgrade the device business system.
[0138] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A system for intelligent software upgrade deployment, characterized in that: Includes multiple servers and an upgrade terminal device; Distributed system node services are run on multiple servers simultaneously to form a distributed system; Each server supports two operating modes: business mode and upgrade mode; Business mode: In this mode, the server enters the operating system running the distributed system business and executes the business; Upgrade mode: In this mode, the server enters a lightweight operating system for offline server upgrades; The business mode and upgrade mode run on two different operating systems, and these two operating systems are deployed on the same hard disk of the server. The upgrade mode uses a lightweight operating system, which is used to perform software upgrades in an environment where distributed system node services are running in non-business mode. The business mode runs the software of the distributed system. When the server starts the system, it can find the boot program GRUB through UEFI and load different partitions to switch the operating system. In a normally functioning distributed system, each server operates in business mode; The upgrade terminal device runs the software upgrade tool. When the distributed system needs to upgrade the software, the upgrade terminal device is used to perform the operation.
2. The system according to claim 1, characterized in that The upgrade terminal device is connected to the same local area network as the management network port of the distributed system, and allocates IP addresses to the management network ports of each server that needs to be upgraded in the local area network by starting the DHCP server.
3. The system according to claim 2, characterized in that The distributed system is a distributed computing system or a distributed storage system.
4. The system according to claim 2, characterized in that The upgrade terminal device is a desktop computer or a server.
5. A software upgrade method implemented based on the system according to any one of claims 2 to 4, characterized in that: When the distributed system requires each server to perform a software upgrade, enter the management system of the distributed system and set the IP acquisition mode of the server's management network port to automatic acquisition; The prepared software upgrade package is made into a torrent seed in the upgrade terminal device; the software upgrade package includes the upgrade file, the upgrade script and the upgrade configuration file; the upgrade configuration file includes the type of this upgrade, the upgraded version and the description of the relevant upgrade files, and the upgrade type includes online upgrade and offline upgrade; Before creating a torrent seed, upgrade the terminal device to configure the BitTorrent tracker to maintain the user information table; the user information table contains the IP and port information of all active users related to the torrent seed; After the BitTorrent tracker is started, create the torrent seed, that is, create a file list, configure seed properties and generate a seed file; A software upgrade agent runs on the server to communicate with the upgrade terminal device; The upgrade terminal device distributes the torrent seeds to each server through the SFTP protocol. The software upgrade agent verifies the torrent seeds and feeds back the distribution results to the upgrade terminal device. The server that has successfully distributed the content will open the torrent and download the software upgrade package.
6. The method according to claim 5, characterized in that The BitTorrent tracker 6 adopts a centralized tracker and is hosted by an upgraded terminal device.
7. The method according to claim 5, characterized in that While the server is downloading the software upgrade package, the BitTorrent tracker updates all servers connected to it and records their IP addresses and port numbers. When a new server connects to the BitTorrent tracker, the BitTorrent tracker provides a list of other downloaders and uploaders of the current software upgrade package, so that the servers can exchange data on the software upgrade package with each other.
8. The method according to claim 7, characterized in that After the server finishes downloading the software upgrade package, it will be upgraded according to the contents of the upgrade configuration file. For online upgrade, you only need to deploy the upgrade file directly in the business mode and restart the distributed system service. For offline upgrade, the server needs to automatically enter the upgrade mode, deploy the software upgrade package, and then restart to enter the business mode to complete the entire upgrade.
9. The method according to claim 8, characterized in that The steps for online upgrade and offline upgrade are as follows: 1) Online upgrade: Online upgrade involves updating and upgrading configuration files and service files in some distributed systems. These files are replaced during the operation of the distributed system and the business service is restarted to complete. The service file refers to the executable file of a specific business. Therefore, online upgrade includes the following steps: a) Back up the files to be overwritten; b) Stop relevant business services; c) Place the new file in the specified path; d) Start relevant business services; e) Delete backup files; 2) Offline upgrade: Offline upgrade involves the version update and upgrade of the distributed system and the upgrade of the server's operating system kernel. It requires the server to process the files on the file system when the operating system is not started in business mode; therefore, offline upgrade performs the following steps: a) After all relevant servers have completed receiving the software upgrade package, stop running the distributed system business; b) Modify the server's business mode operating system startup item and switch the business mode to upgrade mode; c) Restart the server and enter the upgrade mode; d) In upgrade mode, mount the disk partition where the business mode operating system is located, and according to the requirements of the software upgrade package, back up the files to be overwritten and place the new files in the specified path; e) After the operation is completed, modify the server's upgrade mode operating system startup item and switch the upgrade mode to business mode; f) Restart the server; g) Delete the backup file.
10. The method according to claim 9, characterized in that If an upgrade fails during the software upgrade, you can roll back the software to the state before the upgrade through a rollback operation. The rollback operations for online and offline upgrades are as follows: 1) Rollback operation of online upgrade: a) Stop relevant business services; b) Place the backup file in the specified path; c) Restart relevant business services; d) Delete backup files; 2) Rollback operation of offline upgrade: a) Modify the server's business mode operating system startup item and switch to upgrade mode; b) Restart the server and enter the upgrade mode; c) In upgrade mode, mount the disk partition where the business mode operating system is located, and copy the backed-up files to the specified path according to the modified content of the software upgrade package; d) After the operation is completed, modify the server's upgrade mode operating system startup item and switch to business mode; e) Restart the server; f) After the server business mode is successfully started, delete the backup file.
Citation Information
Patent Citations
On-line updating method and system for client side software on basis of P2SP (Peer to Server and to Peer)
CN102065110A
Automatic upgrading and releasing system and method for application software in distributed network environment
CN105740019A
Software upgrade package downloading method and system and storage medium
CN110267107A