Cloud native signaling service disconnection reconnection method and device, equipment and storage medium
By obtaining the reasons for disconnection, filtering connection information and setting a reconnection strategy, the problem of inefficient recovery after disconnection between the cloud-native signaling service and the terminal is solved, efficient and reliable connection recovery is achieved, and financial transactions are ensured. Real-time and security.
Patent Information
- Application Number
- CN202411334073.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2024-12-13
AI Technical Summary
After the connection between cloud-native signaling services and various terminals is disconnected, the recovery connection efficiency is low, resulting in transaction delays, data inconsistencies and system crashes, affecting the user experience and the stability of the financial market.
By obtaining the reasons for disconnection, filtering connection information, setting up reconnection policies, and using reconnection queues and optimized state recovery policies, automatically detecting and re-establishing connections, ensuring data consistency and integrity, quickly identifying the latest status of the terminal, and reducing services Interrupt time.
It significantly improves the efficiency of connection recovery, reduces service interruption time caused by disconnection, improves the reliability and user experience of the system, and ensures real-time and security of transactions.
Smart Images

Figure CN119135745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud technology, and in particular to a method, device, electronic device and computer-readable storage medium for reconnecting a cloud-native signaling service. Background Art
[0002] In the financial industry, efficient connection recovery of cloud-native signaling services is of great significance. Financial services usually require real-time transactions and data updates. Efficient signaling service connection recovery can significantly reduce transaction delays and data synchronization problems caused by disconnections, which is particularly critical for trading platforms, online payment systems, and real-time data analysis systems. Financial institutions rely on cloud-native signaling services to ensure transaction reliability and data timeliness, but the risk of disconnection still exists, especially during system upgrades, network problems, or terminal failures.
[0003] Due to the high transaction frequency and strict real-time requirements of financial services, cloud-native signaling services need to quickly restore connections to ensure smooth financial transactions. The shortcomings of existing technologies in this regard may lead to transaction delays, data inconsistencies, and even system crashes, which will affect user experience and the stability of financial markets. Therefore, the financial industry has put forward higher requirements for the connection recovery efficiency of cloud-native signaling services to ensure the real-time and security of transactions and the high availability of the system.
[0004] The existing technology has the problem of low efficiency in restoring the connection between the cloud native signaling service and various terminals after the connection between the cloud native signaling service and various terminals is disconnected. Summary of the invention
[0005] The present invention provides a cloud native signaling service disconnection reconnection method, device and computer-readable storage medium, the main purpose of which is to solve the problem of low efficiency in restoring the connection between the cloud native signaling service and various terminals after the connection between the cloud native signaling service and various terminals is disconnected.
[0006] To achieve the above object, the present invention provides a cloud native signaling service disconnection reconnection method, comprising:
[0007] Obtain the disconnection reason between the cloud native signaling service and the preset connection terminal;
[0008] If the disconnection reason is that the connection terminal is disconnected, obtaining the disconnection reason of the connection terminal;
[0009] Filtering out preset connection information according to the disconnection reason of the connection terminal;
[0010] Put the connection information into a preset reconnection queue to obtain an update queue;
[0011] Setting a reconnection strategy according to the type of the connection terminal;
[0012] Reconnecting the cloud native signaling service to the connection terminal according to the reconnection strategy and the connection information in the update queue, and restoring the connection between the cloud native signaling service and the connection terminal;
[0013] If the disconnection reason is the restart of the cloud native signaling service, the connection of the cloud native signaling service is restored according to the preset connection strategy.
[0014] In order to solve the above problems, the present invention also provides a cloud native signaling service disconnection reconnection device, the device comprising:
[0015] The service disconnection reason acquisition module is used to obtain the disconnection reason between the cloud native signaling service and the preset connection terminal;
[0016] A terminal disconnection reason acquisition module, used for acquiring the disconnection reason of the connection terminal if the disconnection reason is that the connection terminal is disconnected;
[0017] A connection information screening module, used to screen out preset connection information according to the disconnection reason of the connection terminal;
[0018] A reconnection queue update module, used to put the connection information into a preset reconnection queue to obtain an update queue;
[0019] A reconnection strategy setting module, used to set a reconnection strategy according to the type of the connection terminal;
[0020] A service terminal connection recovery module, used to reconnect the cloud native signaling service with the connection terminal according to the reconnection strategy and the connection information in the update queue, and restore the connection between the cloud native signaling service and the connection terminal;
[0021] The cloud native service recovery module is used to restore the connection of the cloud native signaling service according to a preset connection strategy if the disconnection reason is the restart of the cloud native signaling service.
[0022] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0023] at least one processor; and,
[0024] a memory communicatively connected to the at least one processor; wherein,
[0025] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned cloud native signaling service disconnection reconnection method.
[0026] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned cloud-native signaling service disconnection reconnection method.
[0027] The embodiment of the present invention obtains the disconnection reason between the cloud native signaling service and the preset connection terminal. If the disconnection reason is that the connection terminal is disconnected, the disconnection reason of the connection terminal is obtained, and the preset connection information is filtered out according to the disconnection reason of the connection terminal, and the connection information is put into the preset reconnection queue to obtain an update queue, and a reconnection strategy is set according to the type of the connection terminal. The cloud native signaling service and the connection terminal are reconnected according to the reconnection strategy and the connection information in the update queue to restore the connection between the cloud native signaling service and the connection terminal. If the disconnection reason is that the cloud native signaling service is restarted, the connection of the cloud native signaling service is restored according to the preset connection strategy. This can solve the problem of low efficiency in restoring the connection between the cloud native signaling service and various terminals after the connection between the cloud native signaling service and various terminals is disconnected. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 This is a schematic diagram of an application environment of a cloud native signaling service disconnection reconnection method provided by an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of a flow chart of a method for reconnecting a cloud native signaling service disconnection provided by an embodiment of the present invention;
[0030] Figure 3 A functional module diagram of a cloud native signaling service disconnection reconnection device provided by an embodiment of the present invention;
[0031] Figure 4 A schematic diagram of the structure of an electronic device for implementing the cloud native signaling service disconnection reconnection method provided in one embodiment of the present invention.
[0032] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical scheme and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. 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.
[0034] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0035] The embodiment of the present invention provides a method for reconnecting a cloud native signaling service after disconnection. The execution subject of the method for reconnecting a cloud native signaling service after disconnection includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided in the embodiment of the present application. In other words, the method for reconnecting a cloud native signaling service after disconnection can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0036] The cloud native signaling service disconnection reconnection method provided in the embodiment of the present invention can be applied in the following aspects: Figure 1In an application environment, wherein the client communicates with the server through a network to obtain the disconnection reason between the cloud native signaling service and the preset connection terminal; if the disconnection reason is that the connection terminal is disconnected, then the disconnection reason of the connection terminal is obtained; the preset connection information is filtered out according to the disconnection reason of the connection terminal; the connection information is put into a preset reconnection queue to obtain an update queue; a reconnection strategy is set according to the type of the connection terminal; the cloud native signaling service is reconnected to the connection terminal according to the reconnection strategy and the connection information in the update queue to restore the connection between the cloud native signaling service and the connection terminal; if the disconnection reason is that the cloud native signaling service is restarted, the connection of the cloud native signaling service is restored according to the preset connection strategy. In the present invention, when the connection between the cloud native signaling service and various terminals is disconnected, the present invention significantly improves the efficiency of connection recovery by introducing an intelligent reconnection mechanism and an optimized state recovery strategy. The intelligent reconnection mechanism can automatically detect and re-establish a connection after a disconnection while ensuring the consistency and integrity of the data. The optimized state recovery strategy can quickly identify the latest state of the terminal and restore it to the working state before disconnection, reducing the service interruption time caused by disconnection. In addition, the system also supports real-time monitoring and fault diagnosis, further improving the speed and reliability of the recovery process. Among them, the client can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices. The server can be implemented with an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.
[0037] Reference Figure 2 FIG. 1 is a flow chart of a method for reconnecting a cloud native signaling service after disconnection provided by an embodiment of the present invention. In this embodiment, the method for reconnecting a cloud native signaling service after disconnection includes:
[0038] S1. Obtain the disconnection reason between the cloud native signaling service and the preset connection terminal.
[0039] In an embodiment of the present invention, the cloud-native signaling service can achieve high-speed iteration and deployment based on the cloud-native framework. Due to the preset connection terminal itself and the environmental factors of the connection terminal, the cloud-native signaling service needs to handle problems such as active disconnection of the connection terminal due to various reasons.
[0040] In detail, the disconnection reasons include: disconnection of the connection terminal and restart of the cloud native signaling service.
[0041] S2. If the disconnection reason is that the connection terminal is disconnected, obtain the disconnection reason of the connection terminal.
[0042] In the embodiment of the present invention, the reasons for the disconnection of the connection terminal include: network problems, such as data packet loss, network delay or connection timeout, which may cause unstable signal transmission and cause the connection terminal to be disconnected; the program of the connection terminal crashes, such as due to software errors, causing the terminal to be unable to maintain the connection; the connection terminal may also actively disconnect, such as manually disconnected by the user or self-disconnected by the terminal according to the policy. These different disconnection reasons require corresponding reconnection strategies and measures to be taken according to the specific situation.
[0043] S3. Filter out preset connection information according to the disconnection reason of the connection terminal.
[0044] In an embodiment of the present invention, a standard for filtering out preset connection information is defined: if the cause of the disconnection of the connection terminal is judged to be a network problem and a program crash of the connection terminal based on the disconnection time and the number of disconnections, the connection information between the connection terminal and the cloud native signaling service is obtained; if the cause of the disconnection of the connection terminal is judged to be that the connection terminal actively disconnects based on the disconnection time and the number of disconnections, the disconnected connection terminal is ignored.
[0045] In detail, the step of filtering out the preset connection information according to the disconnection reason of the connection terminal includes:
[0046] Obtaining the disconnection time when the connection terminal is disconnected;
[0047] Determining whether the disconnection time is greater than a preset disconnection time threshold;
[0048] If the disconnection time is greater than the disconnection time threshold, the disconnection reason of the connection terminal is a network problem, and the connection information between the connection terminal and the cloud native signaling service is obtained;
[0049] If the disconnection time is less than or equal to the disconnection time threshold, counting the number of disconnections of the connection terminal;
[0050] Determining whether the number of disconnections is greater than a preset disconnection number threshold;
[0051] If the number of disconnections is greater than the disconnection number threshold, the disconnection reason of the connection terminal is that the connection terminal program crashes, and connection information between the connection terminal and the cloud native signaling service is obtained;
[0052] If the number of disconnections is less than or equal to the disconnection threshold, the reason for the disconnection of the connection terminal is that the connection terminal actively disconnects, and the disconnected connection terminal is ignored.
[0053] In detail, if the disconnection time is greater than the disconnection time threshold, it means that the time when the disconnection occurred exceeds the preset normal range, and the reason for the disconnection of the connection terminal may be a network problem. At this time, it is necessary to obtain the connection information between the connection terminal and the cloud native signaling service to further diagnose whether there is a problem with the network connection. If the disconnection time is less than or equal to the disconnection time threshold, it is necessary to count the number of disconnections that occur in the connection terminal within a certain period of time to understand the frequency of disconnection events. Compare the number of disconnections obtained by counting with the preset disconnection number threshold. If the number of disconnections is greater than the disconnection number threshold, it means that the connection terminal disconnects frequently in a short period of time, which may be caused by internal problems such as program crashes. At this time, it is necessary to obtain the connection information between the connection terminal and the cloud native signaling service to confirm whether the connection is interrupted due to a program crash. If the number of disconnections is less than or equal to the disconnection number threshold, it indicates that the disconnection event is not frequent, which may be due to the reason that the connection terminal actively disconnects. In this case, these disconnection events can be ignored.
[0054] Specifically, suppose there is a system that needs to monitor the connection quality between the user device and the cloud service. Whenever the connection terminal is disconnected, the time point of the disconnection is recorded, and the disconnection time is compared with the preset disconnection time threshold, for example, the disconnection time threshold is 10 minutes. If the disconnection time is greater than 10 minutes, the system will preliminarily judge it as a network problem. Extract connection information from the cloud native signaling service to analyze the possibility of network problems. If the disconnection time is less than or equal to 10 minutes, count the number of disconnections in the past 24 hours. Compare the counted number of disconnections with the preset disconnection threshold (for example, 5 times). If the number exceeds 5 times, it is judged that the possibility of program crash is high. Obtain relevant information from the system log to confirm the program crash. If the number of disconnections is less than or equal to 5 times, it is assumed that the terminal actively disconnects, ignores these events, and reduces misjudgment. Through this series of steps, the reasons for the disconnection of the connection terminal can be accurately identified and classified, so that corresponding measures can be taken to solve the problem.
[0055] Understanding the specific reasons why the connected terminal is disconnected allows the system to develop more accurate and effective reconnection strategies. For example, if the disconnection is caused by a network failure, the system can prioritize trying to reestablish the network connection or automatically switch to a backup network. If the disconnection is caused by a device program crash, the system may trigger a device restart or program reload. This targeted reconnection strategy can significantly improve the efficiency of restoring connections, reduce user waiting time, and thus enhance the user experience.
[0056] Quickly and accurately identifying the cause of disconnection and taking action can greatly improve the user experience. If users frequently experience disconnection during use, their satisfaction will be directly affected. After understanding the cause of disconnection, the system can make targeted adjustments to reduce the frequency of disconnection, thereby improving the stability and reliability of the system. Users can experience smoother operation and fewer interruptions, which enhances their trust and satisfaction with the system.
[0057] By screening out the connection terminals whose disconnection reasons are network problems and the connection terminal program crashes, it can be ensured that the connection terminals are not actively disconnected, and timely attempts are made to restore the connection after the network problem is resolved, thereby reducing the need for manual intervention, and effectively reducing the service interruption time caused by network interruption, and improving the efficiency of reconnection.
[0058] S4. Put the connection information into a preset reconnection queue to obtain an update queue.
[0059] In the embodiment of the present invention, the step of placing the connection information into a preset reconnection queue to obtain an update queue includes:
[0060] Use FIFO data structure to build reconnection queue;
[0061] The connection information is added to the tail of the reconnection queue to obtain an update queue.
[0062] In detail, a FIFO (first in, first out) data structure is used to construct a reconnection queue. The FIFO data structure is a type of queue that processes elements in the order in which they enter the queue, i.e., the first element to enter the queue will be processed first. When constructing a reconnection queue, you first need to initialize an empty FIFO queue and add new connection information to the end of the reconnection queue. Whenever new connection information needs to be reconnected, the new connection information is placed at the end of the queue. After the addition operation is completed, the state of the reconnection queue is updated to the queue containing the newly inserted connection information.
[0063] Assuming that there are multiple connections that need to be reconnected, and these connections are processed according to priority, the information of each connection can be added to the queue in the order of entry. The FIFO data structure ensures the consistency of the processing order. By maintaining the FIFO queue, multiple connection reconnection operations can be effectively managed and processed, and these operations can be ensured to be performed in order to avoid confusion and errors.
[0064] Using the FIFO data structure to build a reconnection queue ensures that the connection information is processed in the order in which it is added. The FIFO queue follows the first-in-first-out principle. The connection information that enters the queue first will be processed first. This can avoid confusion and omissions in connection information processing. At the same time, the FIFO queue provides simple and efficient operations and reduces complexity.
[0065] S5. Set a reconnection strategy according to the type of the connected terminal.
[0066] In an embodiment of the present invention, the types of connection terminals are divided into client terminals and server terminals. The connection between the client terminal and the cloud native signaling service is mainly a short connection, and the status of the connected client terminal and the cloud native signaling service is informed by a heartbeat packet; the network environment of the server terminal is much more stable than that of the client terminal, and network fluctuations or even disconnections will not often occur.
[0067] In the embodiment of the present invention, the setting of the reconnection strategy according to the type of the connection terminal includes:
[0068] Determining whether the connection terminal type is a client terminal or a server terminal;
[0069] If the connection terminal type is a client terminal, the reconnection strategy of the client terminal is to attempt to reconnect at a preset first time interval;
[0070] If the connection terminal type is a server terminal, the reconnection strategy of the server terminal is to try to reconnect at a preset second time interval.
[0071] In detail, the reconnection strategy of the client terminal is to attempt to reconnect at a preset first time interval, which can be set to m seconds to the power of 2, and to reconnect the client terminal in m seconds to the power of 2, where m is the time set by the device; the reconnection strategy of the server terminal is to attempt to reconnect at a preset second time interval, which can be set to n seconds, and to reconnect the server terminal in n seconds, where n is the time set by the device.
[0072] Furthermore, different types of connected terminals may have different reconnection requirements. For example, mobile devices and servers have different requirements in terms of network stability and reconnection frequency. Therefore, the reconnection strategy needs to be adjusted according to the type of connected terminal.
[0073] The system divides the connecting terminals into client terminals and server terminals. Each type of terminal has different reconnection requirements and strategies. Different reconnection strategies are defined for each terminal type. The system identifies the type of terminal before reconnecting and applies the corresponding reconnection strategy based on the identified terminal type. The system attempts to reconnect according to the reconnection strategy, monitors the connection status, and ensures that the number of retries and intervals are adjusted according to the strategy.
[0074] By setting different reconnection strategies according to different types of connected terminals, the reconnection process can be optimized to better adapt to the characteristics and needs of client terminals and server terminals, and the reconnection success rate can be increased while reducing resource consumption and latency, ensuring that client terminals and server terminals can restore connections in the most effective way when faced with network problems, thereby improving connection efficiency and reliability.
[0075] S6. Reconnect the cloud native signaling service and the connection terminal according to the reconnection strategy and the connection information in the update queue, and restore the connection between the cloud native signaling service and the connection terminal.
[0076] In an embodiment of the present invention, reconnecting the cloud native signaling service with the connection terminal according to the reconnection strategy and the connection information in the update queue to restore the connection between the cloud native signaling service and the connection terminal includes:
[0077] Access the connection information in the update queue one by one using a for loop;
[0078] Extracting accessed connection information in the update queue;
[0079] reconnecting the cloud native signaling service to the connection terminal according to the reconnection strategy and the connection information in the update queue, and determining whether the reconnection is successful according to the received signal;
[0080] When a signal indicating successful reconnection is received, the connection between the cloud native signaling service and the connection terminal is restored, the connection information is removed from the update queue, and the number of waiting connections in the update queue after the removal is counted;
[0081] When a signal indicating a reconnection failure is received, the number of reconnections is counted to determine whether to put the connection information back into the update queue.
[0082] In detail, the statistics of the number of waiting connections in the update queue after removal include:
[0083] Get the number of connections waiting in the update queue after removal;
[0084] Determine whether the waiting quantity is a null value;
[0085] If the waiting number is a null value, all connections in the update queue are reconnected successfully;
[0086] If the waiting number is not a null value, the connection information in the update queue continues to be accessed.
[0087] In detail, counting the number of reconnections and determining whether to put the connection information back into the update queue includes:
[0088] Counting the number of reconnections of the connection information;
[0089] Determine whether the number of reconnections is greater than a preset reconnection number threshold;
[0090] If the number of reconnections is greater than the reconnection number threshold, it is directly deleted from the update queue;
[0091] If the number of reconnections is less than or equal to the reconnection number threshold, the connection information is put back into the update queue to try to reconnect.
[0092] In detail, to ensure business continuity, the system extracts the latest connection information from the update queue. According to the reconnection strategy, the system attempts to reconnect with the connection terminal. Each time it retries, the system records the number of retries and the time. During the retry process, the system continuously monitors the connection status. If the connection is successfully established, the system updates the connection status to "connected". If all retries fail, the system triggers fallback measures, such as sending an alarm to notify the operation and maintenance team.
[0093] By counting and judging the number of waiting times and the number of reconnections, you can manage the connection status more accurately, avoid unnecessary reconnection operations, and improve efficiency. Setting a threshold for the number of reconnections can prevent certain connections from continuously occupying resources due to frequent failures, ensuring the stability of the system. By dynamically processing connection information, you can better handle connection problems caused by network fluctuations or other factors, and improve the overall reliability of the system. Reduce the consumption of system resources, optimize queue management, and avoid system overload or resource waste.
[0094] Applying a reconnection strategy to reconnect the connections in the update queue can effectively restore stable communication between the cloud-native signaling service and the connected terminals, ensuring the high availability and continuity of the cloud-native signaling service. Even in the event of a connection interruption, normal operations can be quickly restored, thereby improving the reliability of the device and user experience.
[0095] S7. If the disconnection reason is the restart of the cloud native signaling service, restore the connection of the cloud native signaling service according to the preset connection strategy.
[0096] In an embodiment of the present invention, the preset connection strategy is classified according to whether the cloud native signaling service participates in the processing of business logic. If the cloud native signaling service does not participate in the processing of business logic, the connection is kept alive at the application layer; if the cloud native signaling service participates in the processing of business logic, K8s is used to perform master-slave backup of the restarted cloud native signaling service. Master-slave backup means that the master server handles all read and write operations, and the slave server regularly synchronizes data from the master server.
[0097] In an embodiment of the present invention, the restoring the connection of the cloud native signaling service according to a preset connection strategy includes:
[0098] Determine whether the cloud native signaling service in the connection information participates in the processing of the business logic;
[0099] If the cloud native signaling service participates in the processing of the business logic, the cloud native signaling service is backed up by a master and a slave according to the connection strategy to obtain an updated slave server;
[0100] Using the update to connect to the acquired connection request from the server, obtaining a connection status;
[0101] Writing the connection status into the database to obtain an updated database;
[0102] When the cloud native signaling service restores the connection, all connection information is read from the update database for storage;
[0103] If the cloud native signaling service does not participate in the processing of the business logic, the connection between the cloud native signaling service and the connection terminal is kept alive according to the connection strategy.
[0104] In detail, in the cloud native architecture, the signaling service is used to process and manage the signaling flow of communication, such as processing the communication signals between services in the microservice architecture. When the cloud native signaling service is disconnected due to reasons such as restart, a mechanism is required to automatically restore the connection according to the preset strategy to ensure the high availability and business continuity of the system.
[0105] The preset connection strategy usually includes the number of retries: specifying the maximum number of retries when trying to restore the connection; retry interval: the time interval between each retry; timeout: the maximum allowed time for a single retry during the retry process; fallback strategy: the backup measures or notifications taken after the retry fails. For example: set the maximum number of retries: 5 times, the interval between each retry: 10 seconds, the timeout for a single retry: 30 seconds, and the fallback strategy: send an alarm notification to the operation and maintenance team.
[0106] In a cloud-native environment, the restart of the signaling service can usually be detected in the following ways: the signaling service periodically sends heartbeat packets to the monitoring system. Detecting the loss or delay of heartbeat packets can determine whether the service has been restarted, and regularly checking the health status or connection status of the service.
[0107] By performing master-slave backup of the cloud-native signaling service, the system can quickly switch to the slave server when the master server fails, ensuring the continuity of business logic and avoiding system operation affected by service interruptions. The update slave server processes connection requests and writes the connection status to the database to ensure that all connection information is accurately recorded in the database, improve data consistency and integrity, read all connection information from the update database for storage, and enable the system to quickly recover to the state before disconnection, reducing the impact of service interruptions. By ensuring high availability and fast recovery of the cloud-native signaling service, users will experience higher stability and fewer service interruptions when using the system. The connection strategy is adjusted according to different service participation situations: master-slave backup or keep-alive processing, so that the system can flexibly respond to various business needs and optimize the overall connection management strategy.
[0108] When the cloud native signaling service is disconnected due to restart, the connection of the cloud native signaling service is restored according to the preset connection strategy. During the service restart, the cloud native signaling service can continue to maintain effective communication with the connected terminal, reducing business interruptions or poor user experience that may be caused by disconnection; the preset connection strategy can automatically handle such interruptions, thereby reducing the need for manual intervention, improving the automation and efficiency of operations, and enabling cloud native applications to maintain consistent service quality and reliability when facing uncertain network environments or cloud native signaling service restarts.
[0109] like Figure 3 As shown, it is a functional module diagram of a cloud native signaling service disconnection reconnection device provided by one embodiment of the present invention.
[0110] The cloud native signaling service disconnection reconnection device 100 of the present invention can be installed in an electronic device. According to the functions implemented, the cloud native signaling service disconnection reconnection device 100 may include a service disconnection reason acquisition module 101, a terminal disconnection reason acquisition module 102, a connection information screening module 103, a reconnection queue update module 104, a reconnection strategy setting module 105, a service terminal connection recovery module 106 and a cloud native service recovery module 107. The module of the present invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0111] In this embodiment, the functions of each module / unit are as follows:
[0112] A service disconnection reason acquisition module 101 is used to acquire a disconnection reason between a cloud native signaling service and a preset connection terminal;
[0113] The terminal disconnection reason acquisition module 102 is used to acquire the disconnection reason of the connection terminal if the disconnection reason is that the connection terminal is disconnected;
[0114] A connection information screening module 103, configured to screen out preset connection information according to the disconnection reason of the connection terminal;
[0115] The reconnection queue updating module 104 is used to put the connection information into a preset reconnection queue to obtain an updated queue;
[0116] A reconnection strategy setting module 105, configured to set a reconnection strategy according to the type of the connection terminal;
[0117] A service terminal connection recovery module 106, configured to reconnect the cloud native signaling service with the connection terminal according to the reconnection strategy and the connection information in the update queue, and to restore the connection between the cloud native signaling service and the connection terminal;
[0118] The cloud native service recovery module 107 is used to restore the connection of the cloud native signaling service according to a preset connection strategy if the disconnection reason is the restart of the cloud native signaling service.
[0119] In one embodiment, the connection information screening module 103 is specifically configured to:
[0120] Obtaining the disconnection time when the connection terminal is disconnected;
[0121] Determining whether the disconnection time is greater than a preset disconnection time threshold;
[0122] If the disconnection time is greater than the disconnection time threshold, the disconnection reason of the connection terminal is a network problem, and the connection information between the connection terminal and the cloud native signaling service is obtained;
[0123] If the disconnection time is less than or equal to the disconnection time threshold, counting the number of disconnections of the connection terminal;
[0124] Determining whether the number of disconnections is greater than a preset disconnection number threshold;
[0125] If the number of disconnections is greater than the disconnection number threshold, the disconnection reason of the connection terminal is that the connection terminal program crashes, and connection information between the connection terminal and the cloud native signaling service is obtained;
[0126] If the number of disconnections is less than or equal to the disconnection threshold, the reason for the disconnection of the connection terminal is that the connection terminal actively disconnects, and the disconnected connection terminal is ignored.
[0127] In some embodiments, the reconnection strategy setting module 105 is specifically configured to:
[0128] Determining whether the connection terminal type is a client terminal or a server terminal;
[0129] If the connection terminal type is a client terminal, the reconnection strategy of the client terminal is to attempt to reconnect at a preset first time interval;
[0130] If the connection terminal type is a server terminal, the reconnection strategy of the server terminal is to try to reconnect at a preset second time interval.
[0131] In some embodiments, the service terminal connection recovery module 106 is specifically configured to:
[0132] Access the connection information in the update queue one by one using a for loop;
[0133] Extracting accessed connection information in the update queue;
[0134] reconnecting the cloud native signaling service to the connection terminal according to the reconnection strategy and the connection information in the update queue, and determining whether the reconnection is successful according to the received signal;
[0135] When a signal indicating successful reconnection is received, the connection between the cloud native signaling service and the connection terminal is restored, the connection information is removed from the update queue, and the number of waiting connections in the update queue after the removal is counted;
[0136] When a signal indicating a reconnection failure is received, the number of reconnections is counted to determine whether to put the connection information back into the update queue.
[0137] In some embodiments, the service terminal connection recovery module 106 is specifically configured to:
[0138] Get the number of connections waiting in the update queue after removal;
[0139] Determine whether the waiting quantity is a null value;
[0140] If the waiting number is a null value, all connections in the update queue are reconnected successfully;
[0141] If the waiting number is not a null value, the connection information in the update queue continues to be accessed.
[0142] In some embodiments, the service terminal connection recovery module 106 is specifically configured to:
[0143] Counting the number of reconnections of the connection information;
[0144] Determine whether the number of reconnections is greater than a preset reconnection number threshold;
[0145] If the number of reconnections is greater than the reconnection number threshold, it is directly deleted from the update queue;
[0146] If the number of reconnections is less than or equal to the reconnection number threshold, the connection information is put back into the update queue to try to reconnect.
[0147] In some embodiments, the cloud native service recovery module 107 is specifically used to:
[0148] Determine whether the cloud native signaling service in the connection information participates in the processing of the business logic;
[0149] If the cloud native signaling service participates in the processing of the business logic, the cloud native signaling service is backed up by a master and a slave according to the connection strategy to obtain an updated slave server;
[0150] Using the update to connect to the acquired connection request from the server, obtaining a connection status;
[0151] Writing the connection status into the database to obtain an updated database;
[0152] When the cloud native signaling service restores the connection, all connection information is read from the update database for storage;
[0153] If the cloud native signaling service does not participate in the processing of the business logic, the connection between the cloud native signaling service and the connection terminal is kept alive according to the connection strategy.
[0154] In detail, each module described in the cloud native signaling service disconnection reconnection device 100 described in the embodiment of the present invention is used in the same manner as described above. Figures 1 to 3 The same technical means are used to resolve disconnection and reconnection issues of the cloud native signaling service described in the previous section, and can produce the same technical effects.
[0155] like Figure 4 As shown, it is a structural diagram of an electronic device for implementing a method for reconnecting a cloud native signaling service disconnection provided by an embodiment of the present invention.
[0156] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a cloud-native signaling service disconnection reconnection program.
[0157] Among them, the processor 10 can be composed of an integrated circuit in some embodiments, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple integrated circuits with the same function or different functions, including one or more central processing units (CPU), microprocessors, digital processing chips, graphics processors and various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and executes or executes the program or module stored in the memory 11 (for example, executing the cloud native signaling service disconnection reconnection program, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.
[0158] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Furthermore, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of the cloud native signaling service disconnection reconnection program, but also can be used to temporarily store data that has been output or is to be output.
[0159] The communication bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0160] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0161] The figure only shows an electronic device with components. Those skilled in the art will understand that the structure shown in the figure does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0162] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0163] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0164] The cloud native signaling service disconnection and reconnection program stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve: obtaining the disconnection reason between the cloud native signaling service and the preset connection terminal. If the disconnection reason is that the connection terminal is disconnected, then obtaining the disconnection reason of the connection terminal, filtering out the preset connection information according to the disconnection reason of the connection terminal, putting the connection information into a preset reconnection queue, obtaining an update queue, setting a reconnection strategy according to the type of the connection terminal, reconnecting the cloud native signaling service and the connection terminal according to the reconnection strategy and the connection information in the update queue, and restoring the connection between the cloud native signaling service and the connection terminal. If the disconnection reason is that the cloud native signaling service is restarted, then restoring the connection of the cloud native signaling service according to the preset connection strategy.
[0165] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0166] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0167] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor of an electronic device, it can achieve: obtaining the reason for the disconnection between a cloud native signaling service and a preset connection terminal. If the reason for the disconnection is that the connection terminal is disconnected, then obtaining the reason for the disconnection of the connection terminal, filtering out preset connection information according to the reason for the disconnection of the connection terminal, putting the connection information into a preset reconnection queue, obtaining an update queue, setting a reconnection strategy according to the type of the connection terminal, reconnecting the cloud native signaling service and the connection terminal according to the reconnection strategy and the connection information in the update queue, and restoring the connection between the cloud native signaling service and the connection terminal. If the reason for the disconnection is that the cloud native signaling service is restarted, then restoring the connection of the cloud native signaling service according to the preset connection strategy.
[0168] It should be noted that if software tools or components other than those of the Company appear in the embodiments of the present application, they are only used for illustration and do not represent actual use. In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0169] The modules described as separate components may or may not be physically separated, and the components shown as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0170] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, 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 modules.
[0171] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0172] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is not limited only according to the above description, and it is intended that all changes within the meaning and scope of equivalent elements within the scope of protection are included in the present invention.
[0173] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for reconnecting a cloud native signaling service after disconnection, characterized in that: The method comprises: Get the disconnection reason between the cloud native signaling service and the preset connection terminal; If the disconnection reason is that the connection terminal is disconnected, obtaining the disconnection reason of the connection terminal; Filtering the preset connection information according to the disconnection reason of the connection terminal; Put the connection information into a preset reconnection queue to obtain an update queue; Setting a reconnection strategy according to the type of the connection terminal; Reconnecting the cloud native signaling service to the connection terminal according to the reconnection strategy and the connection information in the update queue, and restoring the connection between the cloud native signaling service and the connection terminal; If the disconnection reason is the restart of the cloud native signaling service, the connection of the cloud native signaling service is restored according to the preset connection strategy.
2. The cloud native signaling service disconnection reconnection method according to claim 1, characterized in that: The step of filtering out the preset connection information according to the disconnection reason of the connection terminal includes: Obtaining the disconnection time when the connection terminal is disconnected; Determining whether the disconnection time is greater than a preset disconnection time threshold; If the disconnection time is greater than the disconnection time threshold, the disconnection reason of the connection terminal is a network problem, and the connection information between the connection terminal and the cloud native signaling service is obtained; If the disconnection time is less than or equal to the disconnection time threshold, counting the number of disconnections of the connection terminal; Determining whether the number of disconnections is greater than a preset disconnection number threshold; If the number of disconnections is greater than the disconnection number threshold, the disconnection reason of the connection terminal is that the connection terminal program crashes, and connection information between the connection terminal and the cloud native signaling service is obtained; If the number of disconnections is less than or equal to the disconnection threshold, the reason for the disconnection of the connection terminal is that the connection terminal actively disconnects, and the disconnected connection terminal is ignored.
3. The cloud native signaling service disconnection reconnection method according to claim 1, characterized in that: The setting of the reconnection strategy according to the type of the connection terminal includes: Determining whether the connection terminal type is a client terminal or a server terminal; If the connection terminal type is a client terminal, the reconnection strategy of the client terminal is to attempt to reconnect at a preset first time interval; If the connection terminal type is a server terminal, the reconnection strategy of the server terminal is to try to reconnect at a preset second time interval.
4. The cloud native signaling service disconnection reconnection method according to claim 1, characterized in that: The reconnecting the cloud native signaling service with the connection terminal according to the reconnection strategy and the connection information in the update queue, and restoring the connection between the cloud native signaling service and the connection terminal, includes: Access the connection information in the update queue one by one using a for loop; Extracting accessed connection information in the update queue; reconnecting the cloud native signaling service to the connection terminal according to the reconnection strategy and the connection information in the update queue, and determining whether the reconnection is successful according to the received signal; When a signal indicating successful reconnection is received, the connection between the cloud native signaling service and the connection terminal is restored, the connection information is removed from the update queue, and the number of waiting connections in the update queue after the removal is counted; When a signal indicating a reconnection failure is received, the number of reconnections is counted to determine whether to put the connection information back into the update queue.
5. The cloud native signaling service disconnection reconnection method according to claim 4, characterized in that: The number of waiting connections in the update queue after the statistics are removed includes: Get the number of connections waiting in the update queue after removal; Determine whether the waiting quantity is a null value; If the waiting number is a null value, all connections in the update queue are reconnected successfully; If the waiting number is not a null value, the connection information in the update queue continues to be accessed.
6. The cloud native signaling service disconnection reconnection method according to claim 4, characterized in that: The counting of the number of reconnections and determining whether to put the connection information back into the update queue includes: Counting the number of reconnections of the connection information; Determine whether the number of reconnections is greater than a preset reconnection number threshold; If the number of reconnections is greater than the reconnection number threshold, it is directly deleted from the update queue; If the number of reconnections is less than or equal to the reconnection number threshold, the connection information is put back into the update queue to try to reconnect.
7. The cloud native signaling service disconnection reconnection method according to claim 1, characterized in that: The restoring the connection of the cloud native signaling service according to the preset connection strategy includes: Determine whether the cloud native signaling service in the connection information participates in the processing of the business logic; If the cloud native signaling service participates in the processing of the business logic, the cloud native signaling service is backed up by a master and a slave according to the connection strategy to obtain an updated slave server; Using the update to connect to the acquired connection request from the server, obtaining a connection status; Writing the connection status into the database to obtain an updated database; When the cloud native signaling service restores the connection, all connection information is read from the update database for storage; If the cloud native signaling service does not participate in the processing of the business logic, the connection between the cloud native signaling service and the connection terminal is kept alive according to the connection strategy.
8. A cloud native signaling service disconnection reconnection device, characterized in that: The device comprises: The service disconnection reason acquisition module is used to obtain the disconnection reason between the cloud native signaling service and the preset connection terminal; A terminal disconnection reason acquisition module, configured to acquire the disconnection reason of the connection terminal if the disconnection reason is that the connection terminal is disconnected; A connection information screening module, used to screen out preset connection information according to the disconnection reason of the connection terminal; A reconnection queue update module, used to put the connection information into a preset reconnection queue to obtain an update queue; A reconnection strategy setting module, used to set a reconnection strategy according to the type of the connection terminal; A service terminal connection recovery module, used to reconnect the cloud native signaling service with the connection terminal according to the reconnection strategy and the connection information in the update queue, and restore the connection between the cloud native signaling service and the connection terminal; The cloud native service recovery module is used to restore the connection of the cloud native signaling service according to a preset connection strategy if the disconnection reason is the restart of the cloud native signaling service.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the cloud-native signaling service disconnection reconnection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the cloud-native signaling service disconnection reconnection method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Monitoring abnormality checking method and monitoring system thereof
CN119814475A
