CN114844909A - Consensus mechanism query system based on Internet - Google Patents

Consensus mechanism query system based on Internet Download PDF

Info

Publication number
CN114844909A
CN114844909A CN202210344499.2A CN202210344499A CN114844909A CN 114844909 A CN114844909 A CN 114844909A CN 202210344499 A CN202210344499 A CN 202210344499A CN 114844909 A CN114844909 A CN 114844909A
Authority
CN
China
Prior art keywords
node
message
sequencing
module
administrator
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210344499.2A
Other languages
Chinese (zh)
Inventor
顾松林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202210344499.2A priority Critical patent/CN114844909A/en
Publication of CN114844909A publication Critical patent/CN114844909A/en
Pending legal-status Critical Current

Links

Images

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/30Decision processes by autonomous network management units using voting and bidding
    • 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/12Discovery or management of network topologies
    • 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
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/321Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority
    • H04L9/3213Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving a third party or a trusted authority using tickets or tokens, e.g. Kerberos
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The invention discloses an internet-based consensus mechanism query system, which comprises a hierarchical clustering framework module, a distributed message sequencing module and a message multi-backup caching module, the hierarchical clustering architecture module is configured to partition an overall network environment into a plurality of clusters using a hierarchical clustering architecture scheme, the distributed message sequencing module is configured to utilize a distributed messaging network, defining a sequencing node on a cluster controller, the message multi-backup caching module for multi-backup caching of ongoing messages using message forwarding paths, the layered clustering framework module is electrically connected with the distributed message sequencing module, the distributed message sequencing module is electrically connected with the message multi-backup caching module, the cooperative sequencing of an administrator and the sequencing node is realized, the crash management is increased, the invention realizes the quick search feedback of the message through the double-layer index, and has the characteristics of inquiring the missing message sequence number and managing the collapse of the node administrator.

Description

Consensus mechanism query system based on Internet
Technical Field
The invention relates to the technical field of consensus mechanisms, in particular to a consensus mechanism query system based on the Internet.
Background
The consensus mechanism is that the transaction is verified and confirmed within a short time by voting of special nodes, and if a plurality of nodes with irrelevant benefits can achieve consensus, the whole network can also achieve consensus; the publish-subscribe system is a distributed middleware for message interaction and sharing, wherein a topic is a focus of main attention, a subscriber declares the attention to an event in the form of a subscription topic, the position of a publisher paying attention to the topic is not required, the publisher only needs to publish a message of a certain topic to the system, and the subscriber paying attention to the topic is not required, so that the decoupling between the publisher and the subscriber is realized, and based on the characteristics, the publish-subscribe system can be applied to various fields, such as stock information exchange, logistics monitoring and the like. In these applications, it is important to achieve ordering and reliable delivery of messages.
However, in the publish-subscribe system based on SDN, there are two major drawbacks, that is, the subscriber cannot locate which messages are lost in the message transmission process, and that because the system has no message caching mechanism, once a message is lost in the transmission process, the subscriber cannot acquire the message, in a real network environment, due to the complexity of network forwarding, data is often lost in transmission, the consensus of messages mainly refers to the consistency of messages, i.e., if a message is delivered to a subscriber, all subscribers to the message receive the message, while the SDN-based publish-subscribe system is a distributed decentralized Internet of things system, the traditional distributed consensus mechanism cannot be directly applied to the system, therefore, it is necessary to design an internet-based consensus query system that can query for missing message sequence numbers.
Disclosure of Invention
The present invention is directed to provide an internet-based consensus query system to solve the above-mentioned problems in the background art.
In order to solve the technical problems, the invention provides the following technical scheme: the common-recognition mechanism query system based on the Internet comprises a layered clustering framework module, a distributed message sequencing module and a message multi-backup cache module, wherein the layered clustering framework module is used for dividing the whole network environment into a plurality of clusters by adopting a layered clustering framework mode, the distributed message sequencing module is used for defining sequencing nodes on a cluster controller by utilizing a distributed message communication network, the message multi-backup cache module is used for performing multi-backup caching of messages by utilizing a message forwarding path, the layered clustering framework module is electrically connected with the distributed message sequencing module, and the distributed message sequencing module is electrically connected with the message multi-backup cache module.
According to the technical scheme, the layered clustering framework module comprises an administrator module, a cluster control unit, a physical device and a WSN module, wherein an administrator in the administrator module is a special controller and has a controller function and an entire network management function, the cluster control unit is used for bearing processing of issuing subscription transactions in a cluster and has functions of topology management, route management, flow table management and the like of physical environment processing, the physical device in the physical device and the WSN module mainly comprises an SDN switch and is used for forwarding messages according to forwarding rules issued by the cluster controller, the WSN layer is responsible for directly interacting with users to realize forwarding of the messages, the administrator module is in network connection with the cluster control unit, and the cluster control unit is in network connection with the physical device and the WSN module.
According to the technical scheme, the distributed message sequencing module comprises a sequencing node module, a collaborative sequencing management module, a crash management module and a unique message ID generation module, wherein the sequencing node module is used for calculating a root node of a minimum spanning tree according to a topological structure of a system, the collaborative sequencing management module is used for sequencing a node which forms a token ring with sequencing nodes and collaboratively holds a token by an administrator, the crash management module is used for carrying out state transfer processing when the node and the administrator crash, the unique message ID generation module is used for generating a unique ID for a message after receiving a release message by utilizing a WSN layer of a release node, the sequencing node module is electrically connected with the collaborative sequencing management module, and the crash management module is electrically connected with the unique message ID generation module;
the sequencing node module comprises a node selection submodule, a missing message query submodule and an administrator function submodule, wherein the node selection submodule is used for an administrator to select a proper sequencing node according to the topological structure of the whole network and the publishing node of each topic tree, the missing message query submodule is used for querying missing messages to a system when a user does not receive the messages and does not receive message serial numbers, the administrator function submodule is used for packaging some functions of the administrator as interfaces and exposing the interfaces to the user, the user calls the functions of the administrator through the interfaces, the node selection submodule is electrically connected with the missing message query submodule, and the missing message query submodule is electrically connected with the administrator function submodule;
The crash management module comprises a node crash management submodule and an administrator crash management submodule, wherein the node crash management submodule is used for updating the current sequence number state to a termination sequence number after the administrator receives the termination sequence number of the sequencing node, the administrator crash management submodule is used for ensuring the orderliness of the messages by using the state transfer of the sequencing node under the condition that the administrator crashes at any time and recovering the sequencing function, and the node crash management submodule is electrically connected with the administrator crash management submodule.
According to the technical scheme, the message multi-backup caching module comprises a multi-point caching module, a caching node selection module and a double-layer index module, the multi-point caching module is used for setting message multi-backup to ensure that message query service can be provided by other backup nodes when a network edge caching node fails, the caching node selection module is used for acquiring all clusters on a message forwarding path of a publishing group and performing sequencing selection, the double-layer index module is used for realizing quick search when a subscriber searches for missing messages in a double-layer index mode, the multi-point caching module is electrically connected with the caching node selection module, and the caching node selection module is electrically connected with the double-layer index module.
According to the technical scheme, the consensus mechanism query method mainly comprises the following steps:
step S1: starting an administrator and a cluster controller, selecting sequencing nodes by taking a subject tree as a unit for cluster subscription, informing the cluster controller of a selection result by the administrator through broadcasting a sequencing node list according to a sequencing node selection algorithm, and starting a corresponding sequencing program by the selected cluster controller;
step S2: after the sequencing node is started successfully, the administrator issues tokens to the sequencing node in sequence according to the sequence of the token ring, and the sequencing node starts sequencing after receiving the tokens;
step S3: the method comprises the following steps that an administrator issues an initial value of a serial number, a target sequencing node returns a termination value of the serial number according to the number of messages in a cluster, the administrator formally issues a token to the sequencing node after receiving the termination value of the serial number, the sequencing node formally orders the messages and informs the serial number of the messages in a broadcasting mode after receiving the token, and the token is released after sequencing is completed;
step S4: after the sequencing node and the administrator cooperate to generate the serial number, the sequencing node corresponds the unique ID of the theme and the message serial number one by one and issues the unique ID;
step S5: determining whether a sequencing node crashes or not by sending messages for multiple times, and determining whether an administrator crashes or not by the sequencing node in a message timeout mode;
Step S6: caching the message in a hard disk file in a double-layer index mode when the cache node receives the subject message, and quickly searching the message in a double-layer index storage mode;
step S7: and judging whether the message is lost or not by comparing the received message with the subscription node after receiving the message sequence number, and inquiring the cache node according to the judgment result.
According to the above technical solution, in step S1, the sequencing node selected in units of the topic tree is a complete connected subgraph of all cluster nodes and a minimum connected subgraph of all publishing nodes and a minimum spanning tree of the publishing nodes are constructed through a topology based on the whole network, a connected subgraph of all publishing nodes of a certain topic tree in the whole network and a minimum spanning tree of the connected subgraph are calculated, and finally a node with a middle value of one in the obtained minimum spanning tree is deleted to obtain a minimum spanning tree of the publishing nodes, where a root node of the minimum spanning tree is a sequencing node of the topic tree.
According to the above technical solution, the step S2 further includes the following steps:
step S21: the administrator selects a proper sequencing node by taking the topic tree as a unit according to the topological structure of the whole network and the publishing node of each topic tree;
Step S22: the publisher publishes the message through the publishing node, and the sequencing node monitors the subject message simultaneously with the subscribing node when the publishing node publishes the message;
step S23: and the administrator forms the sequencing nodes into a token ring, sequentially issues tokens to the sequencing nodes according to the sequence of the token ring, and sequences the received messages by the nodes holding the tokens.
According to the above technical solution, the step S3 further includes the following steps:
step S31: before receiving and forwarding messages issued by a user, an issuing node WSN layer generates a unique ID for each message to distinguish each message, encapsulates the unique ID into the message, and forwards the message and the unique ID together;
step S32: the sequencing node and the administrator cooperate to generate a global sequence number for the message, and the sequencing node issues the generated sequence number;
step S33: the administrator issues an initial serial number m of the serial numbers, the sequencing node calculates the required serial number a according to the number of the messages in the current node after receiving the initial serial number, and returns a termination serial number m + a;
step S34: and the administrator receives the termination serial number and then issues the token, the sequencing node receives the token and then distributes the serial number for the messages in the node and issues the messages, and the administrator returns the token after the sequencing is finished.
According to the above technical solution, the step S5 further includes the following steps:
step S51: the sequencing node enters a token waiting state, does not receive any message of an administrator within a specified time, determines that the administrator crashes, enters the administrator reselection and initiatively initiates election, sends a voting application to other nodes, casts a vote of the sequencing node, and waits for the reply of other nodes;
step S52: when the current node wins election, the current node becomes a new administrator, the message between the nodes is immediately issued, a sequence number synchronization request is sent to the nodes, and the current sequence number is synchronized.
According to the above technical solution, the step S7 further includes the following steps:
step S71: when the user does not receive the message and the message sequence number, a missing message and a missing message sequence number request are sent to the WSN through a message interface;
step S72: the WSN determines a cluster and a publishing group where a publisher is located according to the message ID, acquires a cache node caching the message, sends a query request by using the cache node closest to the publisher, determines a sequencing node according to the topic of the message and sends the query request through the sequencing node aiming at the missing message serial number request;
step S73: the cache node locks the missing message through the double-layer index according to the received query request and the theme sequence number, the sequencing node searches the sequence number according to the ID of the theme after receiving the query request, the query result is returned to the WSN, and the WSN feeds the result back to the user.
Compared with the prior art, the invention has the following beneficial effects: the invention realizes a sequencing node selection algorithm by taking a theme tree as a unit to select sequencing nodes, realizes the cooperative sequencing with the sequencing nodes in a mode of sequencing and synchronizing serial numbers after sequencing by driving sequencing through an administrator token, increases the management of sequencing node crash, the management of administrator crash and the reselection algorithm of the administrator after the administrator crash to process the problem of node crash in a network, realizes the quick search of messages by a double-layer index mode by utilizing a cache node selection algorithm, and feeds back according to the search result.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a schematic diagram of the system module composition 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 drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Referring to fig. 1, the present invention provides a technical solution: the common-recognition mechanism query system based on the Internet comprises a layered clustering framework module, a distributed message sequencing module and a message multi-backup cache module, wherein the layered clustering framework module is used for dividing the whole network environment into a plurality of clusters by adopting a layered clustering framework mode, the distributed message sequencing module is used for defining sequencing nodes on a cluster controller by utilizing a distributed message communication network, the message multi-backup cache module is used for performing multi-backup caching on messages by utilizing a message forwarding path, the layered clustering framework module is electrically connected with the distributed message sequencing module, the distributed message sequencing module is electrically connected with the message multi-backup cache module, the layered clustering framework mode is adopted for dividing the whole network environment into the plurality of clusters, and the four layers are divided from top to bottom: the system comprises an administrator, a cluster controller, a physical device and a WSN layer.
The layered clustering framework module comprises an administrator module, a cluster control unit, a physical device and a WSN module, wherein an administrator in the administrator module is a special controller and has a controller function and a whole network management function, the cluster control unit is used for bearing the processing of issuing subscription transactions in a cluster and has the functions of topology management, route management, flow table management and the like of physical environment processing, the physical device in the physical device and the physical device in the WSN module mainly comprise an SDN switch and is used for forwarding messages according to forwarding rules issued by the cluster controller, the WSN layer is responsible for directly interacting with users to realize forwarding of the messages, the administrator module is connected with the cluster control unit through a network, and the cluster control unit is connected with the physical device and the WSN module through a network.
The distributed message sequencing module comprises a sequencing node module, a collaborative sequencing management module, a crash management module and a unique message ID generation module, wherein the sequencing node module is used for calculating a root node of a minimum spanning tree according to a topological structure of the system, the collaborative sequencing management module is used for a manager to form a token ring from the sequencing nodes to coordinate with the node holding a token to sequence received messages, the crash management module is used for carrying out state transfer processing when the nodes and the manager crash, the unique message ID generation module is used for generating a unique ID for the messages after receiving the issuing messages by utilizing a WSN layer of the issuing nodes, the sequencing node module is electrically connected with the collaborative sequencing management module, and the crash management module is electrically connected with the unique message ID generation module;
the sequencing node module comprises a node selection submodule, a missing message query submodule and an administrator function submodule, wherein the node selection submodule is used for an administrator to select a proper sequencing node according to the topological structure of the whole network and the publishing node of each topic tree, the missing message query submodule is used for querying missing messages to a system when a user does not receive the messages and does not receive message serial numbers, the administrator function submodule is used for packaging some functions of the administrator into interfaces and exposing the interfaces to the user, the user calls the functions of the administrator through the interfaces, the node selection submodule is electrically connected with the missing message query submodule, and the missing message query submodule is electrically connected with the administrator function submodule;
The crash management module comprises a node crash management submodule and an administrator crash management submodule, wherein the node crash management submodule is used for updating the state of the current sequence number into a termination sequence number after the administrator receives the termination sequence number of the sequencing node, the administrator crash management submodule is used for ensuring the orderliness of the message by using the state transfer of the sequencing node under the condition that the administrator crashes at any time and recovering the sequencing function, and the node crash management submodule is electrically connected with the administrator crash management submodule.
The message multi-backup caching module comprises a multi-point caching module, a caching node selection module and a double-layer index module, wherein the multi-point caching module is used for setting message multi-backup to ensure that other backup nodes can provide message query service when a network edge caching node fails, the caching node selection module is used for acquiring all clusters on a message forwarding path of a publishing group and performing sequencing selection, the double-layer index module is used for realizing quick search when a subscriber searches for missing messages in a double-layer index mode, the multi-point caching module is electrically connected with the caching node selection module, and the caching node selection module is electrically connected with the double-layer index module.
The consensus mechanism query method mainly comprises the following steps:
Step S1: starting an administrator and a cluster controller, selecting sequencing nodes by taking a theme tree as a unit for cluster subscription, informing the cluster controller of a selection result by broadcasting a sequencing node list according to a sequencing node selection algorithm by the administrator, starting a corresponding sequencing program by the selected cluster controller, mainly taking charge of token management, sequence number synchronization and sequencing node crash management by the administrator, selecting a proper sequencing node according to the sequencing node selection algorithm by the administrator, broadcasting the selection, finishing the function initialization of the sequencing node by the selected node, forming a token ring by the administrator node, issuing token synchronization sequence numbers to the sequencing nodes in sequence according to the sequence of the token ring, and discovering and processing in time when the sequencing node crashes;
step S2: after the sequencing node is successfully started, an administrator sequentially issues tokens to the sequencing node according to the sequence of the token ring, the sequencing node starts sequencing after receiving the tokens, the sequencing node is mainly responsible for distributed sequencing and administrator crash management, when the cluster controller is selected as the sequencing node, the cluster controller firstly realizes the initialization of the function of the sequencing node and returns a message of successful starting, and after the sequencing node is successfully established, the cluster controller cooperates with the administrator to finish the distributed sequencing work;
Step S3: the method comprises the following steps that an administrator issues an initial value of a serial number, a target sequencing node returns a termination value of the serial number according to the number of messages in a cluster, the administrator formally issues a token to the sequencing node after receiving the termination value of the serial number, the sequencing node formally orders the messages and informs the serial number of the messages in a broadcasting mode after receiving the token, and the token is released after sequencing is completed;
step S4: after the sequencing node and the administrator cooperate to generate the sequence number, the sequencing node corresponds the unique ID of the theme and the message sequence number one by one and issues the unique ID of the theme, so that a subscriber can receive the sequence number corresponding to the theme message after receiving the theme message;
step S5: determining whether a sequencing node crashes or not by sending messages for multiple times, determining whether an administrator crashes or not by the sequencing node in a message overtime mode, wherein in a real network environment, the administrator of the node and the management node can crash at any time, handling the condition that the sequencing node and the administrator crash or not by sequencing node crash management and administrator crash management, confirming that the sequencing node crashes after sending messages for multiple times and not receiving replies, confirming that the administrator guarantees the normal operation of message sequencing by freezing a token and reselecting a new sequencing node mode after the node crashes, confirming that the administrator crashes when not receiving the administrator messages for overtime, and selecting the normal operation of the message sequencing function by the new administrator by the sequencing node after the administrator crashes and other sequencing nodes;
Step S6: caching the message in a hard disk file in a double-layer index mode when the cache node receives the subject message, and quickly searching the message in a double-layer index storage mode;
step S7: and judging whether the message is lost or not by comparing the received message with the subscription node after receiving the message sequence number, and inquiring the cache node according to the judgment result.
In step S1, the sequencing node selected in units of the topic tree is a complete connected subgraph of all cluster nodes and a minimum connected subgraph of all publishing nodes and a minimum spanning tree of the publishing nodes are constructed based on a topology structure of the whole network, the connected subgraph of all publishing nodes of a certain topic tree in the whole network and the minimum spanning tree of the connected subgraph are calculated, and finally, a node with a middle degree of one in the obtained minimum spanning tree is deleted to obtain the minimum spanning tree of the publishing nodes, wherein a root node of the minimum spanning tree is the sequencing node of the topic tree.
Step S2 further includes the steps of:
step S21: an administrator selects a proper sequencing node by taking a topic tree as a unit according to the topological structure of the whole network and the publishing node of each topic tree, the sequence of the message refers to the sequence of the message reaching the sequencing node, the sender of the message is the publisher of the topic, the distance between the sequencing node and each publishing node is the same or the distance difference is the minimum aiming at a certain topic tree, the input of the algorithm is the topological structure of the whole network and the publishing node of each topic tree, one node is output as the sequencing node through calculation, the node is taken as the root, the publishing node is taken as a child node, a minimum spanning tree is constructed, and the spanning tree is composed of the sequencing node, the publishing node and an intermediate node;
Step S22: the publisher publishes the message through the publishing node, and the sequencing node monitors the subject message simultaneously with the subscribing node when the publishing node publishes the message;
step S23: the administrator forms the sequencing nodes into a token ring, the tokens are sequentially issued to the sequencing nodes according to the sequence of the token ring, the nodes holding the tokens sequence the received messages, the cluster controller receives a sequencing node list of the administrator and the current cluster is in the list, the current cluster is indicated to be selected as the sequencing node, at the moment, the sequencing node starts a sequencing thread and replies a message of successful start to the administrator.
Step S3 further includes the steps of:
step S31: before receiving and forwarding messages issued by a user, the WSN layer of the issuing node generates a unique ID for each message to distinguish each message, encapsulates the unique ID into the message, and forwards the message and the unique ID together to realize the correspondence between the message and the serial number;
step S32: the sequencing node cooperates with an administrator to generate a global sequence number for the message, and the sequencing node issues the generated sequence number;
step S33: the administrator issues an initial serial number m of the serial numbers, the sequencing node calculates the required serial number a according to the number of the messages in the current node after receiving the initial serial number, and returns a termination serial number m + a;
Step S34: and the administrator receives the termination serial number and then issues the token, the sequencing node receives the token and then distributes the serial number for the messages in the node and issues the messages, and the administrator returns the token after the sequencing is finished.
Step S5 further includes the steps of:
step S51: when the administrator crashes, the system cannot normally run, and a new administrator needs to be selected again among the sequencing nodes to ensure the normal running of the system;
step S52: when the current node wins election, the current node becomes a new administrator, the message between the nodes is immediately issued, a sequence number synchronization request is sent to the nodes, and the current sequence number is synchronized.
Step S7 further includes the steps of:
step S71: when the user does not receive the message and the message sequence number, a missing message and a missing message sequence number request are sent to the WSN through a message interface;
step S72: the WSN determines a cluster and a publishing group where a publisher is located according to the message ID, acquires a cache node caching the message, sends a query request by using the cache node closest to the publisher, determines a sequencing node according to the topic of the message and sends the query request through the sequencing node aiming at the missing message serial number request;
Step S73: the cache node locks the missing message through the double-layer index according to the received query request and the theme sequence number, the sequencing node searches the sequence number according to the ID of the theme after receiving the query request, the query result is returned to the WSN, and the WSN feeds the result back to the user.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. The consensus mechanism inquiry system based on the internet comprises a layered clustering framework module, a distributed message sequencing module and a message multi-backup cache module, and is characterized in that: the hierarchical clustering framework module is used for dividing the whole network environment into a plurality of clusters by adopting a hierarchical clustering framework mode, the distributed message sequencing module is used for defining sequencing nodes on a cluster controller by utilizing a distributed message communication network, the message multi-backup cache module is used for performing multi-backup caching of messages by utilizing a message forwarding path, the hierarchical clustering framework module is electrically connected with the distributed message sequencing module, and the distributed message sequencing module is electrically connected with the message multi-backup cache module.
2. The internet-based consensus query system of claim 1, wherein: the hierarchical clustering framework module comprises an administrator module, a cluster control unit, physical equipment and a WSN (wireless sensor network) module, wherein an administrator in the administrator module is a special controller and has a controller function and an entire network management function, the cluster control unit is used for undertaking processing of issuing subscription transactions in a cluster and has functions of topology management, routing management, flow table management and the like of physical environment processing, the physical equipment in the physical equipment and the WSN module mainly comprises an SDN (software defined network) switch and is used for forwarding messages according to forwarding rules issued by the cluster controller, a WSN (wireless sensor network) layer is responsible for directly interacting with a user to realize forwarding of the messages, the administrator module is in network connection with the cluster control unit, and the cluster control unit is in network connection with the physical equipment and the WSN module.
3. The internet-based consensus query system of claim 2, wherein: the distributed message sequencing module comprises a sequencing node module, a collaborative sequencing management module, a crash management module and a unique message ID generation module, wherein the sequencing node module is used for calculating a root node of a minimum spanning tree according to a topological structure of a system, the collaborative sequencing management module is used for sequencing a node which forms a token ring with sequencing nodes and collaboratively holds a token by an administrator, the crash management module is used for carrying out state transfer processing when the node and the administrator crash, the unique message ID generation module is used for generating a unique ID for a message after receiving an issuing message by utilizing a WSN layer of the issuing node, the sequencing node module is electrically connected with the collaborative sequencing management module, and the crash management module is electrically connected with the unique message ID generation module;
the sequencing node module comprises a node selection submodule, a missing message query submodule and an administrator function submodule, wherein the node selection submodule is used for an administrator to select a proper sequencing node according to the topological structure of the whole network and the publishing node of each topic tree, the missing message query submodule is used for querying missing messages to a system when a user does not receive the messages and does not receive message serial numbers, the administrator function submodule is used for packaging some functions of the administrator as interfaces and exposing the interfaces to the user, the user calls the functions of the administrator through the interfaces, the node selection submodule is electrically connected with the missing message query submodule, and the missing message query submodule is electrically connected with the administrator function submodule;
The crash management module comprises a node crash management submodule and an administrator crash management submodule, wherein the node crash management submodule is used for updating the current sequence number state to a termination sequence number after the administrator receives the termination sequence number of the sequencing node, the administrator crash management submodule is used for ensuring the orderliness of the messages by using the state transfer of the sequencing node under the condition that the administrator crashes at any time and recovering the sequencing function, and the node crash management submodule is electrically connected with the administrator crash management submodule.
4. The internet-based consensus query system of claim 3, wherein: the message multi-backup cache module comprises a multi-point cache module, a cache node selection module and a double-layer index module, wherein the multi-point cache module is used for setting message multi-backup to ensure that other backup nodes can provide message query service when a network edge cache node fails, the cache node selection module is used for acquiring all clusters on a message forwarding path of a publishing group and performing sequencing selection, the double-layer index module is used for realizing quick search when a subscriber searches for missing messages in a double-layer index mode, the multi-point cache module is electrically connected with the cache node selection module, and the cache node selection module is electrically connected with the double-layer index module.
5. The internet-based consensus query system of claim 4, wherein: the consensus mechanism query method mainly comprises the following steps:
step S1: starting an administrator and a cluster controller, selecting sequencing nodes by taking a subject tree as a unit for cluster subscription, informing the cluster controller of a selection result by the administrator through broadcasting a sequencing node list according to a sequencing node selection algorithm, and starting a corresponding sequencing program by the selected cluster controller;
step S2: after the sequencing node is started successfully, the administrator issues tokens to the sequencing node in sequence according to the sequence of the token ring, and the sequencing node starts sequencing after receiving the tokens;
step S3: the method comprises the following steps that an administrator issues an initial value of a serial number, a target sequencing node returns a termination value of the serial number according to the number of messages in a cluster, the administrator formally issues a token to the sequencing node after receiving the termination value of the serial number, the sequencing node formally orders the messages and informs the serial number of the messages in a broadcasting mode after receiving the token, and the token is released after sequencing is completed;
step S4: after the sequencing node and the administrator cooperate to generate the serial number, the sequencing node corresponds the unique ID of the theme and the message serial number one by one and issues the unique ID;
Step S5: determining whether a sequencing node crashes or not by sending messages for multiple times, and determining whether an administrator crashes or not by the sequencing node in a message timeout mode;
step S6: caching the message in a hard disk file in a double-layer index mode when the cache node receives the subject message, and quickly searching the message in a double-layer index storage mode;
step S7: and judging whether the message is lost or not by comparing the received message with the subscription node after receiving the message sequence number, and inquiring the cache node according to the judgment result.
6. The internet-based consensus query system of claim 5, wherein: in step S1, the sequencing node selected in units of the topic tree is a complete connected subgraph of all cluster nodes and a minimum connected subgraph of all publishing nodes and a minimum spanning tree of the publishing nodes are constructed through a topology structure based on the whole network, the connected subgraph of all publishing nodes of a certain topic tree in the whole network and the minimum spanning tree of the connected subgraph are calculated, and finally, a node with a middle value of one in the obtained minimum spanning tree is deleted to obtain the minimum spanning tree of the publishing nodes, where a root node of the minimum spanning tree is the sequencing node of the topic tree.
7. The internet-based consensus query system of claim 6, wherein: the step S2 further includes the steps of:
step S21: the administrator selects a proper sequencing node by taking the topic tree as a unit according to the topological structure of the whole network and the publishing node of each topic tree;
step S22: the publisher publishes the message through the publishing node, and the sequencing node monitors the subject message simultaneously with the subscribing node when the publishing node publishes the message;
step S23: and the administrator forms the sequencing nodes into a token ring, sequentially issues tokens to the sequencing nodes according to the sequence of the token ring, and sequences the received messages by the nodes holding the tokens.
8. The internet-based consensus query system of claim 7, wherein: the step S3 further includes the steps of:
step S31: before receiving and forwarding messages issued by a user, an issuing node WSN layer generates a unique ID for each message to distinguish each message, encapsulates the unique ID into the message, and forwards the message and the unique ID together;
step S32: the sequencing node and the administrator cooperate to generate a global sequence number for the message, and the sequencing node issues the generated sequence number;
Step S33: the administrator issues an initial serial number m of the serial numbers, the sequencing node calculates the required serial number a according to the number of the messages in the current node after receiving the initial serial number, and returns a termination serial number m + a;
step S34: and the administrator receives the termination serial number and then issues the token, the sequencing node receives the token and then distributes the serial number for the messages in the node and issues the messages, and the administrator returns the token after the sequencing is finished.
9. The internet-based consensus query system of claim 8, wherein: the step S5 further includes the steps of:
step S51: the sequencing node enters a token waiting state, does not receive any message of an administrator within a specified time, determines that the administrator crashes, enters the administrator reselection and initiatively initiates election, sends a voting application to other nodes, casts a vote of the sequencing node, and waits for the reply of other nodes;
step S52: when the current node wins election, the current node becomes a new administrator, the message between the nodes is immediately issued, a sequence number synchronization request is sent to the nodes, and the current sequence number is synchronized.
10. The internet-based consensus query system of claim 9, wherein: the step S7 further includes the steps of:
Step S71: when the user does not receive the message and the message sequence number, a missing message and a missing message sequence number request are sent to the WSN through a message interface;
step S72: the WSN determines a cluster and a publishing group where a publisher is located according to the message ID, acquires a cache node caching the message, sends a query request by using the cache node closest to the publisher, determines a sequencing node according to the topic of the message and sends the query request through the sequencing node aiming at the missing message serial number request;
step S73: the cache node locks the missing message through the double-layer index according to the received query request and the theme sequence number, the sequencing node searches the sequence number according to the ID of the theme after receiving the query request, the query result is returned to the WSN, and the WSN feeds the result back to the user.
CN202210344499.2A 2022-03-31 2022-03-31 Consensus mechanism query system based on Internet Pending CN114844909A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210344499.2A CN114844909A (en) 2022-03-31 2022-03-31 Consensus mechanism query system based on Internet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210344499.2A CN114844909A (en) 2022-03-31 2022-03-31 Consensus mechanism query system based on Internet

Publications (1)

Publication Number Publication Date
CN114844909A true CN114844909A (en) 2022-08-02

Family

ID=82563305

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210344499.2A Pending CN114844909A (en) 2022-03-31 2022-03-31 Consensus mechanism query system based on Internet

Country Status (1)

Country Link
CN (1) CN114844909A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106995A1 (en) * 2004-11-16 2006-05-18 International Business Machines Corporation Methods to maintain triangle ordering of coherence messages
US20100131554A1 (en) * 2008-11-26 2010-05-27 Yahoo! Inc. System and method for publishing messages asynchronously in a distributed database
CN103647668A (en) * 2013-12-16 2014-03-19 上海证券交易所 Host group decision system in high availability cluster and switching method for host group decision system
US20170099323A1 (en) * 2015-10-01 2017-04-06 Avaya Inc. High availability take over for in-dialog communication sessions
CN111669427A (en) * 2020-04-20 2020-09-15 北京邮电大学 Software defined network publishing and subscribing system and method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106995A1 (en) * 2004-11-16 2006-05-18 International Business Machines Corporation Methods to maintain triangle ordering of coherence messages
US20100131554A1 (en) * 2008-11-26 2010-05-27 Yahoo! Inc. System and method for publishing messages asynchronously in a distributed database
CN103647668A (en) * 2013-12-16 2014-03-19 上海证券交易所 Host group decision system in high availability cluster and switching method for host group decision system
US20170099323A1 (en) * 2015-10-01 2017-04-06 Avaya Inc. High availability take over for in-dialog communication sessions
CN111669427A (en) * 2020-04-20 2020-09-15 北京邮电大学 Software defined network publishing and subscribing system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
唐璐璐: "具有共识机制的SDN发布订阅系统的设计与研究", 中国优秀硕士学位论文全文数据库 信息科技辑, no. 05, pages 139 - 234 *

Similar Documents

Publication Publication Date Title
JP6382454B2 (en) Distributed storage and replication system and method
JP5798644B2 (en) Consistency within the federation infrastructure
CN109729111B (en) Method, apparatus and computer program product for managing distributed systems
US6847993B1 (en) Method, system and program products for managing cluster configurations
US6725261B1 (en) Method, system and program products for automatically configuring clusters of a computing environment
US6801937B1 (en) Method, system and program products for defining nodes to a cluster
CN101102250B (en) Distributed hashing mechanism for self-organizing networks
US7756924B2 (en) Peer communities
US6925490B1 (en) Method, system and program products for controlling system traffic of a clustered computing environment
JP2008533564A (en) Method and apparatus for data management
WO2012071920A1 (en) Method, system, token conreoller and memory database for implementing distribute-type main memory database system
US11729133B2 (en) Software defined network publish-subscribe system and method
US6807557B1 (en) Method, system and program products for providing clusters of a computing environment
CN101128827A (en) Method and apparatus for distributed data management in a switching network
JP4459999B2 (en) Non-stop service system using voting and information updating and providing method in the system
CN110417882B (en) Method and device for determining main node and storage medium
EP2025133B1 (en) Repository synchronization in a ranked repository cluster
CN114844909A (en) Consensus mechanism query system based on Internet
CN113055461B (en) ZooKeeper-based unmanned cluster distributed cooperative command control method
CN112000885B (en) List service system, list generation method, server and storage medium
Vieira et al. Seamless paxos coordinators
CN113254159B (en) Migration method and device of stateful service, computer equipment and storage medium
CN117667963A (en) Method for generating global unique incremental order serial numbers in distributed cluster system
Hogqvist et al. Towards Explicit Data Placement in Scalable Key/Value Stores
JP2005004474A (en) Method for constructing information storage system for distributed management of defined information element

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