Method and system for dynamically updating tcp long connection protocol without shutdown and storage medium

By using a dynamic language to write protocol update scripts and a dynamic loading mechanism, combined with a protocol converter and a smooth update strategy, the problem of TCP long connection protocol updates requiring system downtime was solved, enabling non-stop dynamic updates and improving system stability and user experience.

CN119324945APending Publication Date: 2025-01-17SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411435781.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

In existing technologies, updating the TCP long connection protocol requires downtime for maintenance, leading to service interruptions and system instability.

Method used

The protocol update script is written in a dynamic language and combined with a dynamic loading mechanism, protocol converter, smooth update strategy and connection migration strategy to achieve non-stop dynamic update of TCP long connection protocol.

Benefits of technology

It enables TCP long connection protocol updates without system downtime, ensuring service continuity and stability, providing flexibility and scalability, allowing users to seamlessly switch services without being aware of it, and improving system reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119324945A_ABST
    Figure CN119324945A_ABST
Patent Text Reader

Abstract

The invention relates to a network communication technology, discloses a method and a system for dynamically updating a tcp long connection protocol without shutdown and a storage medium, and solves the problems of service interruption and system instability caused by shutdown maintenance required for updating the tcp long connection protocol in the prior art. In the scheme, a computer system receives a new tcp long connection protocol script, and the new tcp long connection protocol script is written by using a programming language supporting dynamic loading; and in the running process, updating the currently running tcp long connection protocol by dynamically loading and executing the received new tcp long connection protocol script. The method is suitable for scenes needing to dynamically update the tcp long connection protocol, and is particularly suitable for application scenes such as network services and real-time communication systems with high requirements on system continuity and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to network communication technology, and in particular to a method, system and storage medium for dynamically updating a TCP long connection protocol without stopping the system. Background Art

[0002] In traditional technology, static languages ​​(such as Java, C++, etc.) are usually used to write and implement TCP long connection protocol updates, which require downtime maintenance during updates. The entire process includes the following steps: 1. Formulate the requirements and specifications of the new protocol, design and code; 2. Suspend the system and stop the current TCP connection service; 3. Replace the existing protocol module and introduce a new protocol implementation; 4. Restart the system and restore the TCP connection service.

[0003] In the above solution, since it is impossible to dynamically update the TCP protocol during runtime, the protocol module can only be replaced by shutting down for maintenance, which leads to service interruption and system instability. Summary of the invention

[0004] The technical problem to be solved by the present invention is: to propose a method, system and storage medium for dynamically updating the TCP long connection protocol without stopping the system, so as to solve the problem of service interruption and system instability caused by the need for downtime maintenance when updating the TCP long connection protocol in traditional technology.

[0005] The technical solution adopted by the present invention to solve the above technical problems is:

[0006] On the one hand, the present invention provides a method for dynamically updating a TCP long connection protocol without stopping the computer, which is applied to a computer system. The method comprises:

[0007] The computer system receives a new TCP long connection protocol script, which is written in a programming language that supports dynamic loading; during operation, the currently running TCP long connection protocol is updated by dynamically loading and executing the received new TCP long connection protocol script.

[0008] Furthermore, the new TCP long connection protocol script includes the definition, logic and connection conversion rules of the new protocol.

[0009] Furthermore, the programming language supporting dynamic loading is Groovy.

[0010] Furthermore, the updating of the currently running TCP long connection protocol includes:

[0011] The currently running TCP long connection is converted from the old protocol to the new protocol through a protocol converter; the protocol converter can identify the data formats of different protocols for conversion and analysis.

[0012] Furthermore, based on the smooth update strategy and connection migration strategy, the currently running TCP long connection is converted from the old protocol to the new protocol through a protocol converter;

[0013] The smooth update strategy includes: adopting grayscale release to gradually switch traffic from the old protocol to the new protocol;

[0014] The connection migration strategy includes: dynamically adjusting the speed and priority of connection migration according to system load and connection status.

[0015] Furthermore, the method also includes: continuously monitoring the update process of the TCP long connection protocol, and if an abnormal state occurs during the update process, rolling back the TCP long connection protocol to a previous state.

[0016] In a second aspect, the present invention also provides a system for dynamically updating a TCP long connection protocol without stopping, which includes a processor and a memory, wherein a computer program is stored in the memory, and the processor implements the steps of the method for dynamically updating a TCP long connection protocol without stopping by executing the computer program.

[0017] In a third aspect, the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for dynamically updating the TCP long connection protocol without stopping are implemented.

[0018] The beneficial effects of the present invention are:

[0019] (1) Ability to update without downtime: Through dynamic loading and conversion mechanisms, the TCP persistent connection protocol can be updated while the system is running without downtime for maintenance, thus ensuring service continuity and stability.

[0020] (2) Strong flexibility and scalability: Using dynamic languages ​​to write protocol update scripts can achieve flexible updates and expansions of the protocol, adapt to changing needs and environments, and improve the adaptability and maintainability of the system.

[0021] (3) Ability to achieve smooth service switching: Through smooth update strategy and connection migration strategy, smooth service switching can be achieved to avoid any impact on users during the update process and ensure that users can use the service without noticing.

[0022] (4) Improve system stability and reliability: Comprehensive monitoring of the update process can timely identify problems and optimize them, thereby improving system stability. When abnormal conditions occur during the update process, the long connection protocol is rolled back to the previous state through the rollback mechanism, ensuring the reliability of system operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 The present invention is a flowchart of a method for dynamically updating a TCP long connection protocol without shutting down the server in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In the prior art, due to the lack of a dynamic update mechanism, it is impossible to dynamically update the TCP persistent connection protocol without shutting down the server. Therefore, it is necessary to shut down for maintenance to replace the protocol, resulting in service interruption and reduced user experience. In order to dynamically update the TCP persistent connection protocol without shutting down the server, the following issues need to be considered:

[0025] Real-time update protocol: How to dynamically update the TCP long connection protocol while the system is running without affecting the stability of the existing connection and the continuity of the service.

[0026] Dynamic script loading: How to implement the ability to load new protocol definitions and logic while the system is running to achieve dynamic updates of the protocol.

[0027] Connection conversion and migration: How to smoothly convert existing connections from the old protocol to the new protocol after the protocol is updated, and ensure the stability and consistency of data transmission.

[0028] Uninterrupted service: How to ensure the continuity of system services during the protocol update process, that is, no downtime, and ensure that users can use the services without noticing.

[0029] Flexibility and scalability of protocol updates: How to design a mechanism so that protocol updates and extensions can adapt to changing needs and environments while maintaining system stability and performance.

[0030] In view of the above problems, the solution of the present invention uses a dynamic language to write a protocol update script, and dynamically loads and executes the script when the system is running to update the currently running TCP long connection protocol. The technical means are specifically embodied in the following aspects:

[0031] Dynamic language scripting: System administrators use programming languages ​​that support dynamic loading to write protocol update scripts. These scripts contain the definition, logic, and connection conversion rules of the new protocol. Protocol scripts coded in dynamic languages ​​can be separated from link modules and business modules to achieve decoupling.

[0032] Dynamic loading mechanism: The system integrates a dynamic loading mechanism that can dynamically load and execute scripts at runtime. This can be achieved through the built-in mechanism of the programming language or a third-party library.

[0033] Protocol converter: Design and implement a protocol converter module, which is responsible for converting the currently running connection from the old protocol to the new protocol. This module needs to be able to identify the data formats of different protocols, convert and parse them, and ensure the integrity and consistency of the data.

[0034] Connection migration strategy: Develop a connection migration strategy to dynamically adjust the speed and priority of connection migration based on system load and connection status. You can consider adopting a gradual migration approach to avoid excessive system load caused by a one-time update.

[0035] Smooth update strategy: Develop a smooth update strategy to ensure that services are not interrupted during the update process. You can use grayscale releases, traffic switching and other technical means to gradually switch traffic from the old protocol to the new protocol to ensure that users can use the service without noticing.

[0036] Exception handling and rollback mechanism: Design an exception handling and rollback mechanism to handle abnormal situations that may occur during the update process. When the update fails or a problem occurs, it can be rolled back to the previous state in time to ensure the stability and reliability of the system.

[0037] Automated testing and monitoring: Establish an automated testing and monitoring system to conduct comprehensive testing and monitoring of the protocol update process. Timely discover and handle problems in the update process to ensure the success and stability of the update.

[0038] Example

[0039] The implementation process of the method for dynamically updating the TCP long connection protocol without stopping provided in this embodiment is as follows: Figure 1 As shown, it includes the following implementation process:

[0040] First, design and write the corresponding protocol update script according to the TCP long connection protocol that needs to be updated. This script can be written in a dynamic language (such as Groovy) so that it can be modified and executed at runtime. Then, verify the written script. If the verification fails, it needs to be rewritten. If the verification passes, upload the script to the system's protocol script library. Next, test the script of the new protocol. If the test fails, the script needs to be rewritten. If the test passes, a new protocol version number is generated, and the current protocol is used as a rollback version.

[0041] During the operation of the system, when the protocol script library is detected to have changed, it can be known that there is a new protocol version, and the protocol update script is dynamically loaded and executed to ensure that the protocol can be flexibly updated during the operation of the system. During the update process, in order to ensure smooth switching of services, ensure uninterrupted services and avoid excessive system load caused by one-time updates, a smooth update strategy and a connection migration strategy can be adopted. Among them, the smooth update strategy adopts grayscale release to gradually switch traffic from the old protocol to the new protocol. The connection migration strategy dynamically adjusts the speed and priority of connection migration according to the system load and connection status. In addition, based on reliability and stability considerations, the protocol update process is fully monitored, and if an abnormal situation occurs, it is rolled back to the previous protocol version in a timely manner. If the protocol updates can proceed smoothly, the new protocol version can be released in full.

[0042] Based on the above solution, the goal of dynamically updating the TCP long connection protocol without stopping the system can be achieved, the availability and stability of the system can be improved, and the continuity of service and user experience can be guaranteed.

[0043] Finally, it should be noted that the above embodiments are only preferred implementations and are not intended to limit the present invention. It should be pointed out that for those skilled in the art, several modifications, equivalent replacements, improvements, etc. can be made without departing from the scope of the present invention and the scope of protection of the claims, and all of these should be included in the protection scope of the present invention.

Claims

1. A method for dynamically updating a TCP long connection protocol without stopping the computer system, applied to a computer system, characterized in that: The method includes: The computer system receives a new TCP long connection protocol script, which is written in a programming language that supports dynamic loading; during operation, the currently running TCP long connection protocol is updated by dynamically loading and executing the received new TCP long connection protocol script.

2. A method for dynamically updating a TCP long connection protocol without stopping the machine as claimed in claim 1, characterized in that: The new TCP long connection protocol script includes the definition, logic and connection conversion rules of the new protocol.

3. A method for dynamically updating a TCP long connection protocol without stopping the machine as claimed in claim 1 or 2, characterized in that: The programming language supporting dynamic loading is Groovy.

4. A method for dynamically updating a TCP long connection protocol without stopping the machine as claimed in claim 1 or 2, characterized in that: The updating of the currently running TCP long connection protocol includes: The currently running TCP long connection is converted from the old protocol to the new protocol through a protocol converter; the protocol converter can identify the data formats of different protocols for conversion and analysis.

5. A method for dynamically updating a TCP long connection protocol without stopping the machine as claimed in claim 4, characterized in that: Based on the smooth update strategy and connection migration strategy, the currently running TCP long connection is converted from the old protocol to the new protocol through the protocol converter; The smooth update strategy includes: adopting grayscale release to gradually switch traffic from the old protocol to the new protocol; The connection migration strategy includes: dynamically adjusting the speed and priority of connection migration according to system load and connection status.

6. A method for dynamically updating a TCP long connection protocol without stopping the machine as claimed in claim 5, characterized in that: The method also includes: continuously monitoring the update process of the TCP long connection protocol, and if an abnormal state occurs during the update process, rolling back the TCP long connection protocol to a previous state.

7. A system for dynamically updating a TCP long connection protocol without stopping the system, comprising a processor and a memory, wherein a computer program is stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method for dynamically updating the TCP long connection protocol without stopping the computer as described in any one of claims 1 to 6.

8. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamically updating the TCP long connection protocol without stopping the computer as described in any one of claims 1 to 6 are implemented.