CN111444270B - Method and system for controlling harmful information based on block chain - Google Patents

Method and system for controlling harmful information based on block chain Download PDF

Info

Publication number
CN111444270B
CN111444270B CN202010117398.2A CN202010117398A CN111444270B CN 111444270 B CN111444270 B CN 111444270B CN 202010117398 A CN202010117398 A CN 202010117398A CN 111444270 B CN111444270 B CN 111444270B
Authority
CN
China
Prior art keywords
block
chain block
main chain
hash
harmful
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
CN202010117398.2A
Other languages
Chinese (zh)
Other versions
CN111444270A (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.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN202010117398.2A priority Critical patent/CN111444270B/en
Publication of CN111444270A publication Critical patent/CN111444270A/en
Application granted granted Critical
Publication of CN111444270B publication Critical patent/CN111444270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/2053Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where persistent mass storage functionality or persistent mass storage control functionality is redundant
    • G06F11/2094Redundant storage or storage space
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application relates to a method and a system for controlling harmful information based on a blockchain. The method comprises the following steps: generating a main chain block of a main block chain according to a first rule, wherein the main chain block comprises text data; generating a secondary chain block of a secondary block chain according to the main chain block according to a second rule, wherein the secondary chain block does not comprise the text data; recording the corresponding relation between the main chain block and the secondary chain block; when the fact that the text data of any main chain block in the main block chain contains harmful information is detected, determining that the main chain block containing the harmful information is a harmful block, and replacing the harmful block with a corresponding sub-chain block according to the corresponding relation. The method and the system for controlling the harmful information based on the blockchain can effectively control the propagation of the harmful information in the blockchain and improve the safety of the blockchain technology.

Description

Method and system for controlling harmful information based on block chain
Technical Field
The embodiment of the application relates to a block chain technology, in particular to a method and a system for controlling harmful information based on a block chain.
Background
The blockchain technology is a distributed data storage system through decentralization, and can ensure the authenticity of each piece of information, so that the trust problem between people is solved, and the huge expense caused by the trust problem is greatly reduced.
Under the prior blockchain technology, the information stored in the blockchain possibly becomes an entry point for data theft and illegal activities, and can bring unpredictable potential threat to the property life safety of the country and people. Moreover, once the harmful information is successfully written into the blockchain, the harmful information is always present and is difficult to clear, and even the reliability, the use and the application value of the whole chain can be greatly damaged due to the harmful information in one block. In particular, in the use of blockchain technology, social institutions such as banks, medical treatment, education and the like, which are very eager to the blockchain technology, once harmful information is embedded in the blockchain, immeasurable losses are caused, and fatal attacks are caused to the credit of institutions requiring public trust.
Disclosure of Invention
The embodiment of the application provides a method and a system for controlling harmful information based on a blockchain, which can effectively control the propagation of the harmful information in the blockchain and improve the safety of the blockchain technology.
A method of controlling harmful information based on a blockchain, comprising:
generating a main chain block of a main block chain according to a first rule, wherein the main chain block comprises text data;
generating a secondary chain block of a secondary block chain according to the main chain block according to a second rule, wherein the secondary chain block does not comprise the text data;
recording the corresponding relation between the main chain block and the secondary chain block;
when the fact that the text data of any main chain block in the main block chain contains harmful information is detected, determining that the main chain block containing the harmful information is a harmful block, and replacing the harmful block with a corresponding sub-chain block according to the corresponding relation.
A system for controlling harmful information based on a blockchain, comprising:
the first generation module is used for generating a main chain block of a main block chain according to a first rule, wherein the main chain block comprises text data;
the second generation module is used for generating a secondary chain block of a secondary block chain according to a second rule according to the main chain block, wherein the secondary chain block does not comprise the text data;
the recording module is used for recording the corresponding relation between the main chain block and the secondary chain block;
And the replacing module is used for determining the main chain block containing the harmful information as a harmful block when detecting that the text data of any main chain block in the main chain block contains the harmful information, and replacing the harmful block with a corresponding secondary chain block according to the corresponding relation.
According to the method and the system for controlling the harmful information based on the blockchain, the main chain blocks including the text data are generated according to the first rule, the secondary chain blocks not including the text data are generated according to the second rule, the corresponding relation between the generated main chain blocks and the secondary chain blocks is recorded, when the text data of any main chain block in the main blockchain is detected to contain the harmful information, the main chain blocks containing the harmful information are replaced by the corresponding secondary chain blocks, the transmission of the harmful information in the blockchain can be effectively controlled, the integrity and the use of the whole main blockchain are not influenced, and the safety of a blockchain technology is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method of controlling harmful information based on a blockchain in one embodiment;
FIG. 2 is a flow diagram of generating a main chain block and corresponding secondary chain blocks in one embodiment;
FIG. 3 is a schematic diagram of a data structure of a main chain block in one embodiment;
FIG. 4 is a diagram of a data structure of a master blockchain in one embodiment;
FIG. 5 is a diagram illustrating a data structure of a secondary chain block according to one embodiment;
FIG. 6 is a diagram of a data structure of a secondary blockchain in an embodiment;
FIG. 7 is a flow chart of replacing a bad block with a corresponding sub-chain block in one embodiment;
FIG. 8 is a diagram illustrating a data structure of a harmful block replaced with a corresponding sub-chain block according to one embodiment;
FIG. 9 is a block diagram of a system for controlling harmful information based on a blockchain in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It will be understood that the terms first, second, etc. as used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first client may be referred to as a second client, and similarly, a second client may be referred to as a first client, without departing from the scope of the application. Both the first client and the second client are clients, but they are not the same client.
As shown in fig. 1, in one embodiment, a method of controlling harmful information based on a blockchain is provided, comprising the steps of:
step 110, generating a main chain block of a main chain block according to a first rule, wherein the main chain block comprises text data.
Blockchain (Blockchain) is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc., and is essentially a de-centralized database in which various data can be stored. In embodiments of the present application, a primary blockchain may be included, and a secondary blockchain may be considered as a blockchain derived from the primary blockchain, the block data included in the primary blockchain may be referred to as a main chain block, and the block data included in the secondary blockchain may be referred to as a secondary chain block.
The electronic device may generate a main chain block of the main blockchain according to a first rule, wherein the first rule may be a block data generation rule in conventional blockchain technology. As a specific embodiment, the main chain blocks of the main chain may be generated by a preset algorithm, which may be used to implement a specific process of repeatedly performing a Hash function and detecting an execution result, such as SHA-256 (Secure Hash Algorithm-256 ), scrypt algorithm, equihash algorithm, etc., but not limited thereto.
In some embodiments, when the electronic device receives a transaction operation, transaction information for the transaction operation may be obtained and a master chain block may be generated from the transaction information. The generated main chain block may store one or more items of transaction information, which may refer to transaction data, which may include the number of transactions, price, etc. The transaction information may include text data that may be entered and saved by a user, and may include harmful information because the text data is editable. The generated plurality of main chain blocks may form a chain structure, thereby constituting a main blockchain.
Step 120, generating a sub-chain block of the sub-block chain according to the main chain block according to the second rule, wherein the sub-chain block does not include text data.
Whenever a main chain block of a main blockchain is generated, the corresponding secondary chain block may be derived from the generated main chain block. The electronic device can derive the secondary chain block corresponding to the main chain block according to the second rule. As a specific embodiment, the second rule may be different from the first rule described above, and the secondary chain block may not be generated according to a conventional algorithm, and may be generated directly based on data stored in the main chain block.
In some embodiments, the electronic device may obtain the generated transaction information stored in the main chain block, delete the text data in the transaction information, and only retain the transaction information except for the text data input by the user. The secondary chain blocks may be generated based on transaction information deleting literal data. Since the text data which may contain harmful information is deleted, the sub-chain blocks do not contain harmful information, and the sub-chain blocks derived based on the main chain blocks can be used as spare blocks harmless to the main chain blocks, so that when the main chain blocks are detected to contain harmful information, the spare blocks are used. When generating a plurality of sub-chain blocks, a chain structure may also be formed between the sub-chain blocks, thereby constituting a sub-block chain.
Step 130, record the correspondence between the main chain block and the secondary chain block.
The electronic device generates a main chain block, and after a secondary chain block is derived based on the main chain block, a corresponding relationship between the main chain block and the secondary chain block can be recorded. Optionally, the block data structure of the main chain block and the corresponding sub-chain block may be recorded, and the block identifier of the main chain block and the block identifier of the sub-chain block may be obtained to store the corresponding relationship between the two obtained block identifiers, where the block identifier may be a block number, for example, the block number of the main chain block is 1, the block number of the corresponding sub-chain block is 1', and the block identifier may also be a block hash of the block, but is not limited thereto. In some embodiments, the block hash of the main chain block may also be stored in the secondary chain block to record the correspondence between the main chain block and the secondary chain block. One main chain block may correspond to one sub-chain block, which is block data derived based on the main chain block.
And 140, when the character data of any main chain block in the main block chain contains harmful information, determining the main chain block containing the harmful information as a harmful block, and replacing the harmful block with a corresponding secondary chain block according to the corresponding relation.
The electronic device may detect whether each main chain block in the main chain contains harmful information, where the harmful information may refer to information related to illegal activities, information tampered with maliciously, and the like. As one way, whether each main chain block in the main chain block contains harmful information can be detected every preset time period, whether the data stored in the main chain block contains sensitive characters can be detected, and if the data contains sensitive characters, the main chain block can be determined to contain harmful information. The preset time period may be set according to actual requirements, for example, may be 1 hour, 3 hours, and the like, which is not limited herein.
In one embodiment, it is also possible to detect whether each main chain block in the main chain contains harmful information according to the reporting situation of the user. When the data of the main chain block accessed by the user contains harmful information, the harmful information can be reported. The electronic device may receive reporting information, which may include a block identification of the main chain block being reported, based on which the number of times the main chain block was reported may be recorded. When the number of reported intersections of the same main chain block reaches a first threshold, it can be determined that the main chain block contains harmful information.
In one embodiment, the electronic device may record the change information when the data of the main chain block changes, wherein the change of the data of the main chain block is usually the change of the text data in the transaction information. The change information may include a block identification of the backbone block in which the data change occurred, a change time, and a device identification of the backbone block, for example, a device IP (Internet Protocol ) address of the backbone block, or a user account of the backbone block. Whether the fluctuation information is abnormal or not can be detected, for example, whether the fluctuation is too frequent or not can be detected, and when the fluctuation times of the same main chain block are detected to be larger than a second threshold value and the difference value of the adjacent two fluctuation times is smaller than a preset time difference, the abnormality can be determined; it is also possible to detect whether the device performing the change operation is abnormal, and when the device identifier of the modified main chain block is a strange identifier, i.e. the identifier appearing for the first time, or an identifier not in the white list, it is possible to determine that there is an abnormality. The method of detecting abnormality in the fluctuation information is not limited to the above-described ones, and the detection method is not limited thereto. When abnormality of the variation information of the main chain block is detected, it can be determined that the main chain block contains harmful information.
The electronic device may determine a main chain block containing harmful information as a harmful block. And acquiring a sub-chain block corresponding to the harmful block according to the recorded corresponding relation, and replacing the harmful block with the corresponding sub-chain block. It will be appreciated that the manner of detecting whether the backbone block contains harmful information is not limited to the several ways described above, but may be other ways.
In some embodiments, an intelligent contract may be provided in an electronic device, which is a computer protocol intended to propagate, verify, or execute contracts in an informative manner, through which a third party may be permitted to conduct trusted transactions in a blockchain. Through the intelligent contract, the method for controlling the harmful information based on the blockchain in the embodiment of the application can be executed, when the harmful main chain block is detected, the harmful main chain block can be replaced by the corresponding harmless secondary chain block, and the propagation of the harmful information in the blockchain can be effectively controlled.
In the embodiment of the application, the main chain block comprising the text data is generated according to the first rule, the secondary chain block not comprising the text data is generated according to the second rule, the corresponding relation between the generated main chain block and the secondary chain block is recorded, when the text data of any main chain block in the main chain block contains harmful information, the main chain block containing the harmful information is replaced by the corresponding secondary chain block, and the transmission of the harmful information in the blockchain can be effectively controlled by replacing the harmful main chain block by the corresponding harmless secondary chain block, the integrity and the use of the whole main chain block are not influenced, and the safety of the blockchain technology is improved.
As shown in FIG. 2, in one embodiment, the step of generating a main chain block of a main blockchain according to a first rule may include steps 202-204, and the step of generating a secondary chain block of a secondary blockchain according to a second rule from the main chain block may include steps 206-210.
Step 202, generating a root hash of the main chain block according to the transaction information, and storing the root hash into the first block header.
The master chain includes a master block that may have a first block data structure that may include a first block header and a first block body. Alternatively, the first block header may store therein a block hash of a main block, a block hash of a last main block (i.e., a parent hash), a random number, a root hash, etc., but is not limited thereto. The random number may then be used to calculate the workload, and the root hash may be Merkle (Merkle) tree root data, which may be used to summarize and quickly retrieve the data stored in the check first zone block. The first zone block may then store one or more items of transaction information.
In one embodiment, a random number of a main chain block is obtained through a preset algorithm, and a block hash of the main chain block is generated based on the random number. All transaction information stored in the first region block may be obtained and a root hash of the master chain block may be generated based on the stored all transaction information. The transaction information may include transaction data, which may refer to basic data of a transaction, for example, the transaction data may include the number of transactions, price, authentication public key, address, etc., and text data, which is data input and stored by a user. One or more items of transaction information are stored in the first zone block, a hash value corresponding to each item of transaction information can be generated, and a root hash is calculated in an iterative mode, namely a mode that every two hash values can generate new hash values. The calculated root hash may be stored in a first block header of the main block.
Step 204, obtain the block hash of the previous main chain block, and store the block hash of the previous main chain block into the first block header.
The block hash of the last main chain block of the generated main chain block can be obtained and stored into the first block header of the generated main chain block. FIG. 3 is a schematic diagram of a data structure of a main chain block in one embodiment. As shown in fig. 3, the main chain block 300 includes a first block header 310 and a first block 320, the first block header 310 may include a present block hash, a last block hash, a random number, a root hash, and the like, the first block 320 may include n pieces of transaction information, and each piece of transaction information may include transaction data and text data. The block hash may be calculated by a preset algorithm, and the root Ha Xike is calculated according to each item of transaction information in the first block 320.
In one embodiment, the chain structure between the generated backbone block and the last backbone block, i.e., the directional relationship in which the generated backbone block points to the last backbone block, may be established based on the block hash of the last backbone block, thereby forming the master blockchain. For example, the generated block hash of the main chain block is A2, and the block hash of the last main chain block is A1, then a chain structure between the main chain block and the last main chain block, i.e. the pointing relationship of A2 pointing to A1, can be established, so that the main blockchain can be generated. FIG. 4 is a diagram of a data structure of a master blockchain in one embodiment. As shown in fig. 4, the master blockchain may include 3 master chain blocks, wherein the blockhash of master chain block 1 is A1, the blockhash of master chain block 2 is A2, and the blockhash of master chain block 3 is A3. According to the block hash of the last main chain block stored in each main chain block, the pointing relation of A2 pointing to A1 and A3 pointing to A2 can be established, namely, the chain structure of the main chain block 1-main chain block 2-main chain block 3 is formed.
Step 206, acquiring the transaction information stored in the first block body in the main chain block, deleting the text data contained in the acquired transaction information, and storing the transaction information with the text data deleted in the second block body.
The electronic device can derive the corresponding secondary chain block based on the generated primary chain block derivative. The secondary chain block has a second block data structure that may include a second block header and a second block body. Optionally, the second block header may store a block hash of the secondary chain block, a block hash of the last chain block (i.e., a parent hash), a block hash of the corresponding main chain block, a block hash of the last main chain block of the corresponding main chain block (i.e., a parent hash of the corresponding main chain block), a root hash, and the like, but is not limited thereto. In some embodiments, the block hash of the current chain block stored in the second block header may be obtained by calculating the block hash of the last chain block, the block hash of the corresponding main chain block, the block hash of the last main chain block of the corresponding main chain block, and the root hash.
Transaction information stored in a first block body of the main chain block can be obtained, the transaction information comprises transaction data and text data, the text data in the transaction information can be deleted, only the transaction data is reserved, and the transaction information with the text data deleted is stored in a second block body of the secondary chain block. The second block of the sub-chain block contains transaction data of each transaction information in the main chain block, but does not contain text data possibly with harmful information, so that the sub-chain block can be used as a harmless standby block of the main chain block to replace the main chain block for users to access when the harmful information in the main chain block is detected.
And step 208, generating a root hash of the secondary chain block according to the transaction information stored in the second block, and storing the block hash of the secondary chain block in the second block head.
The root hash of the secondary chain block may be generated from all transaction information stored in the second zone block of the secondary chain block, i.e., the root hash of the secondary chain block may be generated from the transaction data of each transaction. One or more items of transaction information which does not contain text data are stored in the second area block, a hash value corresponding to each item of transaction information can be generated, and the root hash is calculated in an iterative mode, namely a mode that every two hash values can generate new hash values. The calculated root hash may be stored in a second block header of the secondary chain block.
Step 210, obtain the block hash of the last chain block, the block hash of the main chain block, and the block hash of the last main chain block, and store the obtained block hash in the second block header.
The block hash of the last-time chain block can be obtained and stored into the second block header of the secondary chain block to establish a chain structure between the generated secondary chain block and the last-time chain block, namely, the pointing relation of the generated secondary chain block to the last-time chain block. The block hash of the main chain block can be obtained and stored in the second block header of the secondary chain block, so that the corresponding relation between the main chain block and the derived secondary chain block is established. The block hash of the last main chain block of the main chain blocks corresponding to the sub chain blocks can also be obtained, so that the main chain blocks can be replaced conveniently when harmful information exists in the main chain blocks.
FIG. 5 is a diagram illustrating a data structure of a secondary chain block in one embodiment. As shown in fig. 5, the secondary chain block 500 includes a second block header 510 and a second block 520, the second block header 510 may include a present block hash, a last block hash (i.e., a block hash of a last chain block), a main chain block hash, a last main chain block hash, and the like, and the second block header 520 may include n items of transaction information identical to the main chain block, each item of transaction information including only transaction data and not text data. The root Ha Xike is calculated according to each transaction information in the second area block 520, and the block hash can be calculated according to the last block hash, the main block hash, and the last main block Ha Xiji.
In one embodiment, a chain structure between the generated secondary chain block and the last chain block, i.e., a pointing relationship in which the generated secondary chain block points to the last chain block, may be established according to the block hash of the last chain block, thereby forming a secondary blockchain.
FIG. 6 is a diagram illustrating a data structure of a secondary blockchain in an embodiment. As shown in FIG. 6, the secondary blockchain corresponds to the primary blockchain shown in FIG. 4. The secondary blockchain may include 3 secondary blockchains, wherein the blockhash of secondary blockchain 1' is C1, derived from primary blockchain 1 in fig. 4, the blockhash of secondary blockchain 2' is C2, derived from primary blockchain 2 in fig. 4, and the blockhash of secondary blockchain 3' is C3, derived from primary blockchain 3 in fig. 4. According to the block hash of the last chain block stored in each sub-chain block, a pointing relationship of C2 pointing to C1 and C3 pointing to C2 can be established, namely, a chain structure of the sub-chain block 1' -sub-chain block 2' -sub-chain block 3' is formed.
In the embodiment of the application, the harmless secondary chain blocks are derived according to the main chain blocks, so that when the main chain blocks are detected to contain harmful information, the corresponding harmless secondary chain blocks are used for replacing, the transmission of the harmful information in the blockchain can be effectively controlled, the integrity and the use of the whole main blockchain are not influenced, and the safety of the blockchain technology is improved. And the generation of the secondary chain block does not need to pass through a preset algorithm, so that the complexity is low, and the data processing efficiency can be improved.
As shown in fig. 7, in one embodiment, the step of replacing the harmful block with a corresponding sub-chain block may include the steps of:
step 702, a first hash pointing relationship of a bad block is determined.
When it is detected that a main chain block in the main chain block contains harmful information, the main chain block containing the harmful information may be determined to be a harmful block. The first hash pointing relationship of the bad block may be obtained based on the chain structure of the master blockchain. The first hash-pointing relationship may include a defective block pointing to a last main chain block relative to the defective block and a next main chain block relative to the defective block pointing to the defective block.
As one embodiment, the first hash direction relationship may be represented by a block hash, and the first hash direction relationship may be determined according to the block hash of the last main block stored in the harmful block and the block hash of the harmful block. For example, as shown in fig. 4, the main blockchain includes a main chain block 1, a main chain block 2 and a main chain block 3, and assuming that the main chain block 2 is a harmful block, it can be determined that the first hash of the harmful block points to the block hash A2 of the harmful block points to the block hash A1 of the previous main chain block, and the block hash A3 of the next main chain block points to the block hash A2 of the harmful block.
Step 704, modifying the first hash pointing relationship to a second hash pointing relationship.
The electronic equipment can replace the harmful block with the sub-chain block corresponding to the harmful block according to the recorded corresponding relation. The first hash pointing relationship of the harmful block may be modified to a second hash pointing relationship, wherein the second hash pointing relationship may include that a sub-chain block corresponding to the harmful block points to a last main chain block of the relatively harmful block, and that a next main chain block of the relatively harmful block points to the corresponding sub-chain block.
As a specific implementation manner, the second hash pointing relationship may be expressed by using a block hash, that is, the block hash pointing to the block Ha Xixiu of the previous main chain block of the harmful block may be changed into the block hash pointing to the block hash of the next main chain block of the harmful block, and the block hash pointing to the harmful block of the next main chain block of the harmful block may be changed into the block hash pointing to the block hash of the next main chain block.
The pointing relationship included in the first hash pointing relationship of the harmful block may be disconnected, that is, the pointing relationship of the block hash of the disconnected harmful block to the block hash of the previous main chain block, and the pointing relationship of the block hash of the next main chain block of the harmful block to the block hash of the harmful block. The pointing relationship of the corresponding sub-chain block to the last main chain block of the relative harmful block can be established according to the block hash of the last main chain block stored in the sub-chain block corresponding to the harmful block. According to the block hash of the corresponding sub-chain block, the pointing relation of the next main chain block of the relative harmful block to the corresponding sub-chain block can be established.
FIG. 8 is a diagram illustrating a data structure of a harmful block replaced with a corresponding sub-chain block according to one embodiment. As shown in fig. 8, the main blockchain includes a main chain block 1, a main chain block 2 and a main chain block 3, and the sub-blockchain corresponding to the main blockchain includes a sub-chain block 1', a sub-chain block 2' and a sub-chain block 3', wherein the sub-chain block 1' is derived from the main blockchain 1, the sub-chain block 2 'is derived from the main blockchain 2, and the sub-chain block 3' is derived from the main blockchain 3. Assuming that the main chain block 2 is a harmful block, the pointing relation of the block hash A2 of the harmful block to the block hash A1 of the previous main chain block and the pointing relation of the block hash A2 of the block hash A3 of the next main chain block to the harmful block can be disconnected, the pointing relation of the block hash C2 of the sub-chain block 2 'to the block hash A1 of the previous main chain block and the block hash A3 of the next main chain block to the block hash C2 of the sub-chain block 2' can be established, thereby completing the block replacement and replacing the harmful block with the harmless sub-chain block.
In one embodiment, the readable properties of the main chain blocks and the secondary chain blocks may be set after the main chain blocks and the secondary chain blocks corresponding to the main chain blocks are generated. When the main chain block is a normal block (i.e. no harmful information is detected by the main chain block), the readable attribute of the main chain block can be set to be readable, and the readable attribute of the secondary chain block can be set to be unreadable, and when a user accesses the main chain block, the stored data of the main chain block can be accessed. When the main chain block is detected to contain harmful information, the harmful block is replaced by a corresponding harmless secondary chain block, the readable attribute of the harmful block can be set to be unreadable, and the readable attribute of the replaced corresponding secondary chain block can be set to be readable. When a user accesses the primary blockchain, the data stored by the replaced secondary blockchain blocks can be accessed, and the harmful blocks can not be accessed, so that the security of the blockchain technology is ensured.
In the embodiment of the application, the harmful main chain blocks are replaced by the corresponding harmless secondary chain blocks, so that the propagation of harmful information in the blockchain can be effectively controlled, the integrity and the use of the whole main blockchain are not influenced, and the safety of the blockchain technology is improved.
In one embodiment, a method of controlling harmful information based on a blockchain is provided, comprising the steps of:
and (1) generating a main chain block of a main block chain according to a first rule, wherein the main chain block comprises text data.
In one embodiment, the main chain block comprises a first block head and a first block body, the first block body comprises transaction information, and the transaction information comprises transaction data and text data; step (1), comprising: generating a root hash of the main chain block according to the transaction information, and storing the root hash into the first block head; and obtaining the block hash of the last main chain block, and storing the block hash of the last main chain block into the first block head.
And (2) generating a secondary chain block of the secondary block chain according to the main chain block according to a second rule, wherein the secondary chain block does not comprise text data.
In one embodiment, the secondary chain block includes a second block header and a second block body; step (2) comprising: acquiring transaction information stored in a first block body in a main chain block, deleting text data contained in the acquired transaction information, and storing the transaction information with the text data deleted in a second block body; generating a root hash of the secondary chain block according to the transaction information stored in the second area block, and storing the root hash of the secondary chain block into the second area head; and acquiring the block hash of the last chain block, the block hash of the main chain block and the block hash of the last main chain block, and storing the acquired block hash into the second block header.
And (3) recording the corresponding relation between the main chain block and the secondary chain block.
And (4) when the character data of any main chain block in the main block chain contains harmful information, determining the main chain block containing the harmful information as a harmful block, and replacing the harmful block with a corresponding secondary chain block according to the corresponding relation.
In one embodiment, replacing the bad block with a corresponding sub-chain block includes: determining a first hash pointing relationship of the harmful blocks, wherein the first hash pointing relationship comprises that the harmful blocks point to a main chain block which is the last main chain block of the relative harmful blocks, and that the next main chain block of the relative harmful blocks point to the harmful blocks; modifying the first hash pointing relationship into a second hash pointing relationship, wherein the second hash pointing relationship comprises that a secondary chain block corresponding to a harmful block points to a main chain block above a relative harmful block, and a next main chain block relative to the harmful block points to a corresponding secondary chain block.
In one embodiment, the step of determining a first hash-pointing relationship for the bad block comprises: determining a first hash pointing relation according to the block hash of the last main chain block stored in the harmful block and the block hash of the harmful block; the step of modifying the first hash pointing relationship to a second hash pointing relationship comprises: disconnecting the pointing relationship contained in the first hash pointing relationship; establishing the pointing relation of the corresponding sub-chain block pointing to the last main chain block of the relative harmful block according to the block hash of the last main chain block stored in the sub-chain block corresponding to the harmful block; and establishing the pointing relation of the next main chain block pointing to the corresponding sub-chain block of the relatively harmful block according to the block hash of the corresponding sub-chain block.
In one embodiment, after step (2), further comprising: the readable property of the main chain block is set to be readable, and the readable property of the secondary chain block is set to be unreadable.
In one embodiment, after step (4), further comprising: the readable attribute of the bad block is set to unreadable and the readable attribute of the corresponding secondary chain block of the replacement is set to readable.
In the embodiment of the application, the main chain block comprising the text data is generated according to the first rule, the secondary chain block not comprising the text data is generated according to the second rule, the corresponding relation between the generated main chain block and the secondary chain block is recorded, when the text data of any main chain block in the main chain block contains harmful information, the main chain block containing the harmful information is replaced by the corresponding secondary chain block, and the transmission of the harmful information in the blockchain can be effectively controlled by replacing the harmful main chain block by the corresponding harmless secondary chain block, the integrity and the use of the whole main chain block are not influenced, and the safety of the blockchain technology is improved.
As shown in fig. 9, in one embodiment, a system 900 for controlling harmful information based on a blockchain is provided, including a first generating module 910, a second generating module 920, a recording module 930, and a replacing module 940.
The first generation module 910 is configured to generate a main chain block of a main chain block according to a first rule, where the main chain block includes text data.
The second generating module 920 is configured to generate a secondary chain block of the secondary blockchain according to the main chain block according to a second rule, where the secondary chain block does not include the text data.
The recording module 930 is configured to record the correspondence between the main chain block and the secondary chain block.
And the replacing module 940 is configured to determine a main chain block containing harmful information as a harmful block when detecting that the text data of any main chain block in the main chain block contains harmful information, and replace the harmful block with a corresponding sub chain block according to the corresponding relationship.
In the embodiment of the application, the main chain block comprising the text data is generated according to the first rule, the secondary chain block not comprising the text data is generated according to the second rule, the corresponding relation between the generated main chain block and the secondary chain block is recorded, when the text data of any main chain block in the main chain block contains harmful information, the main chain block containing the harmful information is replaced by the corresponding secondary chain block, and the transmission of the harmful information in the blockchain can be effectively controlled by replacing the harmful main chain block by the corresponding harmless secondary chain block, the integrity and the use of the whole main chain block are not influenced, and the safety of the blockchain technology is improved.
In one embodiment, the main chain block includes a first block header and a first block body, the first block body containing transaction information, the transaction information including transaction data and literal data.
The first generating module 910 includes a first generating unit and a first storing unit.
The first generation unit is used for generating a root hash of the main chain block according to the transaction information and storing the root hash into the first block head.
The first storing unit is used for obtaining the block hash of the last main chain block and storing the block hash of the last main chain block into the first block head.
The first storing unit is further used for storing the random number obtained through a preset algorithm and the block hash of the main chain block into the first block head.
In one embodiment, the secondary chain block includes a second block header and a second block body.
The second generating module 920 includes a deleting unit, a second generating unit, and a second storing unit.
And the deleting unit is used for acquiring the transaction information stored in the first block body in the main chain block, deleting the text data contained in the acquired transaction information and storing the transaction information with the text data deleted into the second block body.
The second generating unit is used for generating a root hash of the secondary chain block according to the transaction information stored in the second area block and storing the root hash of the secondary chain block into the second area block head.
The second storing unit is used for obtaining the block hash of the last chain block, the block hash of the main chain block and the block hash of the last main chain block, and storing the obtained block hash into the second block header.
In the embodiment of the application, the harmless secondary chain blocks are derived according to the main chain blocks, so that when the main chain blocks are detected to contain harmful information, the corresponding harmless secondary chain blocks are used for replacing, the transmission of the harmful information in the blockchain can be effectively controlled, the integrity and the use of the whole main blockchain are not influenced, and the safety of the blockchain technology is improved. And the generation of the secondary chain block does not need to pass through a preset algorithm, so that the complexity is low, and the data processing efficiency can be improved.
In one embodiment, the replacement module 940 includes a relationship determination unit and a modification unit.
The relationship determining unit is configured to determine a first hash-directed relationship of the harmful blocks, where the first hash-directed relationship includes a main block of the harmful block directed to a previous main block of the relatively harmful block, and a next main block of the relatively harmful block directed to the harmful block.
The modifying unit is configured to modify the first hash pointing relationship into a second hash pointing relationship, where the second hash pointing relationship includes that a secondary chain block corresponding to the harmful block points to a previous main chain block of the relatively harmful block, and that a next main chain block of the relatively harmful block points to the corresponding secondary chain block.
In one embodiment, the relationship determining unit is further configured to determine the first hash pointing relationship according to the block hash of the last main chain block stored in the harmful block and the block hash of the harmful block.
The modifying unit is further configured to disconnect the pointing relationship included in the first hash pointing relationship, establish a pointing relationship of the corresponding sub-chain block to the last main chain block of the relatively harmful block according to the block hash of the last main chain block stored in the sub-chain block corresponding to the harmful block, and establish a pointing relationship of the next main chain block to the relatively harmful block to the corresponding sub-chain block according to the block hash of the corresponding sub-chain block.
In the embodiment of the application, the harmful main chain blocks are replaced by the corresponding harmless secondary chain blocks, so that the propagation of harmful information in the blockchain can be effectively controlled, the integrity and the use of the whole main blockchain are not influenced, and the safety of the blockchain technology is improved.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (8)

1. A method of controlling harmful information based on a blockchain, comprising:
generating a main chain block of a main block chain according to a first rule, wherein the main chain block comprises a first block body, the first block body comprises transaction information, and the transaction information comprises transaction data and text data;
acquiring transaction information stored in a first block body in the main chain block, deleting text data contained in the acquired transaction information, and storing the transaction information deleted with the text data into a second block body of the secondary chain block;
generating a root hash of the secondary chain block according to the transaction information stored in the second area block, and storing the root hash of the secondary chain block into a second area block head of the secondary chain block;
Acquiring the block hash of the last chain block, the block hash of the main chain block and the block hash of the last main chain block, and storing the acquired block hash into the second block header;
recording the corresponding relation between the main chain block and the secondary chain block;
when the fact that the text data of any main chain block in the main block chain contains harmful information is detected, determining that the main chain block containing the harmful information is a harmful block, and replacing the harmful block with a corresponding sub-chain block according to the corresponding relation.
2. The method of claim 1, wherein the main chain block further comprises a first block header, the first block body containing transaction information, the transaction information comprising transaction data and literal data;
the generating a main chain block of the main chain block according to a first rule includes:
generating a root hash of the main chain block according to the transaction information, and storing the root hash into the first block header;
obtaining the block hash of the last main chain block, and storing the block hash of the last main chain block into the first block header;
and storing the random number obtained through a preset algorithm and the block hash of the main chain block into the first block head.
3. The method of claim 1, wherein said replacing the bad block with a corresponding secondary chain block comprises:
determining a first hash-point relationship for the harmful chunk, the first hash-point relationship comprising the harmful chunk pointing to a last backbone chunk relative to the harmful chunk, and a next backbone chunk relative to the harmful chunk pointing to the harmful chunk;
modifying the first hash pointing relationship into a second hash pointing relationship, wherein the second hash pointing relationship comprises that a secondary chain block corresponding to the harmful block points to a last main chain block relative to the harmful block and a next main chain block relative to the harmful block points to the corresponding secondary chain block.
4. The method of claim 3, wherein the determining the first hash-pointing relationship for the bad block comprises:
determining a first hash pointing relation according to the block hash of the last main chain block stored in the harmful block and the block hash of the harmful block;
the modifying the first hash pointing relationship into a second hash pointing relationship includes:
disconnecting the pointing relationship contained in the first hash pointing relationship;
Establishing a pointing relation of the corresponding sub-chain block pointing to the last main chain block relative to the harmful block according to the block hash of the last main chain block stored in the sub-chain block corresponding to the harmful block;
and establishing a pointing relation of pointing the next main chain block relative to the harmful block to the corresponding secondary chain block according to the block hash of the corresponding secondary chain block.
5. The method of claim 1, wherein after the generating of the secondary chain blocks of the secondary chain from the main chain blocks, the method further comprises:
and setting the readable attribute of the main chain block as readable, and setting the readable attribute of the secondary chain block as unreadable.
6. The method of claim 5, wherein after said replacing the bad block with a corresponding secondary chain block, the method further comprises:
and setting the readable attribute of the harmful block as unreadable, and setting the readable attribute of the replaced corresponding secondary chain block as readable.
7. A system for controlling harmful information based on a blockchain, comprising:
the first generation module is used for generating a main chain block of a main block chain according to a first rule, wherein the main chain block comprises a first block body which contains transaction information, and the transaction information comprises transaction data and text data;
The second generation module is used for generating a secondary chain block of a secondary block chain according to a second rule according to the main chain block, wherein the secondary chain block does not comprise the text data;
the recording module is used for recording the corresponding relation between the main chain block and the secondary chain block;
the replacing module is used for determining a main chain block containing harmful information as a harmful block when detecting that the text data of any main chain block in the main chain block contains the harmful information, and replacing the harmful block with a corresponding secondary chain block according to the corresponding relation;
the secondary chain block comprises a second block head and a second block body;
the second generation module includes:
the deleting unit is used for acquiring transaction information stored in a first block body in the main chain block, deleting text data contained in the acquired transaction information, and storing the transaction information for deleting the text data into the second block body;
the second generation unit is used for generating a root hash of the secondary chain block according to the transaction information stored in the second area block and storing the root hash of the secondary chain block into the second area block head;
and the second storage unit is used for acquiring the block hash of the last chain block, the block hash of the main chain block and the block hash of the last main chain block, and storing the acquired block hash into the second block head.
8. The system of claim 7, wherein the main chain block further comprises a first block header;
the first generation module includes:
the first generation unit is used for generating a root hash of the main chain block according to the transaction information and storing the root hash into the first block head;
the first storage unit is used for obtaining the block hash of the last main chain block and storing the block hash of the last main chain block into the first block head;
the first storing unit is further configured to store the random number obtained by a preset algorithm and the block hash of the main chain block into the first block header.
CN202010117398.2A 2020-02-25 2020-02-25 Method and system for controlling harmful information based on block chain Active CN111444270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010117398.2A CN111444270B (en) 2020-02-25 2020-02-25 Method and system for controlling harmful information based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010117398.2A CN111444270B (en) 2020-02-25 2020-02-25 Method and system for controlling harmful information based on block chain

Publications (2)

Publication Number Publication Date
CN111444270A CN111444270A (en) 2020-07-24
CN111444270B true CN111444270B (en) 2023-09-08

Family

ID=71652732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010117398.2A Active CN111444270B (en) 2020-02-25 2020-02-25 Method and system for controlling harmful information based on block chain

Country Status (1)

Country Link
CN (1) CN111444270B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111444215A (en) * 2020-06-12 2020-07-24 支付宝(杭州)信息技术有限公司 Blocking method, device and equipment in block chain type account book

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488722A (en) * 2015-11-30 2016-04-13 布比(北京)网络技术有限公司 Asset data processing method and device based on derivation chain
CN108681572A (en) * 2018-05-04 2018-10-19 蔷薇信息技术有限公司 Date storage method, device and the electronic equipment of block chain
CN108898389A (en) * 2018-06-26 2018-11-27 阿里巴巴集团控股有限公司 Based on the content verification method and device of block chain, electronic equipment
CN109361661A (en) * 2018-10-08 2019-02-19 莆田市烛火信息技术有限公司 A kind of common recognition device for depending on related chain and calculating the block chain of power
CN109558454A (en) * 2018-11-28 2019-04-02 杭州复杂美科技有限公司 Parallel chain digs mine common recognition method, equipment and storage medium
CN109784885A (en) * 2018-12-29 2019-05-21 杨鉴 A kind of block chain ballot common recognition method and system based on equity
CN110471329A (en) * 2019-07-10 2019-11-19 山东开创云软件有限公司 A kind of water quality monitoring and managing method and device, equipment, medium based on block catenary system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488722A (en) * 2015-11-30 2016-04-13 布比(北京)网络技术有限公司 Asset data processing method and device based on derivation chain
CN108681572A (en) * 2018-05-04 2018-10-19 蔷薇信息技术有限公司 Date storage method, device and the electronic equipment of block chain
CN108898389A (en) * 2018-06-26 2018-11-27 阿里巴巴集团控股有限公司 Based on the content verification method and device of block chain, electronic equipment
CN109361661A (en) * 2018-10-08 2019-02-19 莆田市烛火信息技术有限公司 A kind of common recognition device for depending on related chain and calculating the block chain of power
CN109558454A (en) * 2018-11-28 2019-04-02 杭州复杂美科技有限公司 Parallel chain digs mine common recognition method, equipment and storage medium
CN109784885A (en) * 2018-12-29 2019-05-21 杨鉴 A kind of block chain ballot common recognition method and system based on equity
CN110471329A (en) * 2019-07-10 2019-11-19 山东开创云软件有限公司 A kind of water quality monitoring and managing method and device, equipment, medium based on block catenary system

Also Published As

Publication number Publication date
CN111444270A (en) 2020-07-24

Similar Documents

Publication Publication Date Title
Matzutt et al. Thwarting unwanted blockchain content insertion
Torroledo et al. Hunting malicious TLS certificates with deep neural networks
CN108268354A (en) Data safety monitoring method, background server, terminal and system
CN108009445B (en) Semi-centralized trusted data management system
EP3709568A1 (en) Deleting user data from a blockchain
CN110096903B (en) Asset verification method based on block chain and block chain network system
CN108494557A (en) Social security digital certificate management method, computer readable storage medium and terminal device
CN109522747A (en) A kind of anti-tamper diary record system and method based on block chain
CN110018924A (en) A kind of file damage preventing method based on block chain and correcting and eleting codes
WO2019050760A1 (en) Cryptographically linking related events processed across multiple processing systems
CN112487042B (en) Electric energy metering data processing method, device, computer equipment and storage medium
Iftikhar et al. A reversible watermarking technique for social network data sets for enabling data trust in cyber, physical, and social computing
US11868339B2 (en) Blockchain based distributed file systems
CN110223075B (en) Identity authentication method and device, computer equipment and storage medium
CN111444270B (en) Method and system for controlling harmful information based on block chain
Iftikhar et al. A survey on reversible watermarking techniques for relational databases
CN112769567B (en) Block chain HD private key retrieving method
CN117061254B (en) Abnormal flow detection method, device and computer equipment
CN108090364B (en) Method and system for positioning data leakage source
Tiwari et al. A novel watermarking scheme for secure relational databases
CN113987574A (en) Block chain private transaction method, device, equipment and readable storage medium
CN113360568A (en) Method and system for shielding alliance link data and computer readable storage medium
Unnikrishnan et al. Dynamic prediction based watermarking for temporal relational databases
CN102270323A (en) Multi-security cigarette digital anti-counterfeiting method
Harman et al. Cyber resiliency automation using blockchain

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