Method for realizing online and offline of equipment, electronic equipment and computer readable medium
By adopting a heartbeat management mechanism in the SMSC system, automatically sense the equipment offline and trigger disaster recovery switching, the problem of impact on SMS services caused by equipment failure in the prior art is solved, and the availability and response efficiency of the system are improved.
Patent Information
- Application Number
- CN202311673867.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-06
- Publication Date
- 2025-06-06
AI Technical Summary
The existing SMSC system needs to manually block the link or stop the business process when the equipment fails, resulting in a long time of impact on the SMSC service and causing economic losses and life impacts to operators and end users.
The heartbeat management mechanism is adopted to automatically sense the equipment to go offline by sending a heartbeat detection request message to the device and monitoring the response, and automatically control the equipment to enter the offline mode to prepare for the subsequent automatic triggering of disaster recovery switching.
It shortens the time when SMS services are affected, reduces the impact on operators and end users, and improves the availability of the system.
Smart Images

Figure CN120111096A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of mobile communication technology, and in particular to a method for implementing device online and offline, an electronic device, and a computer-readable medium. Background Art
[0002] As a basic telecommunications service, traditional short messages are widely used, and all walks of life pay attention to the use of short messages, such as identity code verification SMS, notification SMS, and marketing SMS, etc. SMS still "permanently exists" in various forms and is an indispensable communication tool for us, so there are higher requirements for the availability of the Short Message Service Center (SMSC) system.
[0003] However, the current disaster recovery method of the SMSC system is to manually trigger disaster recovery by manually blocking the link or stopping the service process after receiving user complaints or maintenance personnel discovering system failures. This method prolongs the time that SMS services are affected. From the perspective of operator customers, this period will cause a certain loss of revenue; from the perspective of end users, the inability to send and receive SMS, especially verification code SMS, will have a certain impact on users' daily travel and life. Summary of the invention
[0004] The embodiments of the present application provide a method for implementing device online and offline, an electronic device, and a computer-readable medium.
[0005] In a first aspect, an embodiment of the present application provides a method for implementing device online and offline operation, which is applied to a first device of a short message service center system, and the method includes: sending a heartbeat detection request message to a second device; determining whether a heartbeat detection response message of the second device is received within a preset time, and if no heartbeat detection response message of the second device is received within the preset time, determining that the second device is in offline mode, and controlling the first device to enter offline mode.
[0006] In a second aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor; a memory, wherein at least one program is stored in the memory, and when the at least one program is executed by the at least one processor, any one of the above-mentioned methods for realizing device online and offline is implemented.
[0007] In a third aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, any of the above-mentioned methods for realizing device online and offline is implemented.
[0008] The method for implementing device online and offline provided in the embodiment of the present application is based on the heartbeat management mechanism, automatically senses the offline of external or internal equipment, and automatically implements the offline, preparing for the subsequent automatic triggering of disaster recovery switching, shortening the time when SMS services are affected, reducing the impact on operators and end users, and improving the availability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A flowchart of a method for implementing device online and offline provided by an embodiment of the present application;
[0010] Figure 2 A schematic diagram of the deployment of the SMSC system according to an embodiment of the present application;
[0011] FIG3( a ) is a schematic diagram of an automatic offline sequence of internal devices of an SMSC system provided in Example 1 of an embodiment of the present application;
[0012] FIG3( b ) is a schematic diagram of an automatic online sequence of internal devices of an SMSC system provided in Example 1 of an embodiment of the present application;
[0013] FIG4( a ) is a schematic diagram of an automatic offline sequence of internal devices of an SMSC system provided in Example 2 of an embodiment of the present application;
[0014] FIG4( b ) is a schematic diagram of an automatic online sequence of internal devices of an SMSC system provided in Example 2 of an embodiment of the present application;
[0015] Figure 5 A block diagram of the composition of an electronic device provided in accordance with another embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the technical solution of the present application, the method for implementing device online and offline, electronic device, and computer-readable medium provided by the present application are described in detail below in conjunction with the accompanying drawings.
[0017] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make this application thorough and complete and to enable those skilled in the art to fully understand the scope of this application.
[0018] In the absence of conflict, the embodiments of the present application and the features therein may be combined with each other.
[0019] As used herein, the term "and / or" includes any and all combinations of at least one of the associated listed items.
[0020] The terms used herein are only used to describe specific embodiments and are not intended to limit the present application. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of at least one other feature, whole, step, operation, element, component and / or its group is not excluded.
[0021] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this application, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined herein.
[0022] Figure 1 A flowchart of a method for implementing device online and offline provided in one embodiment of the present application.
[0023] First, refer to Figure 1 An embodiment of the present application provides a method for implementing device online and offline, which is applied to a first device of an SMSC system, and the method includes:
[0024] Step 100: Send a heartbeat detection request message to the second device.
[0025] In some exemplary embodiments, the SMSC system is deployed in a 1+1 load sharing manner. Figure 2 As shown, SMSC system 1 and SMSC system 2 are deployed in a 1+1 load sharing manner. When SMSC system 1 is offline, the services of SMSC system 1 can be transferred to SMSC system 2 for processing; when SMSC system 2 is offline, the services of SMSC system 2 can be transferred to SMSC system 1 for processing, thus achieving load sharing.
[0026] like Figure 2 As shown, the SMSC system 1 or the SMSC system 2 includes: an external interface device, a message processing device, a service logic processing device and an operation and maintenance device.
[0027] In some exemplary embodiments, the operation and maintenance equipment is used to manage external interface equipment, message processing equipment, and business logic processing equipment, send configurations to external interface equipment, message processing equipment, and business logic processing equipment, and receive alarms reported by external interface equipment, message processing equipment, and business logic processing equipment.
[0028] In some exemplary embodiments, the external interface device is used to connect to an external network element, process the link of the external network element, send the message received from the external network element to the message processing device, and send the message received from the message processing device to the external network element.
[0029] In some exemplary embodiments, when sending a message received from an external network element to a message processing device, the external interface device determines an online message processing device, and then sends the received message to the online message processing device in a predetermined order.
[0030] In some exemplary embodiments, the message processing device is used to decode the message from the external interface device and send it to the business logic processing device, and to encode the message from the business logic processing device and send it to the external interface device.
[0031] In some exemplary embodiments, when sending the decoded message to the business logic processing device, the message processing device determines the online business logic processing device, and then sends the decoded message to the online business logic processing device in a predetermined order.
[0032] In some exemplary embodiments, the business logic processing device is used to perform business processing on the decoded message and send the message related to the business processing to the message processing device.
[0033] In some exemplary embodiments, when sending business processing related messages to the message processing device, the business logic processing device determines the online message processing device, and then sends the business processing related messages to the online message processing device in a predetermined order.
[0034] In some exemplary embodiments, different types of external interface devices establish links with different types of external network elements, and the same type of external interface devices establish links with external network elements, and there are multiple links between the same type of external interface devices and external network elements. Figure 2 As shown, external interface device A and external interface device B are two different types of external interface devices, and external network element A and external network element B are two different types of external network elements. External network element A and external interface device A are of the same type, and there are multiple links between external network element A and external interface device A. External network element B and external interface device B are of the same type, and there are multiple links between external network element B and external interface device B.
[0035] In some exemplary embodiments, external interface devices are deployed in an N+1 load sharing manner, that is, SMSC system 1 includes N external interface devices of each type, and SMSC system 2 includes N external interface devices of each type; wherein N is an integer greater than or equal to 1.
[0036] In some exemplary embodiments, the message processing devices are deployed in an N+1 load sharing manner, that is, the number of message processing devices in SMSC system 1 is N, and the number of message processing devices in SMSC system 2 is also N.
[0037] In some exemplary embodiments, the service logic processing devices are deployed in an N+1 load sharing manner, the number of service logic processing devices in SMSC system 1 is N, and the number of service logic processing devices in SMSC system 2 is also N.
[0038] In some exemplary embodiments, the first device is an operation and maintenance device, and the second device includes: an external interface device, a message processing device, and a service logic processing device of the SMSC system.
[0039] In some exemplary embodiments, the operation and maintenance device sends a heartbeat detection request message to all external interface devices, all message processing devices, and all business logic processing devices.
[0040] In some exemplary embodiments, the operation and maintenance device and the external interface device may communicate based on internal messages, that is, heartbeat detection request messages and heartbeat detection response messages may be sent and received based on internal messages.
[0041] In some exemplary embodiments, the operation and maintenance device and the message processing device may communicate based on internal messages, that is, heartbeat detection request messages and heartbeat detection response messages may be sent and received based on internal messages.
[0042] In some exemplary embodiments, the operation and maintenance device and the business logic processing device may communicate based on internal messages, that is, heartbeat detection request messages and heartbeat detection response messages may be sent and received based on internal messages.
[0043] In some exemplary embodiments, the first device is an external interface device, and the second device includes: an external network element and a message processing device of an SMSC system.
[0044] In some exemplary embodiments, the external interface device sends a heartbeat detection request message to the external network element through all links, and sends a heartbeat detection request message to all message processing devices.
[0045] In some exemplary embodiments, the external interface device and the external network element may communicate based on standard protocol messages, that is, the heartbeat detection request message and the heartbeat detection response message may be sent and received based on standard protocol messages.
[0046] In some exemplary embodiments, the external interface device and the message processing device may communicate based on internal messages, that is, the heartbeat detection request message and the heartbeat detection response message may be sent and received based on the internal messages.
[0047] In some exemplary embodiments, the first device is a message processing device, and the second device is an external interface device and a service logic processing device of an SMSC system.
[0048] In some exemplary embodiments, the message processing device sends a heartbeat detection request message to all external interface devices and all service logic processing devices.
[0049] In some exemplary embodiments, the message processing device and the external interface device may communicate based on internal messages, that is, the heartbeat detection request message and the heartbeat detection response message may be sent and received based on the internal messages.
[0050] In some exemplary embodiments, the message processing device and the service logic processing device may communicate based on internal messages, that is, the heartbeat detection request message and the heartbeat detection response message may be sent and received based on internal messages.
[0051] In some exemplary embodiments, the first device is a service logic processing device, and the second device is a message processing device of an SMSC system.
[0052] In some exemplary embodiments, the service logic processing device sends a heartbeat detection request message to all message processing devices.
[0053] In some exemplary embodiments, the first device may periodically send a heartbeat detection request message to the second device.
[0054] Step 101, determine whether a heartbeat detection response message of the second device is received within a preset time. If no heartbeat detection response message of the second device is received within the preset time, determine that the second device is in offline mode, and control the first device to enter offline mode.
[0055] In some exemplary embodiments, when a heartbeat detection response message is received from the second device within a preset time, it is determined that the second device is in online mode, and the process returns to the step of sending a heartbeat detection request message to the second device.
[0056] In some exemplary embodiments, after the second device receives the heartbeat detection request message, if the second device operates normally and the link between the first device and the second device is normal, the second device will reply with a heartbeat detection response message; if the second device operates abnormally, or the link between the first device and the second device is abnormal, the second device cannot reply with a heartbeat detection response message.
[0057] In some exemplary embodiments, when the first device is an external interface device and the second device is an external network element, after the second device receives a heartbeat detection request message through a certain link, if the second device operates normally and a certain link between the first device and the second device is normal, the second device will reply with a heartbeat detection response message through a certain link; if the second device operates abnormally, or a certain link between the first device and the second device is abnormal, the second device cannot reply with a heartbeat detection response message through a certain link.
[0058] In some exemplary embodiments, when the first device is an external interface device and the second device is a message processing device, after the message processing device receives a heartbeat detection request message, if the message processing device operates normally and the number of normal links between the message processing device and the business logic processing device is greater than or equal to a first preset threshold, the message processing device will reply with a heartbeat detection response message; if the message processing device operates abnormally, or the number of normal links between the message processing device and the business logic processing device is less than the first preset threshold, the message processing device cannot reply with a heartbeat detection response message.
[0059] In some exemplary embodiments, when the first device is a message processing device and the second device is an external interface device, after the external interface device receives a heartbeat detection request message, if the external interface device operates normally and the number of normal links between the external interface device and the external network element is greater than or equal to a first preset threshold, the external interface device will reply with a heartbeat detection response message; if the external interface device operates abnormally, or the number of normal links between the external interface device and the external network element is less than the first preset threshold, the external interface device cannot reply with a heartbeat detection response message.
[0060] In some exemplary embodiments, when the first device is a business logic processing device and the second device is a message processing device module, after the message processing device receives a heartbeat detection request message, if the message processing device operates normally and the number of normal links between the message processing device and the same type of external interface device is greater than or equal to a first preset threshold, the message processing device will reply with a heartbeat detection response message; if the message processing device operates abnormally, or the number of normal links between the message processing device and the same type of external interface device is less than the first preset threshold, the message processing device cannot reply with a heartbeat detection response message.
[0061] In some exemplary embodiments, when no heartbeat detection response message is received from the second device within a preset time, before determining that the second device is in offline mode, the method further includes: determining that a link between the first device and the second device is abnormal.
[0062] In some exemplary embodiments, when no heartbeat detection response message is received from the second device within a preset time, the number of heartbeat detection failures of the second device is increased by 1; the step of sending a heartbeat detection request message to the second device is returned to execute; when the number of heartbeat detection failures of the second device is greater than or equal to the preset number of failures, it is determined that the link between the first device and the second device is abnormal.
[0063] In some exemplary embodiments, when a heartbeat detection response message is received from the second device within a preset time, it is determined that the link between the first device and the second device is normal, and the step of sending a heartbeat detection request message to the second device is returned to execute.
[0064] In some exemplary embodiments, when it is determined that the link between the first device and the second device is normal and the number of heartbeat detection failures of the second device is not 0, the number of heartbeat detection failures is cleared.
[0065] In some exemplary embodiments, when it is determined that the link between the first device and the second device is abnormal, the method further includes: reporting alarm information, where the alarm information is used to indicate that the link between the first device and the second device is abnormal.
[0066] In some exemplary embodiments, when the link between the first device and the second device is abnormal, the link abnormality count of the second device is increased by 1; the step of sending a heartbeat detection request message to the second device is returned to execute; and when the link abnormality count of the second device is greater than or equal to the preset link abnormality count, it is determined that the second device is in offline mode.
[0067] In some exemplary embodiments, when the first device is an external interface device and the second device is an external network element, it is determined whether a heartbeat detection response message of a link of the second device is received within a preset time; if no heartbeat detection response message of a link of the second device is received within the preset time, it is determined that a link between the first device and the second device is abnormal; it is determined whether the number of abnormal links among all links between the first device and the second device is greater than or equal to a second preset threshold; if the number of abnormal links among all links between the first device and the second device is greater than or equal to the second preset threshold, it is determined that the second device is in offline mode.
[0068] In some exemplary embodiments, when no heartbeat detection response message of a link of the second device is received within a preset time, the number of heartbeat detection failures of the link of the second device is increased by 1; the step of sending a heartbeat detection request message to the second device through the link is returned to execute; when the number of heartbeat detection failures of a link of the second device is greater than or equal to the preset number of failures, it is determined that a link between the first device and the second device is abnormal.
[0069] In some exemplary embodiments, when a heartbeat detection response message of a link of the second device is received within a preset time, it is determined that a link between the first device and the second device is normal, and the step of sending a heartbeat detection request message to the second device through the link is returned.
[0070] In some exemplary embodiments, when it is determined that a certain link between the first device and the second device is normal and the number of heartbeat detection failures of a certain link of the second device is not 0, the number of heartbeat detection failures of the certain link is cleared.
[0071] In some exemplary embodiments, when it is determined that a certain link between the first device and the second device is abnormal, the method further includes: reporting alarm information, where the alarm information is used to indicate that the certain link between the first device and the second device is abnormal.
[0072] In some exemplary embodiments, when the first device is an external interface device and the second device is an external network element, when the number of abnormal links in all links between the first device and the second device is greater than or equal to a second preset threshold, the number of link abnormalities of the second device is increased by 1; the step of sending a heartbeat detection request message to the second device through all links is returned to execute; when the number of link abnormalities of the second device is greater than or equal to the preset number of link abnormalities, it is determined that the second device is in offline mode.
[0073] In some exemplary embodiments, before controlling the first device to enter the offline mode, the method also includes: determining whether the number of devices in the offline mode among the second devices of the same type is greater than or equal to a third preset threshold, and controlling the first device to enter the offline mode if the number of devices in the offline mode among the second devices of the same type is greater than or equal to the third preset threshold.
[0074] In some exemplary embodiments, the second devices of the same type may refer to N external interface devices of the same type.
[0075] In some exemplary embodiments, the second devices of the same type may refer to N message processing devices.
[0076] In some exemplary embodiments, the second devices of the same type may refer to N business logic processing devices.
[0077] In some exemplary embodiments, after the first device enters the offline mode, the method also includes: no longer responding to heartbeat detection request messages sent by other devices; sending a heartbeat detection request message to the second device; determining whether a heartbeat detection response message from the second device is received within a preset time, and determining that the second device is back online if a heartbeat detection response message from the second device is received within the preset time; and controlling the first device to go back online.
[0078] In some exemplary embodiments, when no heartbeat detection response message is received from the second device within a preset time, it is determined that the second device has not been restored online, and the process returns to the step of sending a heartbeat detection request message to the second device.
[0079] In some exemplary embodiments, when a heartbeat detection response message is received from the second device within a preset time, the number of successful heartbeat detections is increased by 1; the step of sending a heartbeat detection request message to the second device is returned to execute; and when the number of successful heartbeat detections is greater than or equal to the preset number of successful heartbeat detections, it is determined that the second device is back online.
[0080] In some exemplary embodiments, when the number of successful heartbeat detections is less than a preset number of successful heartbeat detections, it is determined that the second device has not come back online.
[0081] In some exemplary embodiments, before controlling the first device to resume online operation, the method further includes: determining whether the number of second devices that have resumed online among second devices of the same type is greater than or equal to a fifth preset threshold value, and controlling the first device to resume online operation if the number of second devices that have resumed online among second devices of the same type is greater than or equal to the fifth preset threshold value.
[0082] In some exemplary embodiments, when the first device is an external interface device and the second device is an external network element, it is determined whether the number of links that have received heartbeat detection response messages from the second device within a preset time is greater than or equal to a fourth preset threshold. When the number of links that have received heartbeat detection response messages from the second device within the preset time is greater than or equal to the fourth preset threshold, it is determined that the second device is back online.
[0083] In some exemplary embodiments, when the first device is an external interface device and the second device is an external network element, if the number of links that receive heartbeat detection response messages from the second device within a preset time is greater than or equal to a fourth preset threshold, the number of successful heartbeat detections is increased by 1; the step of sending a heartbeat detection request message to the second device is returned to execution; and if the number of successful heartbeat detections is greater than or equal to the preset number of successful heartbeat detections, it is determined that the second device is back online.
[0084] The method for implementing device online and offline provided in the embodiment of the present application is based on the heartbeat management mechanism, automatically senses the offline of external or internal equipment, and automatically implements the offline, preparing for the subsequent automatic triggering of disaster recovery switching, shortening the time when SMS services are affected, reducing the impact on operators and end users, and improving the availability of the system.
[0085] In some exemplary embodiments, based on the heartbeat management mechanism, the external or internal equipment is automatically sensed to be online, and the online operation is automatically realized to prepare for the subsequent automatic triggering of disaster recovery rollback, thereby shortening the time when the SMS service is affected, reducing the impact on operators and end users, and improving the availability of the system.
[0086] In order to illustrate the device online and offline method based on linked heartbeat detection in the embodiment of the present application, two examples are listed below for illustration. The examples listed are only for convenience of explanation and cannot be used to limit the protection scope of the embodiment of the present application.
[0087] Example 1
[0088] This example describes a method for internal devices in an SMSC system to automatically go online and offline due to an abnormal triggering of an external network element.
[0089] like Figure 2 As shown, the execution process of SMSC system 1 and SMSC system 2 is the same, and this example takes SMSC system 1 as an example for description.
[0090] like Figure 2 As shown, the SMSC system 1 includes: N external interface devices A deployed in N+1 load sharing mode, N external interface devices B deployed in N+1 load sharing mode, N message processing devices deployed in N+1 load sharing mode, and N business logic processing devices and operation and maintenance devices deployed in N+1 load sharing mode.
[0091] The operation and maintenance equipment establishes links with N external interface devices A, N external interface devices B, N message processing devices, and N business logic processing devices respectively. Each external interface device A establishes a link with external network element A and N message processing devices. Each external interface device B establishes a link with external network element B and N message processing devices. Each message processing device establishes a link with N external interface devices A, N external interface devices B, and N business logic processing devices. Each business logic processing device establishes a link with N message processing devices.
[0092] As shown in Figure 3(a), when external network element A is abnormal, after external interface device A is powered on, when the first detection cycle arrives, a heartbeat detection request message is sent to external network element A through all links with external network element A. At this time, external network element A is abnormal and cannot reply to the heartbeat detection response message.
[0093] If the external interface device A does not receive a heartbeat detection response message of a certain link of the external network element A within a preset time, the number of heartbeat detection failures of the certain link of the external network element A is increased by 1.
[0094] When the second detection cycle arrives, a heartbeat detection request message is sent to the external network element A through all links with the external network element A. If the external network element A recovers to normal at this time, the external network element A sends a heartbeat detection response message to the external interface device A through all links, and the external interface device A clears the number of heartbeat detection failures;
[0095] At this time, if the external network element A is still abnormal, the external network element A still cannot reply to the heartbeat detection response message.
[0096] If the external interface device A does not receive a heartbeat detection response message of a certain link of the external network element A within a preset time, the number of heartbeat detection failures of the certain link of the external network element A is increased by 1.
[0097] The subsequent detection cycles are similar.
[0098] When the number of heartbeat detection failures of a certain link of the external network element A is greater than or equal to the preset number of failures, it is determined that a certain link between the external interface device A and the external network element A is abnormal.
[0099] When the number of abnormal links in the links between the external network element A and the external interface device A is greater than or equal to the second preset threshold, it is determined that the external network element A is in the offline mode, and the external interface device A automatically enters the offline mode.
[0100] Since the external network element A and the N external interface devices A are all linked, the N external interface devices A automatically enter the offline mode.
[0101] After the external interface device A enters the offline mode, it no longer responds to the heartbeat detection request messages sent by the N message processing devices, but continues to send heartbeat detection request messages to the external network element A and the N message processing devices.
[0102] If the message processing module does not receive the heartbeat detection response message of the external interface device A within the preset time, the number of heartbeat detection failures of the external interface device A is increased by 1. If the number of heartbeat detection failures of the external interface device A is greater than or equal to the preset number of failures, it is determined that the link with the external interface device A is abnormal, and further determined that the external interface device A is in offline mode.
[0103] When the number of the external interface devices A in the offline mode among the N external interface devices A is greater than or equal to a third preset threshold, it is determined that the message processing module enters the offline mode.
[0104] Since the external interface device A establishes links with the N message processing devices, the N message processing devices automatically enter the offline mode.
[0105] After the message processing device enters the offline mode, it no longer responds to the heartbeat detection request messages sent by the N business logic processing devices and the N external interface devices B, but continues to send heartbeat detection request messages to the N external interface devices A, the N external interface devices B and the N business logic processing devices.
[0106] After the message processing device enters the offline mode, the N business logic processing devices and the N external interface devices B also automatically enter the offline mode.
[0107] After the N external interface devices A, the N external interface devices B, the N message processing devices and the N service logic processing devices all enter the offline mode, the SMSC system enters the offline mode.
[0108] As shown in Figure 3(b), after the SMSC system enters offline mode, if external network element A returns to normal, when external network element A receives the heartbeat detection request message sent by external interface device A through all links, it will reply with a heartbeat detection response message to external interface device A through all links.
[0109] When the number of links of the heartbeat detection response message received by the external interface device A from the external network element A is greater than or equal to the fourth preset threshold, it is determined that the external network element A is back online, and the external interface device A is also automatically back online.
[0110] Since the external network element A and the N external interface devices A are all linked, the N external interface devices A are automatically restored online.
[0111] After the external interface device A is restored online, the external interface device A resumes responding to the heartbeat detection request message of the message processing device, and the message processing device is also restored online.
[0112] After the message processing device is restored online, the business logic processing device and the external interface device B are also restored online.
[0113] Example 2
[0114] This example describes a method for internal devices in an SMSC system to automatically go online and offline due to a service logic processing device exception trigger.
[0115] like Figure 2 As shown, the execution process of SMSC system 1 and SMSC system 2 is the same, and this example takes SMSC system 1 as an example for description.
[0116] like Figure 2As shown, the SMSC system 1 includes: N external interface devices A deployed in N+1 load sharing mode, N external interface devices B deployed in N+1 load sharing mode, N message processing devices deployed in N+1 load sharing mode, and N business logic processing devices and operation and maintenance devices deployed in N+1 load sharing mode.
[0117] The operation and maintenance equipment establishes links with N external interface devices A, N external interface devices B, N message processing devices, and N business logic processing devices respectively. Each external interface device A establishes a link with external network element A and N message processing devices. Each external interface device B establishes a link with external network element B and N message processing devices. Each message processing device establishes a link with N external interface devices A, N external interface devices B, and N business logic processing devices. Each business logic processing device establishes a link with N message processing devices.
[0118] As shown in Figure 4(a), when the business logic processing device is abnormal, after the message processing device is powered on, when the first detection cycle arrives, it sends a heartbeat detection request message to the business logic processing device. At this time, the business logic processing device is abnormal and cannot reply with a heartbeat detection response message.
[0119] If the message processing device does not receive a heartbeat detection response message from the business logic processing device within a preset time, the number of heartbeat detection failures of the business logic processing device is increased by 1.
[0120] When the second detection cycle arrives, a heartbeat detection request message is sent to the business logic processing device. If the business logic processing device returns to normal at this time, the message processing device sends a heartbeat detection response message to the business logic processing device, and the message processing device clears the number of heartbeat detection failures;
[0121] At this time, if the business logic processing device is still abnormal, the business logic processing device still cannot reply to the heartbeat detection response message.
[0122] If the message processing device does not receive a heartbeat detection response message from the business logic processing device within a preset time, the number of heartbeat detection failures of the business logic processing device is increased by 1.
[0123] The subsequent detection cycles are similar.
[0124] When the number of heartbeat detection failures of the business logic processing device is greater than or equal to the preset number of failures, it is determined that the link between the business logic processing device and the message processing device is abnormal, and further determined that the business logic processing device is in offline mode.
[0125] When the number of the service logic processing devices in the offline mode among the N service logic processing devices is greater than or equal to a third preset threshold, the message processing module automatically enters the offline mode.
[0126] Since the business logic processing device and the N message processing devices are linked, the N message processing devices automatically enter the offline mode.
[0127] After the message processing device enters the offline mode, it no longer responds to the heartbeat detection request messages sent by N external interface devices A and N external interface devices B, but continues to send heartbeat detection request messages to N external interface devices A, N external interface devices B and N business logic processing devices.
[0128] After the message processing device enters the offline mode, the N external interface devices and the N external interface devices B also automatically enter the offline mode.
[0129] After the N external interface devices A, the N external interface devices B, the N message processing devices and the N service logic processing devices all enter the offline mode, the SMSC system enters the offline mode.
[0130] As shown in Figure 4(b), after the SMSC system enters offline mode, if the business logic processing device returns to normal, when the business logic processing device receives the heartbeat detection request message sent by the message processing device, it will reply with a heartbeat detection response message to the message processing device.
[0131] The message processing device receives the heartbeat detection response message sent by the business logic processing device and determines that the business logic processing device is back online.
[0132] When the number of the service logic processing devices that have resumed online among the N service logic processing devices is greater than or equal to a fifth preset threshold, the message processing device also automatically resumes online.
[0133] Since the business logic processing device and the N message processing devices are linked, the N message processing devices are automatically restored online.
[0134] After the message processing device is restored online, the message processing device resumes responding to the heartbeat detection request messages of the external interface device A and the external interface device B, and the external interface device A and the external interface device B are also restored online.
[0135] Second, refer to Figure 5 Another embodiment of the present application provides an electronic device, including: at least one processor 501; a memory 502, wherein at least one program is stored in the memory 502, and when the at least one program is executed by the at least one processor 501, any one of the above-mentioned methods for realizing device online and offline is implemented.
[0136] In some exemplary embodiments, the electronic device further includes: one or more I / O interfaces 503 connected between the processor 501 and the memory 502 , and configured to implement information interaction between the processor 501 and the memory 502 .
[0137] Among them, the processor 501 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 502 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 503 is connected between the processor 501 and the memory 502, and can realize information interaction between the processor 501 and the memory 502, including but not limited to a data bus (Bus), etc.
[0138] In some embodiments, the processor 501 , the memory 502 , and the I / O interface 503 are connected to each other via a bus 504 , and further connected to other components of the computing device.
[0139] In a third aspect, another embodiment of the present application provides a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, any one of the above-mentioned methods for realizing device online and offline is implemented.
[0140] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0141] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly noted, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, those skilled in the art will appreciate that various changes in form and detail may be made without departing from the scope of the present application as set forth in the appended claims.
Claims
1. A method for realizing device online and offline, applied to a first device of a short message service center system, the method include: Sending a heartbeat detection request message to the second device; Determine whether a heartbeat detection response message of the second device is received within a preset time. If no heartbeat detection response message of the second device is received within the preset time, determine that the second device is in offline mode, and control the first device to enter offline mode.
2. The method for realizing device online and offline according to claim 1, in, In the case where no heartbeat detection response message of the second device is received within the preset time, before determining that the second device is in offline mode, the method further includes: It is determined that a link between the first device and the second device is abnormal.
3. The method for realizing device offline and offline according to claim 2, wherein the method further include: If no heartbeat detection response message from the second device is received within the preset time, the number of heartbeat detection failures of the second device is increased by 1; Return to executing the step of sending a heartbeat detection request message to the second device; When the number of heartbeat detection failures of the second device is greater than or equal to a preset number of failures, it is determined that the link between the first device and the second device is abnormal.
4. The method for realizing device online and offline according to claim 2, in, After determining that the link between the first device and the second device is abnormal, the method further includes: Increment the number of link abnormalities of the second device by 1; Return to executing the step of sending a heartbeat detection request message to the second device; When the link abnormality number of the second device is greater than or equal to the preset link abnormality number, it is determined that the second device is in offline mode.
5. The method for realizing device offline and offline according to any one of claims 1 to 4, wherein after the first device is controlled to enter offline mode, the method further include: No longer respond to heartbeat detection request messages sent by other devices; Sending a heartbeat detection request message to the second device; Determine whether a heartbeat detection response message of the second device is received within the preset time; In the case where a heartbeat detection response message of the second device is received within the preset time, it is determined that the second device is back online, and the first device is controlled to be back online.
6. The method for realizing device offline and offline according to claim 5, wherein the method further comprises: include: If a heartbeat detection response message from the second device is received within the preset time, the number of successful heartbeat detections is increased by 1; Return to the step of continuing to send a heartbeat detection request message to the second device; When the number of successful heartbeat detections is greater than or equal to a preset number of successful heartbeat detections, it is determined that the second device is back online.
7. An electronic device, include: at least one processor; A memory having at least one program stored therein, wherein when the at least one program is executed by the at least one processor, the method for realizing device online and offline as described in any one of claims 1 to 6 is implemented.
8. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for implementing device online and offline as described in any one of claims 1 to 6.