A method and system for uninterrupted service upgrade
Through functional service plug-in and dynamic methods, shared memory is used to process business data during the server upgrade process, which solves the problems of upgrade process interruption and complex configuration in the existing technology, and achieves uninterrupted server upgrades and increased upgrade speed.
Patent Information
- Application Number
- CN202011387387.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-01
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-12-01
AI Technical Summary
In the existing technology, the server upgrade process requires interrupting services or configuring complex load balancing, resulting in business interruption and slow upgrade speed, affecting user experience.
Adopt functional service plug-in and dynamic methods, automatically detect upgrade files through the Web upgrade management platform, use shared memory to process business data during the upgrade process, and switch between old and new business processing processes without interrupting services to achieve smooth upgrades.
It achieves uninterrupted server upgrades, reduces user losses and upgrade time, and improves upgrade speed and system stability.
Smart Images

Figure CN112596771B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer information technology, and in particular to a method for providing upgrade services for a server. Background Art
[0002] With the rapid development of Internet technology, web applications are also constantly upgrading. Upgrading means that one software replaces one or more parts or even all of the previous software. Its essence is to replace one software with another to provide services, which requires uninterrupted business release and update. In software development, in order to facilitate the functional expansion of the software, plug-in development can be adopted. The functions to be implemented by the software are encapsulated in the plug-in. A plug-in corresponds to one or more functional modules. Finally, each plug-in is integrated into the main software package and released together.
[0003] In network service applications, the server part is mainly composed of two parts: one is the network connection, providing network connection services; the other is specific business or data, typically file storage servers and database servers. Due to the increase in business, services, software bug fixes and other reasons, it is necessary to upgrade the running services, and the actual business requirement is to provide services 24 hours a day without interruption. Figure 1 The diagram of the uninterrupted service architecture of the email DLP system is shown. The email DLP system performs 24-hour uninterrupted scanning of sensitive information on emails in the email system. In the prior art, there are two main types of service upgrades: one is the upgrade of interrupted services, and the other is to dynamically transfer services to other similar servers through load balancing, and the target server is upgraded offline. The first type of interrupted service upgrades typically involves stopping the service, re-upgrading the service, and then restarting it. The second type of uninterrupted service upgrades uses a load balancing scheduler to dispatch the services on the target server that need to be upgraded to other similar servers. This method has high environmental requirements and complex configuration. Summary of the invention
[0004] In order to overcome the problems existing in the prior art, the present application adopts a method of plug-in and dynamic function service. The plug-in code is only loaded on demand by the application, so that the program can make smaller requirements on the memory and start faster. During the upgrade process, the execution of the business will not be interrupted. The upgrade speed is fast, the system can be upgraded smoothly, and the inconvenience and loss caused to users by the upgrade are reduced.
[0005] Specifically, the present invention proposes a method for uninterrupted service upgrade, comprising the following steps:
[0006] S1. Send upgrade service request
[0007] The Web upgrade management platform receives the pushed upgrade file, automatically searches for the corresponding upgrade process and the adapted plug-in version according to the process service file, and sends an upgrade service request to the process that needs to be upgraded after determining that there is a file that needs to be upgraded;
[0008] S2. Start uninterrupted service upgrade
[0009] The first service processing process puts the service data to be processed during the upgrade process into the shared memory, and retains the first service entry thread; starts the second service entry thread, and directly obtains the service data from the shared memory; after processing all the service data, closes the first service entry thread, and the service upgrade is completed;
[0010] S3.Maintenance service plug-in
[0011] After the service upgrade is complete, perform service plug-in maintenance.
[0012] Optionally, step S2 includes:
[0013] S21. Start the uninterrupted upgrade process and change the process status to upgrading;
[0014] S22. The first business processing process puts the business data to be processed during the upgrade process into the shared memory, and then closes the first business processing module, leaving only the first business entry thread;
[0015] S23. Start the second business processing process, the second business processing module and the second business entry thread, and the second business entry thread obtains the business data of the first business processing process from the shared memory;
[0016] S24. Determine whether all the business data in the shared memory has been acquired and processed. If so, close the first business entry thread and the first business processing process, switch between the old and new business processing processes, and complete the service upgrade.
[0017] The present invention also proposes a system for uninterrupted service upgrade, comprising:
[0018] The Web upgrade management platform is configured to: automatically detect upgrade file service requests, import the process service file to be upgraded when it is determined that there is a file that needs to be upgraded, and automatically find the corresponding upgrade process and the adapted plug-in version according to the process service file;
[0019] A request module is configured to: send an upgrade request to a file to be upgraded by using an upgrade process, start the file upgrade, and modify the process status to being upgraded;
[0020] Upgrade module, which is configured as:
[0021] The first service processing process puts the service data to be processed during the upgrade process into the shared memory, and retains the first service entry thread; starts the second service entry thread, and directly obtains the service data from the shared memory; after processing all the service data, closes the first service entry thread, and the service upgrade is completed;
[0022] The plug-in maintenance module is configured to perform service plug-in maintenance after the upgrade is completed.
[0023] The rollback module is configured to perform upgrade rollback according to the rollback version selected by the user if the upgrade is unsuccessful.
[0024] In addition, the present invention also proposes a computer-readable storage medium, in which a plurality of instructions are stored; the method for uninterrupted service upgrade of the present invention is loaded and executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 The architecture diagram of the email DLP system's uninterrupted service is shown;
[0026] Figure 2 A flow chart of the method for uninterrupted service upgrade of the present invention;
[0027] Figure 3 The non-stop service upgrade process is shown;
[0028] Figure 4 The service plug-in maintenance flow chart is shown. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0030] Figure 2 A flow chart showing the method for uninterrupted service upgrade of the present invention is shown.
[0031] The present invention proposes a method for uninterrupted service upgrade, comprising the following steps:
[0032] S1. The Web upgrade management platform automatically detects upgrade file service requests. When it is determined that a file needs to be upgraded, it imports the process service file to be upgraded and searches for the corresponding upgrade process and the adapted plug-in version according to the process service file.
[0033] Import the process service file that needs to be upgraded in the Web management platform upgrade management. The management platform will find the corresponding upgrade process based on the MD5 of the process file. The file information in the upgrade request mainly includes the file name and version information of each file contained in the software to be upgraded, and can further include the HASH value and relative path of each file.
[0034] S2. Start uninterrupted service upgrade
[0035] The first business processing process puts the business data that needs to be processed during the upgrade process into the shared memory and retains the first business entry thread; starts the second business entry thread and directly obtains the business data from the shared memory; after processing all the business data, closes the first business entry thread and the service upgrade is completed.
[0036] Figure 3 The non-stop service upgrade process is shown, which includes the following steps:
[0037] S21. Start the uninterrupted upgrade process and change the process status to upgrading;
[0038] S22. The first business processing process puts the business data to be processed during the upgrade process into the shared memory, and then closes the first business processing module, leaving only the first business entry thread;
[0039] S23. Start the second business processing process, the second business processing module and the second business entry thread, and the second business entry thread obtains the business data of the first business processing process from the shared memory;
[0040] S24. Determine whether all the business data in the shared memory has been acquired and processed. If so, close the first business entry thread and the first business processing process, switch the old and new business processing processes, and complete the service upgrade. After starting the uninterrupted service upgrade process, the plug-in manager calls the plug-in interface of the old process, inserts an interceptor, and tracks all calls during the file upgrade.
[0041] When executing the service upgrade process, the plug-in upgrade package needs to be verified. The plug-in upgrade package includes a verification file for verifying the integrity of the plug-in installation package. The verification file records the verification code, plug-in number, plug-in name, and plug-in download address. The verification code is the calculated value obtained after the server calculates the plug-in file. For example, the server performs MD5 calculation on the plug-in file, and the obtained MD5 value can be used as a verification code. The server saves the obtained MD5 value together with the plug-in file and saves the verification code in the verification file. According to the plug-in number and plug-in name, it is determined whether there is a plug-in file in the cache directory of the server segment. Each plug-in name subdirectory stores several plug-in files corresponding to the plug-in number. After the integrity check of the plug-in installation package is completed, the version of the plug-in is queried to determine whether the current version is the latest version. If so, the upgrade operation is not performed. If not, the latest version is used for the upgrade operation. If the upgrade fails, a version rollback is required.
[0042] Create a shared memory (Shared Memory), which is used to continuously save and record the status information of the file system during the operation of the target user-mode file system. By parsing the shared memory, the status information of the process is extracted from the shared memory, and a new process is run based on the extracted status information. By persistently saving the status information of the user-mode file system through the shared memory, the loss of file system data can be avoided. In this way, when it is monitored that a new process is started and enters a normal operation state, the new process will inherit and use the relevant data stored in the shared memory.
[0043] S3.Maintenance service plug-in
[0044] After the service upgrade is complete, perform service plug-in maintenance.
[0045] The execution service plug-in maintenance includes: traversing the service plug-in installation directory, if the MD5 check of the plug-in is inconsistent with the current one, loading the plug-in into the hash table, and mounting the old plug-in to the linked list under the hash item; when the traversal is completed, traversing the hash linked list, when the reference is 0, uninstalling the linked list item corresponding to the old plug-in.
[0046] The present invention also proposes a system for uninterrupted service upgrade, comprising:
[0047] The Web upgrade management platform is configured to: automatically detect upgrade file service requests, import the process service file to be upgraded when it is determined that there is a file that needs to be upgraded, and automatically find the corresponding upgrade process and the adapted plug-in version according to the process service file;
[0048] The request module is configured to: send an upgrade request to the file to be upgraded by using the upgrade process, start the file upgrade, and modify the process status to upgrading;
[0049] Upgrade module, which is configured as:
[0050] Start the uninterrupted service upgrade process and change the process status to upgrading;
[0051] The first business processing process puts the business data that needs to be processed during the upgrade process into the shared memory, and then closes the first business processing module, leaving only the first business entry thread;
[0052] Start a second business processing process, a second business processing module and a second business entry thread, and the second business entry thread obtains business data of the first business processing process from the shared memory;
[0053] Determine whether all the business data in the shared memory has been acquired and processed. If so, close the first business entry thread and the first business processing process, switch between the old and new business processing processes, and complete the service upgrade;
[0054] The plug-in maintenance module is configured to perform service plug-in maintenance after the upgrade is completed.
[0055] The rollback module is configured to perform upgrade rollback according to the rollback version selected by the user if the upgrade is unsuccessful.
[0056] Figure 4 The figure shows the process of the plug-in maintenance module performing service plug-in maintenance: traverse the service plug-in installation directory. If the MD5 checksum of the plug-in is inconsistent with the current one, load the plug-in into the hash table and mount the old plug-in to the linked list under the hash item. When the traversal is completed, traverse the hash linked list. When the reference is 0, uninstall the linked list item corresponding to the old plug-in.
[0057] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.
[0058] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0059] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0060] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0061] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a physical server, or a network cloud server, etc., which needs to be installed with Windows or Windows Server operating system) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store program codes.
[0062] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention still falls within the scope of the technical solution of the present invention.
Claims
1. A method for non-stop service upgrades, It is characterized in that The following steps are involved: S1. Send upgrade service request The Web upgrade management platform receives the pushed upgrade file, automatically searches for the corresponding upgrade process and the adapted plug-in version according to the process service file, and after determining that there is a file that needs to be upgraded, sends an upgrade service request to the process that needs to be upgraded. The Web upgrade management platform searches for the corresponding upgrade process according to the MD5 value of the process service file; S2. Start uninterrupted service upgrade The first business processing process puts the business data to be processed during the upgrade process into the shared memory, retains the first business entry thread; starts the second business entry thread, and directly obtains the business data from the shared memory; After processing all business data, close the first business entry thread and the service upgrade is completed; Specifically include: S21. Start the uninterrupted upgrade process and change the process status to upgrading; S22. The first business processing process puts the business data to be processed during the upgrade process into the shared memory, and then closes the first business processing module, leaving only the first business entry thread; S23. Start the second business processing process, the second business processing module and the second business entry thread, and the second business entry thread obtains the business data of the first business processing process from the shared memory; S24. Determine whether all business data in the shared memory has been acquired and processed. If so, close the first business entry thread and the first business processing process, switch the old and new business processing processes, and complete the service upgrade; S3.Maintenance service plug-in After the service upgrade is complete, perform service plug-in maintenance.
2. The method for uninterrupted service upgrade according to claim 1, It is characterized in that In step S2: After starting the uninterrupted service upgrade process, the plug-in manager calls the plug-in interface of the first business processing process, inserts an interceptor, and tracks all calls during the file upgrade.
3. The method for uninterrupted service upgrade according to claim 1, It is characterized in that In step S2: When executing the upgrade process, the plug-in upgrade package is verified, and the plug-in upgrade package includes a verification file for verifying the integrity of the plug-in installation package.
4. The method for uninterrupted service upgrade according to claim 3, It is characterized in that In step S2: After the integrity check of the plug-in installation package is completed, the plug-in version is queried to determine whether the current version is the latest version. If so, the upgrade operation is not performed. If not, the latest version is used for the upgrade operation.
5. The method for uninterrupted service upgrade according to claim 4, Features: If the upgrade fails, the version will be rolled back.
6. The method for uninterrupted service upgrade according to claim 1, It is characterized in that In step S3: Executing service plug-in maintenance includes: traversing the service plug-in installation directory. If the MD5 checksum of the plug-in is inconsistent with the current one, the plug-in is loaded into the hash table, and the old plug-in is mounted to the linked list under the hash item. When the traversal is completed, the hash linked list is traversed, and when the reference is 0, the linked list item corresponding to the old plug-in is uninstalled.
7. A system for uninterrupted service upgrades, It is characterized in that include: The Web upgrade management platform is configured to: automatically detect upgrade file service requests, import the process service file to be upgraded when it is determined that there is a file that needs to be upgraded, automatically search for the corresponding upgrade process and the adapted plug-in version according to the process service file, and the Web upgrade management platform searches for the corresponding upgrade process according to the MD5 value of the process service file; A request module is configured to: send an upgrade request to a file to be upgraded by using an upgrade process, start the file upgrade, and modify the process status to being upgraded; Upgrade module, which is configured as: The first business processing process puts the business data to be processed during the upgrade process into the shared memory, retains the first business entry thread; starts the second business entry thread, and directly obtains the business data from the shared memory; After processing all business data, close the first business entry thread and the service upgrade is completed; as well as, Start the uninterrupted service upgrade process and change the process status to upgrading; The first business processing process puts the business data that needs to be processed during the upgrade process into the shared memory, and then closes the first business processing module, leaving only the first business entry thread; Start a second business processing process, a second business processing module and a second business entry thread, and the second business entry thread obtains business data of the first business processing process from the shared memory; Determine whether all the business data in the shared memory has been acquired and processed. If so, close the first business entry thread and the first business processing process, switch between the old and new business processing processes, and complete the service upgrade; A plug-in maintenance module, which is configured to: perform service plug-in maintenance after the upgrade is completed; The rollback module is configured to perform upgrade rollback according to the rollback version selected by the user if the upgrade is unsuccessful.
Citation Information
Patent Citations
Hot upgrading method and device for server program
CN105677433A
Network connection service based upgrade method and device
CN106301820A
Upgrading system and virtual machine-based upgrading method and device
CN108021378A
