CN114938392B - Distributed subscription and release system and method - Google Patents

Distributed subscription and release system and method Download PDF

Info

Publication number
CN114938392B
CN114938392B CN202210725844.7A CN202210725844A CN114938392B CN 114938392 B CN114938392 B CN 114938392B CN 202210725844 A CN202210725844 A CN 202210725844A CN 114938392 B CN114938392 B CN 114938392B
Authority
CN
China
Prior art keywords
publisher
subscription
node
event
information
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
CN202210725844.7A
Other languages
Chinese (zh)
Other versions
CN114938392A (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.)
Chengdu Quality Starker Technology Co Ltd
Original Assignee
Chengdu Quality Starker 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 Chengdu Quality Starker Technology Co Ltd filed Critical Chengdu Quality Starker Technology Co Ltd
Priority to CN202210725844.7A priority Critical patent/CN114938392B/en
Publication of CN114938392A publication Critical patent/CN114938392A/en
Application granted granted Critical
Publication of CN114938392B publication Critical patent/CN114938392B/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/10Active monitoring, e.g. heartbeat, ping or trace-route
    • 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/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multi Processors (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of communication, in particular to a distributed subscription publishing system and a distributed subscription publishing method, wherein the system comprises a plurality of publisher nodes and a plurality of subscriber nodes, each publisher node can subscribe at least one subscriber node, each subscriber node can receive the subscription of at least one subscriber node, each subscriber node for one event can subscribe only one corresponding publisher node, and other publisher nodes are randomly and repeatedly subscribed only after the corresponding publisher node is offline, and the subscribed publisher nodes are replaced when the online state of the publisher node is judged to be the offline state, so that the real-time event state between the publisher node and the subscriber node in a blockchain network is realized, the propagation speed of event state information among all nodes in the blockchain network is effectively increased through the distributed subscription, and the overall operation efficiency of the blockchain network is further improved.

Description

Distributed subscription and release system and method
Technical Field
The invention relates to the technical field of communication, in particular to a distributed subscription and release system and a distributed subscription and release method.
Background
The message subscription service in the traditional internet application needs to be realized by integrating a third party message middleware, which brings great challenges to deployment and operation and maintenance in a decentralized distributed network environment with huge node scale, not only increases the maintenance cost of the message subscription service, but also requires extra storage cost to ensure the reliability of the message not to be lost, and the message subscription and release mode is too heavy compared with the blockchain, and is not beneficial to the quick propagation of the blockchain message.
Disclosure of Invention
The embodiment of the invention aims to provide a distributed subscription publishing system and a distributed subscription publishing method. The specific technical scheme is as follows:
in a first aspect of an embodiment of the present invention, a distributed subscription publishing system is provided, the system comprising a plurality of publisher nodes and a plurality of subscriber nodes, each of the publisher nodes being capable of subscribing to at least one of the subscriber nodes, each of the subscriber nodes being capable of receiving subscriptions of at least one of the publisher nodes, wherein each of the subscriber nodes is capable of subscribing to only one corresponding one of the publisher nodes for an event subscription, and is capable of subscribing to other publisher nodes randomly and non-repeatedly only after the corresponding one of the publisher nodes is offline.
In a second aspect of the embodiment of the present invention, there is provided a distributed subscription publishing method, the method including: the method comprises the steps that a subscriber node sends a first subscription request to a first publisher node according to a first publisher node identifier, so that the first publisher generates a first subscription registry, current state information of a first subscription event is sent to the subscriber node, and the first subscription event is a business event corresponding to the first subscription request;
and the subscriber node receives the subscription success information and the current state information of the first subscription event sent by the first publisher and records the first publisher information in a publisher list.
Optionally, before the subscriber node sends the first subscription request to the first publisher node according to the first publisher node identifier, the method includes:
the method comprises the steps that a subscriber node obtains a subscription instruction sent by a first upper application system, wherein the subscription instruction comprises a first subscription event type;
and the subscriber node invokes a plurality of corresponding publisher node identifiers in the local blockchain public account book according to the event type, and randomly selects one corresponding publisher node identifier to be recorded as a first publisher node identifier.
Optionally, after the first publisher generates the first subscription registry and sends the current state information of the first subscription event to the subscriber node, the method further includes:
the method comprises the steps that a first publisher node creates a first publisher event push task so that the subscriber node continuously receives state information of a first subscription event, wherein the first publisher event push task comprises an event state change push subtask and a first heartbeat subtask, the event state change push subtask is used for sending the state information of the changed first subscription event to the subscriber node when the state information of the first subscription event changes, and the first heartbeat subtask is used for periodically sending the state information of the current first subscription event to the subscriber node.
Optionally, after the subscriber node receives the subscription success information and the current state information of the first subscription event sent by the first publisher and records the first publisher information in the publisher list, the method further includes:
the method comprises the steps that a subscriber node creates a monitoring task corresponding to a first publisher node and records the monitoring task as a first timing task, wherein the first timing task is used for periodically detecting the online state of a first publisher, and deleting first publisher information recorded in a publisher list under the condition that the first publisher does not respond to the first timing task within preset time, so that the subscribing node screens out the information of a first subscription event sent by the first publisher.
Optionally, the subscribing node screens out the information of the first subscription event sent by the first publisher, including:
the method comprises the steps that a subscriber node obtains a plurality of event information sent by a plurality of publisher nodes, wherein the plurality of event information comprises information of a first subscription event sent by a first publisher;
and the subscriber node intercepts and deletes the information of the first subscription event in the event information under the condition that the first publisher information is not in the publisher list.
In a second aspect of an embodiment of the present invention, there is provided a distributed subscription publishing device, the device being adapted for use with any subscriber node in a blockchain network, the device comprising:
the request module is used for sending a first subscription request to a first publisher node according to a first publisher node identifier so that the first publisher generates a first subscription registry and sends current state information of a first subscription event to the subscriber node, wherein the first subscription event is a service event corresponding to the first subscription request;
the receiving module is used for receiving the subscription success information and the current state information of the first subscription event sent by the first publisher, recording the first publisher information in a publisher list, and creating a first heartbeat monitoring task for the first publisher node, wherein the first heartbeat monitoring task is used for periodically monitoring the online state of the first publisher node.
The invention has at least the following beneficial effects: the method has the advantages that nodes in the blockchain network are divided into the subscriber nodes and the publisher nodes, the subscriber nodes and the publisher nodes subscribe to each other in many-to-many mode, the on-line state of the publisher nodes is detected in real time through establishing a heartbeat monitoring task thread of the publisher nodes on the subscriber nodes, and the subscribed publisher nodes are replaced when the on-line state of the publisher nodes is judged to be an off-line state, so that the real-time event state between the publisher nodes and the subscriber nodes in the blockchain network is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention 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 evident that the drawings in the following description are only some embodiments of the present invention and that other drawings may be obtained from these drawings by those of ordinary skill in the art without inventive effort.
FIG. 1 is a schematic diagram illustrating the operation of subscription steps between a subscriber node and a publisher node in a distributed subscription publishing system according to one embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Example 1
The embodiment provides a distributed subscription and publishing system, the system comprises a plurality of publisher nodes and a plurality of subscriber nodes, the publisher nodes of various events in a blockchain network are required to be described to be non-unique, the subscriber nodes can only subscribe one corresponding publisher node in the plurality of publisher nodes, meanwhile, the publisher nodes have the option of enabling the subscriber nodes to access a subscription interface or not, so that each publisher node can judge whether to agree with the subscription according to the running condition of the publisher nodes, a self-defined supply and demand equilibrium setting function is provided, each publisher node can subscribe at least one subscriber node, each subscriber node can receive the subscription of at least one subscriber node, each subscriber node can only subscribe one corresponding publisher node for the subscription of an event, and only randomly and repeatedly subscribe other publisher nodes after the corresponding publisher node is offline, the subscriber nodes in the blockchain network can be divided into the subscriber nodes and the publisher nodes, the subscriber nodes can be mutually connected with the subscriber nodes, the subscription state of the subscriber nodes can be monitored by the subscription nodes in the blockchain network, the real-time state information is further replaced by the subscription nodes, the real-time state information is further monitored between the subscriber nodes in the blockchain network, and the real-time state is further realized, thereby improving the overall operation efficiency of the block chain network.
Example 2
As shown in fig. 1, based on a distributed subscription publishing system in embodiment 1, before the foregoing description, it should be noted that publisher nodes of various events in a blockchain network are not unique, and a subscribing node can only select one of a plurality of publisher nodes to subscribe, and meanwhile, it should be noted that a publisher node has a choice of whether to allow the subscriber node to access a subscription interface, so that each publisher node can determine whether to agree with the subscription according to its own operation condition, and provide a customizable supply and demand balance setting function.
S1, a subscriber node acquires a subscription instruction sent by a first upper layer application system, wherein the subscription instruction comprises a first subscription event type;
s2, the subscriber node invokes a plurality of corresponding publisher node identifiers in a local blockchain public account book according to the event type, and randomly selects one corresponding publisher node identifier to be marked as a first publisher node identifier;
s3, the subscriber node sends a first subscription request to a first publisher node according to a first publisher node identifier, so that the first publisher generates a first subscription registry, and sends current state information of a first subscription event to the subscriber node, wherein the first subscription event is a service event corresponding to the first subscription request;
s4, the subscriber node receives the subscription success information and the current state information of the first subscription event sent by the first publisher, records the first publisher information in a publisher list, creates a first heartbeat monitoring task for the first publisher node, the first heartbeat monitoring task is used for periodically monitoring the online state of the first publisher node, randomly selects another publisher node to subscribe when the first heartbeat monitoring task detects that the online state of the first publisher node is in an offline state, and then feeds back the current latest event state information to the subscriber node, namely the publisher node is concerned with the historical information of the subscriber node.
After the subscriber node receives the subscription success information sent by the first publisher in step S4, the subscriber node and the first publisher node have subsequent actions, where:
first aspect: for a first publisher, a first publisher node creates a first publisher event push task so that the subscriber node continuously receives state information of the first subscription event, wherein the first publisher event push task comprises an event state change push subtask and a first heartbeat subtask, the event state change push subtask is used for sending the state information of the changed first subscription event to the subscriber node when the state information of the first subscription event changes, and the first heartbeat subtask is used for periodically sending the state information of the current first subscription event to the subscriber node;
in a second aspect, regarding a subscriber node, the subscriber node creates a monitoring task corresponding to a first publisher node and marks the monitoring task as a first timing task, wherein the first timing task is used for periodically detecting the online state of a first publisher, and deleting first publisher information recorded in the publisher list when the first publisher does not respond to the first timing task within a preset time, so that the subscription node screens out information of a first subscription event sent by the first publisher;
the specific operation of screening out the information of the first subscription event sent by the first sender may be: the method comprises the steps that a subscriber node obtains a plurality of event information sent by a plurality of publisher nodes, wherein the plurality of event information comprises information of a first subscription event sent by a first publisher; and the subscriber node intercepts and deletes the information of the first subscription event in the event information under the condition that the publisher list does not have the first publisher information.
Example 3
The embodiment provides a distributed subscription publishing device, which is applicable to any subscriber node in a blockchain network, and comprises:
the request module is used for sending a first subscription request to a first publisher node according to a first publisher node identifier so that the first publisher generates a first subscription registry and sends current state information of a first subscription event to the subscriber node, wherein the first subscription event is a service event corresponding to the first subscription request;
the receiving module is used for receiving subscription success information and current state information of a first subscription event sent by the first publisher, recording the first publisher information in a publisher list, and creating a first heartbeat monitoring task for a first publisher node, wherein the first heartbeat monitoring task is used for periodically monitoring the online state of the first publisher node;
the request module is further configured to create a monitoring task corresponding to the first publisher node, and record the monitoring task as a first timing task, where the first timing task is configured to periodically detect an online state of the first publisher, and delete, when the first publisher does not respond to the first timing task within a preset time, first publisher information recorded in the publisher list, so that the subscription node screens out information of a first subscription event sent by the first publisher.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (7)

1. A distributed subscription publishing system, characterized by being applied to a blockchain network, the system comprising a plurality of publisher nodes and a plurality of subscriber nodes, each of the publisher nodes being capable of subscribing to at least one of the subscriber nodes, each of the subscriber nodes being capable of receiving subscriptions of at least one of the publisher nodes, wherein each of the subscriber nodes is capable of subscribing to only one corresponding one of the publisher nodes for an event and randomly and non-repeatedly subscribing to other publisher nodes only after the corresponding publisher node is offline.
2. A distributed subscription publishing method, for use in a blockchain network, the method comprising:
the method comprises the steps that a subscriber node sends a first subscription request to a first publisher node according to a first publisher node identifier, so that the first publisher generates a first subscription registry, current state information of a first subscription event is sent to the subscriber node, and the first subscription event is a business event corresponding to the first subscription request;
the subscriber node receives the subscription success information and the current state information of the first subscription event sent by the first publisher, records the first publisher information in a publisher list, and creates a first heartbeat monitoring task for the first publisher node, wherein the first heartbeat monitoring task is used for periodically monitoring the online state of the first publisher node.
3. The method of claim 2, wherein before the subscriber node sends the first subscription request to the first publisher node based on the first publisher node identification, comprising:
the method comprises the steps that a subscriber node obtains a subscription instruction sent by a first upper application system, wherein the subscription instruction comprises a first subscription event type;
and the subscriber node invokes a plurality of corresponding publisher node identifiers in the local blockchain public account book according to the event type, and randomly selects one corresponding publisher node identifier to be recorded as a first publisher node identifier.
4. The method of claim 2, wherein after the first publisher generates a first subscription registry and sends current state information of a first subscription event to the subscriber node, further comprising:
the method comprises the steps that a first publisher node creates a first publisher event pushing task so that the subscriber node continuously receives state information of a first subscription event, wherein the first publisher event pushing task comprises an event state change pushing subtask and a first heartbeat subtask, the event state change pushing subtask is used for sending the state information of the changed first subscription event to the subscriber node when the state information of the first subscription event changes, and the first heartbeat subtask is used for periodically sending the state information of the current first subscription event to the subscriber node.
5. The method of claim 2, wherein after the subscriber node accepts the subscription success information and the current status information of the first subscription event sent by the first publisher and records the first publisher information in the publisher list, further comprising:
the method comprises the steps that a monitoring task corresponding to a first publisher node is established by a subscriber node and recorded as a first timing task, the first timing task is used for periodically detecting the online state of the first publisher, and under the condition that the first publisher does not respond to the first timing task within preset time, the first publisher information recorded in a publisher list is deleted, so that the subscriber node screens out the information of a first subscription event sent by the first publisher.
6. The method of claim 5, wherein the subscriber node screens out information of the first subscription event sent by the first publisher, comprising:
the method comprises the steps that a subscriber node obtains a plurality of event information sent by a plurality of publisher nodes, wherein the plurality of event information comprises information of a first subscription event sent by a first publisher;
and the subscriber node intercepts and deletes the information of the first subscription event in the event information under the condition that the first publisher information is not in the publisher list.
7. A distributed subscription publishing apparatus adapted for use with any subscriber node in a blockchain network, the apparatus comprising:
the request module is used for sending a first subscription request to a first publisher node according to a first publisher node identifier so that the first publisher generates a first subscription registry and sends current state information of a first subscription event to the subscriber node, wherein the first subscription event is a service event corresponding to the first subscription request;
the receiving module is used for receiving the subscription success information and the current state information of the first subscription event sent by the first publisher, recording the first publisher information in a publisher list, and creating a first heartbeat monitoring task for the first publisher node, wherein the first heartbeat monitoring task is used for periodically monitoring the online state of the first publisher node.
CN202210725844.7A 2022-06-23 2022-06-23 Distributed subscription and release system and method Active CN114938392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210725844.7A CN114938392B (en) 2022-06-23 2022-06-23 Distributed subscription and release system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210725844.7A CN114938392B (en) 2022-06-23 2022-06-23 Distributed subscription and release system and method

Publications (2)

Publication Number Publication Date
CN114938392A CN114938392A (en) 2022-08-23
CN114938392B true CN114938392B (en) 2023-06-30

Family

ID=82868108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210725844.7A Active CN114938392B (en) 2022-06-23 2022-06-23 Distributed subscription and release system and method

Country Status (1)

Country Link
CN (1) CN114938392B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115834691B (en) * 2023-02-13 2023-06-30 美云智数科技有限公司 Distributed publishing and subscribing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108390933A (en) * 2018-02-26 2018-08-10 广州华多网络科技有限公司 Message distributing method, device, server and storage medium
WO2021197097A1 (en) * 2020-04-02 2021-10-07 支付宝(杭州)信息技术有限公司 Cross-chain data subscription

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102594718A (en) * 2011-01-12 2012-07-18 阿尔卡特朗讯 Method and device for processing presentation information
US20170270527A1 (en) * 2016-03-17 2017-09-21 John Rampton Assessing trust to facilitate blockchain transactions
CN108173902A (en) * 2017-11-29 2018-06-15 清华大学 Data transmission, publication and method for subscribing and device
CN108777625B (en) * 2018-06-28 2020-08-11 腾讯科技(深圳)有限公司 Signature verification method, device and system, storage medium and electronic device
US20190050854A1 (en) * 2018-09-28 2019-02-14 Intel Corporation Blockchain-based digital data exchange
CN113867915A (en) * 2021-09-27 2021-12-31 深圳前海微众银行股份有限公司 Task scheduling method, electronic device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108390933A (en) * 2018-02-26 2018-08-10 广州华多网络科技有限公司 Message distributing method, device, server and storage medium
WO2021197097A1 (en) * 2020-04-02 2021-10-07 支付宝(杭州)信息技术有限公司 Cross-chain data subscription

Also Published As

Publication number Publication date
CN114938392A (en) 2022-08-23

Similar Documents

Publication Publication Date Title
US7583189B2 (en) Methods for managing remote devices over an instant messaging network and systems thereof
US20020124081A1 (en) Method and system for a set of network appliances which can be connected to provide enhanced collaboration, scalability, and reliability
CN109274557B (en) Intelligent CMDB management and cloud host monitoring method in cloud environment
US20080244077A1 (en) Methods for auditing peer-to-peer communications in remote device monitoring system and systems thereof
US20060117101A1 (en) Node discovery and communications in a network
CN114938392B (en) Distributed subscription and release system and method
CN110677282B (en) Hot backup method of distributed system and distributed system
CN101742254A (en) Backup method for video monitoring system information and central platform server
CN112039718A (en) Upgrade state detection method, server, device and storage medium
CN110071968B (en) Block chain based message storage method and device
CN108509296B (en) Method and system for processing equipment fault
CN111460038A (en) Quasi-real-time data synchronization method and device
EP3171565B1 (en) Methods, devices and system for netconf hello packets interaction
CN111338858B (en) Disaster recovery method and device for double machine rooms
CN113055203B (en) Method and device for recovering exception of SDN control plane
CN102346698A (en) Time program management method, server and system
CN103297328B (en) A kind of information communication method and apparatus
CN110545197A (en) node state monitoring method and device
CN110971669B (en) Message notification method, device, server, electronic equipment and readable storage medium
CN113472566A (en) Status monitoring method of union block chain and master node status monitoring system
CN114090342A (en) Storage disaster tolerance link management method, message execution node and storage control cluster
CN104301240B (en) Data transmission method and system
CN109327529B (en) Distributed scanning method and system
JP2004295656A (en) Communication system, client device, load distribution method of server device by client device
CN110830281B (en) Hot standby method and system based on mesh network structure

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
GR01 Patent grant
GR01 Patent grant