Heartbeat monitoring methods, systems, devices, and storage media for IT systems
By generating temporary child nodes on ZooKeeper server nodes and sending change notification messages, the problems of low efficiency and high cost of center-hop monitoring in multi-service systems are solved, achieving more efficient and accurate monitoring.
Patent Information
- Application Number
- CN202310614306.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-29
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2043-05-29
AI Technical Summary
In existing technologies, heartbeat monitoring methods are inefficient and costly in multi-service systems, and the high coupling between service callers and service providers leads to insufficient monitoring efficiency and accuracy.
By generating temporary child nodes on ZooKeeper server nodes, monitoring is performed based on the service provider's heartbeat publication, and the service caller is notified of the service provider's status changes through change notification messages, thereby reducing the direct coupling between the service caller and the service provider.
It improves the efficiency and accuracy of heartbeat monitoring, reduces costs, and decreases the coupling between service callers and service providers.
Smart Images

Figure CN116566864B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the financial field, and more particularly to a heartbeat monitoring method, system, device, and storage medium for an IT system. Background Technology
[0002] In modern IT systems, a typical business function relies on multiple internal or external services to function properly; in complex, large-scale enterprise IT systems, this may involve dozens or even hundreds of services. In such cases, different services or modules need to detect each other's operational status. If a dependent service fails (e.g., service downtime), all services or modules that depend on it need to be immediately notified of the failure and take appropriate action.
[0003] In existing technologies, heartbeat services are typically implemented by applications, establishing long-lived connections between services. Heartbeat detection between services is achieved through a heartbeat detection and response mechanism. Specifically, the service caller continuously sends heartbeat detection messages to the service provider at certain time intervals, and the service provider replies with response messages to indicate that it is available. If the service caller does not receive a heartbeat response message from the provider in a timely manner, it indicates that the service has been interrupted.
[0004] However, when there are a large number of services, both the detection and the detected systems need to implement heartbeat mechanisms and be directly linked, resulting in a high degree of coupling. This leads to problems such as low efficiency and high cost in existing heartbeat monitoring methods. Summary of the Invention
[0005] This application provides a method, system, device, and storage medium for heartbeat monitoring in an IT system, in order to solve the problems of low efficiency and accuracy in heartbeat monitoring.
[0006] In a first aspect, this application provides a heartbeat monitoring method for an IT system, comprising:
[0007] The system receives heartbeat announcements from the service provider, which are configured to be sent continuously at certain time intervals. The heartbeat announcements include: an initial heartbeat announcement and other heartbeat announcements.
[0008] Based on the initial heartbeat release, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one of the temporary child nodes;
[0009] The existence status of the temporary child node is updated based on the reception status of other heartbeat broadcasts;
[0010] The existence status of the temporary child node is monitored, and a change notification message is generated based on the change in the existence status of the temporary child node;
[0011] The change notification message is sent to the service caller.
[0012] Secondly, this application provides a heartbeat monitoring method for an IT system, comprising:
[0013] Send a call request to the service provider so that the service caller can access the service provider corresponding to the call request;
[0014] Receive a change notification message sent by the ZooKeeper server. The change notification message is a notification message generated by the ZooKeeper server based on the change in the existence status of temporary child nodes. The temporary child nodes are generated by the ZooKeeper server under the namespace on the ZooKeeper server node based on the initial heartbeat.
[0015] Thirdly, this application provides a heartbeat monitoring method for an IT system, comprising:
[0016] Receive a call request sent by a service caller, and provide services to the service caller according to the call request;
[0017] Based on its own working status, it generates other heartbeats and sends them to the ZooKeeper server at certain time intervals to update the existence status of the temporary child nodes.
[0018] Fourthly, this application provides a heartbeat monitoring system for an IT system, including: a ZooKeeper server, a service caller, and a service provider.
[0019] The ZooKeeper server is configured to receive heartbeat announcements from service providers, wherein the heartbeat announcements are sent continuously at regular time intervals and include: an initial heartbeat announcement and other heartbeat announcements; based on the initial heartbeat announcement, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node; the existence status of the temporary child nodes is updated based on the reception of the other heartbeat announcements; the existence status of the temporary child nodes is monitored, and a change notification message is generated based on changes in the existence status of the temporary child nodes; the change notification message is sent to the service caller;
[0020] The service caller is used to send a call request to the service provider so that the service caller can access the service provider corresponding to the call request; and to receive a change notification message sent by the ZooKeeper server. The change notification message is a notification message generated by the ZooKeeper server based on the change in the existence status of the temporary child node. The temporary child node is generated by the ZooKeeper server based on the initial heartbeat and in the namespace on the ZooKeeper server node.
[0021] The service provider is configured to receive call requests sent by the service caller, and provide services to the service caller according to the call requests; generate other heartbeats based on its own working status, and continuously send them to the ZooKeeper server at certain time intervals, so that the ZooKeeper server can update the existence status of temporary child nodes.
[0022] Fifthly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0023] The memory stores computer-executed instructions;
[0024] The processor executes computer execution instructions stored in the memory to implement the method described in the first, second, or third aspect above.
[0025] In a sixth aspect, this application provides a computer-readable storage medium, comprising: computer-executable instructions stored in the computer-readable storage medium, wherein the computer-executable instructions, when executed by a processor, are used to implement the method described in the first, second, or third aspect above.
[0026] In a seventh aspect, this application provides a computer program product, comprising: a computer program that, when executed by a processor, implements the methods described in the first, second, or third aspect above.
[0027] The heartbeat monitoring method, system, device, and storage medium provided in this application for an IT system receive heartbeat announcements sent by service providers. These heartbeat announcements are configured to be sent continuously at regular intervals and include an initial heartbeat announcement and other heartbeat announcements. Based on the initial heartbeat announcement, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node. The existence status of the temporary child nodes is updated based on the reception of other heartbeat announcements. By indirectly monitoring the working status of service providers through the generation of temporary child nodes in the namespace on the ZooKeeper server node, the coupling between service callers and service providers can be effectively reduced, improving the efficiency of heartbeat monitoring and lowering costs. The existence status of temporary child nodes is monitored, and change notification messages are generated based on changes in the existence status of temporary child nodes, which are then sent to service callers. The proactive sending of change notification messages by the ZooKeeper server proactively provides service callers with information on changes in the working status of service providers, improving the efficiency and accuracy of heartbeat monitoring. Attached Figure Description
[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0029] Figure 1 This is a schematic diagram illustrating an application scenario of a heartbeat monitoring method for an IT system provided in an embodiment of this application.
[0030] Figure 2 A flowchart illustrating a heartbeat monitoring method for an IT system provided in an embodiment of this application;
[0031] Figure 3 A flowchart illustrating another heartbeat monitoring method for an IT system provided in this application embodiment;
[0032] Figure 4 This is a schematic diagram illustrating the process of updating the existence status of temporary child nodes based on the reception of other heartbeat announcements, as provided in an embodiment of this application.
[0033] Figure 5 A flowchart illustrating the process of generating a change notification message based on changes in the existence status of temporary child nodes, provided in an embodiment of this application;
[0034] Figure 6 A flowchart illustrating another heartbeat monitoring method for an IT system provided in this application embodiment;
[0035] Figure 7A flowchart illustrating another heartbeat monitoring method for an IT system provided in this application embodiment;
[0036] Figure 8 A flowchart illustrating another heartbeat monitoring method for an IT system provided in this application embodiment;
[0037] Figure 9 A flowchart illustrating another heartbeat monitoring method for an IT system provided in this application embodiment;
[0038] Figure 10 This is a schematic diagram of the structure of a heartbeat monitoring device for an IT system, provided as an embodiment of this application.
[0039] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0040] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0041] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0042] It should be noted that the heartbeat monitoring method, device, and storage medium of the IT system in this application can be used in the financial field, or in any field other than the financial field. The application field of the heartbeat monitoring method, device, and storage medium of the IT system in this application is not limited.
[0043] In existing technologies, heartbeat services are typically implemented by applications, establishing long-lived connections between services. Heartbeat detection is achieved through a heartbeat detection and response mechanism. Specifically, the service caller continuously sends heartbeat messages to the service provider at regular intervals, and the service provider replies with a response message to indicate its availability. If the service caller does not receive a timely heartbeat response from the provider, it indicates that the service has been interrupted. However, when there are many services, both the detection and monitored systems need to implement heartbeat mechanisms and are directly linked, resulting in high coupling and leading to inefficiencies and high costs in existing heartbeat monitoring methods.
[0044] The heartbeat monitoring method, system, device, and storage medium provided in this application for an IT system receive heartbeat announcements sent by service providers. These heartbeat announcements are configured to be sent continuously at regular intervals and include an initial heartbeat announcement and other heartbeat announcements. Based on the initial heartbeat announcement, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node. The existence status of the temporary child nodes is updated based on the reception of other heartbeat announcements. By indirectly monitoring the working status of service providers through the generation of temporary child nodes in the namespace on the ZooKeeper server node, the coupling between service callers and service providers can be effectively reduced, improving the efficiency of heartbeat monitoring and lowering costs. The existence status of temporary child nodes is monitored, and change notification messages are generated based on changes in the existence status of temporary child nodes, which are then sent to service callers. The proactive sending of change notification messages by the ZooKeeper server proactively provides service callers with information on changes in the working status of service providers, improving the efficiency and accuracy of heartbeat monitoring.
[0045] Figure 1 This is a schematic diagram illustrating an application scenario of a heartbeat monitoring method for an IT system provided in an embodiment of this application.
[0046] like Figure 1 As shown, the application scenarios provided in this application include: ZooKeeper server 11, service caller 12, and at least one service provider 13.
[0047] The ZooKeeper server 11 connects to the service caller 12 to send change notification messages to the service caller 12.
[0048] The ZooKeeper server 11 mentioned above is also connected to at least one service provider 13 to receive heartbeats sent by the service provider 13.
[0049] The aforementioned service caller 12 also connects to at least one service provider 13 to send a call request to the service provider 13.
[0050] The method for heartbeat monitoring of IT systems provided in this application aims to solve the above-mentioned technical problems of the prior art.
[0051] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0052] Figure 2 This is a flowchart illustrating a heartbeat monitoring method for an IT system provided in the first embodiment of this application.
[0053] like Figure 2 As shown, the heartbeat monitoring method of the IT system in this embodiment is executed by a ZooKeeper server. Generally, it can be implemented through software, hardware, or a combination of both. It may include the following steps:
[0054] Step S201: Receive heartbeat announcements sent by the service provider. The heartbeat announcements are set to be sent continuously at certain time intervals. The heartbeat announcements include: initial heartbeat announcements and other heartbeat announcements.
[0055] Specifically, service providers can generate heartbeat announcements based on their own operational status, and ZooKeeper servers can receive heartbeat announcements sent by service providers.
[0056] Specifically, the heartbeat sending is set to be sent continuously at certain time intervals. The time interval can be set according to the user's needs. For example, when the user pays more attention to the service provider, a shorter time interval can be set, and when the user pays less attention to the service provider, a longer time interval can be set.
[0057] Specifically, a heartbeat publication refers to a message sent by a service provider to the ZooKeeper server to report its operational status. Heartbeat publications include the initial heartbeat publication and other heartbeat publications. Whether the ZooKeeper server can receive a heartbeat publication depends on whether the service provider can generate a heartbeat publication. The service provider's ability to generate a heartbeat publication depends on whether its operational status is normal. When the service provider generates a heartbeat publication, the ZooKeeper server can receive it; when the service provider does not generate a heartbeat publication, the ZooKeeper server cannot receive it. The initial heartbeat publication is the one generated by the service provider when it begins publishing its service and sent to the ZooKeeper server. It will not encounter the situation described above where the service provider does not generate a heartbeat publication. Other heartbeat publications refer to any heartbeat publications sent by the service provider other than the initial heartbeat publication, and may encounter the situations described above where the service provider generates or / or does not generate a heartbeat publication.
[0058] Step S202: Based on the initial heartbeat release, generate temporary child nodes in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node.
[0059] Specifically, based on the initial heartbeat announcement received by the ZooKeeper server and sent by the service provider as described in step S201, temporary child nodes can be generated in the namespace on the ZooKeeper server node, where each service provider can correspond to one temporary child node.
[0060] As described in step S201, the initial heartbeat publication refers to the heartbeat publication generated by the service provider when it begins publishing the service and sent to the ZooKeeper server. The scenario described above, where the service provider fails to generate a heartbeat publication, will not occur. After receiving the initial heartbeat publication from the service provider, the ZooKeeper server can generate a temporary child node corresponding to the service provider under the ZooKeeper server node. This temporary child node is a temporary child node set in the namespace of the ZooKeeper server node to represent the working status of the corresponding service provider.
[0061] Step S203: Update the existence status of the temporary child node based on the reception status of other heartbeats.
[0062] Specifically, as described in step S201, other heartbeat releases refer to heartbeat releases sent by the service provider other than the initial heartbeat release.
[0063] Specifically, the existence status of the temporary child node generated in step S202 can be updated based on the reception status of other heartbeat publications described in step S201. Here, a heartbeat publication refers to a message from the service provider to the ZooKeeper server reporting its own working status. Unlike the initial heartbeat publication, other heartbeat publications may result in either the service provider generating or not generating a heartbeat publication, as described in step S201. Therefore, the reception status of other heartbeat publications can include both received and unreceived states. As described in step S202, a temporary child node refers to a temporary child node set in the namespace of the ZooKeeper server node, used to represent the working status of the corresponding service provider. Therefore, the existence status of the temporary child node can be updated based on the reception status of other heartbeat publications described above.
[0064] Step S204: Monitor the existence status of temporary child nodes and generate change notification messages based on changes in the existence status of temporary child nodes.
[0065] Specifically, the existence status of the temporary child node updated in step S203 can be monitored, and a change notification message can be generated based on the monitoring results, i.e., the change in the existence status of the temporary child node.
[0066] Among them, the change notification message refers to a notification message that contains the service provider's working status information, generated based on changes in the existence status of temporary child nodes.
[0067] Step S205: Send the change notification message to the service caller.
[0068] Specifically, the change notification message generated in step S204 can be sent to the service caller. As described in step S204, the change notification message is a notification message containing the service provider's operational status information, generated based on changes in the existence status of temporary child nodes. Optionally, a monitoring mechanism, i.e., a watch mechanism, can be used to push monitoring messages (i.e., change notification messages) indicating that the service provider's operational status has changed to normal (e.g., online) or abnormal (e.g., offline). This allows the service caller to understand the service provider's operational status based on the change notification message sent by the ZooKeeper server and take appropriate action.
[0069] The heartbeat monitoring method for IT systems provided in this embodiment receives heartbeat announcements sent by service providers. These heartbeat announcements are set to be sent continuously at regular time intervals and include an initial heartbeat announcement and other heartbeat announcements. Based on the initial heartbeat announcement, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node. The existence status of the temporary child nodes is updated based on the reception of other heartbeat announcements. By indirectly monitoring the working status of service providers through the generation of temporary child nodes in the namespace on the ZooKeeper server node, the coupling between service callers and service providers can be effectively reduced, improving the efficiency of heartbeat monitoring and lowering costs. The existence status of the temporary child nodes is monitored, and change notification messages are generated based on changes in the existence status of the temporary child nodes, which are then sent to the service callers. The method of the ZooKeeper server proactively sending change notification messages proactively provides service callers with information on changes in the working status of service providers, improving the efficiency and accuracy of heartbeat monitoring.
[0070] Figure 3 This is a flowchart illustrating another heartbeat monitoring method for an IT system provided in the second embodiment of this application. Figure 2 Based on the illustrated embodiment, the service provider includes one or more service providers, and the namespace on the ZooKeeper server node includes one or more namespaces. The namespaces correspond to the service provider's vendor. This embodiment elaborates on the case of multiple service providers and multiple vendors.
[0071] like Figure 3 As shown, the heartbeat monitoring method of the IT system in this embodiment is executed by a ZooKeeper server. Generally, it can be implemented through software, hardware, or a combination of both. It may include the following steps:
[0072] Step S301: Receive heartbeat announcements from multiple service providers. The heartbeat announcements are set to be sent continuously at certain time intervals. The heartbeat announcements include: initial heartbeat announcements and other heartbeat announcements.
[0073] Specifically, the service provider includes one or more service providers. In the case of multiple service providers, the multiple service providers can generate heartbeat announcements according to their own working status, and the ZooKeeper server can receive the heartbeat announcements sent by each service provider.
[0074] For further details of this step, please refer to the description in S201 above, which will not be repeated here.
[0075] Step S302: Based on the initial heartbeat release and the supplier name corresponding to the service provider, set up multiple namespaces on the ZooKeeper server node, with each namespace corresponding to the service provider's supplier.
[0076] Specifically, the service provider includes one or more service providers, and the namespace on the ZooKeeper server node includes one or more namespaces. In the case of multiple service providers and multiple vendors, multiple namespaces can be set on the ZooKeeper server node according to the initial heartbeat announcements sent by multiple service providers received by the ZooKeeper server as described in step S301, and the vendor names corresponding to the service providers. The namespaces correspond to the vendors of the service providers.
[0077] For further details of this step, please refer to the description of S202 above, which will not be repeated here.
[0078] Step S303: Generate temporary child nodes in multiple namespaces based on the initial heartbeat, with each service provider corresponding to one temporary child node.
[0079] Specifically, based on the initial heartbeat received in step S301, temporary child nodes can be generated under multiple namespaces set in step S302 on the ZooKeeper server node. The namespaces correspond to the service provider's vendor, and each service provider can correspond to one temporary child node.
[0080] Optionally, each service caller may correspond to one ZooKeeper server node, and each ZooKeeper server may include multiple ZooKeeper server nodes.
[0081] For further details of this step, please refer to the description of S202 above, which will not be repeated here.
[0082] Step S304: Update the existence status of the temporary child node based on the reception status of other heartbeats.
[0083] Specifically, the existence status of the temporary child node generated in step S303 can be updated based on the reception status of other heartbeat broadcasts described in step S301.
[0084] For further details of this step, please refer to the description in S203 above, which will not be repeated here.
[0085] Step S305: Monitor the existence status of temporary child nodes and generate change notification messages based on changes in the existence status of temporary child nodes.
[0086] Specifically, the existence status of the temporary child nodes updated in step S304 can be monitored, and a change notification message can be generated based on the change in the existence status of the temporary child nodes. The change notification message includes the identifiers of each service provider and each supplier.
[0087] For further details of this step, please refer to the description in S204 above, which will not be repeated here.
[0088] Step S306: Send the change notification message to the service caller.
[0089] Specifically, the change notification message generated in step S305 can be sent to the service caller.
[0090] For further details of this step, please refer to the description in S205 above, which will not be repeated here.
[0091] The heartbeat monitoring method for an IT system provided in this embodiment receives heartbeat announcements from multiple service providers. These heartbeat announcements are set to be sent continuously at certain time intervals. The heartbeat announcements include an initial heartbeat announcement and other heartbeat announcements. Based on the initial heartbeat announcement and the vendor name corresponding to each service provider, multiple namespaces are set on the ZooKeeper server node. Each namespace corresponds to a service provider's vendor. Temporary child nodes are generated under these namespaces based on the initial heartbeat announcement, with each service provider corresponding to one temporary child node. The existence status of the temporary child nodes is updated based on the reception of other heartbeat announcements. The existence status of the temporary child nodes is monitored, and a change notification message is generated based on changes in the existence status of the temporary child nodes. This change notification message is then sent to the service caller. Among these, [the text abruptly ends here, likely due to an incomplete sentence or missing information]. Figure 2 Compared to the illustrated embodiments, this embodiment elaborates on the scenario of multiple service providers and multiple suppliers. In the case of multiple service providers and multiple suppliers, the heartbeat monitoring method provided in this embodiment can improve the accuracy of heartbeat monitoring.
[0092] Figure 4 This is a schematic diagram illustrating the process of updating the existence status of temporary child nodes based on the reception of other heartbeat broadcasts, as provided in the third embodiment of this application. Figure 2 Based on the illustrated embodiment, the existence state of temporary child nodes includes: generation, maintenance, and deletion. This embodiment elaborates on the process of updating the existence state of temporary child nodes according to the reception of other heartbeat announcements.
[0093] like Figure 4 As shown, the process of updating the existence status of temporary child nodes based on the reception of other heartbeats in this embodiment may include the following steps:
[0094] Step S401: Set the heartbeat release time threshold.
[0095] Specifically, a heartbeat publication time threshold can be set. This threshold is used to determine the ZooKeeper server's reception of other heartbeat publications. The publication time threshold is related to the heartbeat publication time interval described in step S201 and can be set according to user needs. The specific determination method is described below.
[0096] Step S402: If the time interval between receiving other heartbeats is less than the release time threshold, the temporary child node remains in the "maintain" state.
[0097] As described in step S202, a temporary child node refers to a temporary child node set in the namespace of the ZooKeeper server node to represent the working status of the corresponding service provider.
[0098] Specifically, if the time interval between receiving other heartbeats by the ZooKeeper server is less than the publication time threshold set in step S401, the working status of the corresponding service provider is normal, and the existence status of the temporary child node is maintained.
[0099] Step S403: If the time interval between receiving other heartbeats is greater than or equal to the publication time threshold, the temporary child node is deleted.
[0100] Specifically, if the time interval between receiving other heartbeats from the ZooKeeper server is greater than the publication time threshold set in step S401, the corresponding service provider's working status is abnormal, and the temporary child node's existence status is deleted.
[0101] Step S404: When the existence status of the temporary child node is deleted, if other heartbeats are received again, the existence status of the temporary child node will be generated.
[0102] Specifically, if the temporary child node described in step S403 is in the state of deletion, and another heartbeat is received again, the working status of the corresponding service provider is normal, and the temporary child node is in the state of generation.
[0103] Optionally, for the case where the temporary child node's existence status is deleted as described in step S403, the conditions for changing the temporary child node's existence status to generation can also be set. For example, if a certain number of heartbeats are received, such as two other heartbeats, and the corresponding service provider's working status is normal, the temporary child node's existence status will be generated.
[0104] This embodiment provides a process for updating the existence status of temporary child nodes based on the reception of other heartbeats. By setting a heartbeat publication time threshold, if the time interval between receiving other heartbeats is less than the threshold, the existence status of the temporary child node remains unchanged; if the time interval is greater than or equal to the threshold, the existence status of the temporary child node is deleted. When the temporary child node is deleted, if another heartbeat is received, its existence status is re-established. By monitoring the reception of other heartbeats through setting a publication time threshold and then updating the status of temporary child nodes, the accuracy of heartbeat monitoring is improved.
[0105] Figure 5 This is a flowchart illustrating the process of generating a change notification message based on changes in the existence state of a temporary child node, as provided in the fourth embodiment of this application. Figure 4 Based on the illustrated embodiment, the change notification message includes the service provider's identifier. This embodiment elaborates on the process of generating a change notification message based on changes in the existence status of temporary child nodes.
[0106] like Figure 5 As shown, generating a change notification message based on changes in the existence state of temporary child nodes in this embodiment may include the following steps:
[0107] Step S501: If the existence status of the temporary child node changes to deletion, a second change notification message is generated. The second change notification message contains information that the working status of the service provider corresponding to the service provider's identifier is abnormal.
[0108] As described in step S204, the existence status of temporary child nodes can be monitored, and change notification messages can be generated based on changes in the existence status of temporary child nodes. Figure 4 The illustrated embodiment describes temporary child nodes as having three states: creation, maintenance, and deletion. Therefore, changes in the state of a temporary child node can be categorized as either creation or deletion. If a temporary child node remains in the maintenance state, it indicates that the service provider corresponding to the temporary child node is functioning normally, and therefore no change notification will be generated.
[0109] Specifically, if the existence status of a temporary child node changes to deletion, a second change notification message can be generated. As described above, the change notification message includes the identifier of the service provider. The second change notification message contains information that the working status of the service provider corresponding to the identifier of the service provider is abnormal, so that the service caller can understand the corresponding service provider with an abnormal working status based on the second change notification message.
[0110] Step S502: If the existence status of the temporary child node changes to "generated", generate a first change notification message. The first change notification message contains information that the working status of the service provider corresponding to the service provider's identifier is normal.
[0111] Specifically, if the existence status of a temporary child node changes to "generated", a first change notification message can be generated. As described above, the change notification message includes the identifier of the service provider. The first change notification message contains information that the working status of the service provider corresponding to the identifier of the service provider is normal, so that the service caller can understand the corresponding service provider whose working status has been restored to normal based on the first change notification message.
[0112] This embodiment provides a process for generating change notification messages based on changes in the existence status of temporary child nodes. If the temporary child node's existence status changes to deletion, a second change notification message is generated. This second change notification message includes information indicating that the service provider's working status, corresponding to the service provider's identifier, is abnormal. If the temporary child node's existence status changes to creation, a first change notification message is generated. This first change notification message includes information indicating that the service provider's working status, corresponding to the service provider's identifier, is normal. By dividing the change notification message into first and second change notification messages to push different statuses of the service provider, the accuracy of heartbeat monitoring is improved.
[0113] Figure 6 This is a flowchart illustrating another heartbeat monitoring method for an IT system provided in the fifth embodiment of this application.
[0114] like Figure 6 As shown, the heartbeat monitoring method of the IT system in this embodiment is executed by the service caller. Generally, it can be implemented through software, hardware, or a combination of both. It may include the following steps:
[0115] Step S601: Send a call request to the service provider so that the service caller can access the service provider corresponding to the call request.
[0116] Specifically, a service caller can send a call request to the service provider that needs to be invoked, so that the service caller can access the service provider corresponding to the call request.
[0117] Step S602: Receive a change notification message sent by the ZooKeeper server. The change notification message is a notification message generated by the ZooKeeper server based on the change in the existence status of the temporary child node. The temporary child node is generated by the ZooKeeper server based on the initial heartbeat and is generated in the namespace on the ZooKeeper server node.
[0118] Specifically, after the ZooKeeper server sends the change notification message to the service caller as described in step S205, the service caller can receive the change notification message sent by the ZooKeeper server. The change notification message is a notification message generated by the ZooKeeper server based on changes in the existence status of temporary child nodes. Temporary child nodes are generated by the ZooKeeper server based on the initial heartbeat and are created within the namespace on the ZooKeeper server node.
[0119] The heartbeat monitoring method for IT systems provided in this embodiment sends a call request to the service provider, enabling the service caller to access the service provider corresponding to the call request and receive change notification messages sent by the ZooKeeper server. The service caller only sends a call request to the service provider once, eliminating multiple couplings and improving the efficiency of heartbeat monitoring. Furthermore, analyzing the service provider's working status by receiving change notification messages from the ZooKeeper server improves the accuracy and efficiency of heartbeat monitoring.
[0120] Figure 7 This is a flowchart illustrating another heartbeat monitoring method for an IT system provided in the sixth embodiment of this application. Figure 7 Based on the illustrated embodiment, the service provider includes one or more service providers, and the change notification message includes the identifier of the service provider. This embodiment elaborates on the situation of multiple service providers and multiple suppliers.
[0121] like Figure 7 As shown, the heartbeat monitoring method of the IT system in this embodiment is executed by the service caller. Generally, it can be implemented through software, hardware, or a combination of both. It may include the following steps:
[0122] Step S701: Send a call request to multiple service providers so that the service caller can access the multiple service providers corresponding to the call request.
[0123] Specifically, the service provider includes one or more service providers. In the case of multiple service providers, the service caller can send a call request to the multiple service providers that need to be called, so that the service caller can access the multiple service providers corresponding to the call request.
[0124] Step S702: Receive a change notification message sent by the ZooKeeper server. The change notification message is a notification message generated by the ZooKeeper server based on the change in the existence status of the temporary child node. The change notification message includes the identifier of the service provider. The temporary child node is published by the ZooKeeper server based on the initial heartbeat and is generated in the namespace on the ZooKeeper server node.
[0125] Specifically, after the ZooKeeper server sends the change notification message to the service caller as described in step S306, the service caller can receive the change notification message sent by the ZooKeeper server. The change notification message is a notification message generated by the ZooKeeper server based on changes in the existence status of temporary child nodes. Temporary child nodes are generated by the ZooKeeper server based on the initial heartbeat and are created within the namespace on the ZooKeeper server node.
[0126] The change notification message includes the service provider's identifier, which can be used to distinguish the change notification message corresponding to each service provider.
[0127] Step S703: Receive the first change notification message and resume the call to the service provider corresponding to the identifier of the service provider in the first change notification message.
[0128] Among them, such as Figure 5 The illustrated embodiment describes a change notification message that includes a first change notification message and a second change notification message. The first change notification message contains information indicating that the service provider's identifier corresponds to a normal operating status.
[0129] Specifically, the service caller can receive the first change notification message sent by the ZooKeeper server and resume the call to the service provider corresponding to the service provider identifier in the first change notification message.
[0130] Step S704: Receive the second change notification message and perform fault response handling for the service provider corresponding to the service provider identifier in the second change notification message.
[0131] The second change notification message includes information that the service provider's working status, corresponding to the service provider's identifier, is abnormal.
[0132] Specifically, the service caller can receive the second change notification message sent by the ZooKeeper server and handle the fault response for the service provider corresponding to the service provider identifier in the second change notification message.
[0133] The heartbeat monitoring method for an IT system provided in this embodiment sends call requests to multiple service providers, enabling the service caller to access the service provider corresponding to the call request and receive a change notification message sent by the ZooKeeper server. This change notification message is generated by the ZooKeeper server based on changes in the existence status of temporary child nodes. The change notification message includes the identifier of the service provider. The temporary child nodes are generated by the ZooKeeper server based on the initial heartbeat and are located in the namespace on the ZooKeeper server node. Figure 2 Compared to the illustrated embodiment, this embodiment elaborates on the scenario of multiple service providers and multiple suppliers. For this scenario, the heartbeat monitoring method provided in this embodiment can improve the accuracy of heartbeat monitoring. It receives a first change notification message and resumes the call to the service provider corresponding to the service provider identifier in the first change notification message. It then receives a second change notification message and performs fault handling on the service provider corresponding to the service provider identifier in the second change notification message. Specifically, by dividing the change notification message into a first change notification message and a second change notification message, and elaborating on the different actions taken by the service caller after receiving the first and second change notification messages, the accuracy of heartbeat monitoring is improved.
[0134] Figure 8 This is a flowchart illustrating another heartbeat monitoring method for an IT system provided in the seventh embodiment of this application.
[0135] like Figure 8 As shown, the heartbeat monitoring method of the IT system in this embodiment is implemented by a service provider. Generally, it can be implemented through software, hardware, or a combination of both. It may include the following steps:
[0136] Step S801: Receive the call request sent by the service caller, and provide services to the service caller according to the call request.
[0137] Specifically, the service provider can receive the call request sent by the service caller, and the service provider provides services to the service caller according to the call request.
[0138] Step S802: Generate other heartbeats based on its own working status and send them to the ZooKeeper server at certain time intervals to update the existence status of temporary child nodes.
[0139] Specifically, service providers can generate other heartbeats based on their own operational status and send them to the ZooKeeper server at regular intervals to update the existence status of temporary child nodes.
[0140] The heartbeat monitoring method for IT systems provided in this embodiment receives call requests from service callers, provides services to service callers based on the call requests, generates other heartbeat publications according to its own working status, and continuously sends them to the ZooKeeper server at certain time intervals, so that the ZooKeeper server can update the existence status of temporary child nodes. Specifically, the service provider sends its working status to the ZooKeeper server by generating initial heartbeat publications and other heartbeat publications, reducing the coupling between the service caller and the service provider, and improving the efficiency and accuracy of heartbeat monitoring.
[0141] Figure 9 This is a flowchart illustrating another heartbeat monitoring method for an IT system provided in the eighth embodiment of this application. Figure 8 Based on the illustrated embodiment, the service provider includes one or more service providers. This embodiment elaborates on the situation of multiple service providers and the operations after generating other heartbeats based on their own working status and continuously sending them to the ZooKeeper server at certain time intervals.
[0142] like Figure 9 As shown, the heartbeat monitoring method of the IT system in this embodiment is implemented by a service provider. Generally, it can be implemented through software, hardware, or a combination of both. It may include the following steps:
[0143] Step S901: Multiple service providers receive the call request sent by the service caller, and provide services to the service caller according to the call request.
[0144] Specifically, multiple service providers can receive call requests sent by service callers, and provide services to service callers according to the call requests.
[0145] Step S902: Multiple service providers generate other heartbeats based on their own working status and send them to the ZooKeeper server continuously at certain time intervals so that the ZooKeeper server can update the existence status of temporary child nodes.
[0146] Specifically, multiple service providers can generate other heartbeats based on their own operational status and send them to the ZooKeeper server at regular intervals to update the existence status of temporary child nodes.
[0147] Specifically, the service provider's working status can include two states: normal and abnormal.
[0148] If its own working status is normal, it generates other heartbeat releases.
[0149] Specifically, when the service provider is in a normal working state, it can generate other heartbeats to send to the ZooKeeper server.
[0150] If its own working status is abnormal, no other heartbeats will be generated.
[0151] Specifically, when the service provider's own working status is abnormal, it cannot generate other heartbeats to send to the ZooKeeper server.
[0152] Step S903: Provide services for the calls made by the service caller.
[0153] Specifically, as described in step S502, when the existence state of a temporary child node changes to the state of being generated, the ZooKeeper server generates a first change notification message. The first change notification message contains information that the working status of the service provider corresponding to the service provider's identifier is normal. As described in step S703, the service caller receives the first change notification message and resumes the call to the service provider corresponding to the service provider's identifier in the first change notification message.
[0154] Specifically, the service provider can provide services in response to the calls made by the aforementioned service callers.
[0155] Step S904: Perform fault repair according to the fault handling and disposal methods provided by the service caller.
[0156] Specifically, as described in step S501, when the existence status of a temporary child node changes to deletion, the ZooKeeper server generates a second change notification message. The second change notification message contains information that the working status of the service provider corresponding to the service provider's identifier is abnormal. As described in step S704, the service caller receives the second change notification message and performs fault response handling on the service provider corresponding to the service provider's identifier in the second change notification message.
[0157] Specifically, the service provider can perform fault repair based on the fault handling and response methods provided by the service caller.
[0158] The heartbeat monitoring method for IT systems provided in this embodiment receives call requests from service callers through multiple service providers, and provides services to service callers according to the call requests. Multiple service providers generate other heartbeat publications based on their own working status and continuously send them to the ZooKeeper server at certain time intervals, so that the ZooKeeper server updates the existence status of temporary child nodes, provides services for service callers, and performs fault repair based on the fault response and handling provided by service callers, thereby improving the efficiency and accuracy of heartbeat monitoring.
[0159] The ninth embodiment of this application provides a heartbeat monitoring system for an IT system, the structural schematic of which can be referred to. Figure 1 The diagram shows an application scenario of the heartbeat monitoring method in an IT system.
[0160] like Figure 1 As shown, the heartbeat monitoring system of the IT system in this embodiment may include:
[0161] ZooKeeper server 11, service caller 12, and at least one service provider 13.
[0162] The ZooKeeper server 11 described above is used to receive heartbeat announcements sent by service provider 13. The heartbeat announcements are set to be sent continuously at certain time intervals. The heartbeat announcements include: an initial heartbeat announcement and other heartbeat announcements. Based on the initial heartbeat announcement, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider 13 corresponding to one temporary child node. The existence status of the temporary child nodes is updated according to the reception of other heartbeat announcements. The existence status of the temporary child nodes is monitored, and a change notification message is generated based on the change in the existence status of the temporary child nodes. The change notification message is sent to the service caller 12.
[0163] The aforementioned service caller 12 is used to send a call request to the service provider 13 so that the service caller 12 can access the service provider 13 corresponding to the call request; and to receive a change notification message sent by the ZooKeeper server 11. The change notification message is a notification message generated by the ZooKeeper server 11 based on the change in the existence status of the temporary child node. The temporary child node is generated by the ZooKeeper server 11 based on the initial heartbeat and is generated in the namespace on the ZooKeeper server node.
[0164] The aforementioned service provider 13 is used to receive call requests sent by service caller 12, and to provide services to service caller 12 according to the call requests; and to generate other heartbeat publications according to its own working status, and send them to ZooKeeper server 11 continuously at certain time intervals, so that ZooKeeper server 11 can update the existence status of temporary child nodes.
[0165] Figure 10 This is a schematic diagram of the structure of a heartbeat monitoring device for an IT system, provided in the eleventh embodiment of this application.
[0166] like Figure 10 As shown, the heartbeat monitoring device 100 of the IT system in this embodiment includes:
[0167] Processor 101, and memory 102 communicatively connected to processor 101;
[0168] Memory 102 stores computer-executed instructions;
[0169] The processor 101 executes computer execution instructions stored in the memory 102 to implement the above-described method embodiments. Figures 1 to 5 any one or Figures 6 to 7 any one or Figures 8 to 9 Any one of the methods.
[0170] The twelfth embodiment of this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by processor 101, implement the above-described method embodiments. Figures 1 to 5 any one or Figures 6 to 7 any one or Figures 8 to 9 A heartbeat monitoring method for any IT system.
[0171] Embodiments of this application also provide a computer program product comprising a computer program stored in a readable storage medium. At least one processor of electronic device 110 can read the computer program from the readable storage medium, and the at least one processor executes the computer program to cause electronic device 100 to implement the heartbeat monitoring method of the IT system provided in the various embodiments described above.
[0172] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0173] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A heartbeat monitoring method for an IT system, characterized in that, Applied to ZooKeeper server nodes, including: The system receives heartbeat announcements from multiple service providers. These heartbeat announcements are configured to be sent continuously at certain time intervals. The heartbeat announcements include an initial heartbeat announcement and other heartbeat announcements. The namespace on the ZooKeeper server node includes multiple namespaces, each corresponding to one of the service provider's suppliers. Based on the initial heartbeat release, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node; the existence status of the temporary child node includes: creation, maintenance, and deletion. The existence status of the temporary child node is updated based on the comparison result between the receiving interval of other heartbeat announcements and the heartbeat announcement time threshold. The existence status of the temporary child nodes is monitored, and a change notification message is generated based on the changes in the existence status of the temporary child nodes; the change notification message is used to indicate whether the working status of the service provider corresponding to the service provider's identifier is normal. The change notification message is sent to the service caller.
2. The method according to claim 1, characterized in that, The step of updating the existence status of the temporary child node based on the comparison result between the receiving interval of other heartbeat announcements and the heartbeat announcement time threshold includes: If the time interval between receiving other heartbeats is less than the release time threshold, the temporary child node remains in the state of existence. If the time interval between receiving other heartbeats is greater than or equal to the release time threshold, the temporary child node is deleted. When the temporary child node is in the state of deletion, if another heartbeat is received, the temporary child node will be in the state of generation.
3. The method according to claim 2, characterized in that, The change notification message includes the identifier of the service provider, and the generation of the change notification message based on the change in the existence status of the temporary child node includes: If the existence status of the temporary child node changes to deletion, a second change notification message is generated. The second change notification message contains information that the working status of the service provider corresponding to the identifier of the service provider is abnormal. If the existence status of the temporary child node changes to "generated", a first change notification message is generated. The first change notification message contains information that the working status of the service provider corresponding to the identifier of the service provider is normal.
4. A heartbeat monitoring method for an IT system, characterized in that, Applied to the service caller, including: Sending invocation requests to multiple service providers to enable service invokers to access the service providers corresponding to the invocation requests; Receive a change notification message sent by the ZooKeeper server node. The change notification message is a notification message generated by the ZooKeeper server node after updating the existence status of the temporary child node based on the comparison result of the receiving interval of other heartbeats and the publication time threshold of the heartbeat. The temporary child node is generated by the ZooKeeper server node in the namespace on the ZooKeeper server node based on the initial heartbeat publication. The namespace on the ZooKeeper server node includes multiple namespaces, each corresponding to a service provider's vendor; the existence status of the temporary child node includes: creation, maintenance, and deletion; the change notification message is used to indicate whether the working status of the service provider corresponding to the service provider's identifier is normal.
5. The method according to claim 4, characterized in that, The change notification message includes the identifier of the service provider. After receiving the change notification message sent by the ZooKeeper server node, the process further includes: Receive the first change notification message and resume the call to the service provider corresponding to the identifier of the service provider in the first change notification message; Receive the second change notification message and perform fault response handling for the service provider corresponding to the identifier of the service provider in the second change notification message.
6. A heartbeat monitoring method for an IT system, characterized in that, Applied to service providers, including: Receive a call request sent by a service caller, and provide services to the service caller according to the call request; Based on its own working status, it generates other heartbeats and sends them to the ZooKeeper server node at certain time intervals. This allows the ZooKeeper server node to update the existence status of the temporary child node based on the comparison between the time interval of receiving other heartbeats and the heartbeat release time threshold. The ZooKeeper server node's namespace includes multiple namespaces, each corresponding to a service provider's vendor. The temporary child node is generated by the ZooKeeper server node based on the initial heartbeat within the namespace on the ZooKeeper server node. The service provider includes multiple service providers, each corresponding to one temporary child node. The temporary child node's existence status includes: generated, maintained, and deleted.
7. The method according to claim 6, characterized in that, The generation of other heartbeat releases based on its own working status includes: If its own working status is normal, generate the other heartbeat releases; If its own working status is abnormal, no other heartbeat releases will be generated.
8. The method according to claim 7, characterized in that, After providing the service to the service caller according to the call request, the method further includes: Provide services in response to the invocations of the aforementioned service callers; Fault repair is performed based on the fault handling and response provided by the service caller.
9. A heartbeat monitoring system for an IT system, characterized in that, include: ZooKeeper server nodes, service callers, and multiple service providers. The ZooKeeper server node is used to receive heartbeat announcements sent by service providers. These heartbeat announcements are configured to be sent continuously at regular time intervals and include an initial heartbeat announcement and other heartbeat announcements. Based on the initial heartbeat announcement, temporary child nodes are generated in the namespace on the ZooKeeper server node, with each service provider corresponding to one temporary child node. The existence status of the temporary child nodes is updated based on a comparison between the receiving interval of the other heartbeat announcements and a heartbeat announcement time threshold. The existence status of the temporary child nodes is monitored, and a change notification message is generated based on changes in the existence status of the temporary child nodes. The change notification message is sent to the service caller. The namespace on the ZooKeeper server node includes multiple namespaces, each corresponding to a service provider's vendor. The existence status of the temporary child nodes includes: creation, maintenance, and deletion. The change notification message indicates whether the service provider corresponding to the service provider's identifier is functioning correctly. The service caller is configured to send call requests to multiple service providers so that the service caller can access the service provider corresponding to the call request; and to receive a change notification message sent by the ZooKeeper server node, wherein the change notification message is a notification message generated by the ZooKeeper server node based on the change in the existence status of the temporary child node; The service provider is configured to receive a call request from a service caller and provide services to the service caller according to the call request; generate other heartbeat publications based on its own working status and continuously send them to the ZooKeeper server node at certain time intervals, so that the ZooKeeper server node updates the existence status of the temporary child node based on the comparison result between the time interval of receiving other heartbeat publications and the publication time threshold of the heartbeat publication.
10. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 3, or any one of claims 4 to 5, or any one of claims 6 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 3, 4 to 5, or 6 to 8.
Citation Information
Patent Citations
Distributed message system and service status detection method thereof
CN102710554A
Distributed calling system for timed tasks
CN112416581A
Switching method of master node in distributed master-slave system, master node equipment and storage medium
CN112860787A