Communication method and apparatus, and electronic device
By determining the target business node as the spokesperson role in the signaling intercommunication gateway and utilizing the distributed lock atomic script and health status monitoring mechanism, the problem of redundant message sending in the distributed cluster of the signaling intercommunication gateway is solved, achieving efficient utilization of network resources and system stability.
Patent Information
- Application Number
- CN202511028593.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-10-10
AI Technical Summary
In the 5G private network environment, when multiple business nodes in the distributed cluster of signaling intercommunication gateways communicate with the core network, due to the lack of an effective coordination mechanism, messages are sent redundantly, resulting in waste of network resources and increased processing burden on the core network.
By determining the target business node as the spokesperson among multiple business nodes in the signaling intercommunication gateway, and using distributed lock atomic scripts and health status monitoring mechanisms, it is ensured that only one node is responsible for sending network function heartbeat messages and update messages to avoid repeated sending.
It achieves efficient use of network resources, reduces network bandwidth waste and core network processing burden, and improves system availability and response speed.
Smart Images

Figure CN120769303A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of wireless network, in particular to a communication method and device and electronic equipment. BACKGROUND
[0002] In the 5G private network environment, the signaling interworking gateway (C-IWF) as the key bridge connecting the private network and the public 5G core network, the distributed cluster design aims to improve the high availability and load balancing capability of the system. However, in the actual operation as shown in the figure, each service node in the C-IWF cluster independently performs the message sending task of the Nnrf_NFM service, that is, the network function (Network Function, NF) registration, NF update and NF heartbeat message. Although this design enhances the fault tolerance and response speed of the system, it is not conducive to the effective use of resources, especially in the multi-instance load balancing scenario, each C-IWF instance will repeatedly send the same service message to the network storage function entity (Network Repository Function, NRF) of the core network, causing redundant signaling traffic, not only wasting valuable network bandwidth resources, but also significantly increasing the processing burden of the NRF. Figure 1
[0003] At present, there is no effective solution to the above problems. SUMMARY
[0004] The present application provides a communication method and device and electronic equipment to at least solve the technical problem of wasting network resources caused by redundant message sending due to the lack of effective coordination mechanism when multiple service nodes of the signaling interworking gateway distributed cluster communicate with the core network.
[0005] According to one aspect of the present application, a communication method is provided, comprising: determining a target service node in multiple service nodes in a signaling interworking gateway, wherein the target service node is the speaker role of the multiple service nodes; sending a local network function heartbeat message to a network storage function entity of a core network through the target service node; and in the case that the registration configuration information of the signaling interworking gateway changes, sending a network function update message to the network storage function entity through the target service node.
[0006] Optionally, determining a target service node in multiple service nodes in a signaling interworking gateway comprises: selecting multiple first service nodes supporting service interface SBI function and in a healthy state in the multiple service nodes in the signaling interworking gateway; instructing each first service node to participate in speaker role election by executing a distributed lock atomic script; and determining the first service node that first successfully acquires a distributed lock key as the speaker role.
[0007] Optionally, among the multiple service nodes in the signaling intercommunication gateway, multiple first service nodes that support the service-based interface SBI function and are in a healthy state are selected, including: receiving the SBI function enable mark sent by the network management system, wherein the SBI function enable mark is a mark generated when the service function configured by the network management system for the service node includes the SBI interface function identifier; extracting the instance identifier preset in the service node, binding the instance identifier and the SBI function enable mark to write into the distributed state database, starting the SBI health monitoring client, and binding the instance identifier as the identity identifier of the SBI health monitoring client, wherein the SBI health monitoring client is used to periodically send information to the service health monitoring client. The server sends a heartbeat message, which includes at least an instance identifier and a timestamp sequence; the business health monitoring server is used to calculate the heartbeat interval deviation value based on the timestamp sequence in the heartbeat message, and generate a health status mark when the heartbeat interval deviation value is less than a preset threshold, and bind the health status mark to the instance identifier and write it into the distributed status database; access the distributed status database, and determine that the business node is the first business node that supports the SBI function and is in a healthy state when the following conditions are met at the same time: there is an SBI function enable mark bound to the instance identifier, the health status mark bound to the instance identifier is in a valid state, and the generation time of the health status mark is within the valid time window.
[0008] Optionally, instruct each first business node to participate in the speaker role election by executing a distributed lock atomic script, including: the first business node obtains a parameter set in the process of executing the distributed lock atomic script, wherein the parameter set includes: a target resource identifier, a node identity identifier and a lease life cycle, and the target resource identifier is used to represent the distributed lock key to be preempted; calling the atomic set value instruction of the distributed storage, performing exclusive writing with the target resource identifier as the key value and the node identity identifier as the value, and generating an operation result flag according to the operation result; when the operation result flag is in the preemption permission state, adding the lease life cycle in the parameter set to the target resource identifier Restriction, and return the role holding certificate to the first business node. When the operation result is marked as the preemption rejection state, the current value of the target resource identifier is used as the actual holder identifier; when the actual holder identifier is equal to the current node identity identifier of the first business node, the lease life cycle of the target resource identifier is reset, and the role renewal confirmation certificate is generated, and the role renewal confirmation certificate is sent to the first business node as proof of successful renewal; when the actual holder identifier is not equal to the current node identity identifier of the first business node, a role preemption failure event is sent to the first business node, wherein the role preemption failure event includes the actual holder identifier.
[0009] Optionally, after determining the target service node in the plurality of service nodes in the signaling interworking gateway, the method further comprises: in the case of obtaining a node failure event of a speaker role, extracting a target resource identifier and a last active timestamp in the failure event; based on the target resource identifier, invoking a distributed lock atomic script and obtaining an incoming parameter, wherein the incoming parameter includes: the target resource identifier, the node identity of the current first service node, and the lease lifetime; through the distributed lock atomic script, the following steps are executed: in the case that the target resource identifier is not occupied, the node identity of the current first service node is written into a key value, and a candidate result flag is generated as a re-election permission; in the case that the target resource identifier is already occupied, a candidate result flag is generated as a re-election delay, and the remaining survival time of the current lock is obtained; in the case that the candidate result flag is the re-election permission, a role takeover credential is sent to the current first service node, wherein the role takeover credential includes: the target resource identifier and the last active timestamp; in the case that the candidate result flag is the re-election delay, a retry deadline is calculated according to the remaining survival time, a retry timer is started, and step S2 is retriggered after the retry timer reaches the retry deadline.
[0010] Optionally, after determining the target service node in the plurality of service nodes in the signaling interworking gateway, the method further comprises: generating a target message instance based on a network function heartbeat message according to the target node identity, the timestamp and the heartbeat period value of the target service node corresponding to the speaker role; after the target message instance is completely serialized, writing it into a string key in a distributed state database with the same name as the distributed lock key, setting the expiration time of the string key to be consistent with the remaining survival time of the distributed lock key, and returning a success identifier; sending a local network function heartbeat message to a network storage function entity of the core network through the target service node, including: in the case of detecting the success identifier and confirming that the current node holds the distributed lock key, reading the content of the string key to obtain a byte sequence, and sending the byte sequence to the network storage function entity as a request body through the target service node.
[0011] Optionally, the operation result flag is generated according to the operation result, including: in the case that the key does not exist and the writing is successful, the operation result flag is in the preemption permission state; in the case that the key already exists, the operation result flag is in the preemption rejection state.
[0012] According to still another aspect of the present application, a communication apparatus is also provided, comprising: a determining module configured to determine a target service node from a plurality of service nodes in a signaling interworking gateway, wherein the target service node is a speaker role of the plurality of service nodes; a first sending module configured to send a local network function heartbeat message to a network storage function entity of a core network through the target service node; and a second sending module configured to send a network function update message to the network storage function entity through the target service node in a case where registration configuration information of the signaling interworking gateway is changed.
[0013] According to still another aspect of the present application, a non-transitory storage medium is also provided, comprising a stored program, wherein the program, when executed, controls a device in which the storage medium is located to perform the above communication method.
[0014] According to still another aspect of the present application, an electronic device is also provided, comprising: a memory and a processor, wherein the processor is configured to execute a program stored in the memory, and the program, when executed, performs the above communication method.
[0015] According to still another aspect of the present application, a computer program is also provided, wherein the computer program, when executed by a processor, implements the above communication method.
[0016] According to still another aspect of the present application, a computer program product is also provided, comprising a non-transitory computer readable storage medium, wherein the non-transitory computer readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the above communication method.
[0017] In the present application, a target service node is determined from a plurality of service nodes in a signaling interworking gateway, wherein the target service node is a speaker role of the plurality of service nodes; a local network function heartbeat message is sent to a network storage function entity of a core network through the target service node; and in a case where registration configuration information of the signaling interworking gateway is changed, a network function update message is sent to the network storage function entity through the target service node, so that the plurality of service nodes in a signaling interworking gateway distributed cluster only perform message forwarding functions through the elected speaker role in the communication process with the core network, thereby achieving the technical effect of efficient use of network resources, and further solving the technical problem of waste of network resources caused by redundant sending of messages due to lack of effective coordination mechanism when the plurality of service nodes in the signaling interworking gateway distributed cluster communicate with the core network. BRIEF DESCRIPTION OF DRAWINGS
[0018] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
[0019] Figure 1 A signaling interaction diagram of a C-IWF distributed cluster and an NRF is shown;
[0020] Figure 2 A flowchart of a communication method according to an embodiment of the application;
[0021] Figure 3 A flowchart of another communication method according to an embodiment of the application;
[0022] Figure 4 A method flowchart of a distributed lock preemption LUA script according to an embodiment of the application;
[0023] Figure 5 A signaling interaction diagram of a C-IWF distributed cluster and an NRF according to an embodiment of the application;
[0024] Figure 6 A structural diagram of a communication device according to an embodiment of the application;
[0025] Figure 7 A hardware structural block diagram of a computer terminal of a communication method according to an embodiment of the application. DETAILED DESCRIPTION
[0026] In order to enable persons skilled in the art to better understand the application scheme, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by persons skilled in the art without creative labor should fall within the scope of protection of the application.
[0027] It should be noted that the terms "first", "second" and the like in the description and in the claims of the present application and above-described accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular sequential or chronological order. It should be understood that the data thus used can be interchanged, where appropriate, so that the embodiments of the present application described herein can be carried out in sequences other than those illustrated or described herein. Moreover, the terms "comprise" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, processes, methods, systems, products, or devices that include a series of steps or units are not necessarily limited to those clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0028] According to an embodiment of the present application, a method embodiment of a communication method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0029] Figure 2 is a flowchart of a communication method according to an embodiment of the present application, as shown in Figure 2 The method comprises the following steps:
[0030] Step S202, determining a target service node in a plurality of service nodes in a signaling interworking gateway, wherein the target service node is a speaker role of the plurality of service nodes.
[0031] In step S202, the process of determining the "TALKER" role is carried out among the plurality of service nodes in the signaling interworking gateway through a distributed coordination mechanism. This mechanism is based on a distributed lock preemption LUA script, when the service node supports the Service Based Interface (SBI) function and the health status is good, its Nnrf_NFM module will participate in the election of the "TALKER" role. The election process attempts to acquire a specific KEY by executing a SETNX command in the REDIS database, the node that successfully acquires the KEY will be assigned the "TALKER" role, its ID will be written into the KEY, and a TTL (Time To Live) timeout value will be set to realize the automatic release of the lock feature. This step is the key to ensure that only a unique node in the distributed cluster can perform a specific task, thereby avoiding redundant sending of messages and optimizing the utilization of network resources.
[0032] Step S204, sending a local network function heartbeat message to a network storage function entity of the core network through the target service node.
[0033] In step S204, the target service node corresponding to the "TALKER" role is configured to send a heartbeat message of the local network function to the network storage function entity of the core network. The sending of the heartbeat message is an important means to maintain the effectiveness of the connection between the NF and the NRF. The "TALKER" node selected to perform this task ensures that the communication with the NRF is centralized and efficient, avoiding the waste of network bandwidth and the increase of the processing burden of the NRF caused by repeated sending of multiple nodes.
[0034] In step S206, the target service node sends a network function update message to the network storage function entity in the case of a change in the registration configuration information of the signaling interworking gateway.
[0035] In step S206, when the registration configuration information of the signaling interworking gateway changes, the target service node of the "TALKER" role is configured to update these information to the NRF. Among them, the change of the registration configuration information includes the update of the NFProfile information, such as the capability, address or state change of the NF. Through the "TALKER" node for updating, the accuracy and consistency of the information can be ensured, and the conflict and unnecessary network traffic caused by multiple instances in the distributed cluster trying to update at the same time can be avoided. This process also follows the SBI interface specification defined in 3GPP TS29.510, maintaining the compatibility with the core network architecture.
[0036] In summary, the above steps determine a target service node in a plurality of service nodes in a signaling interworking gateway, wherein the target service node is the "TALKER" role of the plurality of service nodes; send a heartbeat message of the local network function to the network storage function entity of the core network through the target service node; and in the case of a change in the registration configuration information of the signaling interworking gateway, send a network function update message to the network storage function entity through the target service node. The purpose of only using the elected "TALKER" role to perform the message forwarding function in the communication process between the plurality of service nodes in the distributed cluster of the signaling interworking gateway and the core network is achieved, thereby realizing the technical effect of efficient use of network resources.
[0037] The steps shown in FIG. 8 will be exemplarily explained and explained below. Figure 2
[0038] According to some optional embodiments of the present application, the target service node in the plurality of service nodes in the signaling interworking gateway can be determined by the following method: selecting a plurality of first service nodes supporting service interface SBI function and in a healthy state from the plurality of service nodes in the signaling interworking gateway; instructing each first service node to participate in the "TALKER" role election by executing a distributed lock atomic script; and determining the first service node that first successfully acquires the distributed lock key as the "TALKER" role.
[0039] In this embodiment, to determine which first service node will play the role of "speaker", the unique network function management tasks such as sending NF heartbeat messages and configuration update triggered NF registration update messages to the NRF are performed, and each selected first service node is instructed to run a distributed lock atomic script. This script takes advantage of the atomic operation features of the REDIS database, in particular the SETNX and EXPIRE commands. By executing the SETNX command, the service node attempts to set a specific key-value pair, where the key is a unique identifier used to identify the distributed lock, and the value is the node's own ID. Because the SETNX operation has atomicity, that is, either the key-value pair is successfully set or the key already exists without any change, this ensures that only one node can successfully set the key-value pair at any time, and in turn obtain control of the lock.
[0040] When the service node executes the SETNX command and successfully sets the key-value pair, the EXPIRE command is executed to set a time to live (TTL) for the key, which is not only an automatic release mechanism for the lock to prevent lock deadlocks in the event of node failure, but also a confirmation process for the "speaker" role. The node that successfully sets the key-value pair and is assigned a TTL is determined to be the "speaker", which assumes the responsibility of unique communication with the NRF, while other service nodes follow the "speaker" role mechanism to avoid sending the same message repeatedly, thereby reducing the processing burden of the core network and the consumption of network bandwidth.
[0041] Optionally, in the plurality of service nodes in the signaling interworking gateway, the plurality of first service nodes supporting the service-based interface (SBI) function and in a healthy state can be selected by the following method: receiving an SBI function enabling mark sent by the network management system, wherein the SBI function enabling mark is a mark generated in the case that the SBI interface function identifier is included in the service function configured by the network management system for the service node; extracting an instance identifier pre-stored in the service node, binding the instance identifier with the SBI function enabling mark and writing into a distributed state database, starting an SBI health monitoring client, and binding the instance identifier as the identity of the SBI health monitoring client, wherein the SBI health monitoring client is used to periodically send a heartbeat message to a service health monitoring server, and the heartbeat message at least includes the instance identifier and a timestamp sequence; the service health monitoring server is used to calculate a heartbeat interval deviation value according to the timestamp sequence in the heartbeat message, generate a health state mark in the case that the heartbeat interval deviation value is less than a preset threshold, and bind the health state mark with the instance identifier and write into the distributed state database; accessing the distributed state database, and determining that the service node is a first service node supporting the SBI function and in a healthy state in the case that the following conditions are simultaneously met: there is the SBI function enabling mark bound with the instance identifier, the health state mark bound with the instance identifier is in a valid state, and the generation time of the health state mark is within a valid time window.
[0042] In the technical solution, the network management system indicates which service nodes should be activated to support the SBI function by sending the SBI function enabling mark. The SBI function enabling mark is generated after confirming that the SBI interface function identifier is included in the service function configured by the network management system for the specific service node. In other words, only those service nodes that are designated to perform tasks related to the SBI, such as NF registration, update, and heartbeat keep-alive, will receive and be marked as having the SBI function enabled.
[0043] After receiving the SBI function enabling mark, the service node extracts an instance identifier (Instance ID) from the information pre-set in its internal. This instance identifier is the unique identity representation of the service node in the distributed system, and by binding it with the SBI function enabling mark and writing it into the distributed state database, it can ensure that the state of the service node is uniformly managed in the distributed environment. The service node starts the SBI health monitoring client, which uses the instance identifier as its identity, periodically sends a heartbeat message containing the instance identifier and a timestamp sequence to the service health monitoring server, wherein the timestamp sequence records the time point of each heartbeat message sending.
[0044] After receiving the heartbeat message, the service end calculates the time difference between the two heartbeat messages according to the time stamp sequence in the message, that is, the heartbeat interval deviation value. If this deviation value is less than a pre-set threshold, it indicates that the heartbeat frequency of the service node is stable, and there is no abnormal delay or disconnection. At this time, the service end will generate a health status mark and bind it with the instance identifier of the service node, and write them into the distributed state database. The effectiveness of the health status mark is based on the timing of the heartbeat message and the stable interval time, which further ensures the stable operation of the service node.
[0045] To determine whether a service node is a first service node supporting SBI function and in a healthy state, access the distributed state database to check the relevant marks and status of the node. This determination needs to meet three conditions: first, there must be an SBI function enabled mark bound with the instance identifier of the service node; second, the health status mark bound with the instance identifier needs to be in a valid state; third, the generation time of the health status mark should fall within a pre-set valid time window, meaning that the service node is not only authorized to support SBI function, but also its recent heartbeat behavior shows that it is in good health and does not exceed the allowed heartbeat interval deviation range. When all three conditions are met at the same time, it is determined that the service node is a first service node that can perform Nnrf_NFM service communication tasks, and thus is included in the subsequent "speaker" role election and other related processes.
[0046] The above steps not only realize the dynamic management and monitoring of service node functions, but also ensure that the performer of key tasks in the distributed system is always in the best state, effectively improving the reliability and response speed of the system.
[0047] Optionally, the indication that each first service node participates in the speaker role election by executing the distributed lock atomic script can be implemented by the following method: the first service node obtains a parameter set in the process of executing the distributed lock atomic script, wherein the parameter set includes a target resource identifier, a node identity, and a lease lifetime, the target resource identifier is used to represent a distributed lock key to be preempted; an atomic set value instruction of the distributed storage is called to perform exclusive writing with the target resource identifier as a key value and the node identity as a value, and an operation result flag is generated according to an operation result; in the case that the operation result flag is in a preemption permission state, the target resource identifier is added with the lease lifetime limit in the parameter set, and a role holding credential is returned to the first service node, in the case that the operation result flag is in a preemption rejection state, a current value of the target resource identifier is taken as an actual holder identity; in the case that the actual holder identity is equal to the node identity of the current first service node, the lease lifetime of the target resource identifier is reset, a role renewal confirmation credential is generated, and the role renewal confirmation credential is sent to the first service node as a renewal success proof; in the case that the actual holder identity is not equal to the node identity of the current first service node, a role preemption failure event is sent to the first service node, wherein the role preemption failure event includes the actual holder identity.
[0048] Specifically, the operation result flag is generated according to the operation result, including the following steps: in the case that the key does not exist and the writing is successful, the operation result flag is in a preemption permission state; in the case that the key already exists, the operation result flag is in a preemption rejection state.
[0049] In the technical solution, a series of necessary parameters are first obtained, which form a set including a target resource identifier, a node identity, and a lease lifetime. The target resource identifier is essentially a key representing a lock to be preempted in the distributed storage, which is unique among all the nodes participating in the election and is used to identify a specific instance of the distributed lock. The node identity is a unique identifier of the first service node in the system, which is used to determine which node finally obtains the ownership of the lock in the distributed lock preemption operation. The lease lifetime is a time value, which is used to set the validity period of the lock to prevent the lock from being occupied for a long time and prevent other nodes from obtaining the resource, and also provides a mechanism for automatic release of the lock.
[0050] Then, the first service node executes an atomic set instruction, i.e. uses the SETNX command of Redis, to attempt an exclusive write operation with the target resource identifier as the key and the node identity as the value. The SETNX command has the feature that it can only successfully set the key-value pair when the key does not exist (i.e. the lock has not been occupied by any node), and returns 1 to indicate the preemption permission state, or 0 to indicate the preemption rejection state. The operation result flag is this return value, which determines whether the first service node can continue to execute the subsequent steps.
[0051] When the operation result flag is the preemption permission state (i.e. SETNX returns 1), it indicates that the first service node has successfully preempted the lock, and at this time the EXPIRE command is executed to add a lease lifetime limit to the target resource identifier, thereby setting the automatic release time of the lock. A role holding credential is generated and sent back to the first service node, which is the proof that the node has successfully obtained the "speaker" role.
[0052] On the contrary, if the operation result flag is the preemption rejection state (SETNX returns 0), it is necessary to further determine the current holder of the lock. The current value of the target resource identifier is read as the actual holder identity. After that, it is checked whether the actual holder identity matches the node identity of the first service node. If the two match, it means that the lock is currently held by the first service node, and at this time the lease lifetime of the lock is reset by executing the EXPIRE command, a role renewal confirmation credential is generated, and the credential is sent to the first service node as the proof that it has successfully renewed the "speaker" role. If the actual holder identity does not match the node identity of the first service node, it indicates that the lock is held by other nodes, and a role preemption failure event is sent to the first service node to inform it of the failure of the election, and the actual holder identity is included in the event to inform the first service node who the current "speaker" role holder is.
[0053] The above process ensures the certainty and dynamics of the "speaker" role in the distributed cluster, and at the same time effectively avoids the problems of deadlock and resource competition through atomic operation and lease mechanism, thereby ensuring the efficient execution of network function management tasks.
[0054] Optionally, after determining the target service node in the plurality of service nodes in the signaling interworking gateway, the following steps can be further performed: step S1, in a case where a node failure event of a speaker role is acquired, extracting a target resource identifier and a last active timestamp in the failure event; step S2, based on the target resource identifier, calling a distributed lock atomic script and acquiring incoming parameters, wherein the incoming parameters include: the target resource identifier, a node identity of the current first service node, and a lease survival period; step S3, performing the following steps by the distributed lock atomic script: in a case where the target resource identifier is not occupied, writing the node identity of the current first service node into a key value, and generating a candidate result flag as a re-election permission; in a case where the target resource identifier is occupied, generating the candidate result flag as a re-election delay, and acquiring a remaining survival time of the current lock; step S4, in a case where the candidate result flag is the re-election permission, sending a role takeover credential to the current first service node, wherein the role takeover credential includes: the target resource identifier and the last active timestamp; in a case where the candidate result flag is the re-election delay, calculating a retry deadline according to the remaining survival time, starting a retry timer, and retriggering step S2 after the retry timer reaches the retry deadline.
[0055] Step S1 describes a process of how to quickly respond to and handle the situation when the node that originally holds the "speaker" role fails in the distributed cluster. Once the node failure event is detected, two important information are extracted therefrom: a target resource identifier, which is a unique identifier representing the "speaker" role lock, and a last active timestamp, which records a time point at which the node last effectively executes a task.
[0056] Step S2 is entered, based on the extracted target resource identifier, a distributed lock atomic script is called to start the re-election process of the "speaker" role. While calling the script, a set of necessary incoming parameters are acquired, including the target resource identifier itself, a node identity of the first service node participating in the election, and a preset lease survival period. These parameters jointly constitute the input of the distributed lock atomic script, which is used to determine the election result and update the state of the lock.
[0057] In step S3, the distributed lock atomic script execution logic judges and updates the state, and the flow is divided into two parts. First, the script checks whether the target resource identifier is occupied by other nodes, that is, whether the lock is held by another node. If the target resource identifier is not occupied, the script will perform an exclusive write operation to write the node identity of the current first service node to the key value corresponding to the identifier, and at the same time, generate a competition result flag as "re-election permission", indicating that the current node has the right to become a new "speaker". On the contrary, if the target resource identifier is occupied, the competition result flag is generated as "re-election delay", which means that the current node needs to wait for the release of the lock. In addition, the remaining survival time of the current lock is obtained, which provides a basis for subsequent retry decision.
[0058] In step S4, different actions are taken according to the competition result flag generated in step S3. If the competition result flag is "re-election permission", it indicates that the current first service node has successfully won the competition for the lock, and sends a "role takeover credential" to the node, which contains the target resource identifier and the last active timestamp of the failed node, which helps the newly elected "speaker" understand the current state and quickly take over the related tasks. On the other hand, if the competition result flag is "re-election delay", it indicates that the current node has failed to immediately obtain the lock, and a retry period is calculated according to the previously obtained lock remaining survival time, and a retry timer is started. Once the timer reaches the preset retry period, step S2 is automatically retriggered, that is, the distributed lock atomic script is called again to give the current node an additional opportunity to try to obtain the "speaker" role.
[0059] The above mechanism ensures that even in a high-concurrency distributed environment, the "speaker" role function can be restored in time and effectively through a dynamic re-election strategy, ensuring the high availability and stability of the system.
[0060] Optionally, after determining the target service node in the plurality of service nodes in the signaling interworking gateway, the following steps can also be performed: generating a target message instance based on the network function heartbeat message according to the target node identity, the timestamp and the heartbeat period value of the target service node corresponding to the speaker role; after serializing the target message instance completely, writing it to a string key in the distributed state database with the same name as the distributed lock key, setting the expiration time of the string key to be consistent with the remaining survival time of the distributed lock key, and returning a success identifier; sending the local network function heartbeat message to the network storage function entity of the core network through the target service node, including: reading the content of the string key to obtain a byte sequence under the condition of detecting the success identifier and confirming that the current node holds the distributed lock key, and sending the byte sequence as a request body to the network storage function entity through the target service node.
[0061] In the technical solution, after the target service node is successfully elected as the "speaker" role, a specific network function heartbeat message packet instance is generated based on the target node identity of the node, the last active timestamp and the heartbeat period value. The packet instance contains the key information of the "speaker" node, which is used for the core network network storage function entity (such as NRF) to identify and monitor the state of the node.
[0062] After the target packet instance is generated, it is serialized and converted into a byte sequence format that can be transmitted and stored in a distributed environment, and the byte sequence is written into a specific string key in the distributed state database. The string key has the same name as the key used for preemption of the distributed lock, to maintain consistency and simplify resource management. At the same time, in order to ensure the timeliness and consistency of the information, an expiration time equal to the remaining survival time of the distributed lock key is set on the string key. This means that when the lock is no longer valid, the "speaker" role changes, and the information stored in the database will also be automatically invalidated, avoiding the residual and misleading of old information. After this operation is completed, a success identifier is returned, indicating that the state information of the "speaker" node has been successfully stored.
[0063] Next, the target service node corresponding to the "speaker" role, i.e. the node currently holding the lock, sends the local network function heartbeat message to the network storage function entity of the core network. Before sending, the node will first read the content written in the string key, restore it to the original byte sequence, and use this sequence as part of the request body to construct a request conforming to the network function heartbeat message format, and then send it to the network storage function entity such as NRF. The above mechanism ensures that the core network entity can timely and accurately understand the latest state of the "speaker" node, and since the message is sent only by the currently valid "speaker" node, it avoids the waste of network bandwidth and core network processing capacity caused by repeated messages, and improves the efficiency and stability of the entire system.
[0064] Figure 3 is a flowchart of another communication method according to an embodiment of the present application, as shown in Figure 3 the method comprises the following steps:
[0065] Step S301, node function configuration. Through the network management system (EMS), the C-IWF node is set up in detail for service functions, including the activation of key communication functions such as N4 interface, SBI interface and AAA-P service. The N4 interface is responsible for data forwarding and processing between the private network and the core network, while the SBI interface is a service-based interface, which is used for standardized communication and management between network functions (NFs) according to the 3GPP TS29.510 standard definition. Among them, the Nnrf_NFM service as the core component undertakes the work of NF registration, update and heartbeat message sending, ensuring the discovery and interaction ability between network functions.
[0066] Step S302, health monitoring client activation. In order to maintain the health running state of the node, each C-IWF node configured with SBI service function will activate the SBI service health monitoring client. This client can continuously monitor the health status of the node during the node running, ensuring that the node can reliably perform the network function management tasks assigned to it.
[0067] Step S303, heartbeat keep-alive mechanism. The activated SBI service health monitoring client will perform the heartbeat keep-alive mechanism, that is, periodically send heartbeat messages to the service end of the service health monitoring in the C-IWF control node. Heartbeat messages not only help the service end to master the active state of the node in real time, but also can verify the health status of the node, such as processing capacity, connection stability and resource usage. Each time the heartbeat message is sent, it is a self-health status report of the node, which is crucial for maintaining the stability and high availability of the entire distributed system.
[0068] Step S304, health status monitoring. The service health monitoring service end of the control node receives and analyzes the heartbeat messages from each service node, evaluates the real-time health status of the service node by monitoring the timestamp, response time and message content of the message, etc. If the health status of the node is determined to be abnormal or unstable, the service end takes measures such as triggering health check process, or isolating the node if necessary to prevent possible fault propagation. In addition, the health status information of the node will be updated in real time to the distributed state database Redis, ensuring that all related components can access the latest node status.
[0069] Step S305, TALKER role election mechanism. The election mechanism allows each business node to compete for the TALKER role by executing a distributed lock seizing LUA script to perform a specific unique task. In the election, the first node that successfully acquires the specified KEY (i.e., the node that successfully sets a unique identifier corresponding to it in the Redis database) will be officially recognized as the TALKER role. The ID of the node is written into the KEY, and the TTL expiration time is set to ensure the automatic release of the lock, preventing deadlock or resource deadlock. In order to enhance the high availability and dynamic adaptability of the TALKER role, the business node periodically refreshes or reattempts to seize the KEY, which means that even if the current TALKER node fails, other healthy nodes can quickly take over to maintain the continuity of the key service.
[0070] Figure 4 is a method flow chart of a distributed lock seizing LUA script according to an embodiment of the present application, as Figure 4 shown, the TALKER role can be elected by the following steps.
[0071] The first business node prepares to execute the instructions of the distributed lock atomic script, which includes the target resource identifier (i.e., the Key of the distributed lock), the node identity (Node ID), and the lease lifetime (TTL). These parameters together constitute the context environment of script execution, ensuring the atomicity and consistency of the operation.
[0072] When the first business node starts executing the script, the first step is to call the SETNX command of Redis to set the value of the target resource identifier (Key) as the node identity (Node ID) in an atomic manner. The feature of the SETNX command is that it only sets the value when the Key does not exist, ensuring that the acquisition process of the distributed lock is exclusive, avoiding the risk of the lock being set by multiple nodes at the same time. If the SETNX operation is successful, i.e., the Key has not been set by any node before, the command will return 1, indicating the seizing permission state, which means that the first business node has successfully obtained the ownership of the lock.
[0073] In the seizing permission state (SETNX returns 1), the EXPIRE command is further called to add a lease lifetime limit (TTL) to the set Key, which ensures that the lock will not be occupied indefinitely, even if the first business node suddenly fails, the lock will be automatically released after the TTL set time, providing an opportunity for other nodes to regain the ownership of the lock. Then a role holding credential is returned to confirm the identity of the first business node as the "TALKER" node, enabling it to perform unique tasks of communication with the NRF.
[0074] If the SETNX operation returns 0, it indicates that the Key has been set by other nodes, i.e. the lock has been occupied, the script will enter the branch of the preemption failure. In this case, the script will call the GET command to read the current value of the Key from the Redis database, and the current value represents the actual holder identity of the lock. If the read value matches the node identity of the first business node, it means that the first business node is currently the holder of the lock, and the EXPIRE command is called to refresh the TTL of the lock, prolong the life cycle of the lock, thereby generating a role renewal confirmation voucher to ensure the persistence of the "TALKER" role.
[0075] On the contrary, if the actual holder identity does not match the node identity of the first business node, i.e. the lock is held by other nodes, the role preemption failure event is returned, which contains the actual holder identity information. This feedback mechanism enables the first business node to understand the current state of the lock, avoiding unnecessary resource competition.
[0076] Step S306, TALKER role responsibility. The C-IWF business node selected as the TALKER role can send the C-IWF local NF heartbeat message to the core network NRF, ensuring that the NRF can monitor the state of the C-IWF node in real time and timely discover and handle potential connection problems or failures. In addition, when the network management system EMS modifies the registration configuration, the TALKER role node can also immediately synchronize the update to the core network NRF, ensuring that all NFs have consistent configuration information, thereby avoiding communication abnormalities or service interruptions caused by configuration mismatches.
[0077] Through the above mechanism, the distributed Nnrf_NFM service communication system realizes flexible configuration of node functions, real-time monitoring of health status, effective scheduling of resources, and unique control of network function management, builds a communication framework that not only meets industry standards but also has great innovation, and significantly improves the adaptability and stability of 5G private networks in complex network environments.
[0078] Figure 5 is a signaling interaction diagram of a C-IWF distributed cluster and NRF according to an embodiment of the present application, in which Figure 1 Each C-IWF node independently sends NF registration, NF update, and NF heartbeat messages to the core network NRF, regardless of its internal state or function configuration. This design may lead to a large amount of redundant message sending in a distributed cluster environment, increasing the processing burden of the NRF, increasing the consumption of network bandwidth, and increasing the risk of being misidentified as abnormal traffic.
[0079] In contrast, Figure 5A significantly optimized architecture is proposed. First, by introducing centralized node function configuration, it is ensured that only the C-IWF node that is authenticated and explicitly identified as supporting SBI function has the ability to participate in the Nnrf_NFM service. More importantly, the addition of the TALKER role mechanism enables intelligent node election based on health status and service function, which means that only one healthy node with SBI function in the system will be elected as "TALKER" to perform key tasks such as sending NF heartbeat messages and configuration updates to NRF. This improvement not only significantly reduces the total amount of signaling messages sent to NRF, avoiding unnecessary network load, but also ensures the efficiency and accuracy of task execution.
[0080] In addition, in Figure 5 , the application of distributed lock and TTL mechanism becomes the core means to realize the dynamic election of TALKER role. When the "TALKER" node cannot continue to perform its duties due to various reasons, other healthy nodes can seamlessly take over this role through the distributed lock preemption mechanism, ensuring the continuous execution of key network function management tasks and improving the high availability and fault tolerance of the system. The introduction of service health status monitoring further perfects this mechanism, only those nodes that pass the health monitoring and are in good condition are qualified to participate in the election of TALKER role, avoiding the negative impact of faulty nodes and improving the efficiency of resource allocation and use.
[0081] In summary, compared with related technologies, by implementing dynamic election and management of TALKER role, combined with health monitoring, distributed lock preemption process and TTL mechanism, the application reduces the redundant signaling impact on the core network NRF, optimizes system resource allocation, and also follows the 3GPP protocol specification, ensuring the safety and compliance of communication between the private network and the core network.
[0082] Figure 6 is a structural diagram of a communication device according to an embodiment of the application, as Figure 6 shown, the device comprises:
[0083] The determining module 62 is configured to determine a target service node from a plurality of service nodes in the signaling interworking gateway, wherein the target service node is a TALKER role of the plurality of service nodes.
[0084] The first sending module 64 is configured to send a local network function heartbeat message to a network storage function entity of a core network through the target service node.
[0085] The second sending module 66 is configured to send a network function update message to the network storage function entity through the target service node in the case that the registration configuration information of the signaling interworking gateway changes.
[0086] Optionally, the target service node is determined in the plurality of service nodes in the signaling interworking gateway, specifically comprising the following steps: selecting a plurality of first service nodes supporting service-based interface (SBI) function and in a healthy state from the plurality of service nodes in the signaling interworking gateway; instructing each first service node to participate in a speaker role election by executing a distributed lock atomic script; and determining a first service node that first successfully acquires a distributed lock key as the speaker role.
[0087] Optionally, the plurality of first service nodes supporting SBI function and in a healthy state are selected from the plurality of service nodes in the signaling interworking gateway, specifically comprising the following steps: receiving an SBI function enabling flag sent by a network management system, wherein the SBI function enabling flag is generated in a case where the SBI interface function identifier is included in the service function configured for the service node by the network management system; extracting an instance identifier pre-stored in the service node, binding the instance identifier with the SBI function enabling flag, writing the instance identifier and the SBI function enabling flag into a distributed state database, starting an SBI health monitoring client, and binding the instance identifier as an identity of the SBI health monitoring client, wherein the SBI health monitoring client is configured to periodically send a heartbeat message to a service health monitoring server, the heartbeat message at least including the instance identifier and a timestamp sequence; the service health monitoring server is configured to calculate a heartbeat interval deviation value according to the timestamp sequence in the heartbeat message, generate a health status flag in a case where the heartbeat interval deviation value is less than a preset threshold, bind the health status flag with the instance identifier, and write the health status flag and the instance identifier into the distributed state database; and accessing the distributed state database, and determining the service node as the first service node supporting SBI function and in a healthy state in a case where the following conditions are simultaneously met: the SBI function enabling flag bound with the instance identifier exists, the health status flag bound with the instance identifier is in a valid state, and a generation time of the health status flag is within a valid time window.
[0088] Optionally, the first service node is instructed to participate in the speaker role election by executing a distributed lock atomic script, specifically including the following steps: the first service node obtains a parameter set during execution of the distributed lock atomic script, wherein the parameter set includes a target resource identifier, a node identity, and a lease lifetime, and the target resource identifier is used to represent a distributed lock key to be preempted; an atomic set instruction of the distributed storage is called to perform exclusive writing with the target resource identifier as a key value and the node identity as a value, and an operation result flag is generated according to an operation result; in a case where the operation result flag is a preemption permission state, the target resource identifier is added with the lease lifetime limit in the parameter set, and a role holding credential is returned to the first service node; in a case where the operation result flag is a preemption rejection state, a current value of the target resource identifier is taken as an actual holder identity; in a case where the actual holder identity is equal to the node identity of the current first service node, the lease lifetime of the target resource identifier is reset, a role renewal confirmation credential is generated, and the role renewal confirmation credential is sent to the first service node as renewal success proof; in a case where the actual holder identity is not equal to the node identity of the current first service node, a role preemption failure event is sent to the first service node, wherein the role preemption failure event includes the actual holder identity.
[0089] Optionally, after determining the target service node among the plurality of service nodes in the signaling interworking gateway, the following steps can be further performed: in a case where a node failure event of the speaker role is obtained, the target resource identifier and the last active timestamp in the failure event are extracted; based on the target resource identifier, a distributed lock atomic script is called and incoming parameters are obtained, wherein the incoming parameters include the target resource identifier, the node identity of the current first service node, and the lease lifetime; the distributed lock atomic script is executed to perform the following steps: in a case where the target resource identifier is not occupied, the node identity of the current first service node is written into the key value, and a competition result flag is generated as a re-election permission; in a case where the target resource identifier is occupied, the competition result flag is generated as a re-election delay, and a remaining survival time of the current lock is obtained; in a case where the competition result flag is the re-election permission, a role takeover credential is sent to the current first service node, wherein the role takeover credential includes the target resource identifier and the last active timestamp; in a case where the competition result flag is the re-election delay, a retry deadline is calculated according to the remaining survival time, a retry timer is started, and step S2 is retriggered after the retry timer reaches the retry deadline.
[0090] Optionally, after determining the target service node in the plurality of service nodes in the signaling interworking gateway, the following steps can be further performed: generating a target message instance based on the network function heartbeat message according to the target node identity of the target service node corresponding to the speaker role, the timestamp and the heartbeat period value; writing the completely serialized target message instance into a string key in the distributed state database with the same name as the distributed lock key, setting an expiration time of the string key consistent with the remaining survival time of the distributed lock key, and returning a success identifier; sending the local network function heartbeat message to the network storage function entity of the core network through the target service node, including: reading the content of the string key to obtain a byte sequence under the condition that the success identifier is detected and it is confirmed that the current node holds the distributed lock key, and sending the byte sequence as a request body to the network storage function entity through the target service node.
[0091] Optionally, the operation result flag is generated according to the operation result, and specifically includes the following steps: in the case that the key does not exist and the writing is successful, the operation result flag is in the preemption permission state; and in the case that the key already exists, the operation result flag is in the preemption rejection state.
[0092] It should be noted that the above Figure 6 Each module can be a program module (for example, a program instruction set for implementing a certain specific function), or a hardware module. For the latter, it can be in the form of, but not limited to: a processor, or the functions of the above-mentioned modules are implemented by a processor.
[0093] It should be noted that Figure 6 The preferred embodiments of the embodiments shown in Figure 2 will not be described here.
[0094] Figure 7 A hardware structure block diagram of a computer terminal for implementing a communication method is shown. As Figure 7 shown, the computer terminal 70 can include one or more (shown in the figure as 702a, 702b, …, 702n) processors 702 (the processor 702 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 704 for storing data, and a transmission module 706 for communication functions. In addition, it can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. Those skilled in the art can understand that Figure 7 The structure shown is only schematic, and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 70 can also include moreFigure 7 more or less components than those shown, or configured differently. Figure 7
[0095] It should be noted that the one or more processors 702 and / or other data processing circuitry described above can be generally referred to herein as "data processing circuitry". The data processing circuitry can be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuitry can be a single standalone processing module, or incorporated in whole or in part within any one of the other elements of the computer terminal 70. As referred to in embodiments of the present application, the data processing circuitry functions as a processor to control, for example, selection of variable resistance terminal paths in connection with an interface.
[0096] The memory 704 can be used to store software programs and modules of application software, such as program instructions / data storage means corresponding to the communication method in embodiments of the present application. The processor 702 can execute various functional applications and data processing, i.e. implement the communication method described above, by running the software programs and modules stored in the memory 704. The memory 704 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 704 can further include a memory disposed remotely with respect to the processor 702, which can be connected to the computer terminal 70 through a network. Examples of the network can include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0097] The transmission module 706 is configured to receive or send data via a network. Specific examples of the network can include a wireless network provided by a communication provider of the computer terminal 70. In one example, the transmission module 706 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission module 706 can be a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.
[0098] The display can be, for example, a touch screen type liquid crystal display (LCD), which can enable a user to interact with a user interface of the computer terminal 70.
[0099] It should be noted that in some alternative embodiments, the computer terminal described above Figure 7 It should be noted that the computer terminal described above can include hardware elements (including circuitry), software elements (including computer code stored on a computer readable medium), or a combination of both hardware and software elements. It should be noted that,Figure 7 is merely one instance of a particular specific example and is intended to show the type of components that can be present in the computer terminal described above.
[0100] It should be noted that, Figure 7 The computer terminal shown is used to execute Figure 2 The communication method shown, so the relevant explanation of the execution method of the above command also applies to the electronic device, here will not be repeated.
[0101] The embodiments of the present application also provide a non-volatile storage medium, the non-volatile storage medium comprises a stored program, wherein the program controls the device where the storage medium is located to execute the above communication method when running.
[0102] The non-volatile storage medium executes the program to perform the following functions: determining a target service node in a plurality of service nodes in a signaling interworking gateway, wherein the target service node is a speaker role of the plurality of service nodes; sending a local network function heartbeat message to a network storage function entity of a core network through the target service node; and in the case that registration configuration information of the signaling interworking gateway changes, sending a network function update message to the network storage function entity through the target service node.
[0103] The embodiments of the present application also provide an electronic device, comprising: a memory and a processor, the processor is used to run the program stored in the memory, wherein the program executes the above communication method when running.
[0104] The processor is used to run the program to perform the following functions: determining a target service node in a plurality of service nodes in a signaling interworking gateway, wherein the target service node is a speaker role of the plurality of service nodes; sending a local network function heartbeat message to a network storage function entity of a core network through the target service node; and in the case that registration configuration information of the signaling interworking gateway changes, sending a network function update message to the network storage function entity through the target service node.
[0105] The above serial numbers of the embodiments of the present application are only for description, not representing the pros and cons of the embodiments.
[0106] In the above embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0107] In the above embodiments of the present application, the collected information is information and data authorized by the user or authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of related data comply with relevant laws, regulations and standards, take necessary protection measures, do not violate public order and good customs, and provide corresponding operation portal for user to choose authorization or refusal.
[0108] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other manners. For example, the described unit embodiments are merely schematic, and the division of units can be different from the above. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, and electrical or other forms.
[0109] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0110] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0111] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application, essentially or the part that makes a contribution to the related art, or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0112] The above is merely the preferred embodiments of the present application, and it should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A communication method, characterized in that: include: Determining a target service node among multiple service nodes in the signaling interworking gateway, wherein the target service node is a spokesperson role of the multiple service nodes; Sending a local network function heartbeat message to the network storage function entity of the core network through the target service node; And when the registration configuration information of the signaling intercommunication gateway changes, a network function update message is sent to the network storage function entity through the target service node.
2. The method according to claim 1, characterized in that Determining a target service node from among multiple service nodes in the signaling interworking gateway includes: Selecting, from the plurality of service nodes in the signaling interworking gateway, a plurality of first service nodes that support a service-based interface (SBI) function and are in a healthy state; Instructing each of the first service nodes to participate in the spokesperson role election by executing a distributed lock atomic script; The first service node that successfully obtains the distributed lock key is determined as the spokesperson role.
3. The method according to claim 2, characterized in that Among the plurality of service nodes in the signaling interworking gateway, a plurality of first service nodes that support a service-based interface (SBI) function and are in a healthy state are selected, including: receiving an SBI function enablement flag sent by the network management system, wherein the SBI function enablement flag is a flag generated when the service function configured by the network management system for the service node includes an SBI interface function identifier; Extract the instance identifier preset in the business node, bind the instance identifier and the SBI function enable mark to the distributed state database, start the SBI health monitoring client, and bind the instance identifier as the identity of the SBI health monitoring client, wherein the SBI health monitoring client is used to periodically send a heartbeat message to the business health monitoring server, and the heartbeat message includes at least the instance identifier and a timestamp sequence; the business health monitoring server is used to calculate the heartbeat interval deviation value according to the timestamp sequence in the heartbeat message, and generate a health status mark when the heartbeat interval deviation value is less than a preset threshold, and bind the health status mark to the instance identifier and write it into the distributed state database; Access the distributed status database and determine that the business node is the first business node that supports the SBI function and is in a healthy state when the following conditions are met at the same time: there is an SBI function enable mark bound to the instance identifier, the health status mark bound to the instance identifier is in a valid state, and the generation time of the health status mark is within the valid time window.
4. The method according to claim 2, characterized in that Instruct each of the first business nodes to participate in the spokesperson role election by executing the distributed lock atomic script, including: The first service node obtains a parameter set during execution of the distributed lock atomic script, wherein the parameter set includes: a target resource identifier, a node identity, and a lease lifecycle, wherein the target resource identifier is used to represent the distributed lock key to be preempted; Invoke an atomic set instruction of distributed storage, perform exclusive write with the target resource identifier as the key value and the node identity as the value, and generate an operation result flag according to the operation result; If the operation result flag is in the preemption permission state, add the lease life cycle limit in the parameter set to the target resource identifier, and return the role holding credential to the first service node; if the operation result flag is in the preemption rejection state, use the current value of the target resource identifier as the actual holder identifier; When the actual holder identifier is equal to the node identity identifier of the current first service node, resetting the lease lifecycle of the target resource identifier, generating a role renewal confirmation certificate, and sending the role renewal confirmation certificate to the first service node as proof of successful renewal; When the actual holder identifier is not equal to the node identity identifier of the current first service node, a role preemption failure event is sent to the first service node, wherein the role preemption failure event includes the actual holder identifier.
5. The method according to claim 4, characterized in that After determining the target service node among the multiple service nodes in the signaling interworking gateway, the method further includes: Step S1, when a node failure event of the speaker role is obtained, extracting the target resource identifier and the last active timestamp in the failure event; Step S2: Based on the target resource identifier, call the distributed lock atomic script and obtain input parameters, wherein the input parameters include: the target resource identifier, the node identity of the current first service node, and the lease life cycle; Step S3, executing the following steps through the distributed lock atomic script: if the target resource identifier is not occupied, writing the node identity of the current first service node into the key value, and generating a campaign result flag as re-election permission; if the target resource identifier is occupied, generating a campaign result flag as re-election delay, and obtaining the remaining lifetime of the current lock; Step S4: When the election result flag is re-election permission, send a role takeover credential to the current first business node, wherein the role takeover credential includes: the target resource identifier and the last active timestamp; when the election result flag is re-election delay, calculate the retry period according to the remaining lifetime, start a retry timer, and re-trigger step S2 after the retry timer reaches the retry period.
6. The method according to claim 4, characterized in that After determining the target service node among the multiple service nodes in the signaling interworking gateway, the method further includes: Generate a target message instance based on a network function heartbeat message according to a target node identity, a timestamp, and a heartbeat period value of a target service node corresponding to the speaker role; The target message instance is fully serialized and written into a string key in the distributed state database with the same name as the distributed lock key, an expiration time is set for the string key that is consistent with the remaining lifetime of the distributed lock key, and a success indicator is returned; Sending a local network function heartbeat message to a network storage function entity of a core network through the target service node includes: When the success identifier is detected and it is confirmed that the current node holds the distributed lock key, the content of the string key is read to obtain a byte sequence, and the byte sequence is sent as a request body to the network storage function entity through the target service node.
7. The method according to claim 4, characterized in that Generating an operation result flag according to the operation result, including: in the case where the key does not exist and the writing is successful, the operation result flag is the preemption permission state; In the case where the key already exists, the operation result flag is the preemption rejection state.
8. A communication device, characterized in that: include: A determination module, configured to determine a target service node among a plurality of service nodes in a signaling interworking gateway, wherein the target service node is a spokesperson role of the plurality of service nodes; A first sending module is used to send a local network function heartbeat message to the network storage function entity of the core network through the target service node; The second sending module is used to send a network function update message to the network storage function entity through the target service node when the registration configuration information of the signaling intercommunication gateway is changed.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the communication method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the communication method according to any one of claims 1 to 7 is executed when the program is run.
11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the communication method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Database lease-driven exclusive task anti-re-execution method
CN121501771A
Database lease driven exclusive task anti-duplication method
CN121501771B
