CN109525466B - Data node monitoring method and device, electronic equipment and storage medium - Google Patents

Data node monitoring method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109525466B
CN109525466B CN201910004437.5A CN201910004437A CN109525466B CN 109525466 B CN109525466 B CN 109525466B CN 201910004437 A CN201910004437 A CN 201910004437A CN 109525466 B CN109525466 B CN 109525466B
Authority
CN
China
Prior art keywords
monitoring
data node
target data
listener
client
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.)
Active
Application number
CN201910004437.5A
Other languages
Chinese (zh)
Other versions
CN109525466A (en
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.)
Hangzhou Yunyi Network Technology Co.,Ltd.
Original Assignee
Hangzhou Yunyi Network Technology 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 Hangzhou Yunyi Network Technology Co ltd filed Critical Hangzhou Yunyi Network Technology Co ltd
Priority to CN201910004437.5A priority Critical patent/CN109525466B/en
Publication of CN109525466A publication Critical patent/CN109525466A/en
Application granted granted Critical
Publication of CN109525466B publication Critical patent/CN109525466B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes

Abstract

The application provides a data node monitoring method and a data node monitoring device, wherein the method comprises the steps of monitoring a target data node by using a monitor; if the listener monitors that the target data node changes, sending a notification request to a client registered with the listener; and keeping the listener to continuously listen to the target data node. The monitor can be reserved after one-time monitoring operation and cannot be deleted, so that the target data nodes can be monitored repeatedly, the situation that the target data nodes are changed between deletion and a new monitor is avoided, and the problem that the target data nodes are changed between the deleted monitor and the new monitor is solved. The client only needs to send a registration request to the server once, and does not need to send the registration request to the server for multiple times, so that the interaction times of the client and the server network can be reduced, network resources are saved, and monitoring mechanism operation is simplified.

Description

Data node monitoring method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of network communication technologies, and in particular, to a data node monitoring method and apparatus.
Background
The Zookeeper is used as a distributed coordination service system and can provide services such as open-source distributed configuration, synchronization service, naming registration and the like for large-scale distributed computing. The ZooKeeper system comprises a server and a plurality of clients, wherein the server comprises a plurality of data nodes.
In the snooping mechanism supported by ZooKeeper, a client may register a listener (listener) with a server, so that the server listens to a target data node concerned by the client. And if the server side monitors that the target data node changes, the listener is triggered to inform the client side registered with the listener.
However, since the default listener of the ZooKeeper deletes the listener after being used once, the listener in the ZooKeeper can only execute a trigger operation once, that is, the client only receives a notification once after the target data node changes. Thereafter, the target data node changes again and the client that previously set the listener will not receive any more notifications.
If the client still wants to monitor the target data node, the listener needs to be registered with the server again, which increases the network interaction times of the client and the server; if the target data node changes after the original listener is deleted and before a new listener is constructed, the server cannot monitor the change, that is, the change of the target data node in the period is omitted.
Namely, the existing monitoring mechanism in the ZooKeeper has the disadvantages of complicated operation process, occupation of more network resources and certain leakage rate.
Disclosure of Invention
In view of this, the present application provides a data node monitoring method and apparatus, which can simplify the operation process of the monitoring mechanism, avoid occupying more network resources, and avoid omitting the change of the data node.
In order to achieve the above object, the present application provides the following technical features:
a data node monitoring method comprises the following steps:
monitoring a target data node by using a monitor;
if the listener monitors that the target data node changes, sending a notification request to a client registered with the listener;
and keeping the listener to continuously listen to the target data node.
Optionally, before the snooping, by the snooper, the target data node, the method further includes:
receiving a registration request sent by the client; the registration request comprises a target data node identifier and a monitoring type;
constructing a listener corresponding to the registration request;
storing the monitoring information of the listener; wherein the interception information includes the client identifier, the target data node identifier, and the interception type.
Optionally, if the listener monitors that the target data node changes, sending a notification request to a client registered with the listener, including:
if the monitor monitors that the target data node changes in the monitoring type indication, a notification request is generated;
sending the notification request to a client; wherein the notification request may include the client identification, the target data node identification, and the listening type.
Optionally, the registration request further includes a monitoring end condition, where the monitoring end condition includes a monitoring parameter and a monitoring threshold;
updating the monitoring parameters after the notification request is sent to the client registered with the listener;
before the holding the listener to continue listening to the target data node, further comprising:
judging whether the updated monitoring parameters reach the monitoring threshold value;
if the updated monitoring parameter reaches the monitoring threshold value, indicating that the monitoring ending condition is reached, and deleting the monitor;
and if the updated monitoring parameters do not reach the monitoring threshold value, indicating that the monitoring ending condition is not reached, and executing the step of reserving the monitor to continue monitoring the target data node.
Optionally, when the monitoring parameter includes a monitoring frequency, the monitoring threshold includes a preset frequency.
And under the condition that the monitoring parameter comprises monitoring time length, the monitoring threshold comprises preset time length.
Optionally, the method further includes:
receiving a deletion request sent by the client; the deleting request comprises a client identifier, a target data node identifier and a monitoring type;
searching a listener corresponding to the deletion request;
and deleting the listener corresponding to the deletion request.
A data node monitoring method comprises the following steps:
sending a registration request to a server side, so that the server side can construct a listener corresponding to the registration request, and utilizing the listener to monitor a target data node;
receiving a notification request sent by the server;
the notification request is sent to the client after the listener of the server monitors that the target data node changes, and the server keeps the listener to continue monitoring the target data node.
Optionally, after receiving the notification request sent by the server, the method further includes:
sending a data acquisition request corresponding to the notification request to the server;
receiving data content of the target data node sent by a server;
if the data content of the target data node reaches a set condition, executing a trigger operation corresponding to the registration request;
and sending a deletion request to a server side so that the server side deletes the listener.
A data node snooping device, comprising:
the monitoring node unit is used for monitoring the target data node by using a monitor;
a sending notification unit, configured to send a notification request to a client that registers the listener if the listener monitors that the target data node changes;
and the reservation unit is used for reserving the listener to continuously monitor the target data node.
A data node snooping device, comprising:
the sending request unit is used for sending a registration request to a server so that the server can construct a listener corresponding to the registration request and monitor a target data node by using the listener;
a receiving notification unit, configured to receive a notification request sent by the server;
the notification request is sent to the client after the listener of the server monitors that the target data node changes, and the server keeps the listener to continue monitoring the target data node.
An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data node listening method via execution of the executable instructions.
A storage medium for storing a software program, the software program being operable to implement the data node listening method.
Through the technical means, the following beneficial effects can be realized:
the monitor can be reserved after one-time monitoring operation and cannot be deleted, so that the target data nodes can be monitored repeatedly, the situation that the target data nodes are changed between deletion and a new monitor is avoided, and the problem that the target data nodes are changed between the deleted monitor and the new monitor is solved.
The client only needs to send a registration request to the server once, and does not need to send the registration request to the server for multiple times, so that the interaction times of the client and the server network can be reduced, network resources are saved, and monitoring mechanism operation is simplified.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data node monitoring system disclosed in an embodiment of the present application;
fig. 2 is a flowchart of a data node monitoring method disclosed in an embodiment of the present application;
fig. 3 is a flowchart of another data node monitoring method disclosed in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a data node monitoring apparatus disclosed in an embodiment of the present application;
fig. 5 is a schematic structural diagram of another data node monitoring apparatus disclosed in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The Zookeeper server is mainly applied to Zookeeper, so that the server side related to the Zookeeper server is a server cluster of the Zookeeper, and the client side is a machine using Zookeeper service. And will not be explained one by one subsequently.
According to an embodiment of the present application, a data node snooping system is provided. Referring to fig. 1, the data node listening system includes:
a server 100; the server 100 may store a plurality of data nodes.
A plurality of clients 200 connected to the server 100.
Before introducing the data node monitoring method provided by the present application, pre-execution operations of the server 100 and the client 200 are introduced. Referring to fig. 2, the pre-execution operation includes the steps of:
step S201: the client generates a registration request and sends the registration request to the server.
The server has a plurality of data nodes, and if a client pays attention to a certain data node in the server, that is, the client needs to know whether the certain data node changes, the client can generate a registration request so as to send the registration request to the server, thereby constructing a listener in the server for monitoring whether the data node changes.
Taking the target data node as an example, if the client needs to know whether the target data node changes, a registration request corresponding to the target data node needs to be constructed. The registration request comprises a target data node identifier and a monitoring type. The registration request may also include a listening-end condition, but it is also possible that the registration request does not include the listening-end condition.
The following describes the contents of the registration request:
target data node identification: since the server includes a plurality of data nodes, the target data node identification is used to indicate that the registration request is for the target data node.
And (3) monitoring type: changes to a target data node include many types, such as creating child nodes, data value changes, deleting child nodes, and so forth.
The client may select a type as the snooping type according to a requirement, for example, a data value change is selected as the snooping type, and then a subsequently constructed snooper may be used to snoop whether a data value change occurs to the target data node. In general, one listener corresponds to one snooping type, and if a plurality of types of changes of a target data node need to be snooped, a plurality of listeners for snooping different types of changes can be constructed.
And (3) monitoring ending conditions: the addition of the monitoring ending condition in the registration request can help to provide an ending condition for the monitoring process in the process that the server side continuously monitors the target data node, and the monitoring is prevented from being carried out continuously without limit.
The interception end condition includes an interception parameter and an interception threshold, and this embodiment provides two implementation manners of the interception end condition:
the first implementation mode comprises the following steps: and under the condition that the monitoring parameters comprise the monitoring times, the monitoring threshold comprises preset times, and under the condition that the monitoring times reach the preset times, the monitoring ending condition is reached.
The second implementation mode comprises the following steps: and under the condition that the monitoring parameters comprise monitoring duration, the monitoring threshold comprises preset duration, and under the condition that the monitoring duration reaches the preset duration, the monitoring ending condition is reached.
Step S202: the client stores the setting conditions and the trigger operation corresponding to the registration request.
The client can set a setting condition corresponding to the registration request and trigger operation to be executed after the setting condition is reached. Then, the setting condition and the trigger operation corresponding to the registration request are stored. The setting conditions and the triggering operations will be described in steps S310 to S312, and will not be described in detail herein.
Step S203: and the server receives the registration request sent by the client and constructs a listener corresponding to the registration request.
And the server receives a registration request sent by the client, and constructs a listener corresponding to the registration request.
And under the condition that the registration request comprises a client identifier, a target data node identifier and a monitoring type, the server side constructs a monitor for monitoring whether the target data node changes the monitoring type or not, and notifies the client corresponding to the client identifier after determining that the target data node changes the monitoring type.
The registration request may further include a monitor termination condition, where the monitor termination condition is the survival period of the constructed monitor, and the monitor needs to be deleted when the monitor termination condition is reached, and the monitor may continue to be used if the monitor termination condition is not reached.
Step S204: the server side stores the monitoring information.
The server side usually maintains a monitoring information table, and the monitoring information table can uniformly store each monitoring information, so that the server side uniformly controls the monitor of each client side.
Referring to table 1, there is an illustration of the table of snoop information of the server side (snoop end condition is not shown).
TABLE 1
Figure DEST_PATH_IMAGE001
Taking the example of color-emphasizing a column in the table, the column corresponds to a listener, and the listener is used for listening to whether the data node 1 changes to the "create child node" for the client 1 and the client 2. The data column includes a client identifier 1 corresponding to the client 1 and a client identifier 2 corresponding to the client 2.
The above pre-execution operation for the server and the client is described below with reference to the online execution process of the server and the client.
According to an embodiment of the present application, a data node monitoring method is provided, which is applied to the data node monitoring system shown in fig. 1. In this embodiment, the listener corresponding to the registration request has a listening end condition. It is understood that steps S304-306 may not be executed if the registration request does not include the listening ending condition.
Referring to fig. 3, the data node listening method may include the steps of:
step S301: and the server side monitors the target data node by using the listener.
In general, the server side may monitor whether each data node changes or not in a unified manner according to the monitoring information table. Taking table 1 as an example, the server monitors the data nodes corresponding to the data node identifiers in table 1, and determines whether a change of the monitoring type indication occurs.
Taking the example of constructing the listener corresponding to the registration request in step 203, the server will monitor the target data node corresponding to the target data node identifier, and determine whether the specified change of the monitoring type indication occurs.
Step S302: the listener listens whether the target data node changes, if so, the step S303 is performed, and if not, the step S304 is performed.
In general, a listener in a server monitors a data node for a change indicated by a certain monitoring type, and notifies all clients corresponding to the monitoring type in the data node. Still taking the color-weighted column in table 1 as an example, if a change of creating a child node occurs in the data node 1 corresponding to the data node identifier 1, the server notifies the client 1 corresponding to the client identifier 1 and the client 2 corresponding to the client identifier 2.
Taking the example of constructing the listener corresponding to the registration request in step 203, the listener listens to whether the target data node changes in the indication of the listening type in the registration request, if so, step S303 is performed, and if not, step S304 is performed.
Step S303: and if the listener monitors that the target data node changes, sending a notification request to the client.
And if the listener monitors that the target data node has the change of the monitoring type indication in the registration request, generating a notification request and sending the notification request to a client. Wherein the notification request may include the client identification, the target data node identification, and a listening type.
Step S304: and the server side updates the monitoring parameters in the monitoring ending condition.
In case the listening parameter comprises a listening number, the listening number may be updated. For example, in the case where the number of snoops is initialized to zero, the number of snoops may be incremented; still alternatively, in the case where the number of times of interception is initialized to the number of times of interception, the number of times of interception may be decremented.
And under the condition that the monitoring parameters comprise the monitoring duration, continuously recording the monitoring duration. For example, in the case where the listening duration is initialized to zero, the listening duration may be continuously recorded. Or, in the case that the monitoring duration is initialized to the preset monitoring duration, the countdown operation may be performed on the monitoring duration.
Step S305: the server side judges whether a monitoring ending condition is reached; if so, the process proceeds to step S306, otherwise, the process proceeds to step S307.
The server can judge whether the monitoring parameter reaches a monitoring threshold value; if the monitoring parameter reaches the monitoring threshold value, the monitoring ending condition is reached, otherwise, the monitoring ending condition is not reached.
Under the condition that the monitoring parameters comprise monitoring times, the monitoring threshold comprises preset times; and under the condition that the monitoring times reach the preset times, indicating that the monitoring ending condition is reached, otherwise, indicating that the monitoring ending condition is not reached.
And under the condition that the monitoring parameter comprises the monitoring duration, the monitoring threshold comprises a preset duration. And under the condition that the monitoring time length reaches the preset time length, indicating that the monitoring ending condition is reached, otherwise, indicating that the monitoring ending condition is not reached.
Step S306: and deleting the listener.
And if the monitoring parameter reaches the monitoring threshold value, indicating that a monitoring ending condition is reached, and deleting the monitor. Deleting the listener may specifically include: the server deletes the client identifier in the monitoring type corresponding to the target data node identifier in the monitoring information table of table 1, so that the target data node is changed with the same monitoring type, and the client is not notified. It should be noted that the target data node may still be notified to other clients if the same snoop type changes.
Step S307: and reserving the listener and entering the step S301.
If the monitoring parameter does not reach the monitoring threshold value, indicating that the monitoring ending condition is not reached, reserving the monitor, and continuing to monitor the target data node. The step can avoid the client from repeatedly registering the monitor to the server.
Step S308: the client receives a notification request sent by the server and sends a data acquisition request corresponding to the notification request to the server.
The client receives a notification request sent by the server, and the notification request may include the client identifier, the target data node identifier, and the listening type.
After knowing that the target data node changes, the client may generate a data acquisition request in order to know the changed data.
Step S309: and the client receives the data content of the target data node sent by the server.
And under the condition that the data acquisition request comprises the target data node identification, the client receives all data contents of the target data node sent by the server.
Step S310: and the client judges whether the data content of the target data node reaches a set condition. If yes, the process proceeds to step S311, otherwise, no operation is performed.
The client stores preset conditions and trigger operation corresponding to the registration request in advance, and when the data content of the target data node reaches the preset conditions, the change of the target data node in the server side is shown to meet the requirement of the client, and at the moment, the trigger operation can be executed without monitoring the target data node.
And under the condition that the data content of the target data node does not reach the set condition, the change of the target data node in the server does not reach the requirement of the client, and at the moment, the triggering operation is not executed, and the target data node needs to be monitored continuously.
Step S311: and the client executes the trigger operation corresponding to the registration request.
And if the data value corresponding to the monitoring type in the data content reaches a set condition, the client executes a trigger operation corresponding to the registration request.
For example, if the target data node is the number of complaints, the set condition is 3, and the triggering operation is to connect the artificial customer service, the client sets a listener corresponding to the number of complaints, and monitors that the number of complaints changes, and if the data value of the obtained number of complaints is 3, the set condition is satisfied for 3 times, the operation of connecting the artificial customer service can be triggered.
Step S312: and the client sends a deletion request to the server so that the server deletes the listener.
Since the client monitors that the target data node has reached the set condition, that is, the monitoring requirement is met, the client does not need to monitor the target data node any more in the following process, and sends the deletion request to the server. The delete request may include that the delete request includes a client identification, a target data node identification, and a listen type.
Step S313: and the server deletes the listener corresponding to the deletion request.
Even if the listener does not reach the monitoring ending condition in the server, the server deletes the listener corresponding to the deletion request after receiving the deletion request sent by the client.
Deleting the listener may specifically include: the server deletes the client identifier in the monitoring type corresponding to the target data node identifier in the monitoring information table of table 1, so that the target data node is changed with the same monitoring type, and the client is not notified.
Through the technical characteristics, the following beneficial effects can be achieved:
first, in this embodiment, the listener remains after a listening operation, and is not deleted, so that the target data node can be repeatedly listened, and the situation of missing the change of the target data node between the deletion and the new listener is avoided, thereby solving the change problem of missing the target data node between the deletion of the listener and the new listener.
Second, the present application provides a multi-way persistent listening mechanism: under the condition of not having the monitoring ending condition, the method is a continuous repeated monitoring mode; under the condition that the monitoring ending condition exists and the monitoring ending condition is the appointed number of times, the method is a repeated mode of the appointed number of times; in the case that the listening ending condition exists and the listening ending condition is the specified time, the mode is repeated for the specified time. The repeated notification mode can be set according to actual conditions.
Thirdly, the client only needs to send a registration request to the server once, and does not need to send the registration request to the server for multiple times, so that the number of times of interaction between the client and the server network can be reduced, network resources are saved, and monitoring mechanism operation is simplified.
Referring to fig. 4, the present application provides a data node monitoring apparatus, including:
a snooping node unit 41 for snooping the target data node by the snooper;
a sending notification unit 42, configured to send a notification request to a client that registers the listener if the listener monitors that the target data node changes;
a reservation unit 43, configured to reserve the listener to continue listening to the target data node.
Wherein, the data node monitoring apparatus further includes, before monitoring the node unit 41:
a receiving unit 44, configured to receive a registration request sent by the client; the registration request comprises a target data node identifier and a monitoring type;
a constructing unit 45, configured to construct a listener corresponding to the registration request;
a storage unit 46, configured to store the listening information of the listener; wherein the interception information includes the client identifier, the target data node identifier, and the interception type.
The transmission notification unit 42 includes:
a notification request generating unit 421, configured to generate a notification request if the change of the monitoring type indication occurs in the target data node is monitored by the monitor;
a sending unit 422, configured to send the notification request to the client; wherein the notification request may include the client identification, the target data node identification, and the listening type.
The registration request further comprises a monitoring ending condition, wherein the monitoring ending condition comprises a monitoring parameter and a monitoring threshold value;
after sending the notification unit 42, the following steps are also included:
an updating unit 47, configured to update the monitoring parameter;
before the holding the listener to continue listening to the target data node, further comprising:
a judging unit 48, configured to determine whether the updated monitoring parameter reaches the monitoring threshold;
a deleting unit 49, configured to delete the listener if the updated monitoring parameter reaches the monitoring threshold, which indicates that the monitoring end condition is reached;
if the updated snooping parameter does not reach the snooping threshold, it indicates that the snooping end condition is not reached, the reservation unit 43 is entered to execute the step of reserving the snooper to continue snooping the target data node.
Wherein, under the condition that the monitoring parameter comprises the monitoring times, the monitoring threshold comprises preset times; and under the condition that the monitoring parameter comprises monitoring time length, the monitoring threshold comprises preset time length.
Wherein, data node monitoring device still includes:
a receiving unit 410, configured to receive a deletion request sent by the client; the deleting request comprises a client identifier, a target data node identifier and a monitoring type;
a searching unit 411, configured to search for a listener corresponding to the delete request;
and a deleting unit 49, configured to delete the listener corresponding to the deletion request.
For specific implementation of the data node listening device, reference may be made to the embodiments shown in fig. 2 and fig. 3, which are not described herein again.
Referring to fig. 5, the present application further provides a data node monitoring apparatus, including:
a sending request unit 51, configured to send a registration request to a server, so that the server constructs a listener corresponding to the registration request, and monitors a target data node by using the listener;
a receiving notification unit 52, configured to receive a notification request sent by the server;
the notification request is sent to the client after the listener of the server monitors that the target data node changes, and the server keeps the listener to continue monitoring the target data node.
After receiving the notification unit 52, the data node monitoring apparatus further includes:
a sending and acquiring request unit 53, configured to send a data acquiring request corresponding to the notification request to the server;
a data content receiving unit 54, configured to receive the data content of the target data node sent by the server;
an executing unit 55, configured to execute a trigger operation corresponding to the registration request if the data content of the target data node reaches a set condition;
a delete request sending unit 56, configured to send a delete request to the server, so that the server deletes the listener.
For specific implementation of the data node listening device, reference may be made to the embodiments shown in fig. 2 and fig. 3, which are not described herein again.
The present application further provides an electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data node listening method as shown in fig. 2 and 3 via execution of the executable instructions.
A storage medium is provided for storing a software program that can be used to implement the data node listening method as shown in fig. 2 and 3.
The functions described in the method of the present embodiment, if implemented in the form of software functional units and sold or used as independent products, may be stored in a storage medium readable by a computing device. Based on such understanding, part of the contribution to the prior art of the embodiments of the present application or part of the technical solution may be embodied in the form of a software product stored in a storage medium and including several instructions for causing a computing device (which may be a personal computer, a server, a mobile computing device or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A data node monitoring method is characterized by comprising the following steps:
monitoring a target data node by using a monitor;
if the listener monitors that the target data node changes, sending a notification request to a client registered with the listener;
keeping the listener to continue monitoring the target data node;
before the snooping the target data node by the snooper, the method further includes:
receiving a registration request sent by the client; the registration request comprises a target data node identifier and a monitoring type;
constructing a listener corresponding to the registration request;
storing the monitoring information of the listener; wherein the monitoring information comprises the client identifier, the target data node identifier and the monitoring type;
the registration request also comprises a monitoring ending condition, wherein the monitoring ending condition comprises a monitoring parameter and a monitoring threshold value;
updating the monitoring parameters after the notification request is sent to the client registered with the listener;
before the holding the listener to continue listening to the target data node, further comprising:
judging whether the updated monitoring parameters reach the monitoring threshold value;
if the updated monitoring parameter reaches the monitoring threshold value, indicating that the monitoring ending condition is reached, and deleting the monitor;
and if the updated monitoring parameters do not reach the monitoring threshold value, indicating that the monitoring ending condition is not reached, and executing the step of reserving the monitor to continue monitoring the target data node.
2. The method of claim 1, wherein sending a notification request to a client registered with the listener if the listener hears a change to the target data node comprises:
if the monitor monitors that the target data node changes in the monitoring type indication, a notification request is generated;
sending the notification request to a client; wherein the notification request may include the client identification, the target data node identification, and the listening type.
3. The method of claim 1,
under the condition that the monitoring parameters comprise monitoring times, the monitoring threshold comprises preset times;
and under the condition that the monitoring parameter comprises monitoring time length, the monitoring threshold comprises preset time length.
4. The method of claim 1, further comprising:
receiving a deletion request sent by the client; the deleting request comprises a client identifier, a target data node identifier and a monitoring type;
searching a listener corresponding to the deletion request;
and deleting the listener corresponding to the deletion request.
5. A data node monitoring method is characterized by comprising the following steps:
sending a registration request to a server side, so that the server side can construct a listener corresponding to the registration request, and utilizing the listener to monitor a target data node;
receiving a notification request sent by the server;
the notification request is sent to the client after the change of the target data node is monitored by the listener of the server, and the server can keep the listener to continue monitoring the target data node;
before the server side monitors the target data node by using the listener, the method further comprises the following steps:
the server receives a registration request sent by the client; the registration request comprises a target data node identifier and a monitoring type; constructing a listener corresponding to the registration request; storing the monitoring information of the listener; wherein the monitoring information comprises the client identifier, the target data node identifier and the monitoring type;
the registration request also comprises a monitoring ending condition, wherein the monitoring ending condition comprises a monitoring parameter and a monitoring threshold value; after the server side sends a notification request to the client side registered with the listener, updating the monitoring parameters;
before the server keeps the listener to continue listening to the target data node, the method further includes:
the server side judges whether the updated monitoring parameters reach the monitoring threshold value; if the updated monitoring parameter reaches the monitoring threshold value, indicating that the monitoring ending condition is reached, and deleting the monitor; and if the updated monitoring parameters do not reach the monitoring threshold value, indicating that the monitoring ending condition is not reached, and executing the step of reserving the monitor to continue monitoring the target data node.
6. The method of claim 5,
after receiving the notification request sent by the server, the method further includes:
sending a data acquisition request corresponding to the notification request to the server;
receiving data content of the target data node sent by a server;
if the data content of the target data node reaches a set condition, executing a trigger operation corresponding to the registration request;
and sending a deletion request to a server side so that the server side deletes the listener.
7. A data node snooping apparatus, comprising:
the monitoring node unit is used for monitoring the target data node by using a monitor;
a sending notification unit, configured to send a notification request to a client that registers the listener if the listener monitors that the target data node changes;
a reservation unit, configured to reserve the listener to continue to listen to the target data node;
wherein before the listening node unit further comprises:
a receiving unit, configured to receive a registration request sent by the client; the registration request comprises a target data node identifier and a monitoring type;
a construction unit, configured to construct a listener corresponding to the registration request;
the storage unit is used for storing the monitoring information of the monitor; wherein the monitoring information comprises the client identifier, the target data node identifier and the monitoring type;
the registration request further comprises a monitoring ending condition, wherein the monitoring ending condition comprises a monitoring parameter and a monitoring threshold value;
after the sending of the notification unit, the method further includes:
the updating unit is used for updating the monitoring parameters;
before the holding the listener to continue listening to the target data node, further comprising:
a judging unit, configured to determine whether the updated monitoring parameter reaches the monitoring threshold;
a deleting unit, configured to delete the listener if the updated monitoring parameter reaches the monitoring threshold, which indicates that the monitoring end condition is reached;
and if the updated monitoring parameters do not reach the monitoring threshold value, indicating that the monitoring ending condition is not reached, entering a reservation unit to execute the step of reserving the monitor to continue monitoring the target data node.
8. A data node snooping apparatus, comprising:
the sending request unit is used for sending a registration request to a server so that the server can construct a listener corresponding to the registration request and monitor a target data node by using the listener;
a receiving notification unit, configured to receive a notification request sent by the server;
the notification request is sent to the client after the change of the target data node is monitored by the listener of the server, and the server can keep the listener to continue monitoring the target data node;
before the server side monitors the target data node by using the listener, the method further comprises the following steps:
the server receives a registration request sent by the client; the registration request comprises a target data node identifier and a monitoring type; constructing a listener corresponding to the registration request; storing the monitoring information of the listener; wherein the monitoring information comprises the client identifier, the target data node identifier and the monitoring type;
the registration request also comprises a monitoring ending condition, wherein the monitoring ending condition comprises a monitoring parameter and a monitoring threshold value; after the server side sends a notification request to the client side registered with the listener, updating the monitoring parameters;
before the server keeps the listener to continue listening to the target data node, the method further includes:
the server side judges whether the updated monitoring parameters reach the monitoring threshold value; if the updated monitoring parameter reaches the monitoring threshold value, indicating that the monitoring ending condition is reached, and deleting the monitor; and if the updated monitoring parameters do not reach the monitoring threshold value, indicating that the monitoring ending condition is not reached, and executing the step of reserving the monitor to continue monitoring the target data node.
9. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the data node snooping method of any one of claims 1 to 4 via execution of the executable instructions.
10. A storage medium for storing a software program, the software program being operable to implement the data node snooping method of any one of claims 1 to 4.
CN201910004437.5A 2019-01-03 2019-01-03 Data node monitoring method and device, electronic equipment and storage medium Active CN109525466B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910004437.5A CN109525466B (en) 2019-01-03 2019-01-03 Data node monitoring method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910004437.5A CN109525466B (en) 2019-01-03 2019-01-03 Data node monitoring method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109525466A CN109525466A (en) 2019-03-26
CN109525466B true CN109525466B (en) 2020-09-29

Family

ID=65798146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910004437.5A Active CN109525466B (en) 2019-01-03 2019-01-03 Data node monitoring method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109525466B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166528B (en) * 2019-04-16 2022-03-18 平安科技(深圳)有限公司 Method and device for preventing node change notification from being lost and computer equipment
CN110321140A (en) * 2019-05-23 2019-10-11 天津五八到家科技有限公司 Data-updating method, device and mobile terminal
CN111294382A (en) * 2019-12-30 2020-06-16 欧普照明股份有限公司 Real-time data pushing method and device
CN113553126B (en) * 2021-07-06 2024-03-22 网易(杭州)网络有限公司 Data processing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105682115A (en) * 2014-11-21 2016-06-15 联想(北京)有限公司 Information processing method and electronic device
CN105791354A (en) * 2014-12-23 2016-07-20 中兴通讯股份有限公司 Job scheduling method and cloud scheduling server

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070112856A1 (en) * 2005-11-17 2007-05-17 Aaron Schram System and method for providing analytics for a communities framework
US7756898B2 (en) * 2006-03-31 2010-07-13 Isilon Systems, Inc. Systems and methods for notifying listeners of events
CN101977124B (en) * 2010-11-05 2013-09-04 山东中创软件工程股份有限公司 Service clustering method and system based on ZooKeeper technology
US9680692B2 (en) * 2013-01-23 2017-06-13 Facebook, Inc. Method and system for using a recursive event listener on a node in hierarchical data structure
CN106155662B (en) * 2015-04-15 2019-11-15 高德软件有限公司 A kind of Web page event-handling method, system and page controller
CN106375342A (en) * 2016-10-21 2017-02-01 用友网络科技股份有限公司 Zookeeper-technology-based system cluster method and system
CN108347718B (en) * 2018-02-02 2021-07-30 北京小米移动软件有限公司 Method, device and storage medium for monitoring communication packet

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105682115A (en) * 2014-11-21 2016-06-15 联想(北京)有限公司 Information processing method and electronic device
CN105791354A (en) * 2014-12-23 2016-07-20 中兴通讯股份有限公司 Job scheduling method and cloud scheduling server

Also Published As

Publication number Publication date
CN109525466A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
CN109525466B (en) Data node monitoring method and device, electronic equipment and storage medium
US11922431B2 (en) Consent management system with client operations
CN107889069B (en) Short message gateway selection method, device, server and readable storage medium
JP6640855B2 (en) Method, server, and terminal device for deleting push information
WO2019001421A1 (en) Method, device, and computer readable storage medium for managing network slice
CN115004673B (en) Message pushing method, device, electronic equipment and computer readable medium
TW201814609A (en) Information pushing
US10834559B2 (en) Information processing method for machine-to-machine/man (M2M) application, common services entity (CSE) and application entity (AE)
JP2022537643A (en) Resource subscription method, device, server and computer storage medium
WO2013029442A1 (en) Buddy status prompting method and system in sns network, client and server
US10430441B1 (en) Tagging resources of a remote computing service based on locality
CN106911769B (en) Cloud platform routing data processing method and physical server of cloud platform
CN109194993B (en) Media file distribution method and file distribution platform
EP3998754A1 (en) Data distribution method, electronic device, and storage medium
CN112751689A (en) Network connectivity detection method, monitoring server and monitoring agent device
US8978108B2 (en) Method, device, and system for service presentation
CN105681262A (en) Interaction message allocating method and system
US10103897B2 (en) Method and apparatus for managing subscription to a policy counter
CN115022106A (en) Group information processing method, device, equipment and medium
CN112507193A (en) Data updating method, device, equipment and storage medium
CN112968788A (en) Network slice capacity setting method, control method, device, equipment and medium
CN117081872A (en) Conference call method, conference call device, electronic equipment and computer storage medium
CN117596360A (en) Cluster construction system and method
CN116489229A (en) Micro-service arrangement method, device and storage medium
CN116455722A (en) Quota management method, device, equipment and medium based on application

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200731

Address after: 310000 2 6th Floor, No. 3588 Jiangnan Avenue, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Yunyi Network Technology Co.,Ltd.

Address before: 11, building 310053, Hang Seng tower, 3588 Jiangnan Avenue, Hangzhou, Zhejiang, Binjiang District

Applicant before: HANGZHOU YUN-IN NETWORK TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant