Connection management method and system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN WISDOM IOT CO LTD
- Filing Date
- 2026-05-07
- Publication Date
- 2026-08-04
AI Technical Summary
[0002]传统信令服务器功能混杂,其连接管理服务可能会受到其他业务的干扰,从而影响连接稳定性和效率
[0048] The aforementioned connection management method and system, by separating the signaling server from the cluster server, can reduce the interference of the cluster server's business logic on the signaling connection, avoid contention for cluster server resources, ensure low latency and high concurrency, and reduce service jitter caused by rapid changes in the cluster server's business logic, thereby improving the stability of the signaling connection. Furthermore, the signaling server is only used to implement the signaling connection, while the registration task is handled by the cluster server, which simplifies business branching, reduces latency, and improves connection efficiency and stability.
Smart Images

Figure CN122513461A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of signaling service technology, and in particular to a connection management method and system. Background Technology
[0002] Traditional signaling servers have mixed functions, and their connection management services may be interfered with by other services, thus affecting connection stability and efficiency. Summary of the Invention
[0003] Therefore, it is necessary to provide a connection management method and system that can improve connection stability in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a connection management method applied to a signaling server, wherein the signaling server is independent of the cluster server, and the method includes:
[0005] In response to the registration command, a registration signal is sent to the cluster server;
[0006] The system receives registration information returned by the cluster server in response to the registration signal; the registration information includes first address information, which is different for different signaling servers.
[0007] Receive the connection signal initiated by the client to the corresponding signaling server based on the first address information;
[0008] A signaling channel for connection with the client is established based on the connection signal.
[0009] In one embodiment, the connection signal carries encryption parameters and a first key generated by the client based on the encryption parameters and the device password; different connection signals carry different encryption parameters.
[0010] The signaling channel for establishing a connection with the client based on the connection signal includes:
[0011] A second key is generated based on the device password and encryption parameters sent by the cluster server.
[0012] If the second key and the first key are the same, a signaling channel is established to connect with the client.
[0013] In one embodiment, before establishing a signaling channel for connection with the client based on the connection signal, the method further includes:
[0014] A verification request is initiated to the cluster server; the verification request carries the client identifier.
[0015] Receive a confirmation signal indicating successful verification;
[0016] The confirmation signal is a signal issued by the cluster server when it confirms that the client is allowed to access the current signaling server. The cluster server verifies whether the client is allowed to access the current signaling server based on the client identifier.
[0017] In one embodiment, after establishing a signaling channel for connection with the client based on the connection signal, the method further includes:
[0018] Based on the signaling channel, a session request is sent to the client, the session request carrying a one-time temporary token and a session identifier;
[0019] Send verification information to the cluster server; the verification information includes the one-time temporary token and the session identifier;
[0020] Upon receiving a login verification confirmation signal from the cluster server, it is determined that the client's login verification has passed;
[0021] The login verification confirmation signal is sent by the cluster server after confirming that the client has passed the login verification. The cluster server confirms that the client has passed the login verification if the information carried in the login verification signal sent by the client corresponds to the verification information. The login verification signal initiated by the client carries a one-time temporary token, a session identifier, and a client identifier.
[0022] In one embodiment, after determining that the client login verification is successful, the method further includes:
[0023] Receive migration signaling from the cluster server; the migration signaling carries the second address information of the new signaling server;
[0024] The migration signaling is sent to the client to instruct the client to disconnect the signaling channel established with the current signaling server and establish a new signaling channel with the signaling server corresponding to the second address information.
[0025] In one embodiment, the client includes a device and an app.
[0026] After confirming that the client login verification is successful, the method further includes:
[0027] After confirming that both the device and the APP have successfully logged in, the system receives point-to-point call signaling from the APP. The point-to-point call signaling carries a device identifier and transmission information, including at least one of media negotiation information and network candidate address information.
[0028] The transmitted information is transparently transmitted to the device corresponding to the device identifier.
[0029] In one embodiment, the client includes an APP.
[0030] The connection signal initiated by the receiving client to the corresponding signaling server based on the first address information includes:
[0031] The APP client receives a connection signal initiated by the corresponding signaling server based on the best first address information.
[0032] The optimal first address information is the first address information of the optimal signaling server determined by the cluster server based on at least one of the geographical location and network quality of the APP.
[0033] In one embodiment, after determining that the client login verification is successful, the method further includes:
[0034] Send configuration signaling to the client, the configuration signaling carrying configuration information, the configuration information including at least one of the interval for sending heartbeat signals and reconnection strategy;
[0035] A first heartbeat signal is sent to the client based on the configuration information;
[0036] Upon receiving the first heartbeat confirmation signal from the client, it is determined that the client is online; and / or
[0037] Upon receiving the second heartbeat signal from the client, a second heartbeat confirmation signal is sent to the client.
[0038] Secondly, this application provides a connection management system, including:
[0039] The signaling server is used to execute the steps of the above method;
[0040] A cluster server is used to respond to a registration signal and return registration information to the signaling server; the registration information includes first address information, which is different for different signaling servers.
[0041] In one embodiment, upon receiving a verification request, the cluster server is further configured to verify whether the client is allowed to access the current signaling server based on the client identifier; if it is confirmed that the client is allowed to access the current signaling server, it sends a verification success confirmation signal to the signaling server; wherein the verification request carries the client identifier; and / or
[0042] If the information carried in the login verification signal received from the client corresponds to the verification information received from the signaling server, it is determined that the client has passed the verification, and a login verification confirmation signal is sent to the signaling server; wherein, the login verification signal carries a one-time temporary token, a session identifier, and a client identifier; and / or
[0043] Send a migration signaling message to the signaling server, the migration signaling message carrying the second address information of the new signaling server; and / or
[0044] When the client includes an APP, the first address information of the optimal signaling server is determined based on at least one of the geographical location and network quality of the APP as the best first address information, and the best first address information is sent to the APP.
[0045] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0046] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of the above-described method.
[0047] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the steps of the above-described method.
[0048] The aforementioned connection management method and system, by separating the signaling server from the cluster server, can reduce the interference of the cluster server's business logic on the signaling connection, avoid contention for cluster server resources, ensure low latency and high concurrency, and reduce service jitter caused by rapid changes in the cluster server's business logic, thereby improving the stability of the signaling connection. Furthermore, the signaling server is only used to implement the signaling connection, while the registration task is handled by the cluster server, which simplifies business branching, reduces latency, and improves connection efficiency and stability. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is one of the flowcharts illustrating the connection management method in one embodiment.
[0051] Figure 2 This is the second flowchart of a connection management method in one embodiment.
[0052] Figure 3 This is the third flowchart of a connection management method in one embodiment.
[0053] Figure 4 This is the fourth flowchart of a connection management method in one embodiment.
[0054] Figure 5 This is the fifth flowchart of a connection management method in one embodiment.
[0055] Figure 6 This is the sixth flowchart of a connection management method in one embodiment.
[0056] Figure 7 This is the seventh flowchart of a connection management method in one embodiment.
[0057] Figure 8 This is the eighth flowchart of a connection management method in one embodiment.
[0058] Figure 9 This is a structural block diagram of the connection management system in one embodiment.
[0059] Figure 10 This is an internal structural diagram of a computer device in one embodiment.
[0060] Figure label:
[0061] 100: Signaling server; 200: Cluster server. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0063] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0064] Traditional signaling services typically employ a star topology deployment. The signaling service itself is not a single point but a cluster, potentially containing multiple nodes. These nodes are usually in a fully connected, mesh-like synchronous state, presenting a single star-shaped center to the outside world. In this model, business logic such as device authentication and permission verification, as well as other connectionless services like device management, are naturally intertwined with the signaling process. Separating these functions would increase complexity and latency, hence the integration of these functionalities into the signaling service. However, this setup results in a mixed functionality, complex logic, and high maintenance costs for the signaling service, consequently affecting the stability and efficiency of signaling connections. For example, if one device sends a registration request and another device calls for signaling, the signaling service must wait for the device registration to be completed before processing the signaling connection, leading to low connection efficiency. If the business logic service has a heavy load, consuming significant memory, it may directly cause global latency, affecting signaling processing. Furthermore, devices may drop out due to not receiving timely signaling feedback, resulting in low signaling connection stability.
[0065] Firstly, this application provides a connection management method applied to a signaling server, which is independent of the cluster server.
[0066] The signaling server is used to implement the signaling service logic, while the cluster server is used to implement other logic besides the signaling service logic.
[0067] The signaling server is independent of the cluster server. As a separately deployed server, it is separate from, does not co-locate with, and is not coupled with the cluster servers that handle other logic. The signaling server does not handle business logic, device management logic, etc. The signaling server can have its own thread pool, memory, and network bandwidth, avoiding resource contention with the cluster server. Independently deployed signaling servers enable elastic scaling and automatic failover, thus providing a foundation for global deployment.
[0068] Understandably, signaling is extremely sensitive to latency and stability, and cluster servers can become unstable due to high CPU load, network congestion, and memory leaks. Adding a signaling server to the cluster could lead to all users dropping out in the event of a sudden signaling processing timeout. However, if the signaling server is kept independent of the cluster, sudden issues during business logic processing will only affect the corresponding business logic, with minimal impact on the signaling itself.
[0069] See Figure 1 The connection management method provided in this embodiment includes steps S102 to S108, wherein:
[0070] Step S102: In response to the registration command, a registration signal is sent to the cluster server.
[0071] Understandably, without registration, it is impossible to distinguish between signaling servers, and devices cannot determine the source of the signaling when receiving it. Therefore, it is necessary to register the signaling server.
[0072] This could involve sending a registration signal to the regional master node (Master) or the registry center (Consul) in the cluster server.
[0073] Step S104: Receive registration information returned by the cluster server in response to the registration signal; the registration information includes first address information, which is different for different signaling servers.
[0074] The registration signal sent by the signaling server to the cluster server can carry the corresponding internal network IP, port, etc. The cluster server generates the first address information based on the information carried by the registration signal according to the internally configured method.
[0075] The first address information is a unique network address that can be accessed by the client or other services. If the first address information of different signaling servers is the same, the client cannot distinguish the signaling server to connect to. By restricting the first address information of different signaling servers to be different, it can be ensured that the client accurately connects to the corresponding server.
[0076] The registration information may also include port information, such as using port 443 or port 8080.
[0077] Step S106: Receive the connection signal initiated by the client to the corresponding signaling server based on the first address information.
[0078] The signaling server receiving a connection signal indicates that it has received an initial handshake request initiated by the client, with the purpose of establishing a signaling channel.
[0079] The client can send a request to the cluster server to obtain a signaling access point. This request can carry a client identifier. The cluster server can assign a signaling server to the client based on the client identifier, or it can assign multiple signaling servers to the client. The client selects one signaling server to connect to. The information sent by the cluster server to the client's signaling server is the first address information corresponding to the signaling server.
[0080] The client identifier can also be obtained by registering with the cluster server, which will not be elaborated here.
[0081] The connection signal can be a WebSocket connection signal, which means that the client initiates a WebSocket connection to the corresponding signaling server based on the first address information.
[0082] Step S108: Establish a signaling channel for connection with the client based on the connection signal.
[0083] After establishing a signaling channel, the client and the signaling server can interact by sending JSON or binary messages through the signaling channel. There are no restrictions on the messages transmitted through the signaling channel.
[0084] Once the interaction is complete, the current signaling channel is no longer needed, and the current signaling server has no other signaling services, the signaling server can automatically request deregistration from the cluster server.
[0085] The aforementioned connection management method, by separating the signaling server from the cluster server, reduces interference from the cluster server's business logic on the signaling connection, avoids contention for cluster server resources, ensures low latency and high concurrency, and reduces service jitter caused by rapid changes in the cluster server's business logic, thereby improving the stability of the signaling connection. Furthermore, since the signaling server is only used to implement the signaling connection, and the registration task is handled by the cluster server, business branches can be simplified, latency reduced, and connection efficiency and stability improved.
[0086] In one embodiment, the connection signal can carry the client type. For example, if the client is a device, the signaling server can process the device's signaling based on the path / dev. If the client is a mobile app, the signaling server can process the app's signaling based on the path / client.
[0087] Among them, the device side can be IoT cameras, sensors, smart speakers, smart air conditioners, smart washing machines, robot vacuum cleaners and other IoT devices.
[0088] In one embodiment, the connection signal carries encryption parameters and a first key generated by the client based on the encryption parameters and the device password; different connection signals carry different encryption parameters.
[0089] For example, encryption parameters may include encryption type (cipher-type) and encryption salt (cipher-salt). The encryption salt can be sent to the client by the cluster server. The encryption type is used to specify the encryption algorithm, such as password-based key derivation function 2 (PBKDF2), password hash algorithm scrypt, memory-based key derivation algorithm bcrypt, or a custom hash algorithm. According to the specified encryption algorithm, the encryption salt and the device password are encrypted to generate the first key.
[0090] Step S108: Establish a signaling channel for connection with the client based on the connection signal. (See [link]) Figure 2 Step S108 includes steps S202 to S204, wherein:
[0091] Step S202: Generate a second key based on the device password and encryption parameters sent by the cluster server.
[0092] The signaling server generates a second key based on the encryption type in the encryption parameters, the obtained encryption salt value, and the device's local password.
[0093] Each time a signaling channel is established, a random encryption salt value is generated. Therefore, even if the client is the same, the first key obtained will be different in different connection scenarios.
[0094] Step S204: If the second key and the first key are the same, establish a signaling channel to connect with the client.
[0095] Understandably, if the signaling server and the client do not correspond, the device password cannot be obtained, and therefore the second key, which is the same as the first key, cannot be generated based on the encryption type and encryption salt value.
[0096] By setting up encryption algorithms, two-way authentication between the client and the signaling server can be achieved, thereby improving the security of the signaling channel.
[0097] In one embodiment, before establishing a signaling channel for connection with the client based on the connection signal, i.e. before step S108, see [reference needed]. Figure 3 The method further includes steps S302 to S304, wherein:
[0098] Step S302: Send a verification request to the cluster server; the verification request carries the client identifier.
[0099] The client has connected to the signaling server via a connection signal, but cannot use the signaling service until a signaling channel is established. Initiating a verification request at this point verifies the client's legitimacy.
[0100] Step S304: Receive a confirmation signal indicating that the verification has passed.
[0101] The acknowledgment signal is a signal sent by the cluster server to confirm that the client is allowed to access the current signaling server. The cluster server verifies whether the client is allowed to access the current signaling server based on the client identifier.
[0102] For example, the cluster server can verify whether the current client is in the blacklist of the current signaling server based on the client identifier, and verify whether the current client has permission to access the current signaling server. If access is confirmed to be allowed, the cluster server sends a verification confirmation signal to the signaling server.
[0103] By using cluster servers for access control verification, not only can unauthorized clients be prevented from accessing the signaling server and the legitimacy of accessing clients be confirmed, thus improving security performance, but the business logic of the signaling server can also be simplified, thereby improving the stability of the signaling connection.
[0104] In one embodiment, after establishing a signaling channel for connection with the client based on the connection signal, i.e. after step S108, refer to... Figure 4 The method further includes steps S402 to S406, wherein:
[0105] Step S402: Based on the signaling channel, a session request is sent to the client. The session request carries a one-time temporary token (TokenCode) and a session identifier (SessionId).
[0106] A one-time temporary token is a temporary credential that is used only once. It is a random string and the session identifier can be uniquely associated with this session.
[0107] Step S404: Send verification information to the cluster server; the verification information includes a one-time temporary token and a session identifier.
[0108] The signaling server sends a one-time temporary token and session identifier to the client, and then sends them to the cluster server to provide a basis for the cluster server to verify the client's login request.
[0109] Step S406: Upon receiving a login verification confirmation signal from the cluster server, confirm that the client login verification is successful.
[0110] The login verification confirmation signal is sent by the cluster server after confirming that the client has passed the login verification. The cluster server confirms that the client has passed the login verification if the information carried in the login verification signal sent by the client corresponds to the verification information. The login verification signal initiated by the client carries a one-time temporary token, a session identifier, and a client identifier.
[0111] After receiving a session request from the signaling server, the client sends a login verification signal to the cluster server. The login verification signal carries a one-time temporary token, a session identifier, and a client identifier. The cluster server verifies the client based on the verification information received from the signaling server. If the information matches, the client login verification corresponding to the client identifier is successful, and the cluster server sends a login verification confirmation signal to the signaling server.
[0112] The signaling server is only used to initiate session requests and send authentication information to the cluster server. The actual login authentication process is completed by the cluster server. This not only improves the security of the signaling connection, but also simplifies the business logic of the signaling server and improves the stability of the signaling connection.
[0113] In one embodiment, after confirming that the client login verification is successful, i.e. after step S406, refer to Figure 5 The method further includes steps S502 to S504, wherein:
[0114] Step S502: Receive migration signaling from the cluster server; the migration signaling carries the second address information of the new signaling server.
[0115] The cluster server sends a migration signaling message to the signaling server, which carries the second address information of the new signaling server.
[0116] Step S504: Send migration signaling to the client to instruct the client to disconnect the signaling channel established with the current signaling server and establish a new signaling channel with the signaling server corresponding to the second address information.
[0117] After receiving the migration signaling, the client disconnects from the current signaling server and establishes a new signaling channel with the corresponding signaling server based on the second address information carried in the migration signaling. The process of establishing a signaling channel based on the second address information can be found in the previous section. The process of establishing a signaling channel based on the first address information will not be described here.
[0118] Throughout the process, the signaling server does not handle complex business logic; it only forwards migration signaling from the cluster server to the client, simplifying the signaling server's business logic. Furthermore, it can promptly establish a signaling channel with a new signaling server after disconnecting from the current one, enabling a smooth migration. The cluster server can also dynamically manage each signaling server.
[0119] In one embodiment, the client includes an APP.
[0120] Step S106, receiving a connection signal initiated by the client to the corresponding signaling server based on the first address information, including:
[0121] Receive the connection signal initiated by the APP to the corresponding signaling server based on the best first address information;
[0122] Among them, the best first address information is the first address information of the optimal signaling server determined by the cluster server based on at least one of the geographical location and network quality of the APP.
[0123] The cluster server can determine the most suitable signaling server (optimal signaling server) for the APP based on geographical location and network quality, and then send the first address information of the most suitable signaling server to the APP. The APP initiates a connection signal to the signaling server based on the optimal first address information.
[0124] The cluster server can also determine the optimal signaling server based on the geographical location and network quality of the APP, combined with the real-time load, geographical location, and network quality of the candidate signaling servers.
[0125] Based on the aforementioned selection, not only can the business logic of the signaling server be simplified, but also a signaling server with relatively lower latency and higher stability can be selected, thereby achieving a more stable signaling connection.
[0126] In one embodiment, the client includes a device and an app. The device has a device identifier and the app has an app identifier.
[0127] After confirming successful client login verification, i.e. after step S406, refer to... Figure 6 The method further includes steps S602 to S604, wherein:
[0128] Step S602: After confirming that both the device and the APP have successfully logged in, receive the point-to-point call signaling (StartP2P) sent by the APP. The point-to-point call signaling carries the device identifier and transmission information, which includes at least one of Media Negotiation Information (MediaSDP) and Network Candidate Address Information (NetCandi).
[0129] Step S604: Transmit the information to the device corresponding to the device identifier.
[0130] When the APP sends a point-to-point call signaling to the signaling server, it indicates that the APP wants to have a conversation with the target device. At this time, the signaling server does not parse the transmission information carried by the point-to-point call signaling, but directly transmits the transmission information to the device based on the device identifier.
[0131] Media negotiation information can include media type, such as audio and video, and codec-supported formats, such as H.264, VP8, and Opus. Network candidate address information typically refers to information carrying ICE (Interactive Connectivity Establishment) candidate addresses. The signaling server does not parse data; it only performs transparent forwarding, which simplifies the signaling server's business logic, improves stability, and reduces latency and resource consumption.
[0132] In one embodiment, after confirming that the client login verification is successful, i.e. after step S406, refer to Figure 7 The method further includes steps S702 to S706, wherein:
[0133] Step S702: Send configuration signaling to the client. The configuration signaling carries configuration information, which includes at least one of the interval for sending heartbeat signals and reconnection strategy.
[0134] The interval for sending heartbeat signals refers to the time interval at which the client periodically sends heartbeat signals to the signaling server, or the time interval at which the signaling server periodically sends heartbeat signals to the client. For example, a reconnection strategy can define the timing of reconnection, the reconnection interval, and the state recovery during reconnection. For instance, the reconnection timing might be initiated after a heartbeat signal timeout is detected. The reconnection interval could be every 5 seconds, and the state recovery during reconnection could be simply re-establishing the connection or restoring the session. No specific limitations are imposed on the reconnection strategy here.
[0135] Step S704: Send the first heartbeat signal to the client based on the configuration information.
[0136] Step S706: Upon receiving the first heartbeat confirmation signal from the client, determine that the client is online.
[0137] Understandably, heartbeat signals and reconnection strategies are crucial components for establishing stable signaling channels. For independently deployed signaling servers, implementing heartbeat confirmation and reconnection after disconnection ensures that the heartbeat is not interfered with by the cluster server's operations, improves the accuracy of connection liveness detection, and thus enhances stability.
[0138] In one embodiment, after confirming that the client login verification is successful, i.e. after step S406, refer to Figure 8 The method further includes steps S802 to S804, wherein:
[0139] Step S802: Send configuration signaling to the client. The configuration signaling carries configuration information, including at least one of the interval for sending heartbeat signals and reconnection strategy.
[0140] For specific details, please refer to step S702, which will not be elaborated here.
[0141] Step S804: Upon receiving the second heartbeat signal from the client, send a second heartbeat confirmation signal to the client.
[0142] By performing heartbeat confirmation and reconnection after disconnection, the stability of signaling connections can be improved.
[0143] In one embodiment, the device can carry its own protocol version number during registration. This protocol version number can be associated with a device identifier. When the APP obtains a list of available devices, it can return the protocol version number to the APP. This protocol version number indicates whether the corresponding device is a new or old device. Old devices can interact based on signaling channels already established using traditional methods, while new devices can establish signaling channels based on the methods defined in this application embodiment. The two signaling services operate independently, ensuring compatibility between the new and old systems and a smooth transition.
[0144] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0145] Based on the same inventive concept, this application also provides a connection management system for implementing the connection management method described above. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations in one or more connection management system embodiments provided below can be found in the limitations of the connection management method described above, and will not be repeated here.
[0146] In one exemplary embodiment, this application provides a connection management system, see [link to relevant documentation]. Figure 9 This includes a signaling server 100 and a cluster server 200, which are connected in communication.
[0147] The signaling server 100 is used to execute the steps of the method in the above embodiments. Specific limitations can be found in the limitations described in the above embodiments, and will not be repeated here.
[0148] Cluster server 200 is used to respond to registration signals and return registration information to signaling server 100; the registration information includes first address information, which is different for different signaling servers 100.
[0149] The aforementioned connection management system, by separating the signaling server 100 from the cluster server 200, reduces interference from the cluster server 200's business logic on signaling connections. It also avoids resource contention on the cluster server 200, ensuring low latency and high concurrency. Furthermore, it reduces service jitter caused by rapid changes in the cluster server 200's business logic, thereby improving the stability of signaling connections. Moreover, since the signaling server 100 is only used for implementing signaling connections, and the registration task is handled by the cluster server 200, business processes are simplified, latency is reduced, and connection efficiency and stability are improved.
[0150] In one embodiment, upon receiving a verification request, the cluster server 200 is further configured to verify whether the client is allowed to access the current signaling server 100 based on the client identifier; if it is confirmed that the client is allowed to access the current signaling server 100, it sends a verification success confirmation signal to the signaling server 100; wherein the verification request carries the client identifier. For details regarding the limitations of the cluster server 200 in the foregoing embodiments, they will not be repeated here.
[0151] In one embodiment, if the information carried in the login verification signal received from the client corresponds to the verification information received from the signaling server 100, it is determined that the client has passed the verification, and a login verification confirmation signal is sent to the signaling server 100; wherein, the login verification signal carries a one-time temporary token, a session identifier, and a client identifier. For details regarding the limitations of the cluster server 200 in the foregoing embodiments, they will not be repeated here.
[0152] In one embodiment, a migration signaling message is sent to the signaling server 100, carrying the second address information of the new signaling server 100. For details regarding the limitations of the cluster server 200 in the foregoing embodiments, they will not be repeated here.
[0153] In one embodiment, when the client includes an APP, the first address information of the optimal signaling server 100 is determined based on at least one of the APP's geographical location and network quality, and the optimal first address information is sent to the APP. For details regarding the limitations of the cluster server 200 in the foregoing embodiments, they will not be repeated here.
[0154] Each server in the aforementioned connection management system can be implemented entirely or partially through software, hardware, or a combination thereof.
[0155] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores connection management data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a connection management method.
[0156] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0157] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps described above.
[0158] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps described above.
[0159] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps described above.
[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0161] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0162] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A connection management method, characterized in that, Applied to a signaling server, which is independent of the cluster server, the method includes: In response to the registration command, a registration signal is sent to the cluster server; The system receives registration information returned by the cluster server in response to the registration signal; the registration information includes first address information, which is different for different signaling servers. Receive the connection signal initiated by the client to the corresponding signaling server based on the first address information; A signaling channel for connection with the client is established based on the connection signal.
2. The method according to claim 1, characterized in that, The connection signal carries encryption parameters and a first key generated by the client based on the encryption parameters and the device password; The encryption parameters carried by the different connection signals are different; The signaling channel for establishing a connection with the client based on the connection signal includes: A second key is generated based on the device password and encryption parameters sent by the cluster server. If the second key and the first key are the same, a signaling channel is established to connect with the client.
3. The method according to claim 1 or 2, characterized in that, Before establishing a signaling channel for connection with the client based on the connection signal, the method further includes: A verification request is initiated to the cluster server; the verification request carries the client identifier. Receive a confirmation signal indicating successful verification; The confirmation signal is a signal issued by the cluster server when it confirms that the client is allowed to access the current signaling server. The cluster server verifies whether the client is allowed to access the current signaling server based on the client identifier.
4. The method according to claim 3, characterized in that, After establishing a signaling channel with the client based on the connection signal, the method further includes: Based on the signaling channel, a session request is sent to the client, the session request carrying a one-time temporary token and a session identifier; Send verification information to the cluster server; the verification information includes the one-time temporary token and the session identifier; Upon receiving a login verification confirmation signal from the cluster server, it is determined that the client's login verification has passed; The login verification confirmation signal is sent by the cluster server after confirming that the client has passed the login verification. The cluster server confirms that the client has passed the login verification if the information carried in the login verification signal sent by the client corresponds to the verification information. The login verification signal initiated by the client carries a one-time temporary token, a session identifier, and a client identifier.
5. The method according to claim 4, characterized in that, After confirming that the client login verification is successful, the method further includes: Receive migration signaling from the cluster server; the migration signaling carries the second address information of the new signaling server; The migration signaling is sent to the client to instruct the client to disconnect the signaling channel established with the current signaling server and establish a new signaling channel with the signaling server corresponding to the second address information.
6. The method according to claim 4, characterized in that, The client includes a device and an app. After confirming that the client login verification is successful, the method further includes: After confirming that both the device and the APP have successfully logged in, the system receives point-to-point call signaling from the APP. The point-to-point call signaling carries a device identifier and transmission information, including at least one of media negotiation information and network candidate address information. The transmitted information is transparently transmitted to the device corresponding to the device identifier.
7. The method according to claim 4, characterized in that, The client includes an APP; The connection signal initiated by the receiving client to the corresponding signaling server based on the first address information includes: The APP client receives a connection signal initiated by the corresponding signaling server based on the best first address information. The optimal first address information is the first address information of the optimal signaling server determined by the cluster server based on at least one of the geographical location and network quality of the APP.
8. The method according to claim 4, characterized in that, After confirming that the client login verification is successful, the method further includes: Send configuration signaling to the client, the configuration signaling carrying configuration information, the configuration information including at least one of the interval for sending heartbeat signals and reconnection strategy; A first heartbeat signal is sent to the client based on the configuration information; Upon receiving the first heartbeat confirmation signal from the client, it is determined that the client is online; and / or Upon receiving the second heartbeat signal from the client, a second heartbeat confirmation signal is sent to the client.
9. A connection management system, characterized in that, include: A signaling server, configured to perform the steps of the method according to any one of claims 1-8; A cluster server is used to respond to a registration signal and return registration information to the signaling server; the registration information includes first address information, which is different for different signaling servers.
10. The system according to claim 9, characterized in that, Upon receiving a verification request, the cluster server is further configured to verify whether the client is allowed to access the current signaling server based on the client identifier; if it confirms that the client is allowed to access the current signaling server, it sends a verification success confirmation signal to the signaling server; wherein the verification request carries the client identifier; and / or If the information carried in the login verification signal received from the client corresponds to the verification information received from the signaling server, it is determined that the client has passed the verification, and a login verification confirmation signal is sent to the signaling server; wherein, the login verification signal carries a one-time temporary token, a session identifier, and a client identifier; and / or Send a migration signaling message to the signaling server, the migration signaling message carrying the second address information of the new signaling server; and / or When the client includes an APP, the first address information of the optimal signaling server is determined based on at least one of the geographical location and network quality of the APP as the best first address information, and the best first address information is sent to the APP.