CN112565173B - Method and apparatus for message processing - Google Patents

Method and apparatus for message processing Download PDF

Info

Publication number
CN112565173B
CN112565173B CN202010923724.9A CN202010923724A CN112565173B CN 112565173 B CN112565173 B CN 112565173B CN 202010923724 A CN202010923724 A CN 202010923724A CN 112565173 B CN112565173 B CN 112565173B
Authority
CN
China
Prior art keywords
message
instruction
peer node
issued
send
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010923724.9A
Other languages
Chinese (zh)
Other versions
CN112565173A (en
Inventor
王聪
杨文锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202010923724.9A priority Critical patent/CN112565173B/en
Publication of CN112565173A publication Critical patent/CN112565173A/en
Application granted granted Critical
Publication of CN112565173B publication Critical patent/CN112565173B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Abstract

The embodiment of the disclosure discloses a method and a device for message processing. One embodiment of the method comprises: receiving a message operation instruction; sending the message operation instruction to a peer node preset in a block chain constructed in advance; each peer node in the block chain corresponds to a user; and the message operation instruction is used for indicating the peer node to perform data interaction with the block chain. And sending the message operation instruction to the peer node in the block chain to indicate the peer node to perform data interaction with the block chain, so as to complete the processing action of the message, realize decentralized and distributed deployment of the message middleware platform, and improve the data security of the framework service.

Description

Method and apparatus for message processing
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to the field of information processing, and particularly relates to a method and a device for message processing.
Background
The message middleware is mainly used for decoupling the components, and by means of the message middleware, a sender of a message can publish the message to a message platform without knowing a message user, and meanwhile, a user can acquire the message from the message platform without knowing the message publisher.
Most message middleware platforms in the related art adopt centralized deployment, a message management system needs to be additionally deployed, and the functions of publishing, subscribing and the like of messages can be realized only by sending the messages to a core server.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for message processing.
In a first aspect, an embodiment of the present disclosure provides a method for message processing, where the method includes: receiving a message operation instruction; sending the message operation instruction to a peer node preset in a block chain constructed in advance; each peer node in the block chain corresponds to a user; and the message operation instruction is used for indicating the peer node to perform data interaction with the block chain.
In some embodiments, the message operation instruction comprises a message publishing instruction for instructing the peer node to send the message to be published to the blockchain; the message issuing instruction comprises a message to be issued, a channel identifier, a subject identifier and a message unique identifier, wherein the channel identifier is used for indicating the peer node to send the message to be issued to a channel corresponding to the channel identifier in the block chain; the topic identification is used for indicating the peer node to send the message to be issued to a topic corresponding to the topic identification in a channel corresponding to the channel identification; the message unique identification is used for representing the unique identity of the message to be issued in the block chain.
In some embodiments, the message operation instruction comprises a message query instruction for instructing the peer node to fetch and send a message matching the message query instruction from the blockchain.
In some embodiments, the message operation instructions include message subscription instructions that include subscription conditions for instructing the peer node to fetch and send messages from the blockchain that satisfy the subscription conditions.
In some embodiments, the method further comprises: if the message operation instruction is a message issuing instruction, extracting a message to be issued from the message issuing instruction, and storing the message to be issued to an issued message set; and in response to the fact that the to-be-issued message in the issued message set meets a preset condition, generating a cache message issuing instruction based on a preset strategy, and sending the cache message issuing instruction to the peer node to indicate the peer node to send the to-be-issued message included in the cache message issuing instruction to the block chain.
In some embodiments, the method further comprises: storing the received message sent by the peer node to a callback message set; and in response to receiving a preset callback instruction, executing the callback instruction on the messages of the callback message set.
In a second aspect, an embodiment of the present disclosure provides an apparatus for message processing, the apparatus including: an instruction receiving unit configured to receive a message operation instruction; the instruction sending unit is configured to send the message operation instruction to a peer node preset in a block chain constructed in advance; each peer node in the block chain corresponds to a user; and the message operation instruction is used for indicating the peer node to perform data interaction with the block chain.
In some embodiments, the instruction sending unit further comprises a message issuing module configured to send a message issuing instruction to the peer node to instruct the peer node to send the message to be issued to the block chain; the message issuing instruction comprises a message to be issued, a channel identifier, a subject identifier and a message unique identifier, wherein the channel identifier is used for indicating the peer node to send the message to be issued to a channel corresponding to the channel identifier in the block chain; the topic identification is used for indicating the peer node to send the message to be issued to a topic corresponding to the topic identification in a channel corresponding to the channel identification; the message unique identification is used for representing the unique identity of the message to be issued in the block chain.
In some embodiments, the instruction sending unit further comprises a message query module configured to send a message query instruction to the peer node to instruct the peer node to fetch and send a message matching the message query instruction from the blockchain.
In some embodiments, the instruction sending unit further includes a message subscription module configured to send a message subscription instruction to the peer node, where the message subscription instruction includes a subscription condition for instructing the peer node to acquire and send a message satisfying the subscription condition from the blockchain.
In some embodiments, the apparatus further comprises a message buffering unit configured to: if the message operation instruction is a message issuing instruction, extracting a message to be issued from the message issuing instruction, and storing the message to be issued to an issuing message set; and responding to the condition that the to-be-issued message of the issued message set meets the preset condition, generating a cache message issuing instruction based on a preset strategy, and sending the cache message issuing instruction to the peer node to indicate the peer node to send the to-be-issued message included in the cache message issuing instruction to the block chain.
In some embodiments, the apparatus further comprises a message callback unit configured to: storing the received message sent by the peer node to a callback message set; and responding to the received preset callback instruction, and executing the callback instruction on the message of the callback message set.
According to the method and the device for message processing, the message operation instruction is sent to the peer node in the block chain to indicate the peer node to perform data interaction with the block chain, so that the message processing action is completed, decentralized and distributed deployment of a message middleware platform are achieved, and the data security of framework services is improved.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which some embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a method for message processing according to the present disclosure;
FIG. 3 is a schematic diagram of one scenario in which the method for message processing shown in FIG. 2 may be applied;
FIG. 4 is a flow diagram of yet another embodiment of a method for message processing according to the present disclosure;
FIG. 5 is a block diagram of one embodiment of an apparatus for message processing according to the present disclosure;
FIG. 6 is a schematic structural diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a method for message processing or an apparatus for message processing to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages, etc., for example, a message of the user that the user wants to publish on the message middleware platform may be sent to the server, and a message to be queried by the user may be received from the server.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be electronic devices with communication functions, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
In the disclosed embodiment, the server 105 is a peer node in the blockchain, on which an account book and a preset intelligent contract are stored, and the server implements data interaction with the blockchain through the intelligent contract, for example, issues a message to the blockchain, so that the message is stored in the account book data of all nodes in the blockchain; messages issued by other nodes in the blockchain may also be received. In the embodiment of the present disclosure, the server 105 may perform data interaction with the terminal device through a network, for example, receive a message operation instruction sent by the terminal device, and implement data interaction with the blockchain according to the message operation instruction.
The peer node is a physical concept, and one server can act as the peer. This server can be either a private physical machine or a resource on the cloud. The peer is the infrastructure of the entire blockchain on which critical data is stored and specific programs are executed. The stored data comprises an account book and an intelligent contract, and the executed program mainly comprises endorsement and execution of the intelligent contract. All ledger queries and ledger modifications must be operated by intelligent contracts, and all intelligent contract operations must be invoked by peer nodes, so that SDKs (Software Development kits) or applications must pass peer nodes when they need to access ledger data.
It should be noted that the method for message processing provided by the embodiments of the present disclosure may be executed by the terminal devices 101, 102, and 103, and the apparatus for message processing may be disposed on the terminal devices. For example, the terminal device may be loaded with a message agent module to receive a message operation instruction of a user and send the message operation instruction to a specified server (i.e., peer node), the server is loaded with a block chain SDK, and the server implements data interaction with the block chain through a corresponding intelligent contract according to the received message operation instruction. The method can also be executed by the server 105, at this time, a device for processing the message is arranged in the server 105, and the server 105 is loaded with a message agent module and a block chain SDK, and is used for receiving a message operation instruction of a user, converting the message operation instruction into a corresponding block chain intelligent contract through the block chain SDK, and then realizing data interaction with the block chain by executing the corresponding intelligent contract. The present application is not specifically limited herein.
With continued reference to fig. 2, a flow 200 of one embodiment of a method for message processing in accordance with the present disclosure is shown. The method for message processing comprises the following steps:
step 201, receiving a message operation instruction.
In this embodiment, the execution main body may be loaded with a message agent module for receiving a message operation instruction of a user. The message operation instruction is used for characterizing the processing action of the user on the message, and can be a published message or a query message and the like.
Step 202, sending a message operation instruction to preset peer nodes in a block chain constructed in advance, wherein each peer node in the block chain corresponds to a user; and the message operation instruction is used for indicating the peer node to perform data interaction with the block chain.
In this embodiment, a block chain may be constructed in advance, each peer node in the block chain corresponds to one user, and each peer node stores an account book and a preset intelligent contract, and is used to provide a message service for each user. When a new user is added, only a new peer node needs to be deployed for the new user.
As an example, a company may share a block chain, each department deploys peer nodes of the block chain, and based on an information consensus mechanism between the block chain nodes, messages in an account book stored on each peer node are synchronized, so as to implement publishing and synchronization of messages between each department. Meanwhile, a block chain SDK is deployed on the terminal equipment serving as the peer node, the peer node accesses the block chain constructed in advance according to the block chain SDK, and data interaction is carried out on the block chain according to the received message operation instruction so as to complete the message processing flow.
In a specific example, an execution main body receives a message operation instruction of a user as an instruction for issuing a message, the execution main body sends the instruction for issuing the message to a corresponding peer node, then the peer node accesses a block chain through a block chain SDK, executes an intelligent contract corresponding to the issued message, stores the content of the message to be issued into its own account book, and broadcasts the content to the block chain to synchronously update the account books of other peer nodes, thereby completing "uplink" of the message, that is, completing the issuing of the message.
In another specific example, when a user wants to query messages issued by other users from the blockchain, an instruction of the message to be queried may be input to the execution main body, where the instruction includes characteristic information of the message to be obtained, such as a sender of the message, a global ID of the message, a type of the message, and the like, and then the execution main body sends the instruction of the query message to the corresponding peer node, and after the peer node receives the instruction of the query message, the smart contract corresponding to the obtained data is executed, a message meeting query conditions is retrieved from the ledger, and is sent back to the execution main body, so that the query of the message is completed.
In some optional implementation manners of this embodiment, the message operation instruction includes a message issuing instruction, which is used to instruct the peer node to send the message to be issued to the block chain; the message issuing instruction comprises a message to be issued, a channel identifier, a subject identifier and a message unique identifier, wherein the channel identifier is used for indicating the peer node to send the message to be issued to a channel (channel) corresponding to the channel identifier in the block chain; the topic identification is used for indicating the peer node to send the message to be issued to a topic (topic) corresponding to the topic identification in a channel corresponding to the channel identification; the message unique identification is used for representing the unique identity of the message to be issued in the block chain.
Generally, one peer node can join a plurality of channels in the block chain at the same time, and each channel can be preset with a plurality of themes.
In the implementation manner, by using an isolation mechanism of the channel, isolation of message processing processes of different groups can be achieved, and cooperation among different organizations can be achieved by a plurality of channels. The theme can be preset according to actual requirements so as to carry out classification management and operation on the messages according to the themes of the messages.
As an example, the message sending instruction may consist of a channel name + topic + message ID + message content to be published. After the execution main body sends the message sending instruction to the peer node, the peer node analyzes a channel identifier to be issued, a theme identifier, a message unique identifier and a message to be issued from the message instruction, then determines a channel corresponding to the channel identifier in a block chain based on the channel identifier, determines a theme corresponding to the theme identifier in the channel based on the theme identifier, then executes an intelligent contract corresponding to the issuing information, broadcasts the message to be issued to the corresponding theme in the channel, and completes the issuing process of the message.
In some optional implementations of this embodiment, the message operation instruction includes a message query instruction, which is used to instruct the peer node to acquire and send a message matching the message query instruction from the blockchain.
In the implementation manner, after the execution main body sends the message query instruction to the peer node, the peer node analyzes the query condition of the user from the message query instruction, then executes the intelligent contract corresponding to the acquired data, acquires the message meeting the query condition from the account book, and sends the message back to the execution main body. The query condition may be, for example, a message in a certain channel, a message under a certain subject, or a unique identity of a message.
In some optional implementations of this embodiment, the message operation instruction includes a message subscription instruction, and the message subscription instruction includes a subscription condition, and is used to instruct the peer node to acquire and send a message that satisfies the subscription condition from the blockchain.
In the implementation mode, a user can set subscription conditions according to own requirements, then the execution main body generates a message subscription instruction and sends the message subscription instruction to the peer node, the peer node analyzes the subscription conditions of the user from the message subscription instruction, then executes a corresponding intelligent contract to obtain a message meeting the subscription conditions from the book, and sends the message back to the execution main body. As an example, the subscription condition may be a timing acquisition message or a message to acquire a certain specified channel. In this way, the execution subject can automatically acquire the messages meeting the subscription condition in the blockchain.
According to whether the starting time of the subscription time is the current time or the historical time, the execution subject can acquire the real-time message or the historical message from the block chain through the peer node. If the initial time of the subscription is the current time, the peer node can be further instructed to monitor the messages in the block chain, and when the messages meeting the subscription condition are detected, the messages are automatically sent to the execution main body.
As an example, the message subscription instruction received by the execution main body is to subscribe to a message in a service channel at the current time, the execution main body sends the message subscription instruction to the peer node, the peer node invokes a corresponding intelligent contract, and the message in the channel at the current time in the ledger is sent back to the execution main body. And, the message in the block chain can also be monitored, and when detecting that a new message appears in the channel, the message is automatically sent back to the execution subject.
Further, the message subscription instruction may further include a keyword included in the message to be subscribed, so as to instruct the peer node to acquire a message matching the keyword from the blockchain.
With continued reference to fig. 3, fig. 3 is a schematic illustration of one scenario in which the method of fig. 2 may be applied. In fig. 3, servers 302, 303, 304 and 305 are peer nodes in a blockchain 306, and the execution subject 301 may be a terminal device, and the terminal device 301 is communicatively connected to one of the servers 302 and configured to send a message operation instruction to the server 302. For example, when the execution agent wants to issue the message "a", the instruction "issue the message a" is sent to the server 302, after receiving the instruction, the server 302 sends the message a to the blockchain 306 by executing the node intelligent contract corresponding to the issue message, and then, based on the information consensus mechanism among the nodes, the message "a" is also stored in the ledger of the other peer nodes 303, 304, and 305 in the blockchain, and the issue of the message "a" is completed.
According to the method and the device for message processing, the message operation instruction is sent to the peer node in the block chain to indicate the peer node to perform data interaction with the block chain, the message processing action is completed, decentralized and distributed deployment of the message middleware platform are achieved, and meanwhile, the data security of the framework service can be improved due to the characteristics that the block chain has the advantages of being incapable of being tampered with, traceable, attentive to trust and the like.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method for message processing is shown. The flow 400 of the method for message processing includes the following steps:
step 401, receiving a message operation instruction. This step is similar to the step 201 and will not be described herein again.
And 402, sending the message operation instruction to a peer node preset in the block chain constructed in advance. This step is similar to the step 202, and will not be described herein.
Step 403, if the message operation instruction is a message issuing instruction, extracting a message to be issued from the message issuing instruction, and storing the message to be issued to an issued message set.
In this embodiment, the execution subject may cache the message issued by the user, so as to perform subsequent operations such as analysis and statistics on the message.
Step 404, in response to that the to-be-issued message in the issued message set satisfies a preset condition, generates a cache message issuing instruction based on a preset policy, and sends the cache message issuing instruction to the peer node to instruct the peer node to send the to-be-issued message included in the cache message issuing instruction to the block chain.
In this embodiment, a user may preset a trigger condition and a message generation policy by an execution main body, and when the execution main body detects that a message to be issued in a message issuance set satisfies the preset condition, automatically generate a cache message issuance instruction according to the message generation policy, so as to instruct a peer node to issue a message content corresponding to the cache message issuance instruction to a block chain.
As an example, it may be preset that the content of the message to be published includes a specified keyword, when the execution subject monitors that a message including the keyword appears in the published message set, a cache message publishing instruction "sender identification of the message (for example, a physical address of the sender) + the keyword included in the message" is automatically generated, and then the cache message publishing instruction is sent to the peer node, and the peer node completes a publishing process of the message.
For another example, the user may pre-threshold the number of messages to be published, and when the execution subject detects that the number of messages in the published message set reaches the number threshold, automatically generate a cache message publishing instruction of "the number of published messages in the published message set + the time when the number reaches" and then send the cache message publishing instruction to the peer node, and the peer node completes the publishing process of the message.
It will be appreciated that the execution agent itself may also act as a peer node, in which case the execution agent may cache and monitor all messages sent to the blockchain via the peer node.
And step 405, storing the received message sent by the peer node to a callback message set.
In this embodiment, the callback message set is used for caching the message returned by the peer node so as to facilitate the subsequent callback processing of the part of the message, and the callback message set may include, for example, a message queried by the user and a message subscribed by the user.
Step 406, in response to receiving the preset callback instruction, executes the callback instruction on the messages of the set of callback messages.
In this embodiment, the execution main body may execute a preset instruction on the message cached in the callback message set according to the received callback instruction, for example, the user may set a filtering condition, and filter a message meeting the condition from the callback message set among all messages received by the execution main body. For another example, the user may set an instruction to periodically clear the cache, and when the preset time is reached, the execution subject may automatically clear the message in the callback message set.
As can be seen from fig. 4, the flow 400 of the method for processing a message in this embodiment adds a step of caching a release message and a callback message, and can perform logic processing on the release message by caching and monitoring the release message, thereby implementing message driving; by caching callback messages, further processing of messages retrieved from the blockchain is facilitated.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for message processing, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for message processing of the present embodiment includes: an instruction receiving unit 501 configured to receive a message operation instruction; an instruction sending unit 502 configured to send a message operation instruction to a peer node preset in a block chain constructed in advance; each peer node in the block chain corresponds to a user; and the message operation instruction is used for indicating the peer node to perform data interaction with the block chain.
In this embodiment, the instruction sending unit 502 further includes a message issuing module configured to send a message issuing instruction to the peer node to instruct the peer node to send the message to be issued to the block chain; the message issuing instruction comprises a message to be issued, a channel identifier, a subject identifier and a message unique identifier, wherein the channel identifier is used for indicating the peer node to send the message to be issued to a channel corresponding to the channel identifier in the block chain; the topic identification is used for indicating the peer node to send the message to be issued to a topic corresponding to the topic identification in a channel corresponding to the channel identification; the message unique identification is used for representing the unique identity of the message to be issued in the block chain.
In this embodiment, the instruction sending unit 502 further includes a message query module configured to send a message query instruction to the peer node to instruct the peer node to acquire and send a message matching the message query instruction from the blockchain.
In this embodiment, the instruction sending unit 502 further includes a message subscription module configured to send a message subscription instruction to the peer node, where the message subscription instruction includes a subscription condition for instructing the peer node to acquire and send a message meeting the subscription condition from the blockchain.
In this embodiment, the apparatus further includes a message buffering unit configured to: if the message operation instruction is a message issuing instruction, extracting a message to be issued from the message issuing instruction, and storing the message to be issued to an issuing message set; and responding to the condition that the to-be-issued message of the issued message set meets the preset condition, generating a cache message issuing instruction based on a preset strategy, and sending the cache message issuing instruction to the peer node to indicate the peer node to send the to-be-issued message included in the cache message issuing instruction to the block chain.
In this embodiment, the apparatus further includes a message callback unit configured to: storing the received message sent by the peer node to a callback message set; and in response to receiving a preset callback instruction, executing the callback instruction on the messages of the callback message set.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., the server or terminal device of fig. 1) 600 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the use range of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing device (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage device 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a message operation instruction; and sending a message operation instruction to a preset peer node in a pre-constructed block chain, wherein each peer node in the block chain corresponds to a user identifier, and the message operation instruction is used for indicating the peer node to perform data interaction with the block chain.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an instruction parsing unit, a node determination unit, and an instruction transmission unit. Where the names of these units do not in some cases constitute a limitation on the unit itself, for example, the instruction parsing unit may also be described as "a unit that parses a user identification from a message operation instruction in response to receiving the message operation instruction".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.

Claims (10)

1. A method for message processing, comprising:
receiving a message operation instruction;
sending the message operation instruction to a peer node preset in a block chain constructed in advance;
if the message operation instruction is a message issuing instruction, extracting a message to be issued from the message issuing instruction, and storing the message to be issued to an issuing message set;
responding to that the to-be-issued message of the issued message set meets a preset condition, generating a cache message issuing instruction based on a preset strategy, and sending the cache message issuing instruction to the peer node to instruct the peer node to send the to-be-issued message included in the cache message issuing instruction to the block chain;
storing the received message sent by the peer node into a callback message set, wherein the callback message set comprises a message inquired by a user and a message subscribed by the user;
in response to receiving a callback instruction, executing the callback instruction on messages of the set of callback messages;
wherein each peer node in the blockchain corresponds to a user;
the message operation instruction is used for instructing the peer node to perform data interaction with the blockchain.
2. The method of claim 1, wherein the message operation instructions comprise message publishing instructions to instruct the peer node to send a message to be published to the blockchain;
the message issuing instruction comprises a message to be issued, a channel identifier, a subject identifier and a message unique identifier, wherein the channel identifier is used for indicating the peer node to send the message to be issued to a channel corresponding to the channel identifier in the block chain; the topic identification is used for indicating the peer node to send the message to be issued to a topic corresponding to the topic identification in a channel corresponding to the channel identification; the message unique identifier is used for representing a unique identity of the message to be issued in the block chain.
3. The method of claim 1, wherein the message operation instruction comprises a message query instruction instructing the peer node to fetch and send a message from the blockchain that matches the message query instruction.
4. The method of claim 1, wherein the message operation instruction comprises a message subscription instruction, and the message subscription instruction comprises a preset subscription condition for instructing the peer node to fetch and send a message satisfying the subscription condition from the blockchain.
5. An apparatus for message processing, comprising:
an instruction receiving unit configured to receive a message operation instruction;
the instruction sending unit is configured to send the message operation instruction to a peer node preset in a block chain constructed in advance;
a message caching unit configured to: if the message operation instruction is a message issuing instruction, extracting a message to be issued from the message issuing instruction, and storing the message to be issued to an issuing message set; responding to that the to-be-issued message of the issued message set meets a preset condition, generating a cache message issuing instruction based on a preset strategy, and sending the cache message issuing instruction to the peer node to instruct the peer node to send the to-be-issued message included in the cache message issuing instruction to the block chain;
a message callback unit configured to: storing the received message sent by the peer node into a callback message set, wherein the callback message set comprises a message inquired by a user and a message subscribed by the user; in response to receiving a callback instruction, executing the callback instruction on messages of the callback message set;
wherein each peer node in the blockchain corresponds to a user;
the message operation instruction is used for instructing the peer node to perform data interaction with the blockchain.
6. The apparatus of claim 5, wherein the instruction sending unit further comprises a message publishing module configured to send a message publishing instruction to the peer node to instruct the peer node to send a message to be published to the blockchain;
the message issuing instruction comprises a message to be issued, a channel identifier, a subject identifier and a message unique identifier, wherein the channel identifier is used for indicating the peer node to send the message to be issued to a channel corresponding to the channel identifier in the block chain; the subject mark is used for indicating the peer node to send the message to be issued to the peer node the channel identifies a subject corresponding to the subject identification in the channel corresponding to the channel identification; the message unique identifier is used for representing a unique identity of the message to be issued in the block chain.
7. The apparatus of claim 5, wherein the instruction sending unit further comprises a message query module configured to send a message query instruction to the peer node to instruct the peer node to fetch and send a message matching the message query instruction from the blockchain.
8. The apparatus of claim 5, wherein the instruction sending unit further comprises a message subscription module configured to send a message subscription instruction to the peer node, the message subscription instruction including a preset subscription condition for instructing the peer node to fetch and send a message satisfying the subscription condition from the block chain.
9. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
10. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-4.
CN202010923724.9A 2020-09-04 2020-09-04 Method and apparatus for message processing Active CN112565173B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010923724.9A CN112565173B (en) 2020-09-04 2020-09-04 Method and apparatus for message processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010923724.9A CN112565173B (en) 2020-09-04 2020-09-04 Method and apparatus for message processing

Publications (2)

Publication Number Publication Date
CN112565173A CN112565173A (en) 2021-03-26
CN112565173B true CN112565173B (en) 2023-04-07

Family

ID=75040985

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010923724.9A Active CN112565173B (en) 2020-09-04 2020-09-04 Method and apparatus for message processing

Country Status (1)

Country Link
CN (1) CN112565173B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022217A (en) * 2019-04-04 2019-07-16 深圳大通实业股份有限公司 A kind of credible deposit system of advertisement media business datum based on block chain
CN110380863A (en) * 2019-07-02 2019-10-25 银清科技(北京)有限公司 Cross-border payment message notifier processes method and device based on block chain framework
CN111078745A (en) * 2019-12-20 2020-04-28 京东数字科技控股有限公司 Data uplink method and device based on block chain technology
CN111600790A (en) * 2020-07-20 2020-08-28 百度在线网络技术(北京)有限公司 Block chain based message processing method, device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10936723B2 (en) * 2019-03-27 2021-03-02 Intel Corporation Fast and secure protocol to bootstrap a blockchain by restoring the blockchain state using trusted execution environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022217A (en) * 2019-04-04 2019-07-16 深圳大通实业股份有限公司 A kind of credible deposit system of advertisement media business datum based on block chain
CN110380863A (en) * 2019-07-02 2019-10-25 银清科技(北京)有限公司 Cross-border payment message notifier processes method and device based on block chain framework
CN111078745A (en) * 2019-12-20 2020-04-28 京东数字科技控股有限公司 Data uplink method and device based on block chain technology
CN111600790A (en) * 2020-07-20 2020-08-28 百度在线网络技术(北京)有限公司 Block chain based message processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112565173A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
US20150222616A1 (en) Private cloud connected device cluster architecture
CN110909521B (en) Online document information synchronous processing method and device and electronic equipment
CN112860451A (en) Multi-tenant data processing method and device based on SaaS
CN110781373B (en) List updating method and device, readable medium and electronic equipment
CN111432001B (en) Method, apparatus, electronic device and computer readable medium for jumping scenes
CN112965673A (en) Content printing method, device, equipment and storage medium
CN110677443A (en) Data transmitting and receiving method, transmitting end, receiving end, system and storage medium
CN109981778B (en) Method, device, equipment and storage medium for realizing service of content distribution network
CN112714042A (en) Pressure testing method and device, electronic equipment and storage medium
CN112565173B (en) Method and apparatus for message processing
CN111161072A (en) Block chain-based random number generation method, equipment and storage medium
CN112948138A (en) Method and device for processing message
CN113268272B (en) Application delivery method, device and system based on private cloud
CN112507676B (en) Method and device for generating energy report, electronic equipment and computer readable medium
CN114860213A (en) Application package generation method, device, equipment and medium
US11277300B2 (en) Method and apparatus for outputting information
CN114051024A (en) File background continuous transmission method and device, storage medium and electronic equipment
CN114398035A (en) Method, apparatus, device and computer readable medium for providing service using component
CN114461582A (en) File processing method, device, equipment and storage medium
Ganchev et al. A cloud-based service recommendation system for use in UCWW
CN113778367A (en) Voice interaction method, device, equipment and computer readable medium
CN111309367A (en) Method, device, medium and electronic equipment for managing service discovery
CN113472565B (en) Method, apparatus, device and computer readable medium for expanding server function
CN112948108B (en) Request processing method and device and electronic equipment
CN115102992B (en) Data publishing method and device, electronic equipment and computer readable 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
GR01 Patent grant
GR01 Patent grant