CN114679472A - Communication system, method, apparatus, storage medium, and electronic device - Google Patents

Communication system, method, apparatus, storage medium, and electronic device Download PDF

Info

Publication number
CN114679472A
CN114679472A CN202210195787.6A CN202210195787A CN114679472A CN 114679472 A CN114679472 A CN 114679472A CN 202210195787 A CN202210195787 A CN 202210195787A CN 114679472 A CN114679472 A CN 114679472A
Authority
CN
China
Prior art keywords
message
theme
intelligent contract
target
block chain
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
CN202210195787.6A
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.)
Cloudminds Shanghai Robotics Co Ltd
Original Assignee
Cloudminds Shanghai Robotics 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 Cloudminds Shanghai Robotics Co Ltd filed Critical Cloudminds Shanghai Robotics Co Ltd
Priority to CN202210195787.6A priority Critical patent/CN114679472A/en
Publication of CN114679472A publication Critical patent/CN114679472A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present disclosure relates to a communication system, a method, a device, a storage medium and an electronic device, wherein the system comprises a message broker and a plurality of blockchain nodes in a blockchain network, wherein the message broker maintains an association relationship between a message topic and a subscription end of the message topic, and the plurality of blockchain nodes are deployed with a message intelligent contract; the plurality of block chain nodes are used for responding to a storage request of a first message of a message sending end, and storing the first message into a block chain of the block chain network through a deployed message intelligent contract; the message agent end is used for monitoring the data in the block chain; and under the condition that the newly added message in the block chain is monitored, determining a message receiving end according to the message theme of the newly added message and the incidence relation between the message theme and the subscription end of the message theme, and sending the newly added message to the message receiving end.

Description

Communication system, method, apparatus, storage medium, and electronic device
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a communication system, a method, an apparatus, a storage medium, and an electronic device.
Background
Middleware is a broad class of basic software that spans between operating systems and applications. The message middleware is a middleware technology oriented to message transmission requirements, can utilize an efficient and reliable message transfer mechanism to carry out platform-independent data communication, integrates a distributed system based on data communication, and provides efficient and transparent communication service for a distributed application system.
But in a related scenario, message middleware may also fail. In this case, the applications and systems associated therewith are also susceptible.
Disclosure of Invention
An object of the present disclosure is to provide a communication system, method, apparatus, storage medium and electronic device, so as to solve the above related technical problems.
In order to achieve the above object, according to a first aspect of the embodiments of the present disclosure, a communication system is provided, which includes a message broker and a plurality of blockchain nodes in a blockchain network, where the message broker maintains an association relationship between a message topic and a subscription end of the message topic, and the plurality of blockchain nodes are deployed with a message intelligent contract;
the plurality of block chain link points are used for responding to a storage request of a first message of a message sending end, and storing the first message into a block chain of the block chain network through a deployed message intelligent contract;
The message agent end is used for monitoring the data in the block chain; and under the condition that the newly added message in the block chain is monitored, determining a message receiving end according to the message theme of the newly added message and the incidence relation between the message theme and the subscription end of the message theme, and sending the newly added message to the message receiving end.
Optionally, the message broker is configured to, when receiving a message sent by a message sender, convert the received message into a first message adapted to a message protocol of the blockchain network, and send a save request including the first message to the plurality of blockchain nodes.
Optionally, the message sent by the message sending end is an encrypted message, and the encrypted message is obtained by encrypting the original message by the message sending end according to a private key of the message receiving end.
Optionally, the plurality of blockchain nodes are configured to store the first message into a blockchain of the blockchain network by:
acquiring a first message subject of the first message;
determining a first message intelligent contract with a message theme being a first message theme from a plurality of deployed message intelligent contracts according to the first message theme;
Saving the first message to the blockchain via the first message intelligence contract.
Optionally, the message agent is configured to, in a case that a message topic creation request of a message sender is received, send a message topic intelligent contract creation request to the plurality of block nodes, where the message topic intelligent contract creation request includes a second message topic that the message sender requests to create;
the plurality of block chain nodes are used for creating a target message intelligent contract corresponding to the second message subject or creating a target message intelligent contract instance corresponding to the second message subject under the condition that the message subject intelligent contract creation request is received.
Optionally, the message broker is configured to, when a target message intelligent contract is newly added in the blockchain, obtain a contract address of the target message intelligent contract, and maintain the contract address and a second message topic of the target message intelligent contract in a message topic list of the message broker; alternatively, the first and second electrodes may be,
and under the condition that a target message intelligent contract instance is newly added in the block chain, acquiring a contract address of the target message intelligent contract instance, and maintaining the contract address and a second message theme of the target message intelligent contract instance in a message theme list of the message agent.
Optionally, the message broker is configured to send a message topic list maintained by the message broker to a message receiving end when receiving a message topic query request from the message receiving end; when a subscription request of the message receiving terminal is received, updating the association relationship between the message theme maintained by the message receiving terminal and the subscription terminal of the message theme according to the subscription request;
the subscription request comprises a message topic to which the message receiving end subscribes.
According to a second aspect of the embodiments of the present disclosure, there is provided a communication method applied to a message broker in the communication system of any one of the first aspect, the method including:
acquiring newly generated block data in a block chain network;
under the condition that the block data comprises the newly added message, determining a message receiving end of the newly added message according to the association relationship between the message theme maintained by the message agent end and the subscription end of the message theme;
sending the newly added message to the message receiving end;
the method comprises the steps that a plurality of blockchain nodes in the communication system are used for storing a first message to a blockchain of a blockchain network through a deployed message intelligent contract when a storage request of the first message of a message sending end is received.
Optionally, the method comprises the following steps:
receiving a message sent by a message sending end;
converting the received message into a first message adapted to a message protocol of the blockchain network;
sending a save request comprising the first message to the plurality of block chain nodes.
Optionally, the message sent by the message sending end is an encrypted message, the encrypted message is obtained by encrypting an original message by the message sending end according to a private key of a message receiving end, and the converting the received message into a first message adapted to a message protocol of the blockchain network includes:
the received encrypted message is converted into a first message adapted to a message protocol of the blockchain network.
Optionally, the method comprises the following steps:
receiving a message theme establishing request of a message sending end, wherein the message theme establishing request comprises a second message theme which is required to be established by the message sending end;
sending message subject intelligent contract creation requests to the plurality of blockchain nodes to cause the plurality of blockchain nodes to create a target message intelligent contract corresponding to the second message subject or to create a target message intelligent contract instance corresponding to the second message subject;
Under the condition that a target message intelligent contract is newly added in the block chain, acquiring a contract address of the target message intelligent contract, and maintaining the contract address and a second message theme of the target message intelligent contract into a message theme list of the message agent end; or, in the case of monitoring that a target message intelligent contract instance is newly added in the blockchain, acquiring a contract address of the target message intelligent contract instance, and maintaining the contract address and a second message topic of the target message intelligent contract instance in a message topic list of the message agent.
Optionally, the method comprises the following steps:
receiving a message theme query request of a message receiving end;
sending the message subject list maintained by the message agent end to the message receiving end;
receiving a subscription request of the message receiving terminal, wherein the subscription request comprises a message theme to be subscribed by the message receiving terminal;
and updating the association relationship between the message theme maintained by the message receiving terminal and the subscribing terminal of the message theme according to the subscription request.
According to a third aspect of the embodiments of the present disclosure, there is provided a communication apparatus, which is applied to a message broker in the communication system according to any one of the first aspect, the apparatus including:
The first acquisition module is used for acquiring newly generated block data in the block chain network;
a first determining module, configured to determine, when the block data includes a newly added message, a message receiving end of the newly added message according to an association relationship between a message topic maintained by the message broker and a subscription end of the message topic;
the first sending module is used for sending the newly added message to the message receiving terminal;
the method comprises the steps that a plurality of blockchain nodes in the communication system are used for storing a first message to a blockchain of a blockchain network through a deployed message intelligent contract when a storage request of the first message of a message sending end is received.
Optionally, the apparatus comprises:
the first receiving module is used for receiving the message sent by the message sending end;
a message conversion module, configured to convert the received message into a first message adapted to a message protocol of the blockchain network;
a second sending module, configured to send a save request including the first message to the plurality of block nodes.
Optionally, the message sent by the message sending end is an encrypted message, the encrypted message is obtained by encrypting an original message by the message sending end according to a private key of a message receiving end, and the message conversion module is configured to:
The received encrypted message is converted into a first message adapted to a message protocol of the blockchain network.
Optionally, the apparatus comprises:
a second receiving module, configured to receive a message theme creation request of a message sending end, where the message theme creation request includes a second message theme requested to be created by the message sending end;
a third sending module, configured to send message topic intelligent contract creation requests to the plurality of block nodes, so that the plurality of block nodes create a target message intelligent contract corresponding to the second message topic or create a target message intelligent contract instance corresponding to the second message topic;
the first execution module is used for acquiring a contract address of a target message intelligent contract under the condition that a target message intelligent contract is newly added in the block chain is monitored, and maintaining the contract address and a second message theme of the target message intelligent contract in a message theme list of the message agent end; or, in the case of monitoring that a target message intelligent contract instance is newly added in the blockchain, acquiring a contract address of the target message intelligent contract instance, and maintaining the contract address and a second message topic of the target message intelligent contract instance in a message topic list of the message agent.
Optionally, the apparatus comprises:
the third receiving module is used for receiving the message theme inquiry request of the message receiving end;
a fourth sending module, configured to send the message topic list maintained by the message broker to the message receiving end;
a fourth receiving module, configured to receive a subscription request from the message receiving end, where the subscription request includes a message topic to be subscribed by the message receiving end;
and the updating module is used for updating the association relationship between the message theme maintained by the message receiving end and the subscription end of the message theme according to the subscription request.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any one of the above second aspects.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any of the second aspects above.
By adopting the technical scheme, a plurality of block chain nodes in the communication system can respond to a storage request of a first message aiming at a message sending end, and store the first message into a block chain of the block chain network through a deployed message intelligent contract. In addition, the message agent end in the communication system can acquire the message data stored by the plurality of block chain nodes by monitoring the change of the block chain data, and send the acquired message data to the message receiving end according to the incidence relation between the message theme and the subscription end of the message theme. In this way, the message broker and the plurality of blockchain nodes can implement the function of message middleware.
In addition, in the above technical solution, the message at the message sending end can be saved in the block chain through the message intelligent contract, i.e. it cannot be tampered and forged. Therefore, even if a fault occurs, the message stored in the block chain cannot be lost, and the reliability of message transmission is improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
fig. 1 is a block diagram of a communication system shown in an exemplary embodiment of the present disclosure.
Fig. 2 is a communication flow diagram illustrated in an exemplary embodiment of the present disclosure.
Fig. 3 is a flow chart illustrating a method of communication according to an exemplary embodiment of the present disclosure.
Fig. 4 is a flow chart illustrating a method of communication in an exemplary embodiment of the present disclosure.
Fig. 5 is a schematic diagram of a communication scenario shown in an exemplary embodiment of the present disclosure.
Fig. 6 is a schematic diagram of a communication scenario shown in an exemplary embodiment of the present disclosure.
Fig. 7 is a block diagram of a communication device shown in an exemplary embodiment of the present disclosure.
Fig. 8 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
Before introducing the communication system, method, apparatus, storage medium, and electronic device of the present disclosure, an application scenario of the present disclosure is first introduced.
The message middleware technology can utilize a message transmission mechanism to carry out data communication irrelevant to a platform, and has wide application prospect. In some scenarios, the message middleware is centrally deployed by various companies. In this case, the centralized message middleware may have a high risk of single point failure, and may have problems of data loss, data tampering, and the like, thereby causing the applications and systems associated with the message middleware to be affected.
To this end, the present disclosure provides a communication system. Fig. 1 is a block diagram of a communication system shown in the present disclosure, which may include a message broker and a plurality of blockchain nodes in a blockchain network with reference to fig. 1.
The message broker may be disposed in a computing device capable of interacting with the blockchain network, and the computing device may be a stationary or mobile computing device, such as a tablet computer, a desktop computer, or the like. The number of the message agent terminals can be one or more, and each message agent terminal maintains the association relationship between the message topic and the subscription terminal of the message topic.
And the plurality of block chain nodes are deployed with message intelligent contracts. Here, the plurality of block link points may include all nodes in the block chain network or include endorsement nodes of the message intelligence contract based on the type difference of the block chain network, which is not limited by the present disclosure.
In the communication system, the plurality of block chain nodes are used for responding to the received storage request of a first message of a message sending end, and storing the first message into a block chain of the block chain network through a deployed message intelligent contract.
As an example, the save request may be sent by the message broker. In this case, the message broker may be configured to, upon receiving the message sent by the message sender, convert the received message into a first message adapted to a message protocol of the blockchain network, and send a save request including the first message to the plurality of blockchain nodes. These save requests may be presented in the form of blockchain transactions.
It should be understood that the Message sending end may send a Message to the Message broker end by using Http (Hyper Text Transfer Protocol), STOMP (Streaming Text oriented Message Protocol), MQTT (Message Queuing remote sensing Transport Protocol), and the like, but the Message under these protocols may not adapt to the transmission requirement of the block chain. Therefore, the message agent end can convert the received message into the first message of the message protocol adapted to the block chain network under the condition of receiving the message sent by the message sending end, thereby adapting to various message types of the message sending end and meeting the requirements of different scenes. The message broker may then, for example, send a transaction to the message intelligent contract address, thereby saving the first message into the blockchain.
It should be noted that in some possible implementation scenarios, the message sender may also communicate directly with the plurality of block-level nodes. In this case, the message sending end may also generate a first message to be saved according to a message protocol of the block chain, and send a saving request including the first message to the plurality of block chain nodes.
In this way, the plurality of blockchain nodes may save the first message to a blockchain via a deployed message intelligence contract after receiving a save request. For example, the message intelligence contract may include a set message save template that may include fields for a message subject, a message sender, a message recipient, and so on. In this way, each tile link point may fill in the message saving template according to the first message, and save the resulting message into the tile chain.
Referring to fig. 1, a message broker in the communication system is configured to monitor data in the blockchain; and under the condition that the newly added message in the block chain is monitored, determining a message receiving end according to the message theme of the newly added message and the incidence relation between the message theme and the subscription end of the message theme, and sending the newly added message to the message receiving end.
For example, the message broker may listen to the tile data, and when a new tile is generated by the co-recognition of the tile chain network, the message broker may obtain the newly generated tile data. Thus, the message broker may determine whether the block includes a new message by looking up the message identifier, for example. Under the condition that the newly added message is determined to exist, the message theme of the newly added message can be obtained, so that the message receiving end is determined according to the incidence relation between the message theme and the subscription end of the message theme, and the newly added message is sent to the message receiving end.
By adopting the technical scheme, a plurality of block chain nodes in the communication system can respond to a storage request of a first message aiming at a message sending end, and store the first message into a block chain of the block chain network through a deployed message intelligent contract. In addition, the message agent end in the communication system can acquire the message data stored by the plurality of block chain nodes by monitoring the change of the block chain data, and send the acquired message data to the message receiving end according to the incidence relation between the message theme and the subscription end of the message theme. In this way, the message broker and the plurality of blockchain nodes can implement the function of message middleware.
In addition, in the above technical solution, the message at the message sending end can be saved in the block chain through the message intelligent contract, i.e. it cannot be tampered and forged. Therefore, even if a fault occurs, the message stored in the block chain cannot be lost, and the reliability of message transmission is improved.
It is worth mentioning that the message topic and the subscriber end of the message topic can be one-to-many. Therefore, in the case that multiple subscribers exist in the same message topic, the message broker may send the newly added message to the multiple subscribers.
In some scenarios, the message topic and the subscriber to the message topic may also be one-to-one. In this case, the message sent by the message sending end may be an encrypted message, and the encrypted message is obtained by encrypting the original message by the message sending end according to the private key of the message receiving end.
Illustratively, fig. 2 is a communication flow diagram illustrating the present disclosure, and referring to fig. 2, in step 1, a message receiving end may generate a public-private key pair.
In step 2, the message receiver may send (e.g., pass offline) the public key in the public-private key pair to the message sender.
In step 3, the message sending end can encrypt the original message to be sent through the public key to obtain an encrypted message under the condition of obtaining the public key. In this way, the message sending end can send the encrypted message to the message broker or the plurality of blockchain nodes, so as to store the encrypted message in the blockchain.
In step 4, since the message sending end subscribes to the message subject of the encrypted message, the message broker end can send the encrypted message to the message receiving end after monitoring the encrypted message in the block chain. In this way, the message receiving end can decrypt the encrypted message through the private key, thereby obtaining the original message.
By the mode, even if the message subject list of the message agent end is disclosed, other message receiving ends cannot obtain the content of the encrypted message, and therefore the point-to-point mode of the message middleware is achieved.
In addition, the message agent terminal can also provide various service interfaces, such as a published message topic; closing the message theme; subscribing to a message topic; canceling the subscription; acquiring a message subject list; sending a message; a message is received.
Taking the issue message topic as an example, the message sending end can create a new message topic by calling the issue message topic interface. In this case, the message agent is configured to, in a case that a message topic creation request of a message sender is received, send a message topic intelligent contract creation request to the plurality of block nodes, where the message topic intelligent contract creation request includes a second message topic requested to be created by the message sender;
the plurality of block link points are used for creating a target message intelligent contract corresponding to the second message subject under the condition that the message subject intelligent contract creation request is received.
That is, the plurality of blockchain nodes may contract to create a new target message intelligence contract upon receiving the message topic intelligence contract. For example, a pre-defined message intelligent contract template (which may include message subject name + message body) may be filled in according to the second message subject, and the transaction that created the target message intelligent contract may be sent in the blockchain network after filling in is completed, thereby completing creation of the target message intelligent contract. In this way, when the plurality of blockchain nodes receive the message about the second message subject, the message can be saved into a blockchain through the target message intelligence contract.
In some implementation scenarios, the plurality of block link points may also create a target message intelligent contract instance corresponding to the second message topic upon receiving the message topic intelligent contract creation request. Here, the target message intelligence contract instance may be obtained by running a deployed message intelligence contract. That is, in this case, the message transmission requirement of the new message topic can be satisfied by newly adding a contract instance.
After the target message intelligent contract or target message intelligent contract instance is created, information related to the target message intelligent contract or target message intelligent contract instance may be saved into the blockchain, which may include, for example, the contract name, the contract address, and so on.
The message agent side may be configured to, in a case that a target message intelligent contract is newly added in the blockchain, obtain a contract address of the target message intelligent contract, and maintain the contract address and a second message topic of the target message intelligent contract in a message topic list of the message agent side.
For example, the message topic list data may be stored in a key-value form, where the key is a "message topic name" and the value is an "address of a message intelligence contract corresponding to the message topic name". Following the example of the target message intelligence contract described above, the message broker may generate and maintain into the message topic list data "second message topic — address of the target message intelligence contract" in the event that it is determined that the newly generated block includes the target message intelligence contract.
In addition, the message agent end may also obtain a contract address of the target message intelligent contract instance when a target message intelligent contract instance is newly added in the block chain (for example, a block includes transaction data of "creating the target message intelligent contract instance", information of the created target message intelligent contract instance, and the like), and maintain the contract address and the second message topic of the target message intelligent contract instance in a message topic list of the message agent end, for which, the maintenance manner refers to the above example, which is not described in detail in this disclosure. In this way, the message agent can automatically monitor and maintain the newly-built message topic so as to facilitate the query of the message receiver.
The following is an exemplary description of the query and subscription process for message topics. The message receiver can query the created message subject list by calling a query interface of the message broker, for example. The message broker may be configured to send a message topic list maintained by the message broker to the message receiver when receiving a message topic query request from the message receiver.
In this way, the message receiving end can check whether the message topic list has the message topic to be subscribed. When there is a message topic to be subscribed, the message receiving end may send a subscription request to the message broker end, where the subscription request includes the message topic to be subscribed by the message receiving end.
After receiving the subscription request from the message receiving end, the message broker end may update the association relationship between the message topic maintained by the message receiving end and the subscribing end of the message topic according to the subscription request, thereby completing the subscription. When a message of the message topic subscribed by the message receiving end is newly added in the block chain, the message agent end can send the message to the message receiving end.
Still referring to fig. 1, since the plurality of blockchain nodes may be deployed with a variety of message intelligence contracts (or message intelligence contract instances) corresponding to different message topics, in one possible embodiment, the plurality of blockchain nodes are configured to store the first message into a blockchain of the blockchain network by:
acquiring a first message subject of the first message;
determining a first message intelligent contract with a message theme being a first message theme from a plurality of deployed message intelligent contracts according to the first message theme;
Saving the first message to the blockchain by the first message intelligence contract.
That is to say, the messages under the message subjects corresponding to the intelligent contracts can be saved through the intelligent contracts, so that the management and the maintenance are convenient.
Based on the same inventive concept, the disclosure also provides a communication method. The communication method can be applied to a message agent side in the communication system provided by the disclosure. Fig. 3 is a flow chart of a communication method illustrated by the present disclosure, with reference to fig. 3, the method comprising:
in step 31, newly generated tile data in the tile chain network is obtained;
in step 32, in the case that the block data includes the newly added message, determining a message receiving end of the newly added message according to an association relationship between a message topic maintained by the message broker and a subscription end of the message topic;
in step 33, the newly added message is sent to the message receiving end;
the method comprises the steps that a plurality of blockchain nodes in the communication system are used for storing a first message to a blockchain of a blockchain network through a deployed message intelligent contract when a storage request of the first message of a message sending end is received.
For example, the message broker may listen to the tile data, and when a new tile is generated by the blockchain network, the message broker may obtain the newly generated tile data. Thus, the message broker may determine whether the block includes a new message by looking up the message identifier, for example. And under the condition that the newly added message is determined to exist, the message theme of the newly added message can be obtained, so that a message receiving end is determined according to the incidence relation between the message theme and the subscription end of the message theme, and the newly added message is sent to the message receiving end.
By adopting the technical scheme, a plurality of block chain nodes in the communication system can respond to a storage request of a first message aiming at a message sending end, and store the first message into a block chain of the block chain network through a deployed message intelligent contract. In addition, the message agent end in the communication system can obtain the message data stored by the block chain nodes by monitoring the change of the block chain data, and send the obtained message data to the message receiving end according to the association relationship between the message topic and the subscription end of the message topic. In this way, the message broker and the plurality of blockchain nodes can implement the function of message middleware.
In addition, in the above technical solution, the message at the message sending end can be stored in the block chain through the message intelligent contract, that is, the message cannot be tampered and forged. Therefore, even if a fault occurs, the messages stored in the block chain cannot be lost, and the reliability of message transmission is improved.
It is worth mentioning that the message topic and the subscriber end of the message topic may be one-to-many. Therefore, under the condition that a plurality of subscribers exist in the same message topic, the message agent end can send the newly added message to the plurality of subscribers.
In some scenarios, the message topic and the subscribing end of the message topic may also be one-to-one. In this case, the message sent by the message sending end may be an encrypted message, where the encrypted message is obtained by the message sending end by encrypting the original message according to the private key of the message receiving end. The converting the received message into a first message adapted to a message protocol of the blockchain network includes:
the received encrypted message is converted into a first message adapted to a message protocol of the blockchain network.
For the sake of brevity, the present disclosure will not be described herein again. Through the encryption mode, even if the message topic list of the message agent end is disclosed, other message receiving ends can not obtain the content of the encrypted message, thereby realizing the point-to-point mode of the message middleware.
In one possible embodiment, the method further comprises:
receiving a message sent by a message sending end;
converting the received message into a first message adapted to a message protocol of the blockchain network;
sending a save request comprising the first message to the plurality of block chain nodes.
Wherein the save request may be presented in the form of a blockchain transaction. It should be understood that the message sending end may send the message to the message broker end by means of Http, STOMP, MQTT, etc., but the messages under these protocols may not adapt to the transmission requirement of the block chain. Therefore, the message broker may, upon receiving the message sent by the message sender, convert the received message into a first message adapted to a message protocol of the blockchain network, thereby adapting to various message types.
In addition, the message agent terminal can also provide various service interfaces, such as a published message topic; closing the message theme; subscribing to a message topic; canceling the subscription; acquiring a message subject list; sending a message; a message is received.
Taking the issue message topic as an example, the message sending end can create a new message topic by calling the issue message topic interface. In this case, referring to a flow chart of a communication method shown in fig. 4, the method further includes, on the basis of fig. 3:
And S34, receiving a message theme creating request of the message sender, wherein the message theme creating request comprises a second message theme which is requested to be created by the message sender.
S35, sending message topic intelligent contract creation requests to the plurality of block-linked points to cause the plurality of block-linked points to create a target message intelligent contract corresponding to a second message topic or to create a target message intelligent contract instance corresponding to the second message topic.
That is, the plurality of blockchain nodes may contract to create a new target message intelligence contract upon receiving the message topic intelligence contract. For example, a pre-defined message intelligent contract template (e.g., message subject name + message body) may be filled in based on the second message subject, and the transaction that created the target message intelligent contract may be sent after filling in is completed, thereby completing creation of the target message intelligent contract. In this way, when the plurality of blockchain nodes receive the message about the second message subject, the message can be saved into a blockchain through the target message intelligence contract.
In some implementation scenarios, the plurality of block link points may also create a target message intelligent contract instance corresponding to the second message topic upon receiving the message topic intelligent contract creation request. Here, the target message intelligence contract instance may be derived by running a deployed message intelligence contract. That is, in this case, the message transmission requirement of the new message topic can be satisfied by newly adding a contract instance.
After the target message intelligent contract or target message intelligent contract instance is created, information related to the target message intelligent contract or target message intelligent contract instance may be saved into the blockchain, which may include, for example, the contract name, the contract address, and so on.
S36, under the condition that a target message intelligent contract is newly added in the block chain, acquiring a contract address of the target message intelligent contract, and maintaining the contract address and a second message theme of the target message intelligent contract in a message theme list of the message agent end.
For example, the message subject list data may be stored in a key-value form, where the key is a "message subject name" and the value is an "address of the message intelligent contract corresponding to the message subject name". Following the example of the target message intelligence contract described above, the message broker may generate and maintain into the message topic list data "second message topic — address of the target message intelligence contract" in the event that it is determined that the newly generated block includes the target message intelligence contract.
S37, when the situation that the target message intelligent contract instance is newly added in the block chain is monitored, the contract address of the target message intelligent contract instance is obtained, and the contract address and the second message theme of the target message intelligent contract instance are maintained in the message theme list of the message agent end.
For example, the message agent may obtain a contract address of the target message intelligent contract instance when a target message intelligent contract instance is newly added in the block chain (for example, the block includes transaction data of "creating the target message intelligent contract instance", information of the created target message intelligent contract instance, and the like), and maintain the contract address and the second message topic of the target message intelligent contract instance in a message topic list of the message agent, for which, please refer to the above example, which is not described in detail in this disclosure. In this way, the message agent can automatically monitor and maintain the newly-built message topic so as to facilitate the query of the message receiver.
The following is an exemplary description of the query and subscription process for message topics. The message receiver can query the created message subject list by calling a query interface of the message broker, for example. The method further comprises the following steps:
receiving a message theme query request of a message receiving end;
sending a message subject list maintained by a message agent end to a message receiving end;
receiving a subscription request of a message receiving terminal, wherein the subscription request comprises a message theme to be subscribed by the message receiving terminal;
And updating the association relationship between the message topic maintained by the message receiving end and the subscribing end of the message topic according to the subscription request.
For example, referring to the schematic diagram of one communication scenario shown in fig. 5, in step 1, the robot management and control platform may send a message topic query request to the message broker, so as to obtain a message topic list maintained by the message broker.
Then, the robot management and control platform can check whether the message topics to be subscribed exist in the message topic list. When there is a message topic to be subscribed, the robot management and control platform may send a subscription request to the message broker, where the subscription request includes the message topic to be subscribed by the robot management and control platform. As an example, the message topic to be subscribed to may be "monitor robot behavior".
After receiving the subscription request of the message receiving end, the message broker end may update the association relationship between the message topic maintained by the message receiving end and the subscription end of the message topic according to the subscription request, thereby completing the subscription. In step 2, the various robots can acquire relevant operation data through the internet of things equipment carried by the robots, and send the acquired data to the message theme 'monitoring robot operation condition' through the message sending interface of the message agent. And because the robot management and control platform has subscribed the message theme, in step 3, the message agent end can send the data collected by the robot to the robot management and control platform, so that the management personnel can check and analyze the data conveniently.
Fig. 6 is a schematic diagram of a communication scenario shown in the present disclosure, and in step 1, the cleaning robot may send a message topic query request to the message broker to obtain a message topic list maintained by the message broker.
The cleaning robot can also check whether there is a message topic to be subscribed in the message topic list. When there is a message topic to be subscribed, the message receiving end may send a subscription request to the message broker end, where the subscription request includes the message topic to be subscribed by the cleaning robot. As an example, the message topic to be subscribed to may be "clean operation instruction".
After receiving the subscription request, the message broker may update the association relationship between the message topic maintained by the message receiving end and the subscription end of the message topic according to the subscription request, thereby completing the subscription. Thus, in step 2, the robot management and control platform may send a "cleaning operation instruction" message through the sending message interface. Since the cleaning robot has subscribed to the message topic, the message broker may send a "cleaning operation order" message to the cleaning robot in step 3. Thus, the cleaning robot can perform a cleaning task, and other robots do not receive a cleaning operation command.
Based on the same inventive concept, the disclosure also provides a communication device applied to the message agent side in the communication system provided by the disclosure. Fig. 7 is a block diagram of a communication device illustrated in the present disclosure, and referring to fig. 7, the device 700 includes:
a first obtaining module 701, configured to obtain newly generated tile data in a tile chain network;
a first determining module 702, configured to determine, when the block data includes a new message, a message receiving end of the new message according to an association relationship between a message topic maintained by the message broker and a subscription end of the message topic;
a first sending module 703, configured to send the newly added message to the message receiving end;
the method comprises the steps that a plurality of blockchain nodes in the communication system are used for storing a first message to a blockchain of a blockchain network through a deployed message intelligent contract when a storage request of the first message of a message sending end is received.
By adopting the technical scheme, a plurality of block chain nodes in the communication system can respond to a storage request of a first message aiming at a message sending end, and store the first message into a block chain of the block chain network through a deployed message intelligent contract. In addition, the message agent end in the communication system can acquire the message data stored by the plurality of block chain nodes by monitoring the change of the block chain data, and send the acquired message data to the message receiving end according to the incidence relation between the message theme and the subscription end of the message theme. In this way, the message broker and the plurality of blockchain nodes can implement the function of message middleware.
In addition, in the above technical solution, the message at the message sending end can be saved in the block chain through the message intelligent contract, i.e. it cannot be tampered and forged. Therefore, even if a fault occurs, the message stored in the block chain cannot be lost, and the reliability of message transmission is improved.
Optionally, the apparatus comprises:
the first receiving module is used for receiving the message sent by the message sending end;
a message conversion module, configured to convert the received message into a first message adapted to a message protocol of the blockchain network;
a second sending module, configured to send a save request including the first message to the plurality of block nodes.
Optionally, the message sent by the message sending end is an encrypted message, the encrypted message is obtained by encrypting an original message by the message sending end according to a private key of a message receiving end, and the message conversion module is configured to:
converting the received encrypted message into a first message adapted to a message protocol of the blockchain network.
Optionally, the apparatus comprises:
a second receiving module, configured to receive a message theme creation request of a message sending end, where the message theme creation request includes a second message theme requested to be created by the message sending end;
A third sending module, configured to send message topic intelligent contract creation requests to the plurality of block nodes, so that the plurality of block nodes create a target message intelligent contract corresponding to the second message topic or create a target message intelligent contract instance corresponding to the second message topic;
the first execution module is used for acquiring a contract address of a target message intelligent contract under the condition that the target message intelligent contract is newly added in the block chain, and maintaining the contract address and a second message theme of the target message intelligent contract into a message theme list of the message agent end; or, in the case of monitoring that a target message intelligent contract instance is newly added in the blockchain, acquiring a contract address of the target message intelligent contract instance, and maintaining the contract address and a second message topic of the target message intelligent contract instance in a message topic list of the message agent.
Optionally, the apparatus comprises:
a third receiving module, configured to receive a message topic query request from a message receiving end;
a fourth sending module, configured to send the message topic list maintained by the message broker to the message receiving end;
A fourth receiving module, configured to receive a subscription request from the message receiving end, where the subscription request includes a message topic to be subscribed by the message receiving end;
and the updating module is used for updating the association relationship between the message theme maintained by the message receiving end and the subscription end of the message theme according to the subscription request.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present disclosure also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the communication method provided by the present disclosure.
The present disclosure also provides an electronic device, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the communication method provided by the present disclosure.
Fig. 8 is a block diagram illustrating an electronic device 800 in accordance with an example embodiment. For example, the electronic device 800 may be provided as a server. Referring to fig. 8, an electronic device 800 includes a processor 822, which may be one or more in number, and a memory 832 for storing computer programs executable by the processor 822. The computer programs stored in memory 832 may include one or more modules that each correspond to a set of instructions. Further, the processor 822 may be configured to execute the computer program to perform the above-described communication method.
Additionally, the electronic device 800 may also include a power component 826 and a communication component 850, the power component 826 may be configured to perform power management of the electronic device 800, and the communication component 850 may be configured to enable communication, e.g., wired or wireless communication, of the electronic device 800. The electronic device 800 may also include an input/output (I/O) interface 858. The electronic device 800 may operate based on an operating system, such as Windows Server, stored in the memory 832TM,Mac OS XTM,UnixTM,LinuxTMAnd so on.
In another exemplary embodiment, a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the communication method described above is also provided. For example, the non-transitory computer readable storage medium may be the memory 832 including program instructions described above that are executable by the processor 822 of the electronic device 800 to perform the communication methods described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-mentioned communication method when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure, as long as it does not depart from the spirit of the present disclosure.

Claims (15)

1. A communication system is characterized by comprising a message agent end and a plurality of blockchain nodes in a blockchain network, wherein the message agent end maintains an incidence relation between a message theme and a subscription end of the message theme, and the plurality of blockchain nodes are deployed with a message intelligent contract;
the plurality of block chain nodes are used for responding to a storage request of a first message of a message sending end, and storing the first message into a block chain of the block chain network through a deployed message intelligent contract;
The message agent end is used for monitoring the data in the block chain; and under the condition that the newly added message in the block chain is monitored, determining a message receiving end according to the message theme of the newly added message and the incidence relation between the message theme and the subscription end of the message theme, and sending the newly added message to the message receiving end.
2. The communication system according to claim 1, wherein the message broker is configured to, upon receiving the message sent by the message sender, convert the received message into a first message adapted to a message protocol of the blockchain network, and send a save request including the first message to the plurality of blockchain nodes.
3. The communication system according to claim 2, wherein the message sent by the message sending end is an encrypted message, and the encrypted message is obtained by encrypting an original message by the message sending end according to a private key of a message receiving end.
4. The communication system of claim 1, wherein the plurality of blockchain nodes are configured to store the first message into a blockchain of the blockchain network by:
Acquiring a first message subject of the first message;
determining a first message intelligent contract with a message theme being a first message theme from a plurality of deployed message intelligent contracts according to the first message theme;
saving the first message to the blockchain via the first message intelligence contract.
5. The communication system of claim 1,
the message agent end is used for sending a message theme intelligent contract establishing request to the plurality of block chain nodes under the condition of receiving the message theme establishing request of a message sending end, wherein the message theme intelligent contract establishing request comprises a second message theme which is requested to be established by the message sending end;
the plurality of block chain nodes are used for creating a target message intelligent contract corresponding to the second message subject or creating a target message intelligent contract instance corresponding to the second message subject under the condition that the message subject intelligent contract creation request is received.
6. The communication system according to any of claims 1 to 5,
the message agent end is used for acquiring a contract address of a target message intelligent contract under the condition that a target message intelligent contract is newly added in the block chain is monitored, and maintaining the contract address and a second message theme of the target message intelligent contract into a message theme list of the message agent end; alternatively, the first and second electrodes may be,
And under the condition that a target message intelligent contract instance is newly added in the block chain, acquiring a contract address of the target message intelligent contract instance, and maintaining the contract address and a second message theme of the target message intelligent contract instance in a message theme list of the message agent.
7. The communication system of claim 6,
the message agent end is used for sending a message theme list maintained by the message agent end to a message receiving end under the condition of receiving a message theme inquiry request of the message receiving end; when a subscription request of the message receiving terminal is received, updating the association relationship between the message theme maintained by the message receiving terminal and the subscription terminal of the message theme according to the subscription request;
wherein, the subscription request includes the message topic to be subscribed by the message receiving terminal.
8. A communication method applied to a message broker in the communication system according to any one of claims 1 to 7, the method comprising:
acquiring newly generated block data in a block chain network;
under the condition that the block data comprises the newly added message, determining a message receiving end of the newly added message according to the association relationship between the message theme maintained by the message agent end and the subscription end of the message theme;
Sending the newly added message to the message receiving terminal;
the method comprises the steps that a plurality of blockchain nodes in the communication system are used for storing a first message to a blockchain of a blockchain network through a deployed message intelligent contract when a storage request of the first message of a message sending end is received.
9. The method of claim 8, comprising:
receiving a message sent by a message sending end;
converting the received message into a first message adapted to a message protocol of the blockchain network;
sending a save request including the first message to the plurality of block nodes.
10. The method according to claim 9, wherein the message sent by the message sender is an encrypted message, the encrypted message is obtained by encrypting an original message by the message sender according to a private key of a message receiver, and the converting the received message into a first message adapted to a message protocol of the blockchain network comprises:
the received encrypted message is converted into a first message adapted to a message protocol of the blockchain network.
11. The method of claim 8, comprising:
Receiving a message theme establishing request of a message sending end, wherein the message theme establishing request comprises a second message theme which is required to be established by the message sending end;
sending message subject intelligent contract creation requests to the plurality of blockchain nodes to cause the plurality of blockchain nodes to create a target message intelligent contract corresponding to the second message subject or to create a target message intelligent contract instance corresponding to the second message subject;
under the condition that a target message intelligent contract is newly added in the block chain, acquiring a contract address of the target message intelligent contract, and maintaining the contract address and a second message theme of the target message intelligent contract into a message theme list of the message agent end; or, in the case of monitoring that a target message intelligent contract instance is newly added in the blockchain, acquiring a contract address of the target message intelligent contract instance, and maintaining the contract address and a second message topic of the target message intelligent contract instance in a message topic list of the message agent.
12. The method of claim 11, comprising:
Receiving a message theme query request of a message receiving end;
sending the message subject list maintained by the message agent end to the message receiving end;
receiving a subscription request of the message receiving terminal, wherein the subscription request comprises a message theme to be subscribed by the message receiving terminal;
and updating the association relationship between the message theme maintained by the message receiving end and the subscription end of the message theme according to the subscription request.
13. A communication apparatus, applied to a message broker in the communication system according to any one of claims 1 to 7, the apparatus comprising:
the first acquisition module is used for acquiring newly generated block data in the block chain network;
a first determining module, configured to determine, when the block data includes a newly added message, a message receiving end of the newly added message according to an association relationship between a message topic maintained by the message broker and a subscription end of the message topic;
the first sending module is used for sending the newly added message to the message receiving terminal;
the method comprises the steps that a plurality of blockchain nodes in the communication system are used for storing a first message to a blockchain of a blockchain network through a deployed message intelligent contract when a storage request of the first message of a message sending end is received.
14. A non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 8 to 12.
15. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 8 to 12.
CN202210195787.6A 2022-03-01 2022-03-01 Communication system, method, apparatus, storage medium, and electronic device Pending CN114679472A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210195787.6A CN114679472A (en) 2022-03-01 2022-03-01 Communication system, method, apparatus, storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210195787.6A CN114679472A (en) 2022-03-01 2022-03-01 Communication system, method, apparatus, storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN114679472A true CN114679472A (en) 2022-06-28

Family

ID=82071765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210195787.6A Pending CN114679472A (en) 2022-03-01 2022-03-01 Communication system, method, apparatus, storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN114679472A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115665228A (en) * 2022-09-20 2023-01-31 蚂蚁区块链科技(上海)有限公司 Cross-node service discovery method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1953426A (en) * 2005-10-19 2007-04-25 国际商业机器公司 Publish/subscribe system and method for managing subscriptions
CN109756508A (en) * 2019-01-22 2019-05-14 深圳壹账通智能科技有限公司 Message Agent method and relevant device based on multi-protocols access block chain network
CN110071968A (en) * 2019-04-16 2019-07-30 深圳前海微众银行股份有限公司 A kind of message storage method and device based on block chain
CN111526047A (en) * 2020-04-15 2020-08-11 杭州溪塔科技有限公司 Block chain-based message queue design method and device
CN111711663A (en) * 2020-05-26 2020-09-25 北京金山云网络技术有限公司 Processing method and device for publishing and subscribing services and electronic equipment
WO2020207194A1 (en) * 2019-04-12 2020-10-15 深圳前海微众银行股份有限公司 Blockchain-based iot device changing method and apparatus
CN112560078A (en) * 2020-08-05 2021-03-26 北京京东振世信息技术有限公司 Block chain data processing method, device, equipment and medium
CN113254233A (en) * 2021-06-07 2021-08-13 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and readable storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1953426A (en) * 2005-10-19 2007-04-25 国际商业机器公司 Publish/subscribe system and method for managing subscriptions
CN109756508A (en) * 2019-01-22 2019-05-14 深圳壹账通智能科技有限公司 Message Agent method and relevant device based on multi-protocols access block chain network
WO2020207194A1 (en) * 2019-04-12 2020-10-15 深圳前海微众银行股份有限公司 Blockchain-based iot device changing method and apparatus
CN110071968A (en) * 2019-04-16 2019-07-30 深圳前海微众银行股份有限公司 A kind of message storage method and device based on block chain
CN111526047A (en) * 2020-04-15 2020-08-11 杭州溪塔科技有限公司 Block chain-based message queue design method and device
CN111711663A (en) * 2020-05-26 2020-09-25 北京金山云网络技术有限公司 Processing method and device for publishing and subscribing services and electronic equipment
CN112560078A (en) * 2020-08-05 2021-03-26 北京京东振世信息技术有限公司 Block chain data processing method, device, equipment and medium
CN113254233A (en) * 2021-06-07 2021-08-13 腾讯科技(深圳)有限公司 Data transmission method, device, equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
覃正,王新华,陈芊羽: "新教学", 上海大学出版社, pages: 137 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115665228A (en) * 2022-09-20 2023-01-31 蚂蚁区块链科技(上海)有限公司 Cross-node service discovery method and device

Similar Documents

Publication Publication Date Title
CN109246220B (en) Message pushing system and method
CN111371898B (en) Message monitoring method, device, equipment and storage medium
CN110109766B (en) Data interaction method and device based on cross-department and cross-platform data sharing exchange
US20170279688A1 (en) Method, device and system for providing device application software management service in internet of things
CN113162848B (en) Method, device, gateway and medium for realizing block chain gateway
CN112416396B (en) Application program updating method and system
CN113556359B (en) Communication protocol conversion method, device, system and gateway device
WO2015149531A1 (en) Internet of things terminal firmware management method, device and general service entity
CN112055078A (en) Data transmission method and device, computer equipment and storage medium
CN112630557A (en) Equipment state detection method, device, equipment and medium
WO2022213095A1 (en) Systems and methods for simulating control panel state and control panel responses
CN111857772A (en) Method and equipment for remote transmission and dynamic loading of terminal edge application program
CN114679472A (en) Communication system, method, apparatus, storage medium, and electronic device
CN105281940B (en) Method, equipment and system for HELLO message interaction based on NETCONF protocol
WO2024103943A1 (en) Service processing method and apparatus, storage medium, and device
CN115951923B (en) Subscription event management method, display system, device and storage medium
US10750356B2 (en) Configuration management method, apparatus, and system for terminal in internet of things
CN116915827A (en) Data transmission method and device of internet of things edge gateway, electronic equipment and medium
CN114900558B (en) Universal equipment management protocol control method and device
KR102398134B1 (en) Device troubleshooting service method, device, and system for internet of things
Narita et al. Reliable cloud-based robot services
CN109067861A (en) Communication means, device, equipment and medium based on Internet of Things
CN112491614B (en) Configuration information online automatic validation method and system for embedded equipment
CN113079055B (en) AGV operation data dynamic acquisition method and device
CN113254097A (en) Configuration information issuing method and device, electronic equipment and storage medium

Legal Events

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