CN115665016A - Heartbeat monitoring method, device, equipment and storage medium - Google Patents

Heartbeat monitoring method, device, equipment and storage medium Download PDF

Info

Publication number
CN115665016A
CN115665016A CN202211182176.4A CN202211182176A CN115665016A CN 115665016 A CN115665016 A CN 115665016A CN 202211182176 A CN202211182176 A CN 202211182176A CN 115665016 A CN115665016 A CN 115665016A
Authority
CN
China
Prior art keywords
heartbeat
timestamp
client
heartbeat data
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211182176.4A
Other languages
Chinese (zh)
Inventor
何宁华
陈传传
潘海威
王晨彬
李志涛
金永刚
刘萍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing 263 Enterprise Communication Co ltd
Original Assignee
Beijing 263 Enterprise Communication Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing 263 Enterprise Communication Co ltd filed Critical Beijing 263 Enterprise Communication Co ltd
Priority to CN202211182176.4A priority Critical patent/CN115665016A/en
Publication of CN115665016A publication Critical patent/CN115665016A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application provides a heartbeat monitoring method, a heartbeat monitoring device, heartbeat monitoring equipment and a heartbeat monitoring storage medium. The method comprises the following steps: monitoring heartbeat data of a client terminal received by a server last time and a timestamp of the heartbeat data received by the server, wherein the timestamp is stored in a Redis storage unit of a remote dictionary service, and the heartbeat data comprises: a client identifier; starting a query task of a server according to a set query time interval, and querying whether a timestamp of heartbeat data stored in Redis exceeds a set threshold value; and determining the current state of the client according to whether the time stamp of the heartbeat data exceeds a set threshold value. The method increases the safety and stability of the heartbeat monitoring reference index and improves the accuracy of heartbeat monitoring.

Description

Heartbeat monitoring method, device, equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for heartbeat monitoring.
Background
The client needs a heartbeat mechanism to let the server perceive whether the client is online or alive. The software system of the Client can adopt a C/S architecture (Client/Server, client/Server architecture) and/or a B/S architecture (Browser/Server architecture). The client system adopting any one of the above architectures needs to use a heartbeat mechanism to sense the running state of the client. For example, in a video conference scene based on a client/server architecture, participants enter a conference through the client, the client exits abnormally, the server needs to sense whether the client is still through a heartbeat mechanism, and if the client is not still, a host is prompted to leave a participant; in a system based on a browser/server architecture, a client runs in a browser, the browser is closed, the client cannot report and quit actively, and the server can only sense whether the client is online or not through a heartbeat mechanism; in addition, in the running process of the instant chat software, whether the user is in an online state or not is sensed through a heartbeat mechanism.
In the prior art, a server side senses whether a client side is on line or not through an overdue event of a non-relational database key, and when the server side does not receive heartbeat data for a period of time, the key of the non-relational database triggers an automatic deleting function and sends the overdue event. The server monitors the heartbeat data and the overdue events of the keys of the non-relational database at the same time, and when receiving the overdue events, the server shows that the client corresponding to the overdue events is off-line.
However, the expired event of the non-relational database key is an unreliable event, and is easily lost, so that the problem of inaccurate heartbeat data monitoring occurs, and further the condition that the operating state of the client is judged incorrectly is caused.
Disclosure of Invention
The application provides a heartbeat monitoring method, a heartbeat monitoring device, heartbeat monitoring equipment and a heartbeat monitoring storage medium, which are used for solving the problem of inaccurate heartbeat data monitoring.
In a first aspect, the present application provides a heartbeat listening method, including:
monitoring heartbeat data of a client terminal received last time by a server and a timestamp of the heartbeat data received by the server, wherein the heartbeat data are stored in a Redis storage unit of a remote dictionary service, and the heartbeat data comprise: a client identifier;
starting an inquiry task of a server according to a set inquiry time interval, and inquiring whether a timestamp of the heartbeat data stored in the Redis exceeds a set threshold value or not;
and determining the current state of the client according to whether the timestamp of the heartbeat data exceeds the set threshold value. And determining the current state of the client according to whether the timestamp of the heartbeat data exceeds the set threshold value.
In a second aspect, the present application provides a heartbeat monitoring device, including:
the monitoring module is used for monitoring heartbeat data of a client terminal received by a server last time and a timestamp of the heartbeat data received by the server, wherein the heartbeat data is stored in a Redis storage unit of a remote dictionary service, and comprises: a client identification;
the query module is used for starting a query task of a server according to a set query time interval and querying whether a timestamp of the heartbeat data stored in the Redis exceeds a set threshold value or not;
and the determining module is used for determining the current state of the client according to whether the time stamp of the heartbeat data exceeds the set threshold value.
In a third aspect, the present application provides a heartbeat monitoring device, including:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the heartbeat listening method of the first aspect via execution of the executable instructions.
In a fourth aspect, the present application provides a readable storage medium having stored thereon a computer program comprising:
the computer program, when executed by a processor, implements the method of performing heartbeat listening of the first aspect.
According to the method, the device, the equipment and the storage medium for heartbeat monitoring, the heartbeat data of the client terminal received by the server last time and the timestamp of the heartbeat data received by the server, which are stored in the Redis storage unit, are monitored, the query task of the server is started according to the set query time interval, whether the timestamp of the heartbeat data stored in the Redis exceeds the set threshold value is queried, and the current state of the client terminal is further determined. Wherein the timestamp of heartbeat data is stored in the Redis storage unit, the query of the heartbeat state can be safer and more stable by querying the timestamp, and the effect of more accurate heartbeat monitoring is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flowchart of a method for heartbeat listening according to a first embodiment of the present application;
fig. 2 is a flowchart illustrating a method for heartbeat listening according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a heartbeat monitoring apparatus according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of another heartbeat monitoring device according to a third embodiment of the present application;
fig. 5 is a schematic structural diagram of a heartbeat listening device according to a fourth embodiment of the present application.
Specific embodiments of the present application have been shown by way of example in the drawings and will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The prior art monitors the running state of a client according to an overdue event of a non-relational database key. When the server does not receive heartbeat data for a period of time, the key of the non-relational database triggers the automatic deleting function and sends an overdue event; the server monitors the overdue events of the keys of the non-relational database while monitoring the heartbeat data, and when the server receives the overdue events, the server shows that the clients corresponding to the overdue events are offline. However, the expired event of the non-relational database key is an unreliable event and is easily lost, so that the problem of inaccurate heartbeat data monitoring can occur, and further the operating state of the client is judged incorrectly.
According to the method, the device, the equipment and the storage medium for heartbeat monitoring, a server firstly monitors heartbeat data of a client terminal received by the server last time and a timestamp of the heartbeat data received by the server, wherein the heartbeat data timestamp is stored in a Redis storage unit. According to the set query time interval, whether the timestamp of the heartbeat data stored in the Redis exceeds the set threshold value or not is queried, the current state of the client side is further determined according to the query result of the timestamp, wherein the heartbeat state can be queried more safely and stably in a mode of querying the timestamp, and the effect of more accurate heartbeat monitoring can be achieved.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for heartbeat listening according to a first embodiment of the present application.
As shown in fig. 1, in the method for heartbeat monitoring provided by this embodiment, the execution main body is a server, and generally, the execution main body can be implemented by software, or hardware, or a combination of software and hardware. The method can comprise the following steps:
step S101, heartbeat data of a client terminal received by a server last time and a timestamp of the heartbeat data received by the server are monitored, wherein the heartbeat data are stored in a Redis storage unit of a remote dictionary service, and the heartbeat data comprise: and identifying the client.
Specifically, in this embodiment, the server receives heartbeat data sent by the client, and after parsing by the server, the heartbeat data may be stored in a storage unit of Redis in a certain data format, where the heartbeat data includes: and identifying the client. Meanwhile, the server can generate a timestamp for receiving the heartbeat data while receiving the heartbeat message, and the timestamp for receiving the heartbeat data by the server is stored in a storage unit of Redis in a certain data format. The heartbeat monitoring process provided by this embodiment can be implemented by monitoring heartbeat data stored in the Redis storage unit and a timestamp of the server receiving the heartbeat data.
Step S102, starting a query task of the server according to the set query time interval, and querying whether the timestamp of the heartbeat data stored in Redis exceeds a set threshold value.
The timestamp of the heartbeat data stored in the Redis can be queried through a query task of the server, and whether the timestamp exceeds a set threshold value is judged. Specifically, the query task of the server can be started according to a set query time interval, the start time of the query task of the server is extracted, and the start time of the query task of the server is subtracted by a threshold value set in the query task of the server to obtain a comparison value of the heartbeat data timestamp; comparing the time stamp of the heartbeat data stored in Redis inquired by the inquiry task with the comparison value of the time stamp of the heartbeat data, and judging whether the time stamp of the heartbeat data stored in Redis inquired by the inquiry task exceeds the set threshold value in the inquiry task of the server or not
And step S103, determining the current state of the client according to whether the time stamp of the heartbeat data exceeds a set threshold value.
Specifically, the relationship between the timestamp of the heartbeat data and the set threshold may be obtained through the query task of the server started according to the set query time interval in step S102. When the timestamp of the heartbeat data stored in the Redis exceeds a set threshold value in a query task of the server, the timestamp of the heartbeat data stored in the Redis is smaller than a contrast value of the timestamp of the heartbeat data, namely, the client corresponding to the client identifier in the heartbeat data does not send the heartbeat data to the server within a specified time, namely the reporting time required by the reporting frequency of the heartbeat data; when the timestamp of the heartbeat data stored in the Redis does not exceed the set threshold value in the query task of the server, the timestamp of the heartbeat data stored in the Redis is greater than a contrast value of the timestamp of the heartbeat data, namely, the client corresponding to the client identifier in the heartbeat data sends the heartbeat data to the server within the specified time, namely the reporting time required by the reporting frequency of the heartbeat data.
The server can judge the state of the client according to whether the client sends the heartbeat data to the server within the set time, namely the reporting time required by the reporting frequency of the heartbeat data, so that whether the client sends the heartbeat data to the server within the set time, namely the reporting time required by the reporting frequency of the heartbeat data, can be determined according to whether the timestamp of the heartbeat data exceeds the set threshold, and the current state of the client is further determined.
In the embodiment, the current state of the client is further determined by monitoring the heartbeat data of the client received by the server most recently and the timestamp of the heartbeat data received by the server, which are stored in the Redis storage unit, and starting the query task of the server according to the set query time interval, and querying whether the timestamp of the heartbeat data stored in the Redis exceeds the set threshold. The server can make the inquiry of the heartbeat state safer and more stable in a mode of inquiring the timestamp, and can realize the effect of more accurate heartbeat monitoring.
Fig. 2 is a flowchart of a heartbeat listening method according to a second embodiment of the present application. On the basis of the embodiment shown in fig. 1, in this embodiment, before step S101, a description is added that the server receives a message sent by the client, generates a timestamp of receiving the heartbeat message, and stores heartbeat data and the heartbeat data timestamp in a Redis storage unit; a state prompt of the server to the client is added after the step S103; meanwhile, the specific setting of the server query task in step S102 and the specific determination of the current state of the client in step S103 are further described.
As shown in fig. 2, the method for heartbeat monitoring provided in this embodiment may include the following steps:
step S201, the server receives the heartbeat message sent by the client, and analyzes and stores the heartbeat message.
Specifically, before monitoring the heartbeat data of the client that is received by the server most recently and stored in the Redis storage unit in step S101 and the timestamp that the server receives the heartbeat data, the server needs to receive a heartbeat packet sent by the client; generating a time stamp for receiving the heartbeat message; and storing the heartbeat data including the client identifier and the timestamp of the heartbeat message into the Redis storage unit so as to replace the last heartbeat data and timestamp of the client stored in the Redis storage unit.
Firstly, a server receives a heartbeat message sent by a client, wherein the heartbeat message carries a client identifier.
The server can simultaneously receive heartbeat data sent by the clients and simultaneously monitor the online states of the clients. In this embodiment, the heartbeat data monitoring of one client is mainly taken as an example for description. In particular, the heartbeat data sent by the client to the server may include a small amount of other information related to the heartbeat data in addition to the client identification. After receiving the heartbeat data from each client, the server may analyze the received heartbeat data, and may decompose the heartbeat data into: the client identifies information related to other heartbeat data. The information related to the heartbeat data may be null or meaningful data, which depends on the service scenario and does not affect the efficiency and performance of the heartbeat listening method of this embodiment. For example: for a remote ammeter monitoring scene, the server can judge the running state of the remote ammeter through heartbeat data sent by the remote ammeter at regular time. Meanwhile, the heartbeat message of the remote electricity meter also includes information related to heartbeat data, i.e. a small amount of data related to the device when being uploaded on the heartbeat data, including but not limited to, for example: meter readings, meter voltage, alarm data, etc. The server can judge the reason of the equipment abnormity according to the data related to the heartbeat data, and the application system can also collect information according to the data related to the heartbeat data.
Then, a timestamp of the received heartbeat message is generated.
When receiving the heartbeat message, the server side can generate an integer value of millisecond-level time corresponding to the heartbeat message receiving time, and the integer value records a timestamp of the heartbeat data received by the server, namely the timestamp of the heartbeat message or/and the timestamp of the heartbeat data.
And finally, storing the heartbeat data including the client identifier and the timestamp of the heartbeat message into a Redis storage unit so as to replace the last heartbeat data and timestamp of the client stored in the Redis storage unit.
Among other things, the storage system Redis supports many types of data structures, such as: string, linked list, set, ordered set, and hash. In this embodiment, the heartbeat data sent by the client may be stored by using an ordered set sorted set data structure of the storage system Redis. The analyzed heartbeat data and the timestamp of the heartbeat data can be stored into an ordered set of the storage system Redis. In this embodiment, the Key, the Score and the Member field may be selected to store the analyzed heartbeat data and the timestamp of the heartbeat data. Specifically, the client identifier may be stored in a Key value field in the ordered set of the Redis storage unit, the timestamp may be stored in a Score value field in the ordered set, and the information related to the other heartbeat data may also be stored in a Member number value field in the ordered set. An ordered set of Redis is generated that is correlated to this heartbeat data.
The above storage procedure is directed to the process of receiving heartbeat data by the server for the first time, since the client may be, for example, at intervals: and uploading one heartbeat data to the server again in 10 seconds, so that when the server receives new heartbeat data sent by the client again, the heartbeat data stored in the Redis storage unit in the server and the timestamp of the heartbeat data are correspondingly updated, and the new heartbeat data and the timestamp replace the last heartbeat data and timestamp of the client which are already stored in the Redis storage unit. Therefore, stored in the Redis storage unit is a timestamp of the latest heartbeat data received by the server and the heartbeat data corresponding thereto.
And S202, setting a query task of the server, and querying the timestamp of the heartbeat data stored in Redis.
Before the step S102 starts an inquiry task of the server according to the set inquiry time interval and inquires whether the timestamp of the heartbeat data stored in the Redis exceeds the set threshold, the inquiry task needs to be set, where the setting mainly includes performing parameter configuration for the inquiry task of the server, and the parameters include: the starting time of the query task, the query time interval and the set threshold.
Specifically, the starting time and the query time interval of the query task are set according to the service scene requirements and the service requirements. The starting time of the query task may be set as a time point, for example: and 9 o' clock, starting the query task when the system reaches the starting time of the query task, and querying the scores in the ordered set by the query task. In addition, multiple queries can be performed on the scores of the ordered set in one query task by setting a query time interval in the query task, and the time interval of the Score query in the query task can be set to be a time period, for example: for 3 minutes.
In addition, the threshold set in the query task of the server is an important parameter for judging the heartbeat state of the client, wherein the threshold set in the query task of the server should be greater than the reporting frequency of the heartbeat data of the client, namely the time interval for uploading the heartbeat data. For example: if the heartbeat data of the client is reported to the server once every 10 seconds, the threshold value set in the query task of the server needs to be set to be a numerical value greater than 10 seconds.
Step S203, starting a query task of a server according to a set query time interval, and querying whether a timestamp of heartbeat data stored by Redis exceeds a set threshold value;
specifically, since the Score field in Redis stores the timestamp of the latest received heartbeat data from the client, the server-initiated query task in this embodiment can analyze the ordered set of the Redis by means of fractional Score field query. The system starts a query task when the starting time is reached, and carries out multiple queries on the timestamp of the heartbeat data stored in the Score field in Redis according to a set query time interval, and meanwhile, the starting time of multiple query tasks can be obtained according to the starting time of the query task and the query time interval.
In this embodiment, for example, a fraction query, that is, a query task, of the ordered set is used to query a timestamp of heartbeat data stored in the Redis, and determine whether the timestamp exceeds a set threshold. As described in step S102, a contrast value of the heartbeat data timestamp may be obtained. If the timestamp of the heartbeat data stored in the Redis is smaller than the contrast value of the timestamp of the heartbeat data, the timestamp of the heartbeat data stored in the Redis exceeds the set threshold value in the query task of the server, and if the timestamp of the heartbeat data stored in the Redis is larger than the contrast value of the timestamp of the heartbeat data, the timestamp of the heartbeat data stored in the Redis does not exceed the set threshold value in the query task of the server.
And step S204, determining the current state of the client according to whether the time stamp of the heartbeat data exceeds a set threshold value.
Specifically, if the timestamp of the heartbeat data exceeds a set threshold, it is determined that the client is in an offline state. When the time stamp of the heartbeat data does not exceed the set threshold value, namely when the time stamp of the heartbeat data stored in Redis is smaller than the contrast value of the time stamp of the heartbeat data, the client corresponding to the client identifier in the heartbeat data is judged to send the heartbeat data to the server within the specified time, namely the reporting time required by the reporting frequency of the heartbeat data, so that the client is in an online state; and if the timestamp of the heartbeat data does not exceed the set threshold, determining that the client is in an online state. That is, when the timestamp of the heartbeat data exceeds the set threshold, that is, when the timestamp of the heartbeat data stored in the Redis is greater than the contrast value of the timestamp of the heartbeat data, it is determined that the client corresponding to the client identifier in the heartbeat data does not send the heartbeat data to the server within the specified time, that is, the reporting time required by the reporting frequency of the heartbeat data, so that the client is in an offline state.
Step S205, the server sends the off-line state prompt of the client to the service system of the corresponding client to trigger off-line subsequent service operation.
Specifically, after the server determines the current state of the client, the client identifier of the client in the offline state is extracted, a client offline prompt is generated, and the client offline prompt is sent to the service system of the corresponding client. After receiving a client off-line state prompt sent by the server, the client service system can start off-line service operation.
The offline service operation initiated by the client service system may include, but is not limited to: sending off-line information, cleaning up temporary data and the like.
In this embodiment, a heartbeat message sent by a server receiving client is added before monitoring heartbeat data of the client received by the server last time and a timestamp of the heartbeat data received by the server, which are stored in a Redis storage unit, and the description of analyzing and storing the heartbeat message is described. The server may monitor the heartbeat of the client and may analyze other information related to the client at the same time. In addition, the heartbeat data is monitored in an active query mode of the query task, and the relevant parameters of the query task can be set according to the service scene and the requirement, so that the heartbeat monitoring better conforms to the service characteristics of the client, and the accuracy of the heartbeat monitoring is improved.
Fig. 3 is a schematic structural diagram of a heartbeat listening device according to a third embodiment of the present application.
As shown in fig. 3, the heartbeat monitoring device 30 of the present embodiment includes: monitoring module 31, query module 32, determination module 33.
The monitoring module 31 is configured to monitor heartbeat data of the client that is received last time by the server and is stored in the remote dictionary service Redis storage unit, and a timestamp of the heartbeat data received by the server, where the heartbeat data includes: client identification and other information of heartbeat data;
the query module 32 is configured to query whether a timestamp of the heartbeat data stored in the Redis exceeds a set threshold according to a set query time interval;
and the determining module 33 is configured to determine the current state of the client according to whether the timestamp of the heartbeat data exceeds a set threshold.
The determining module 33 is specifically configured to: if the timestamp of the heartbeat data exceeds a set threshold, determining that the client is in an off-line state; and if the time stamp of the heartbeat data does not exceed the set threshold, determining that the client is in an online state.
On the basis of the heartbeat monitoring device, the heartbeat monitoring device 30 further includes: a receiving module 34, a generating module 35, and a processing module 36, and a schematic structural diagram of another heartbeat monitoring device provided in this embodiment is shown in fig. 4
The receiving module 34 is configured to receive a heartbeat message sent by a client, where the heartbeat message carries a client identifier;
a generating module 35, configured to receive a timestamp of the heartbeat message;
and the processing module 36 is configured to store the heartbeat data including the client identifier and the timestamp of the heartbeat packet in the Redis storage unit, so as to replace the last heartbeat data and timestamp of the client that have been stored in the Redis storage unit. The apparatus provided in this embodiment may be used to implement the technical solutions of fig. 1 and fig. 2 in the above method embodiments, and the implementation principle and technical effects are similar, which are not described herein again.
Fig. 5 is a schematic structural diagram of a heartbeat listening device according to a fourth embodiment of the present application.
As shown in fig. 5, the heartbeat listening device 50 of the present embodiment includes: a processor 51, a memory 52, and a communication interface 53.
The memory 52 is used for storing executable instructions of the processor;
wherein the processor 51 is configured to execute the heartbeat listening method of any one of the above method embodiments of fig. 1 and 2 via execution of executable instructions.
An embodiment of the present application further provides a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the heartbeat monitoring method in the above method embodiment shown in any one of fig. 1 and fig. 2.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method for heartbeat monitoring, comprising:
monitoring heartbeat data of a client terminal received last time by a server and a timestamp of the heartbeat data received by the server, wherein the heartbeat data are stored in a Redis storage unit of a remote dictionary service, and the heartbeat data comprise: a client identifier;
starting an inquiry task of a server according to a set inquiry time interval, and inquiring whether a timestamp of the heartbeat data stored in the Redis exceeds a set threshold value or not;
and determining the current state of the client according to whether the timestamp of the heartbeat data exceeds the set threshold.
2. The method according to claim 1, wherein the determining the current status of the client according to whether the timestamp of the heartbeat data exceeds the set threshold comprises:
if the timestamp of the heartbeat data exceeds the set threshold, determining that the client is in an off-line state;
and if the timestamp of the heartbeat data does not exceed the set threshold, determining that the client is in an online state.
3. The method according to claim 1 or 2, wherein the monitoring before the last received heartbeat data of the client by the server and the timestamp of the heartbeat data received by the server, which are stored in the Redis storage unit, further comprises:
receiving a heartbeat message sent by the client, wherein the heartbeat message carries the client identifier;
generating a timestamp for receiving the heartbeat message;
and storing the heartbeat data including the client identifier and the timestamp of the heartbeat message into the Redis storage unit so as to replace the last heartbeat data and timestamp of the client, which are stored in the Redis storage unit.
4. The method according to claim 3, wherein the storing the heartbeat data including the client identifier and the timestamp of the heartbeat packet to the Redis storage unit includes:
storing the client identification to a key value field in the ordered collection of the Redis storage unit, and storing the timestamp to a score value field in the ordered collection.
5. The method according to claim 4, wherein the querying whether a timestamp of the heartbeat data stored in the Redis exceeds a set threshold before according to a set query time interval, further comprises:
configuring parameters for the query task of the server, wherein the parameters comprise: the starting time of the query task, the query time interval and the set threshold.
6. A heartbeat monitor device, comprising:
the monitoring module is used for monitoring heartbeat data of a client terminal which is received by a server last time and stored in a Redis storage unit of a remote dictionary service, and a timestamp of the heartbeat data received by the server, wherein the heartbeat data comprises: a client identification;
the query module is used for starting a query task of a server according to a set query time interval and querying whether a timestamp of the heartbeat data stored in the Redis exceeds a set threshold value or not;
and the determining module is used for determining the current state of the client according to whether the timestamp of the heartbeat data exceeds the set threshold value.
7. The apparatus of claim 6, wherein the determining module is specifically configured to: if the timestamp of the heartbeat data exceeds the set threshold, determining that the client is in an off-line state; and if the timestamp of the heartbeat data does not exceed the set threshold, determining that the client is in an online state.
8. The apparatus of claim 6 or 7, further comprising:
the receiving module is used for receiving a heartbeat message sent by the client, wherein the heartbeat message carries the client identifier;
the generating module is used for receiving the timestamp of the heartbeat message;
and the processing module is used for storing the heartbeat data comprising the client identifier and the timestamp of the heartbeat message to the Redis storage unit so as to replace the last heartbeat data and timestamp of the client stored in the Redis storage unit.
9. A heartbeat listening device, comprising:
a processor, a memory, a communication interface;
the memory is used for storing executable instructions of the processor;
wherein the processor is configured to perform the heartbeat listening method of any of claims 1 to 5 via execution of the executable instructions.
10. A readable storage medium on which a computer program is stored, which computer program, when being executed by a processor, is adapted to carry out the method of heartbeat listening of any one of claims 1 to 5.
CN202211182176.4A 2022-09-27 2022-09-27 Heartbeat monitoring method, device, equipment and storage medium Pending CN115665016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211182176.4A CN115665016A (en) 2022-09-27 2022-09-27 Heartbeat monitoring method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211182176.4A CN115665016A (en) 2022-09-27 2022-09-27 Heartbeat monitoring method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115665016A true CN115665016A (en) 2023-01-31

Family

ID=84984974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211182176.4A Pending CN115665016A (en) 2022-09-27 2022-09-27 Heartbeat monitoring method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115665016A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116881984A (en) * 2023-09-08 2023-10-13 云筑信息科技(成都)有限公司 Data monitoring method
CN117076560A (en) * 2023-07-21 2023-11-17 九为(浙江)网络科技有限公司 Data synchronization method based on drug retail cashing system
CN117118876A (en) * 2023-10-20 2023-11-24 美云智数科技有限公司 Heartbeat connection detection method and device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076560A (en) * 2023-07-21 2023-11-17 九为(浙江)网络科技有限公司 Data synchronization method based on drug retail cashing system
CN116881984A (en) * 2023-09-08 2023-10-13 云筑信息科技(成都)有限公司 Data monitoring method
CN116881984B (en) * 2023-09-08 2024-02-23 云筑信息科技(成都)有限公司 Data monitoring method
CN117118876A (en) * 2023-10-20 2023-11-24 美云智数科技有限公司 Heartbeat connection detection method and device, electronic equipment and storage medium
CN117118876B (en) * 2023-10-20 2024-03-08 美云智数科技有限公司 Heartbeat connection detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN115665016A (en) Heartbeat monitoring method, device, equipment and storage medium
CN108156006B (en) Buried point data reporting method and device and electronic equipment
CN110647438B (en) Event monitoring method and device, computer equipment and storage medium
EP3386150B1 (en) Terminal failure processing method, device and system
US8352589B2 (en) System for monitoring computer systems and alerting users of faults
CN112040501B (en) Detection and early warning method, device, equipment and storage medium for mobile network quality
CN112636979B (en) Cluster alarm method and related device
CN111538563A (en) Event analysis method and device for Kubernetes
CN112463772B (en) Log processing method and device, log server and storage medium
CN111884843B (en) Message processing method and device, electronic equipment and storage medium
CN110737565B (en) Data monitoring method and device, electronic equipment and storage medium
CN111565135A (en) Method for monitoring operation of server, monitoring server and storage medium
CN104468248B (en) Service performance monitoring method, reverse proxy server, statistical analysis server and system
CN111818097B (en) Traffic monitoring method and device based on behaviors
CN113472858A (en) Buried point data processing method and device and electronic equipment
US11216352B2 (en) Method for automatically analyzing bottleneck in real time and an apparatus for performing the method
CN111416857A (en) Client crash processing method, device, system, equipment and storage medium
CN111124891A (en) Access state detection method and device, storage medium and electronic device
CN114422817B (en) Live broadcast room data processing method and device, electronic equipment and storage medium
CN115883639A (en) Web real-time message pushing method and device, equipment and storage medium
CN114116253A (en) Message processing method and system for message queue
CN113742400A (en) Network data acquisition system and method based on self-adaptive constraint conditions
CN113407363A (en) Sliding window counting method and device based on remote dictionary service
CN113157048B (en) Behavior data analysis method based on multi-terminal time axis and related components
CN113810351A (en) Method and device for determining attacker of network attack and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination