Disclosure of Invention
In order to solve the defects of the prior art, the invention provides a news command scheduling instruction distribution method based on a block chain encryption and consensus algorithm, which is based on an instruction alliance chain mechanism of a block chain, realizes encryption and consensus identification of news propaganda instructions by utilizing the block chain encryption and consensus mechanism and ensures safe transmission of the news instructions.
In order to achieve the above purpose, the present invention adopts the following technical scheme:
the first aspect of the invention provides a news command scheduling instruction distribution method based on a blockchain encryption and consensus algorithm.
A news command scheduling instruction distribution method based on a blockchain encryption and consensus algorithm comprises the following steps:
the news scheduling instruction is uploaded to a news instruction alliance chain and is packaged into an instruction data packet, the instruction data packet is encrypted to obtain an encrypted data packet, and uploading of the encrypted data packet in a first-level news propaganda scheduling center node is executed;
After the uploading of the first-level news propaganda scheduling center node is completed, synchronization with other media nodes is executed, and a consensus algorithm is adopted to carry out credibility identification on the encrypted data packet;
After the implementation of the instruction content is completed by at least one media node, writing the instruction execution condition into an instruction data packet and re-encrypting the instruction data packet, and broadcasting the re-encrypted instruction data packet to the alliance chain whole network;
the first-level news propaganda scheduling center acquires the encrypted data packet of the writing execution condition broadcasted by each media node, and obtains the execution condition of the news propaganda instruction of each media node after decryption.
As a further definition of the first aspect of the invention, the instruction packet comprises at least: news instruction content, instruction issue time, instruction level, instruction security level, timestamp, and broadcast domain.
As a further limitation of the first aspect of the invention, the instruction data packet is encrypted using an asymmetric encryption algorithm.
As a further limitation of the first aspect of the present invention, a heartbeat detection mechanism is employed at each media node to ensure synchronization of each node.
As a further limitation of the first aspect of the present invention, the trusted authentication of the encrypted data packet using the consensus algorithm includes:
The method comprises the steps that a primary news propaganda scheduling center node is taken as a main node, after each media node receives a news instruction packet, a hash abstract of the news instruction packet is recalculated, the hash abstract is added to the news instruction packet, received instructions are identified, relevant operation records are recorded, and then the news instruction packet is broadcasted to the whole network;
Because all nodes of the instruction data broadcast in the whole network, a certain media node receives f+1 successful returns, and the news instruction packet is considered to be credible and tamper-free.
As a further limitation of the second aspect of the present invention, each media node may receive a plurality of f+1 news command packets, and select the news command packet with the maximum value as the final trusted news command packet according to the size of the command packet f+1.
As a further limitation of the second aspect of the present invention, the obtained final trusted news command packet is decrypted by using the public key of the primary news propaganda scheduling center, so as to obtain the relevant command content.
As a further limitation of the first aspect of the present invention, the instruction execution case at least includes: instruction execution progress, instruction reception time, and feedback information.
The second aspect of the invention provides a news command scheduling instruction distribution system based on a blockchain encryption and consensus algorithm.
A news command scheduling instruction distribution system based on a blockchain encryption and consensus algorithm, comprising: a primary news propaganda scheduling center node and a plurality of media nodes respectively communicating with the primary news propaganda scheduling center node;
the news scheduling instruction is uploaded to a news instruction alliance chain and is packaged into an instruction data packet, the instruction data packet is encrypted to obtain an encrypted data packet, and uploading of the encrypted data packet in a first-level news propaganda scheduling center node is executed;
After the uploading of the first-level news propaganda scheduling center node is completed, synchronization with other media nodes is executed, and a consensus algorithm is adopted to carry out credibility identification on the encrypted data packet;
After the implementation of the instruction content is completed by at least one media node, writing the instruction execution condition into an instruction data packet and re-encrypting the instruction data packet, and broadcasting the re-encrypted instruction data packet to the alliance chain whole network;
the first-level news propaganda scheduling center acquires the encrypted data packet of the writing execution condition broadcasted by each media node, and obtains the execution condition of the news propaganda instruction of each media node after decryption.
As a further limitation of the second aspect of the present invention, the trusted authentication of the encrypted data packet using the consensus algorithm includes:
The method comprises the steps that a primary news propaganda scheduling center node is taken as a main node, after each media node receives a news instruction packet, a hash abstract of the news instruction packet is recalculated, the hash abstract is added to the news instruction packet, received instructions are identified, relevant operation records are recorded, and then the news instruction packet is broadcasted to the whole network;
because all nodes of the instruction data broadcast in the whole network, a certain media node receives f+1 successful returns, and the news instruction packet is considered to be credible and tamper-free;
each media node receives a plurality of f+1 news instruction packets, and selects the news instruction packet with the maximum value as the final trusted news instruction packet according to the size of the instruction packet f+1;
And decrypting the obtained final trusted news instruction packet by adopting a first-level news propaganda scheduling center public key to obtain related instruction content.
Compared with the prior art, the invention has the beneficial effects that:
1. The invention creatively provides a news command scheduling instruction distribution method based on a block chain encryption and consensus algorithm, which is based on an instruction alliance chain mechanism of a block chain, realizes encryption and consensus identification of news propaganda instructions by utilizing the block chain encryption and consensus mechanism and ensures safe transmission of the news instructions.
2. The invention creatively provides a news command scheduling instruction distribution method based on a blockchain encryption and consensus algorithm, which completes the whole process of issuing, encrypting and credibility identification of a first-level news propaganda scheduling center instruction, realizes encryption and consensus identification of the news propaganda instruction and ensures the transmission safety of the news instruction.
3. The invention creatively provides a news command scheduling instruction distribution method based on a blockchain encryption and consensus algorithm, which solves the problem of news instruction errors caused by traditional news instruction missing transmission, mistransmission, missing reception and illegal tampering, realizes encryption and consensus identification of news propaganda instructions, and ensures the transmission safety of news instructions.
Detailed Description
The invention will be further described with reference to the drawings and examples.
It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the invention. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the present invention. As used herein, the singular is also intended to include the plural unless the context clearly indicates otherwise, and furthermore, it is to be understood that the terms "comprises" and/or "comprising" when used in this specification are taken to specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof.
Embodiments of the invention and features of the embodiments may be combined with each other without conflict.
Example 1:
As shown in fig. 1, embodiment 1 of the present invention provides a news command scheduling instruction distribution method based on a blockchain encryption and consensus algorithm, which builds a news command alliance chain based on PBFT consensus algorithm, encrypts uplink news commands by using an asymmetric encryption mechanism, and different receiving terminals complete news command reception through alliance link point consensus data, and specifically includes the following steps:
S101: and constructing a news instruction alliance chain based on Springboot frames, wherein a common algorithm adopts PBFT algorithm, and alliance link points are constructed in a 1:1 mode according to the number of news instruction receiving units.
S102: according to the news instruction content form, adopting a similar SQL data structure to design Block storage and designing operation actions of each node pair table (ADD, UPDATE, DELETE);
More specifically, the Block stores Sql-like sentences, database table structures meeting the requirements of service scenes are preset among alliances, then operation authorities (ADD, UPDATE, DELETE) of each node table are set, each node can write Sql-like sentences according to the allowed authorities, the Sql-like sentences are packed into the Block, and then broadcast in the whole network, and the validity of information such as signature, authority and the like is waited for in the whole network verification.
The steps complete the establishment work of the news instruction alliance chain infrastructure and the consensus mechanism, and the following steps are the release, transmission and acceptance of news instructions.
S103: and the municipal news propaganda scheduling center issues news scheduling instructions and uploads the news scheduling instructions to a news instruction alliance chain.
S104: and packaging an instruction data packet for the instruction uploaded in the step S103, wherein the data packet mainly comprises news instruction content, instruction issue time, instruction level, instruction security level, time stamp, broadcast domain and the like.
S105: and (4) encrypting the instruction data packet generated in the step (S104) by adopting a domestic asymmetric encryption algorithm SM2, generating an encrypted data packet, calling an instruction alliance chain ADD method, and finishing uploading of the instruction encrypted data packet by a market-level news propaganda scheduling center node.
S106: after the uploading of the commercial grade news propaganda scheduling center node is successful, synchronization with other media nodes is completed by adopting a websocks transmission mode, and in order to ensure synchronization timeliness, a heartbeat detection mechanism is adopted at each node, so that node synchronization timeliness is ensured.
S107: s106, after the node synchronization is completed, adopting PBFT consensus algorithm to carry out credibility identification on the instruction, and specifically comprising the following steps:
S1071: and (3) taking the municipal news propaganda scheduling center node as a main node, recalculating a hash abstract of the news instruction packet after each media node receives the news instruction packet, adding the hash abstract to the news instruction packet, identifying the received instruction, recording related operations, and broadcasting the operation record to the whole network.
S1072: since all nodes of the instruction data broadcast in the whole network, a certain media node receives f+1 successes (f is the threshold value of the number of the Bayesian nodes, that is, f is greater than the threshold value, and is considered to be credible and correct, for example, a certain node receives f failed instructions or f error messages maliciously returned, and f+1 is the most group, and the instructions are considered to be correct), namely, the news instruction packet is considered to be credible and not tampered.
S1073: since the media node receives a plurality of f+1 news command packets, the maximum value is selected as the final trusted news command packet according to the size of the command packet f+1.
S1074: and decrypting the final news instruction packet acquired in the step S1073 by adopting a public key of a commercial grade news propaganda scheduling center to acquire relevant instruction content.
S108: after the media node finishes implementing the instruction content, writing the instruction execution condition back to the instruction packet, calling an UPDATE method by mainly comprising the instruction execution progress, the instruction receiving time, the feedback information and the like, completing the modification action of the news instruction packet, and broadcasting the news instruction packet to the alliance chain whole network.
S109: the commercial grade news propaganda scheduling center obtains the latest instruction packet broadcast by each media node, obtains the trusted instruction packet in a S107 mode, decrypts by adopting the public key of the commercial grade news propaganda scheduling center, and obtains the execution condition of the news propaganda instruction of each node.
Example 2:
The embodiment 2 of the invention provides a news command scheduling instruction distribution system based on a blockchain encryption and consensus algorithm, which comprises the following steps: a primary (i.e., municipal) news feed scheduling hub node and a plurality of media nodes in communication with the primary news feed scheduling hub node, respectively;
Setting up a news instruction alliance chain based on PBFT consensus algorithm, encrypting the uplink news instruction by using an asymmetric encryption mechanism, and completing news instruction reception by different receiving terminals through alliance chain link point consensus data, wherein the method specifically comprises the following steps:
A101: and constructing a news instruction alliance chain based on Springboot frames, wherein a common algorithm adopts PBFT algorithm, and alliance link points are constructed in a 1:1 mode according to the number of news instruction receiving units.
A102: according to the news instruction content form, adopting a similar SQL data structure to design Block storage and designing operation actions of each node pair table (ADD, UPDATE, DELETE);
More specifically, the Block stores Sql-like sentences, database table structures meeting the requirements of service scenes are preset among alliances, then operation authorities (ADD, UPDATE, DELETE) of each node table are set, each node can write Sql-like sentences according to the allowed authorities, the Sql-like sentences are packed into the Block, and then broadcast in the whole network, and the validity of information such as signature, authority and the like is waited for in the whole network verification.
The steps complete the establishment work of the news instruction alliance chain infrastructure and the consensus mechanism, and the following steps are the release, transmission and acceptance of news instructions.
A103: and the municipal news propaganda scheduling center issues news scheduling instructions and uploads the news scheduling instructions to a news instruction alliance chain.
A104: the instruction uploaded by A103 is packaged into an instruction data packet, and the data packet mainly comprises news instruction content, instruction issue time, instruction level, instruction security level, time stamp, broadcast domain and the like.
A105: and encrypting the instruction data packet generated by the A104 by adopting a domestic asymmetric encryption algorithm SM2, generating an encrypted data packet, calling an instruction alliance chain ADD method, and finishing uploading of the instruction encrypted data packet by a market-level news propaganda scheduling center node.
A106: after the uploading of the commercial grade news propaganda scheduling center node is successful, synchronization with other media nodes is completed by adopting a websocks transmission mode, and in order to ensure synchronization timeliness, a heartbeat detection mechanism is adopted at each node, so that node synchronization timeliness is ensured.
A107: after the node synchronization is completed, carrying out credibility identification on the instruction by adopting PBFT consensus algorithm, wherein the method comprises the following specific steps:
A1071: and (3) taking the municipal news propaganda scheduling center node as a main node, recalculating a hash abstract of the news instruction packet after each media node receives the news instruction packet, adding the hash abstract to the news instruction packet, identifying the received instruction, recording related operations, and broadcasting the operation record to the whole network.
A1072: since each node of the instruction data broadcasts in the whole network, a certain media node receives f+1 successes (f is the tolerable number of Bayesian nodes, even if f fails and f maliciously returned error information exists, f+1 correct is the most group), and the news instruction packet can be considered to be credible and not tampered.
A1073: since the media node receives a plurality of f+1 news command packets, the maximum value is selected as the final trusted news command packet according to the size of the command packet f+1.
A1074: and decrypting the final news instruction packet acquired by the A1073 by adopting a public key of a commercial grade news propaganda scheduling center to acquire relevant instruction content.
A108: after the media node finishes implementing the instruction content, writing the instruction execution condition back to the instruction packet, calling an UPDATE method by mainly comprising the instruction execution progress, the instruction receiving time, the feedback information and the like, completing the modification action of the news instruction packet, and broadcasting the news instruction packet to the alliance chain whole network.
A109: the commercial grade news propaganda scheduling center obtains the latest instruction packet broadcast by each media node, obtains a trusted instruction packet in a step (110) mode, decrypts by adopting a public key of the trusted instruction packet, and obtains the execution condition of the news propaganda instruction of each node.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random-access Memory (Random Access Memory, RAM), or the like.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.