WO2020211361A1 - 防止节点变更通知丢失的方法、装置和计算机设备 - Google Patents

防止节点变更通知丢失的方法、装置和计算机设备 Download PDF

Info

Publication number
WO2020211361A1
WO2020211361A1 PCT/CN2019/118161 CN2019118161W WO2020211361A1 WO 2020211361 A1 WO2020211361 A1 WO 2020211361A1 CN 2019118161 W CN2019118161 W CN 2019118161W WO 2020211361 A1 WO2020211361 A1 WO 2020211361A1
Authority
WO
WIPO (PCT)
Prior art keywords
node change
change notification
node
subscriber server
notification
Prior art date
Application number
PCT/CN2019/118161
Other languages
English (en)
French (fr)
Inventor
黄小军
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020211361A1 publication Critical patent/WO2020211361A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services

Definitions

  • This application relates to the technical field of node change notifications, and in particular to a method, device and computer equipment for preventing the loss of node change notifications.
  • ESG-ADMIN subscriber server
  • zookeeper zookeeper is a distributed, open source distributed application coordination service, is Google’s Chubby is an open source implementation and is an important component of Hadoop and Hbase. It only supports monitoring to notify subscribers (third-party systems, such as ESG-ADMIN), that is, zookeeper is only responsible for sending node change notifications to subscriber servers.
  • zookeeper After receiving the node change notification sent by zookeeper, zookeeper does not care, so when the network is congested and the subscriber system fails, the subscriber server will not receive all the node change notifications sent to it by zookeeper, that is, the node change notification is lost The problem.
  • the main purpose of this application is to provide a method, device, computer equipment and storage medium for sending node change notifications, aiming to solve the problem of node change notifications being lost due to network congestion and subscriber system failures.
  • this application proposes a method for sending a node change notification, which is used by a zookeeper server to send a node change notification to a subscriber server.
  • the zookeeper server is installed with a notification component that enables the zookeeper server to support RESTful interface calls.
  • the method for sending a node change notification includes: the zookeeper server obtains a node change notification, where the node change notification includes the instance node path and the change time; using the notification component to call the first RESTful interface of the subscriber server, The node change notification is sent to the subscriber server, and the node change notification is stored in the local first node change notification set; under preset conditions, the subscriber server is called by the notification component. Set a second RESTful interface, and transmit the first node change notification set to the subscriber server through the second RESTful interface.
  • the present application also adopts a method for preventing the loss of node change notifications, which is used by the subscriber server to prevent the zookeeper server from losing the node change notifications sent by the method for sending node change notifications as described in any one of the above; said preventing node change notifications
  • the method for loss includes: the subscriber server receives the node change notification sent by the zookeeper server through the first RESTful interface, and stores the received node change notification in a preset storage space to form a second node change Notification set; after receiving the first node change notification set sent by the zookeeper server, search for a lost node change notification that does not exist in the second node change notification set in the first node change notification set; The corresponding processing operation is completed according to the path of the instance node notified by the lost node change.
  • the present application also provides a device for sending a node change notification, which is used for a zookeeper server to send a node change notification to a subscriber server.
  • the zookeeper server is installed with a notification component that enables the zookeeper server to support RESTful interface calls.
  • the device includes:
  • the obtaining unit is configured to obtain a node change notification by the zookeeper server, where the node change notification includes the instance node path and the change time;
  • the sending and storing unit is configured to use the notification component to call the first RESTful interface of the subscriber server, send the node change notification to the subscriber server, and store the node change notification in the local first RESTful interface One node change notification set;
  • the calling and sending unit is configured to call the second RESTful interface preset by the subscriber server through the notification component under preset conditions, and transmit the first node change notification set to the second RESTful interface Subscriber server.
  • the present application also provides a device for preventing the loss of node change notifications, which is used by the subscriber server to prevent the zookeeper server from losing the node change notifications sent by the method for sending node change notifications as described in any one of the above; the preventing node change notifications Lost devices, including:
  • the searching unit is configured to, after receiving the first node change notification set sent by the zookeeper server, search for lost node changes that do not exist in the second node change notification set in the first node change notification set Notice;
  • the processing unit is configured to complete corresponding processing operations according to the instance node path notified by the missing node change notification.
  • the present application also provides a computer device, including a memory and a processor, the memory stores computer-readable instructions, and the processor implements any one of the foregoing method for sending a node change notification when the computer-readable instructions are executed , Or implement any of the steps of the method for preventing the loss of a node change notification described above.
  • the present application also provides a computer-readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the steps of any one of the above-mentioned methods for sending node change notifications, or Steps of the method for preventing the loss of a node change notification as described in any one of the above.
  • the method, device and computer equipment for preventing the loss of node change notifications of the present application can quickly find out through the first node change notification set stored in the zookeeper server and the second node change notification set stored in the subscriber server The missing node change notifications in the second node change notification set relative to the first node change notification set. These missing node change notifications are the missing node change notifications that the subscriber server did not receive, ensuring that the zookeeper node change notifications will not Lost due to network congestion, subscriber system failure, etc.
  • FIG. 1 is a schematic flowchart of a method for sending a node change notification according to an embodiment of the application
  • FIG. 2 is a schematic flowchart of a method for preventing loss of a node change notification according to an embodiment of the application
  • FIG. 3 is a schematic block diagram of the structure of an apparatus for sending a node change notification according to an embodiment of the application;
  • FIG. 4 is a schematic block diagram of the structure of an apparatus for preventing loss of a node change notification according to an embodiment of the application;
  • FIG. 5 is a schematic block diagram of the structure of a computer device according to an embodiment of the application.
  • an embodiment of the present application provides a method for sending a node change notification for a zookeeper server to send a node change notification to a subscriber server, and the zookeeper server is installed with a notification component that enables the zookeeper server to support RESTful interface calls.
  • the above zookeeper server is a server running zookeeper.
  • Zookeeper only supports monitoring to notify subscribers, and does not support RESTful (Representational State Transfer, REST for short). It describes an architectural style network system and refers to a set of architectural constraints and principles. . Applications or designs that meet these constraints and principles are RESTful) interface notification tool for subscribers. Therefore, in this application, developers write or call existing RESTful notification components themselves, and add RESTful notification components to zookeeper, so that zookeeper supports RESTful interface notifications.
  • the above method for sending a node change notification includes the following steps:
  • the zookeeper server obtains a node change notification, where the node change notification includes the instance node path and the change time;
  • the zookeeper server After the zookeeper server obtains a change of each node, it will initiate an http call to the first RESTful interface to notify the subscriber server, and store the generated node change notification in a local storage space of the zookeeper server , To form a first node change notification set. Because when the first RESTful interface is called through http to notify the subscriber server, there is network congestion or system failure of the subscriber server, resulting in the loss of the node change notification, that is, after the zookeeper server finishes sending the node change notification to the subscriber server, There is no guarantee that the node change notification will be received by the subscriber server. The first node change set is stored in a local storage space of the zookeeper server, and the node change notification stored in the storage space is not lost.
  • the foregoing preset condition is a pre-set condition, and the corresponding operation will be executed only when the precondition is reached.
  • the above-mentioned preset conditions include multiple types, such as a limited condition that must be a certain time, and a certain amount of aggregated data.
  • the second RESTful interface preset by the subscriber server is called through the above notification component, and the first node change notification set is transmitted through the second RESTful interface To the subscriber server.
  • the subscriber server When the subscriber server receives the first change node set, it can determine the node change notification it has not received based on the node change notification it has received, and then call the subscriber server in the first node change notification set that it has not received The arrived node changes the instance node path notified, and completes the corresponding processing operation again.
  • the second RESTful interface preset by the subscriber server is called by the notification component, and the first node change notification set is transmitted through the second RESTful interface Step S30 for the subscriber server includes:
  • the preset condition is that the number of node change notifications in the first node change notification set is equal to the preset number threshold.
  • the number threshold is 50, when the first node informs the nodes in the set When the number of change notifications is 50, it will trigger to call the second RESTful interface preset by the subscriber server through the notification component, and transmit the first node change notification set to the second RESTful interface The operation of the subscriber server.
  • Using the number threshold as a preset condition can prevent the number of node change notifications in the first node notification set from being sent to the subscriber server to cause network congestion when the number of node change notifications is too large.
  • the second RESTful interface preset by the subscriber server is invoked by the notification component, and the first node change notification set is passed through the second RESTful interface
  • the step S30 of transmitting to the subscriber server includes:
  • the above preset condition is the first time when the first node change notification set was sent to the subscriber server last time, and the time difference between the current second time is equal to the preset time Threshold, if the time threshold is 30 minutes, the current first time to send the first node change notification set to the subscriber server is 1:30 pm, when the time is 2 pm on the same day, two If the time difference of the person is equal to the time threshold, it will trigger to call the second RESTful interface preset by the subscriber server through the notification component, and transmit the first node change notification set to the second RESTful interface The operation of the subscriber server.
  • the above step of transmitting the first node change notification set to the subscriber server through the second RESTful interface includes:
  • the first node change notification set is transmitted to the subscriber server through a second RESTful interface.
  • the first node change notification set is transmitted to the subscriber server through the second RESTful interface after receiving the feedback of the successful handshake, which can prevent the first node change notification set from being blocked by the network. It was not successfully sent to the above-mentioned subscriber server due to reasons. Further, if the subscriber server's successful handshake feedback is not received, the subscriber server will send a handshake request to the subscriber server according to a preset frequency, and will not execute the first handshaking until the feedback of the successful handshake is received. The operation of transmitting a node change notification set to the subscriber server through the second RESTful interface. When the feedback of successful handshake is not received within a specified time period, an alarm message is generated and sent to the preset terminal so that the staff can understand the situation and perform technical processing.
  • the method for sending a node change notification in this embodiment not only sends the corresponding node change notification to the subscriber server, but also changes the node when the zookeeper server receives the monitoring request from the subscriber server.
  • the notification is stored locally.
  • the first node change notification set stored locally is actively sent to the subscriber server, so that the subscriber server can use the first node change notification set to find the missing node change notification. In this way, the processing of the missing node change notification is completed.
  • an embodiment of the present application also provides a method for preventing the loss of a node change notification, which is used by the subscriber server to prevent the zookeeper server from using the method for sending a node change notification in any of the above embodiments to send a node change notification from being lost ;
  • the above-mentioned method for preventing the loss of a node change notification includes the following steps:
  • the subscriber server receives the node change notification sent by the zookeeper server through the first RESTful interface, and stores the received node change notification in a preset storage space to form a second node change notification set;
  • the zookeeper server when the zookeeper server sends the node change notification to the subscriber server, if there is network congestion or the subscriber server's system failure may cause the node change notification to be lost, that is, the node received by the subscriber server
  • the change notification is not necessarily all the node change notifications that the zookeeper server has sent to it, and there may be missing missing node change notifications.
  • the subscriber server will record the node change notification it receives and store it locally to form a second node change notification set.
  • the node change notification in the second node change notification set is the same as the first node change
  • the node change notifications in the combination may be all the same, or there may be a part less than the node change notification in the first node change combination, and the less part is the node change notification that the subscriber server did not receive, which is the above-mentioned loss Node change notification.
  • the corresponding processing operation can be completed according to the instance node path of the lost node change notification, so that the subscriber server can supplement the processing of the lost node change notification.
  • the first node change notification set is searched for a loss that does not exist in the second node change notification set.
  • the step S21 of node change notification includes:
  • the change time of the node change notification is used in this embodiment as the judgment of the node change notification and the second node change notification set in the first node change notification set.
  • the step of searching for a lost node change notification that does not exist in the second node change notification set in the first node change notification set after receiving the zookeeper server to send the first node change notification set After S21 it also includes:
  • S2101 Calculate the ratio of the number of lost node change notifications to the number of all node change notifications in the first node change notification set;
  • the alarm information can be a sound/light physical alarm, or an alarm in the form of text such as emails and short messages.
  • the method for preventing the loss of node change notifications of this application can quickly find the second node change notifications by receiving the first node change notification set stored in the zookeeper server and the second node change notification set stored in the subscriber server.
  • These missing node change notifications are the missing node change notifications that the subscriber server has not received, ensuring that the zookeeper node change notification will not be congested due to network congestion , Subscriber system failure and other reasons are lost.
  • an embodiment of the present application also provides a device for sending a node change notification, which is used for a zookeeper server to send a node change notification to a subscriber server.
  • the zookeeper server is installed with a notification component that enables the zookeeper server to support RESTful interface calls.
  • the device includes:
  • the obtaining unit 10 is configured to obtain a node change notification by the zookeeper server, where the node change notification includes the instance node path and the change time;
  • the sending and storing unit 20 is configured to use the notification component to call the first RESTful interface of the subscriber server, send the node change notification to the subscriber server, and store the node change notification in a local In the first node change notification set;
  • the calling and sending unit 30 is configured to call the second RESTful interface preset by the subscriber server through the notification component under preset conditions, and transmit the first node change notification set to all through the second RESTful interface The subscriber server.
  • the above-mentioned call sending unit 30 includes:
  • the first judgment module is configured to judge whether the number of node change notifications in the first node change notification set is equal to a preset number threshold
  • the first call sending module is configured to, if the number of node change notifications in the first node change notification set is equal to a preset number threshold, call the second RESTful interface preset by the subscriber server through the notification component , And transmit the first node change notification set to the subscriber server through a second RESTful interface.
  • the above-mentioned call sending unit 30 includes:
  • An acquiring module configured to acquire the first time when the first node change notification set was sent to the subscriber server last time, and to acquire the current second time;
  • the second judgment module is used to judge whether the time difference between the first time and the second time is equal to a preset time threshold
  • the second call sending module if the time difference is equal to the preset time threshold, call the second RESTful interface preset by the subscriber server through the notification component, and pass the first node change notification set through The second RESTful interface is transmitted to the subscriber server.
  • the above-mentioned call sending unit 30 includes:
  • a sending module for sending a preset handshake request to the subscriber server
  • the transmission module is configured to transmit the first node change notification set to the subscriber server through a second RESTful interface if the feedback of the successful handshake of the subscriber server is received.
  • the zookeeper server when the zookeeper server receives the monitoring request from the subscriber server, it will not only send the corresponding node change notification to the subscriber server, but also store the node change notification locally. After the preset conditions, the first node change notification set stored locally is actively sent to the subscriber server, so that the subscriber server can use the first node change notification set to find the missing node change notification, so as to complete the missing node Processing of change notifications.
  • an embodiment of the present application also provides a device for preventing the loss of a node change notification, which is used by the subscriber server to prevent the zookeeper server from using the method for sending a node change notification as described in any of the above embodiments to send a node change notification from being lost ;
  • the device to prevent the loss of the node change notification includes:
  • the receiving unit 11 is used for the subscriber server to receive the node change notification sent by the zookeeper server through the first RESTful interface, and store the received node change notification in a preset storage space to form a second node change Notification collection
  • the searching unit 21 is configured to, after receiving the first node change notification set sent by the zookeeper server, search for a lost node that does not exist in the second node change notification set in the first node change notification set Change Notification;
  • the processing unit 31 is configured to complete corresponding processing operations according to the instance node path notified by the lost node change notification.
  • the above-mentioned searching unit 21 includes:
  • An extracting module configured to extract the first change time of each node change notification in the first node change notification set after receiving the first node change notification set sent by the zookeeper server;
  • a searching module configured to search for a second change time that is the same as each of the first change times in the second node change notification set
  • the confirming unit is configured to obtain the remaining first change time for which the same second change time is not found, and record the node change notice corresponding to the remaining first change time as the lost node change notice.
  • the foregoing device for preventing the loss of a node change notification further includes:
  • a ratio calculation unit configured to calculate the ratio of the number of lost node change notifications to the number of all node change notifications in the first node change notification set
  • the generating unit is configured to generate alarm information if the ratio value is greater than a preset ratio threshold value.
  • the device for preventing the loss of node change notifications of the present application can quickly find the second node change notifications by receiving the first node change notification set stored in the zookeeper server and the second node change notification set stored in the subscriber server.
  • These missing node change notifications are the missing node change notifications that the subscriber server has not received, ensuring that the zookeeper node change notification will not be congested due to network congestion , Subscriber system failure and other reasons are lost.
  • an embodiment of the present application also provides a computer device.
  • the computer device may be the aforementioned management server or a server corresponding to the management node, and its internal structure may be as shown in FIG. 5.
  • the computer equipment includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the computer designed processor is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer readable instructions, and a database.
  • the memory provides an environment for the operation of the operating system and computer readable instructions in the non-volatile storage medium.
  • the database of the computer device is used to store data such as the first node change notification set or the second node change notification set.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instruction is executed by the processor to realize a method of sending a node change notification or a method of preventing the loss of a node change notification.
  • the aforementioned processor executes the aforementioned method of sending a node change notification, it is used for the zookeeper server to send a node change notification to a subscriber server, and the zookeeper server is installed with a notification component that enables the zookeeper server to support RESTful interface calls
  • the method for sending a node change notification includes: a zookeeper server obtains a node change notification, wherein the node change notification includes an instance node path and a change time; using the notification component to call the first RESTful interface of the subscriber server, The node change notification is sent to the subscriber server, and the node change notification is stored in the local first node change notification set; under preset conditions, the subscriber server is called by the notification component. Set a second RESTful interface, and transmit the first node change notification set to the subscriber server through the second RESTful interface.
  • the subscriber server prevents the zookeeper server from using the method for sending a node change notification as described in any of the above to send a node change notification from being lost
  • the method for preventing the loss of a node change notification includes: the subscriber server receives the node change notification sent by the zookeeper server through the first RESTful interface, and stores the received node change notification in a preset storage Space to form a second node change notification set; after receiving the first node change notification set sent by the zookeeper server, search for the first node change notification set that does not exist in the second node change notification Collect the lost node change notification; complete the corresponding processing operation according to the instance node path of the lost node change notification.
  • FIG. 5 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the computer device of the embodiment of the present application can quickly find out the relative change notification set of the second node through the first node change notification set stored in the zookeeper server and the second node change notification set stored in the subscriber server.
  • the first node change notification set there are missing node change notifications.
  • These missing node change notifications are the missing node change notifications that the subscriber server has not received, to ensure that the zookeeper node change notification will not be congested or subscribers due to network congestion. Lost due to system failure and other reasons.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium may be a non-volatile readable storage medium or a volatile readable storage medium on which computer-readable instructions are stored.
  • the computer-readable instructions are executed by the processor, a method of sending a node change notification or a method of preventing the loss of a node change notification is realized.
  • the aforementioned processor executes the aforementioned method of sending a node change notification, it is used for the zookeeper server to send a node change notification to a subscriber server, and the zookeeper server is installed with a notification component that enables the zookeeper server to support RESTful interface calls
  • the method for sending a node change notification includes: a zookeeper server obtains a node change notification, wherein the node change notification includes an instance node path and a change time; using the notification component to call the first RESTful interface of the subscriber server, The node change notification is sent to the subscriber server, and the node change notification is stored in the local first node change notification set; under preset conditions, the subscriber server is called by the notification component. Set a second RESTful interface, and transmit the first node change notification set to the subscriber server through the second RESTful interface.
  • the subscriber server prevents the zookeeper server from using the method for sending a node change notification as described in any of the above to send a node change notification from being lost
  • the method for preventing the loss of a node change notification includes: the subscriber server receives the node change notification sent by the zookeeper server through the first RESTful interface, and stores the received node change notification in a preset storage Space to form a second node change notification set; after receiving the first node change notification set sent by the zookeeper server, search for the first node change notification set that does not exist in the second node change notification Collect the lost node change notification; complete the corresponding processing operation according to the instance node path of the lost node change notification.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Abstract

本申请揭示了一种防止节点变更通知丢失的方法、装置和计算机设备,通过在zookeeper服务器中存储的第一节点变更通知集合,以及订阅方服务器中存储的第二节点变更通知集合,既可以快速的查找出第二节点变更通知集合中相对于第一节点变更通知集种缺少的节点变更通知,这些缺少的节点变更通知即为订阅方服务器没有接收到的丢失节点变更通知,确保zookeeper节点的变更通知不会因为网路出现拥堵、订阅方系统故障等原因丢失。

Description

防止节点变更通知丢失的方法、装置和计算机设备
本申请要求于2019年4月16日提交中国专利局、申请号为2019103051898,申请名称为“防止节点变更通知丢失的方法、装置和计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及到节点变更通知的技术领域,特别是涉及到一种防止节点变更通知丢失的方法、装置和计算机设备。
背景技术
ESG-ADMIN(订阅方服务器)是一种企业服务治理平台管理系统,用于监控zookeeper的节点变更等,因为zookeeper(zookeeper是一个分布式的,开放源码的分布式应用程序协调服务,是Google的Chubby一个开源的实现,是Hadoop和Hbase的重要组件)只支持监听方式通知订阅方(第三方系统,例如ESG-ADMIN),也就是zookeeper只负责向订阅方服务器发送节点变更通知,订阅方服务器是否接收到zookeeper发送的节点变更通知,zookeeper并不关心,所以当网路出现拥堵、订阅方系统故障时会导致订阅方服务器不能接收到zookeeper向其发送的全部节点变更通知,即存在节点变更通知丢失的问题。
技术问题
本申请的主要目的为提供发送节点变更通知的方法、装置、计算机设备和存储介质,旨在解决因为网路出现拥堵、订阅方系统故障而导致节点变更通知丢失的问题。
技术解决方案
为了实现上述发明目的,本申请提出一种发送节点变更通知的方法,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,所述发送节点变更通知的方法包括:zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
本申请还通过一种防止节点变更通知丢失的方法,用于订阅方服务器防止zookeeper服务器利用如上述任一项所述的发送节点变更通知的方法发送的节点变更通知丢失;所述防止节点变更通知丢失的方法,包括:所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
本申请还提供一种发送节点变更通知的装置,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,所述装置包括:
获取单元,用于zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
发送存储单元,用于利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
调用发送单元,用于在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
本申请还提供一种防止节点变更通知丢失的装置,用于订阅方服务器防止zookeeper服务器利用如上述任一项所述的发送节点变更通知的方法发送的节点变更通知丢失;所述防止节点变更通知丢失的装置,包括:
接收单元,用于所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
查找单元,用于当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
处理单元,用于依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,所述处理器执行所述计算机可读指令时实现上述任一项所述发送节点变更通知的方法的步骤,或者实现上述任一项所述防止节点变更通知丢失的方法的步骤。
本申请还提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述任一项所述发送节点变更通知的方法的步骤,或者实现上述任一项所述防止节点变更通知丢失的方法的步骤。
有益效果
本申请的防止节点变更通知丢失的方法、装置和计算机设备,通过在zookeeper服务器中存储的第一节点变更通知集合,以及订阅方服务器中存储的第二节点变更通知集合,既可以快速的查找出第二节点变更通知集合中相对于第一节点变更通知集种缺少的节点变更通知,这些缺少的节点变更通知即为订阅方服务器没有接收到的丢失节点变更通知,确保zookeeper节点的变更通知不会因为网路出现拥堵、订阅方系统故障等原因丢失。
附图说明
图1 为本申请一实施例的发送节点变更通知的方法的流程示意图;
图2 为本申请一实施例的防止节点变更通知丢失的方法流程示意图;
图3 为本申请一实施例的发送节点变更通知的装置的结构示意框图;
图4 为本申请一实施例的防止节点变更通知丢失的装置的结构示意框图;
图5 为本申请一实施例的计算机设备的结构示意框图。
本发明的最佳实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
参照图1,本申请实施例提供一种发送节点变更通知的方法,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件。
上述zookeeper服务器是运行zookeeper的服务器,zookeeper是只支持监听方式通知订阅方,而不支持RESTful(Representational State Transfer,简称REST)描述了一个架构样式的网络系统,指的是一组架构约束条件和原则。满足这些约束条件和原则的应用程序或设计就是 RESTful)接口通知订阅方的工具,所以,本申请中开发人员自己编写或者调用现有的RESTful通知组件,并将RESTful通知组件加入zookeeper中,使zookeeper支持RESTful接口通知。
上述发送节点变更通知的方法,包括如下步骤:
S10、zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
S20、利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
S30、在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
如上述步骤S10和S20所述,zookeeper服务器获取到每个节点一次变更后,都会发起一次http调用第一RESTful接口通知订阅方服务器,以及将生成的节点变更通知存储到zookeeper服务器本地的一个存储空间,以形成一个第一节点变更通知集合。因为在通过http调用第一RESTful接口通知订阅方服务器的时候,存在网络拥堵或者订阅方服务器的系统故障,导致节点变更通知丢失,即zookeeper服务器执行完发送节点变更通知给所述订阅方服务器之后,并不能保证该节点变更通知被订阅方服务器接收到。将第一节点变更集合存储在zookeeper服务器本地的一个存储空间,该存储空间内存储的节点变更通知不存在丢失的情况。
如上述步骤S30所述,上述预设条件是一种预先设定好的前提条件,只有达到这个前提条件才会执行对应的操作。本申请中,上述预设的条件包括多种,比如必须是某一个时间的限定条件,必须是某一个集合数据量的限定条件等。在本实施例中,当达到上述预设条件,就通过上述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。当订阅方服务器接收到第一变更节点集合后,可以根据其已经接收到的节点变更通知,确定出其未接收到的节点变更通知,然后调用第一节点变更通知集合中的订阅方服务器未接收到的节点变更通知的实例节点路径,重新完成对应的处理操作。
在一个实施例中,上述在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤S30,包括:
S3011、判断所述第一节点变更通知集合中的节点变更通知的数量是否等于预设的数量阈值;
S3012、若是,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
如上述步骤S3011和S3012所述,即上述预设条件为第一节点变更通知集合中的节点变更通知的数量等于预设的数量阈值,如数量阈值为50,当第一节点通知集合中的节点变更通知数量为50时,即会触发通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的操作。以数量阈值为预设条件,可以防止第一节点通知集合中的节点变更通知数量过多时,再发送给订阅方服务器中造成网络拥堵。
在另一个实施例中,上述在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤S30,包括:
S3021、获取前一次发送所述第一节点变更通知集合给所述订阅方服务器的第一时间,以及获取当前的第二时间;
S3022、判断所述第一时间和第二时间的时间差是否等于预设的时间阈值;
S3023、若是,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
如上述步骤S3021至S3023所述,即上述预设条件为前一次发送所述第一节点变更通知集合给所述订阅方服务器的第一时间,以及当前的第二时间的时间差等于预设的时间阈值,如时间阈值为30分钟,当前一次发送所述第一节点变更通知集合给所述订阅方服务器的第一时间为下午1点30分,当时间为同一天的下午2点的时候,两者的时间差等于时间阈值,即会触发通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的操作。
在一个实施例中,上述将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤,包括:
发送预设的握手请求给所述订阅方服务器;
若接收到所述订阅方服务器的握手成功的反馈,则将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
在本实施例中,在接收到握手成功的反馈后,才将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器,可以防止第一节点变更通知集合因为网络不通的原因而没有成功发送给上述订阅方服务器。进一步地,如果未接收到所述订阅方服务器的握手成功的反馈,则按照预设频率给给所述订阅方服务器发送握手请求,直到接收到握手成功的反馈后,才会执行将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的操作。当在指定时间长度内,未接收到握手成功的反馈,则生成报警信息发送给预设的终端,以便于工作人员了解情况,进行技术处理。
本实施例的发送节点变更通知的方法,与现有技术相比,当zookeeper服务器接收到订阅方服务器的监听请求后,不但会将对应的节点变更通知发送给订阅方服务器,还会将节点变更通知存储在本地,当达到预设条件后将存储在本地的第一节点变更通知集合主动的发送给订阅方服务器,以便于订阅方服务器利用第一节点变更通知集合查找出丢失的节点变更通知,从而补充完成对丢失的节点变更通知的处理。
参照图2,本申请实施例还提供一种防止节点变更通知丢失的方法,用于订阅方服务器防止zookeeper服务器利用如上述任一项实施例中的发送节点变更通知的方法发送的节点变更通知丢失;上述防止节点变更通知丢失的方法,包括如下步骤:
S11、所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
S21、当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
S31、依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
如上述步骤S11至S31所述,zookeeper服务器发送的节点变更通知给上述订阅方服务器的时候,如果存在网络拥堵或者订阅方服务器的系统故障可能导致节点变更通知丢失,即订阅方服务器接收到的节点变更通知并不一定是zookeeper服务器已经发送给它的全部节点变更通知,可能存在丢失的丢失节点变更通知。在本申请中,订阅方服务器会记录其接收到的节点变更通知,并存储在本地,形成第二节点变更通知集合,此时的第二节点变更通知集合中的节点变更通知与第一节点变更结合中的节点变更通知,可能全部相同,也可能比第一节点变更结合中的节点变更通知少一部分,而少的这一部分即为订阅方服务器没有接收到的节点变更通知,也就是上述的丢失节点变更通知。当查找出丢失的丢失节点变更通知后,既可以根据丢失节点变更通知的实例节点路径完成对应的处理操作,以使订阅方服务器补充对丢失节点变更通知的处理。
在一个实施例中,上述当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知的步骤S21包括:
S2111、当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,提取所述第一节点变更通知集合中的每一个节点变更通知的第一变更时间;
S2112、到所述第二节点变更通知集合中查找与每一个所述第一变更时间相同的第二变更时间;
S2113、获取没有查找到相同的第二变更时间的剩余的第一变更时间,将剩余的所述第一变更时间对应的节点变更通知记为所述丢失节点变更通知。
如上述步骤S2111至S2113所述,因为节点变更通知带有产生通知时的变更时间,所以本实施例中使用节点变更通知的变更时间作为判断第一节点变更通知集合中的节点变更通知与第二节点变更通知集合中的节点变更通知是否相同的依据,如果第一节点变更通知集合中的节点变更通知与第二节点变更通知集合中的节点变更通知相同,则说明该节点变更通知被订阅方服务器接收并处理,如果不相同,则说明该节点变更通知是丢失的丢失节点变更通知。
在一个实施例中,上述当接收到所述zookeeper服务器发送第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于第二节点变更通知集合的丢失节点变更通知的步骤S21之后,还包括:
S2101、计算所述丢失节点变更通知的数量占所述第一节点变更通知集合中全部节点变更通知的数量的比例值;
S2102、若所述比例值大于预设的比例阈值,则生成报警信息。
如上述步骤S2101和S2102所述,如果存在大量的丢失节点变更通知,则说明存在网络拥堵或者订阅方服务器的系统故障等严重问题,生成报警信息以便于工作人员及时了解情况,进行相应的维修。报警信息可以为声/光的物理报警,也可以是通过邮件、短信等文字形式的报警。
本申请的防止节点变更通知丢失的方法,通过接收zookeeper服务器中存储的第一节点变更通知集合,以及订阅方服务器中存储的第二节点变更通知集合,既可以快速的查找出第二节点变更通知集合中相对于第一节点变更通知集种缺少的节点变更通知,这些缺少的节点变更通知即为订阅方服务器没有接收到的丢失节点变更通知,确保zookeeper节点的变更通知不会因为网路出现拥堵、订阅方系统故障等原因丢失。
参照图3,本申请实施例还提供一种发送节点变更通知的装置,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,所述装置包括:
获取单元10,用于zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
发送存储单元20,用于利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
调用发送单元30,用于在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
在一个实施例中,上述调用发送单元30,包括:
第一判断模块,用于判断所述第一节点变更通知集合中的节点变更通知的数量是否等于预设的数量阈值;
第一调用发送模块,用于若所述第一节点变更通知集合中的节点变更通知的数量等于预设的数量阈值,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
在另一个实施例中,上述调用发送单元30,包括:
获取模块,用于获取前一次发送所述第一节点变更通知集合给所述订阅方服务器的第一时间,以及获取当前的第二时间;
第二判断模块,用于判断所述第一时间和第二时间的时间差是否等于预设的时间阈值;
第二调用发送模块、若所述时间差等于预设的时间阈值,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
在一个实施例中,上述调用发送单元30,包括:
发送模块,用于发送预设的握手请求给所述订阅方服务器;
传输模块,用于若接收到所述订阅方服务器的握手成功的反馈,则将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
本实施例的发送节点变更通知的装置,当zookeeper服务器接收到订阅方服务器的监听请求后,不但会将对应的节点变更通知发送给订阅方服务器,还会将节点变更通知存储在本地,当达到预设条件后将存储在本地的第一节点变更通知集合主动的发送给订阅方服务器,以便于订阅方服务器利用第一节点变更通知集合查找出丢失的节点变更通知,从而补充完成对丢失的节点变更通知的处理。
参照图4,本申请实施例还一种防止节点变更通知丢失的装置,用于订阅方服务器防止zookeeper服务器利用如上述任一项实施例所述的发送节点变更通知的方法发送的节点变更通知丢失;该防止节点变更通知丢失的装置,包括:
接收单元11,用于所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
查找单元21,用于当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
处理单元31,用于依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
在一个实施例中,上述查找单元21,包括:
提取模块,用于当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,提取所述第一节点变更通知集合中的每一个节点变更通知的第一变更时间;
查找模块,用于到所述第二节点变更通知集合中查找与每一个所述第一变更时间相同的第二变更时间;
确认单元,用于获取没有查找到相同的第二变更时间的剩余的所述第一变更时间,将剩余的所述第一变更时间对应的节点变更通知记为所述丢失节点变更通知。
在一个实施例中,上述防止节点变更通知丢失的装置,还包括:
比例计算单元,用于计算所述丢失节点变更通知的数量占所述第一节点变更通知集合中全部节点变更通知的数量的比例值;
生成单元,用于若所述比例值大于预设的比例阈值,则生成报警信息。
本申请的防止节点变更通知丢失的装置,通过接收zookeeper服务器中存储的第一节点变更通知集合,以及订阅方服务器中存储的第二节点变更通知集合,既可以快速的查找出第二节点变更通知集合中相对于第一节点变更通知集种缺少的节点变更通知,这些缺少的节点变更通知即为订阅方服务器没有接收到的丢失节点变更通知,确保zookeeper节点的变更通知不会因为网路出现拥堵、订阅方系统故障等原因丢失。
参照图5,本申请实施例中还提供一种计算机设备,该计算机设备可以是上述的管理服务器,或者管理节点对应的服务器,其内部结构可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储第一节点变更通知集合或者第二节点变更通知集合等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种发送节点变更通知的方法,或者防止节点变更通知丢失的方法。
在一个实施例中,上述处理器执行上述发送节点变更通知的方法时,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,该发送节点变更通知的方法包括:zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
在另一个实施例中,上述处理器执行上述防止节点变更通知丢失的方法时,用于订阅方服务器防止zookeeper服务器利用如上述任一项所述的发送节点变更通知的方法发送的节点变更通知丢失;所述防止节点变更通知丢失的方法,包括:所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。
本申请实施例的计算机设备,通过在zookeeper服务器中存储的第一节点变更通知集合,以及订阅方服务器中存储的第二节点变更通知集合,既可以快速的查找出第二节点变更通知集合中相对于第一节点变更通知集种缺少的节点变更通知,这些缺少的节点变更通知即为订阅方服务器没有接收到的丢失节点变更通知,确保zookeeper节点的变更通知不会因为网路出现拥堵、订阅方系统故障等原因丢失。
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质可以是非易失性可读存储介质,也可以是易失性可读存储介质,其上存储有计算机可读指令,计算机可读指令被处理器执行时实现一种发送节点变更通知的方法,或者防止节点变更通知丢失的方法。
在一个实施例中,上述处理器执行上述发送节点变更通知的方法时,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,该发送节点变更通知的方法包括:zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
在另一个实施例中,上述处理器执行上述防止节点变更通知丢失的方法时,用于订阅方服务器防止zookeeper服务器利用如上述任一项所述的发送节点变更通知的方法发送的节点变更通知丢失;所述防止节点变更通知丢失的方法,包括:所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种发送节点变更通知的方法,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,其特征在于,所述发送节点变更通知的方法包括:
    zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
    利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
    在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  2. 根据权利要求1所述的发送节点变更通知的方法,其特征在于,所述在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤,包括:
    判断所述第一节点变更通知集合中的节点变更通知的数量是否等于预设的数量阈值;
    若是,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  3. 根据权利要求1所述的发送节点变更通知的方法,其特征在于,所述在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤,包括:
    获取前一次发送所述第一节点变更通知集合给所述订阅方服务器的第一时间,以及获取当前的第二时间;
    判断所述第一时间和第二时间的时间差是否等于预设的时间阈值;
    若是,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  4. 根据权利要求1所述的发送节点变更通知的方法,其特征在于,所述将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤,包括:
    发送预设的握手请求给所述订阅方服务器;
    若接收到所述订阅方服务器的握手成功的反馈,则将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  5. 一种防止节点变更通知丢失的方法,用于订阅方服务器防止zookeeper服务器利用如权利要求1所述的发送节点变更通知的方法发送的节点变更通知丢失;其特征在于,所述防止节点变更通知丢失的方法,包括:
    所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
    当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
    依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
  6. 根据权利要求5所述的防止节点变更通知丢失的方法,其特征在于,所述在所述第一节点变更通知集合中查找不存在于第二节点变更通知集合的丢失节点变更通知的步骤包括:
    提取所述第一节点变更通知集合中的每一个节点变更通知的第一变更时间;
    到所述第二节点变更通知集合中查找与每一个所述第一变更时间相同的第二变更时间;
    获取没有查找到相同的第二变更时间的剩余的所述第一变更时间,将剩余的所述第一变更时间对应的节点变更通知记为所述丢失节点变更通知。
  7. 根据权利要求6所述的防止节点变更通知丢失的方法,其特征在于,所述当接收到所述zookeeper服务器发送第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于第二节点变更通知集合的丢失节点变更通知的步骤之后,还包括:
    计算所述丢失节点变更通知的数量占所述第一节点变更通知集合中全部节点变更通知的数量的比例值;
    若所述比例值大于预设的比例阈值,则生成报警信息。
  8. 一种发送节点变更通知的装置,用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,其特征在于,所述装置包括:
    获取单元,用于zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
    发送存储单元,用于利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
    调用发送单元,用于在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  9. 根据权利要求8所述的发送节点变更通知的装置,其特征在于,所述调用发送单元,包括:
    第一判断模块,用于判断所述第一节点变更通知集合中的节点变更通知的数量是否等于预设的数量阈值;
    第一调用发送模块,用于若所述第一节点变更通知集合中的节点变更通知的数量等于预设的数量阈值,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  10. 根据权利要求8所述的发送节点变更通知的装置,其特征在于,所述调用发送单元,包括:
    获取模块,用于获取前一次发送所述第一节点变更通知集合给所述订阅方服务器的第一时间,以及获取当前的第二时间;
    第二判断模块,用于判断所述第一时间和第二时间的时间差是否等于预设的时间阈值;
    第二调用发送模块、若所述时间差等于预设的时间阈值,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  11. 根据权利要求8所述的发送节点变更通知的装置,其特征在于,所述调用发送单元,包括:
    发送模块,用于发送预设的握手请求给所述订阅方服务器;
    传输模块,用于若接收到所述订阅方服务器的握手成功的反馈,则将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  12. 一种防止节点变更通知丢失的装置,用于订阅方服务器防止zookeeper服务器利用如权利要求1所述的发送节点变更通知的方法发送的节点变更通知丢失;其特征在于,所述防止节点变更通知丢失的装置,包括:
    接收单元,用于所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
    查找单元,用于当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
    处理单元,用于依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
  13. 根据权利要求12所述的防止节点变更通知丢失的装置,其特征在于,所述查找单元,包括:
    提取模块,用于当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,提取所述第一节点变更通知集合中的每一个节点变更通知的第一变更时间;
    查找模块,用于到所述第二节点变更通知集合中查找与每一个所述第一变更时间相同的第二变更时间;
    确认单元,用于获取没有查找到相同的第二变更时间的剩余的所述第一变更时间,将剩余的所述第一变更时间对应的节点变更通知记为所述丢失节点变更通知。
  14. 根据权利要求12所述的防止节点变更通知丢失的装置,其特征在于,还包括:
    比例计算单元,用于计算所述丢失节点变更通知的数量占所述第一节点变更通知集合中全部节点变更通知的数量的比例值;
    生成单元,用于若所述比例值大于预设的比例阈值,则生成报警信息。
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现一种发送节点变更通知的方法,该发送节点变更通知的方法用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,所述发送节点变更通知的方法包括:
    zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
    利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
    在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  16. 根据权利要求15所述的计算机设备,其特征在于,所述在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器的步骤,包括:
    判断所述第一节点变更通知集合中的节点变更通知的数量是否等于预设的数量阈值;
    若是,则通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  17. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现一种防止节点变更通知丢失的方法,用于订阅方服务器防止zookeeper服务器利用如权利要求1所述的发送节点变更通知的方法发送的节点变更通知丢失;所述防止节点变更通知丢失的方法,包括:
    所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
    当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
    依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
  18. 根据权利要求17所述的计算机设备,其特征在于,所述在所述第一节点变更通知集合中查找不存在于第二节点变更通知集合的丢失节点变更通知的步骤包括:
    提取所述第一节点变更通知集合中的每一个节点变更通知的第一变更时间;
    到所述第二节点变更通知集合中查找与每一个所述第一变更时间相同的第二变更时间;
    获取没有查找到相同的第二变更时间的剩余的所述第一变更时间,将剩余的所述第一变更时间对应的节点变更通知记为所述丢失节点变更通知。
  19. 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现一种发送节点变更通知的方法,该发送节点变更通知的方法用于zookeeper服务器向订阅方服务器发送节点变更通知,所述zookeeper服务器中安装有使zookeeper服务器支持RESTful接口调用的通知组件,所述发送节点变更通知的方法包括:
    zookeeper服务器获取节点变更通知,其中,所述节点变更通知包括实例节点路径和变更时间;
    利用所述通知组件调用所述订阅方服务器的第一RESTful接口,将所述节点变更通知向所述订阅方服务器发送,以及,将所述节点变更通知存储在本地的第一节点变更通知集合中;
    在预设条件下,通过所述通知组件调用所述订阅方服务器预设的第二RESTful接口,并将所述第一节点变更通知集合通过第二RESTful接口传输给所述订阅方服务器。
  20. 一种计算机可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现一种防止节点变更通知丢失的方法,用于订阅方服务器防止zookeeper服务器利用如权利要求1所述的发送节点变更通知的方法发送的节点变更通知丢失;所述防止节点变更通知丢失的方法,包括:
    所述订阅方服务器通过所述第一RESTful接口接收所述zookeeper服务器发送的节点变更通知,并将接收到的节点变更通知存储在预设的存储空间,形成第二节点变更通知集合;
    当接收到所述zookeeper服务器发送的所述第一节点变更通知集合后,在所述第一节点变更通知集合中查找不存在于所述第二节点变更通知集合的丢失节点变更通知;
    依据所述丢失节点变更通知的实例节点路径完成对应的处理操作。
PCT/CN2019/118161 2019-04-16 2019-11-13 防止节点变更通知丢失的方法、装置和计算机设备 WO2020211361A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910305189.8 2019-04-16
CN201910305189.8A CN110166528B (zh) 2019-04-16 2019-04-16 防止节点变更通知丢失的方法、装置和计算机设备

Publications (1)

Publication Number Publication Date
WO2020211361A1 true WO2020211361A1 (zh) 2020-10-22

Family

ID=67639613

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118161 WO2020211361A1 (zh) 2019-04-16 2019-11-13 防止节点变更通知丢失的方法、装置和计算机设备

Country Status (2)

Country Link
CN (1) CN110166528B (zh)
WO (1) WO2020211361A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166528B (zh) * 2019-04-16 2022-03-18 平安科技(深圳)有限公司 防止节点变更通知丢失的方法、装置和计算机设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092718A (zh) * 2013-12-12 2014-10-08 腾讯数码(天津)有限公司 分布式系统及分布式系统中配置信息的更新方法
CN104636135A (zh) * 2014-12-31 2015-05-20 北京奇虎科技有限公司 一种节点访问方法和系统、客户端代理和客户端
US20180176082A1 (en) * 2016-12-21 2018-06-21 Juniper Networks, Inc. Communicating state information in distributed operating systems
CN109525466A (zh) * 2019-01-03 2019-03-26 杭州云英网络科技有限公司 数据节点监听方法及装置
CN110166528A (zh) * 2019-04-16 2019-08-23 平安科技(深圳)有限公司 防止节点变更通知丢失的方法、装置和计算机设备

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH033054A (ja) * 1989-05-31 1991-01-09 Yokogawa Electric Corp 通信データ抜け防止方法
US6687848B1 (en) * 2000-05-31 2004-02-03 Sun Microsystems, Inc. Techniques for preventing information loss in a business to business message in an enterprise computer system
CN100596050C (zh) * 2006-03-27 2010-03-24 阿里巴巴集团控股有限公司 一种可靠的系统间消息通知方法和系统
CN105282118B (zh) * 2014-07-21 2019-01-29 中兴通讯股份有限公司 控制资源变更通知消息发送方法及装置
CN106712981B (zh) * 2015-07-23 2020-03-06 阿里巴巴集团控股有限公司 一种节点变更通知方法及装置
CN106980643A (zh) * 2017-02-14 2017-07-25 阿里巴巴集团控股有限公司 变更消息的发送方法、装置及电子设备
CN108984544B (zh) * 2017-05-31 2021-04-30 北京京东尚科信息技术有限公司 一种分布式系统修改配置信息的方法和装置
CN108255592B (zh) * 2017-12-19 2020-12-08 武汉市烽视威科技有限公司 一种Quartz集群定时任务处理系统及方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092718A (zh) * 2013-12-12 2014-10-08 腾讯数码(天津)有限公司 分布式系统及分布式系统中配置信息的更新方法
CN104636135A (zh) * 2014-12-31 2015-05-20 北京奇虎科技有限公司 一种节点访问方法和系统、客户端代理和客户端
US20180176082A1 (en) * 2016-12-21 2018-06-21 Juniper Networks, Inc. Communicating state information in distributed operating systems
CN109525466A (zh) * 2019-01-03 2019-03-26 杭州云英网络科技有限公司 数据节点监听方法及装置
CN110166528A (zh) * 2019-04-16 2019-08-23 平安科技(深圳)有限公司 防止节点变更通知丢失的方法、装置和计算机设备

Also Published As

Publication number Publication date
CN110166528B (zh) 2022-03-18
CN110166528A (zh) 2019-08-23

Similar Documents

Publication Publication Date Title
US10063599B2 (en) Controlling registration floods in VOIP networks via DNS
US8156219B2 (en) System and method of health monitoring and fault monitoring in a network system
US20210176310A1 (en) Data synchronization method and system
US8738700B2 (en) Method and system for providing network services
CN108718347B (zh) 一种域名解析方法、系统、装置及存储介质
US10742691B2 (en) Managing mid-dialog session initiation protocol (SIP) messages
CN110851290A (zh) 一种数据同步方法、装置、电子设备及存储介质
CN110830283A (zh) 故障检测方法、装置、设备和系统
CN113517985B (zh) 文件数据处理方法、装置、电子设备及计算机可读介质
JP2016535908A (ja) eメールのウェブクライアント通知の待ち行列化方法
CN113835836A (zh) 动态发布容器服务的系统、方法、计算机设备及介质
WO2020211361A1 (zh) 防止节点变更通知丢失的方法、装置和计算机设备
CN112953719B (zh) 一种令牌认证方法和装置
CN113364887A (zh) 一种基于ftp的文件下载方法、代理服务器和系统
US10419368B1 (en) Dynamic scaling of computing message architecture
CN115102854B (zh) 微服务的远程过程调用路由管理控制方法、系统及设备
CN115208799B (zh) 一种心跳管理方法、装置及存储介质
CN112866359B (zh) 数据上链方法、装置、电子设备及存储介质
WO2020224413A1 (zh) 负荷控制方法、服务提供者nf及服务使用者nf
US10628803B1 (en) Dial home optimizer
US8166116B2 (en) Automatic distribution of corrective configuration information
EP2475157A1 (en) Method and apparatus for managing telephone services of a user communication device when a server providing those telephone services is unavailable
CN117714439A (zh) 一种数据接入方法、系统及装置
JP2017175248A (ja) Enum/dnsクエリ優先制御システムおよびenum/dnsクエリ優先制御方法
CN117439984A (zh) 一种用户登录控制方法、装置及相关设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19925147

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19925147

Country of ref document: EP

Kind code of ref document: A1