CN112215600A - Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium - Google Patents

Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium Download PDF

Info

Publication number
CN112215600A
CN112215600A CN201910556174.9A CN201910556174A CN112215600A CN 112215600 A CN112215600 A CN 112215600A CN 201910556174 A CN201910556174 A CN 201910556174A CN 112215600 A CN112215600 A CN 112215600A
Authority
CN
China
Prior art keywords
transaction data
blockchain
block
data
identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910556174.9A
Other languages
Chinese (zh)
Inventor
刘勋
魏艳兰
陈黎君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910556174.9A priority Critical patent/CN112215600A/en
Publication of CN112215600A publication Critical patent/CN112215600A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • 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/26Visual data mining; Browsing structured data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data browsing method, a data browsing device, a data storing device, a computer device and a storage medium, and belongs to the technical field of block chains. According to the method, the first transaction data corresponding to the block information of the block to be browsed is acquired on the first block chain, the second transaction data of the block to be browsed can be replaced according to the first transaction data, the replaced block content is output, and the output block content does not contain the second transaction data, so that when the second transaction data carries illegal information, the node equipment can display the transaction data in the replaced block content through outputting the replaced block content, and therefore the legality of the displayed transaction data can be guaranteed.

Description

Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a data browsing method, a data storing method, a data browsing device, a data storing device, a computer device, and a storage medium.
Background
Since the node device only verifies the form of the transaction data and does not verify the content in the transaction data before packaging the transaction data into the blocks, and the blockchain system does not verify the content of the transaction data in the blocks when recognizing the blocks in common, even if the transaction data carries illegal information, the blocks in which the transaction data is located will be stored in the blockchain of the blockchain system as long as the blockchain system recognizes the blocks in which the transaction data is located in common.
Since the blockchain may be composed of a plurality of blocks, each block may store a plurality of transaction data, and the content of the transaction data is not verified during verification, a large amount of illegal information may be stored in the transaction data stored in the blockchain, and therefore, when the node device in the blockchain system displays the transaction data on the blockchain, the validity of the displayed transaction data cannot be guaranteed, and a method is urgently needed to guarantee the validity of the displayed transaction data.
Disclosure of Invention
The embodiment of the invention provides a data browsing method, a data storing method, a data browsing device, a data storing device, computer equipment and a storage medium, which can ensure the legality of displayed transaction data. The technical scheme is as follows:
in a first aspect, a data browsing method is provided, and the method includes:
receiving a block browsing request, wherein the block browsing request comprises block information;
based on the block information, acquiring first transaction data corresponding to the block information from a first block chain in a block chain system, wherein the first transaction data carries position information of second transaction data on a second block chain of the block chain system, and the second transaction data is transaction data which does not meet target conditions;
acquiring the block content of the block corresponding to the block information on the second block chain;
replacing the second transaction data in the tile content based on the location information of the second transaction data and the first transaction data;
and outputting the replaced block content.
Based on the possible implementation manner, by acquiring the first transaction data corresponding to the block information of the block to be browsed on the first block chain, the second transaction data of the block to be browsed can be replaced according to the first transaction data, and the replaced block content is output.
In one possible implementation manner, the transaction content in the third transaction data is null or non-null preset content.
In one possible implementation, the first transaction data further carries a blockchain identifier, and the blockchain identifier is used to indicate a blockchain storing the transaction data.
In one possible implementation manner, the blockchain identifier includes a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the second blockchain.
In a second aspect, a data storage method is provided, the method comprising:
querying a block on a second blockchain of the blockchain system;
when second transaction data are inquired in a first block on the second block chain, generating first transaction data, wherein the first transaction data carry position information of the second transaction data on the second block chain of the block chain system, and the second transaction data are transaction data which do not meet target conditions;
broadcasting the first transaction data in the blockchain system;
storing a second block on a first blockchain of the blockchain system, the second block carrying the first transaction data.
Based on the possible implementation manner, the first transaction data is generated by inquiring the second transaction data which does not meet the target condition on the second blockchain of the blockchain system, and the second transaction data is stored on the first blockchain in the blockchain system. So that the node device in the blockchain system can replace the second transaction data to be browsed by the first transaction data.
In one possible implementation, the querying the tiles on the second blockchain of the blockchain system includes:
detecting a block after each block is stored on the second chain of blocks; or the like, or, alternatively,
and detecting the blocks stored to the second block chain in the preset time after the preset time.
Based on the possible implementation manner, the real-time performance of the block query can be improved by querying the block on the block chain in real time, or the supervision node device can perform one query operation on the block chain after a preset time length, so that the supervision node device can be prevented from performing multiple query operations.
In one possible implementation, the first transaction data also carries third transaction data.
In one possible implementation manner, the transaction content in the third transaction data is null or non-null preset content.
In one possible implementation, the first transaction data further carries a blockchain identifier, and the blockchain identifier is used to indicate a blockchain storing the transaction data.
In a possible implementation manner, the blockchain identifier includes a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the second blockchain.
In a third aspect, a data storage method is provided, which includes:
receiving first transaction data, wherein the first transaction data carries position information of second transaction data on a second blockchain of a blockchain system, and the second transaction data is the transaction data which does not meet target conditions;
when the first transaction data passes verification, generating a second block, wherein the second block carries the first transaction data;
broadcasting the second block in the block chain system;
storing the second block on a first blockchain of the blockchain system.
In one possible implementation, the second transaction data also carries third transaction data.
In one possible implementation manner, the transaction content in the third transaction data is null or non-null preset content.
In one possible implementation, when the signature of the supervising node device carried by the first transaction data is verified, otherwise, the first transaction data is not verified.
In one possible implementation, when the created block of the first block chain stores the public key of the supervisory node device, the signature of the supervisory node device passes verification, otherwise, the signature of the supervisory node device does not pass verification.
In one possible implementation, the first transaction data further carries a blockchain identifier, and the blockchain identifier is used to indicate a blockchain storing the transaction data.
In one possible implementation manner, the blockchain identifier includes a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the second blockchain.
In a fourth aspect, an apparatus for browsing data is provided, which is configured to execute the above data browsing method. Specifically, the data browsing apparatus includes a functional module configured to execute the data browsing method provided in the first aspect or any one of the optional manners of the first aspect, where the aspect is an aspect corresponding to a data browsing method applied to a node device in a blockchain system.
In a fifth aspect, a data storage device is provided for executing the data storage method. Specifically, the data storage apparatus includes functional modules for executing the data storage method provided in the second aspect or any optional manner of the second aspect, where the above aspect is an aspect corresponding to a data storage method applied to a supervising node device in a blockchain system.
In a sixth aspect, an apparatus for storing data is provided, which is used for executing the above data storing method. Specifically, the data storage apparatus includes functional modules configured to execute the data storage method provided in the third aspect or any optional manner of the third aspect, where the above aspect is an aspect corresponding to a data storage method applied to a supervising node device in a blockchain system.
In a seventh aspect, a computer device is provided, which includes a processor and a memory, where the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operations performed by the data browsing method.
In an eighth aspect, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the operation performed by the data storage method.
In a ninth aspect, a storage medium is provided, in which at least one instruction is stored, and the instruction is loaded and executed by a processor to implement the operations performed by the data browsing method.
In a tenth aspect, a storage medium is provided, in which at least one instruction is stored, the instruction being loaded and executed by a processor to implement the operations performed by the data storage method as described above.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a block chain system according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a node device according to an embodiment of the present invention;
FIG. 3 is a flow chart of a data storage method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of first transaction data provided by an embodiment of the invention;
FIG. 5 is a flowchart of a data browsing method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a block chain according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data browsing apparatus according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a data storage device according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a data storage device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a blockchain system according to an embodiment of the present invention, and referring to fig. 1, the blockchain system includes a plurality of node devices. Each node device may be configured with at least one blockchain, that is, there is at least one blockchain in the blockchain system, and the at least one blockchain may be divided into a management chain and a general chain, where transaction data stored on the management chain is used for managing the general chain, and the general chain is used for storing general transaction data.
The plurality of node devices may be a plurality of devices of the same organization, a plurality of devices belonging to different organizations, or a device of a common user, and the plurality of node devices may all generate transaction data, package at least one transaction data, and generate a block, but when the block chain system stores data, the block chain system may be divided into a monitoring node device and a common node device due to different purposes of each node device.
The supervision node equipment can be used as a supervision party for supervising whether bad information is stored in the blocks on the common chain in the block chain system, when the supervising node device finds that the transaction data stored on the regular chain of the blockchain system carries bad information, the supervising node device may generate transaction data for managing the common chain, which, when stored on the management chain, if the node equipment in the blockchain system needs to inquire whether the transaction data related to the transaction data to be browsed is stored in the management chain before displaying the transaction data in the common chain to the user, if the transaction data related to the transaction data to be browsed is stored, and replacing the transaction data to be browsed according to the content in the transaction data, and displaying the replaced transaction data so as to prevent the user from browsing the transaction data carrying bad information.
The supervision node device in the blockchain system has a right to issue transaction data (supervision transaction data for short) for managing a common chain, and the supervision transaction data issued by the supervision node device may have different types, for example, the transaction data for replacing the transaction data carrying bad information is a kind of supervision transaction data, and of course, different types of supervision transaction data may be issued by different types of supervision node devices.
In some embodiments, when the blockchain system creates a management chain, the verification information of the monitoring node device may be stored in a created block of the management chain, and the verification information of the monitoring node device may refer to a public key of the monitoring node device, or may be other information representing the monitoring node device.
Fig. 2 is a schematic structural diagram of a computer device according to an embodiment of the present invention, where the computer device 200 includes a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 201 and one or more memories 202, where the memory 202 stores at least one instruction, and the at least one instruction is loaded and executed by the processor 201 to implement the methods provided by the method embodiments described below. Certainly, the computer device 200 may further have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input and output, and the computer device 200 may further include other components for implementing device functions, which are not described herein again.
In an exemplary embodiment, there is also provided a storage medium, such as a memory including instructions executable by a processor in a terminal to perform a data storage method and a data browsing method in the following embodiments. For example, the storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a compact disc-read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In order to further embody the process of storing the transaction data generated by the supervision node device, refer to a flowchart of a data storage method provided by an embodiment of the present invention as shown in fig. 3, where the method specifically includes:
301. the supervising node apparatus queries for blocks on a second blockchain of the blockchain system.
The second blockchain is a common chain in the blockchain system and is used for storing common transaction data.
The supervisory node device may query at least one block in the second blockchain, and the supervisory node device may query the block in the second blockchain in real time or may query the block in the second blockchain in non-real time.
In a possible implementation manner, the supervisory node device detects a block after storing the block in the second block chain every time, so that the block in the second block chain can be queried in real time, and by querying the block in the block chain in real time, the real-time performance of querying the block can be improved.
In a possible implementation manner, after each preset duration, the supervisory node device detects the block stored in the second blockchain within the preset duration, so that the block on the second blockchain can be detected in a non-real-time manner, where the preset duration may be any duration, and the preset duration is not specifically limited in the embodiment of the present invention. Therefore, after the preset duration, the supervision node device can perform one query operation on the blocks on the block chain, so that the supervision node device can be prevented from performing multiple query operations.
In some embodiments, the supervising node device may also perform this step 301 based on a query blockchain request. In one possible implementation, when the supervising node device receives the query blockchain request, the supervising node device executes step 301. The query blockchain request may be triggered by a user operation, for example, when a user with administrative authority needs to query transaction data on the blockchain, the user may click a query button on a query interface of the supervisory node device to trigger the query blockchain request, so that the supervisory node device may receive the query blockchain request.
302. When second transaction data is inquired in a first block on the second blockchain, the supervision node equipment generates first transaction data, the first transaction data carries position information of the second transaction data on the second blockchain of the blockchain system, and the second transaction data is the transaction data which does not meet target conditions.
The first block is any block on the second blockchain. The target condition may be that the content of the transaction data is legal, and when the content of any transaction data is illegal, the any transaction data is transaction data that does not meet the target condition.
The monitoring node device can judge whether the transaction data is illegal content by inquiring whether sensitive words are stored in the transaction data in the first block, when the sensitive words exist in the transaction data, the content of the transaction data is illegal content and does not accord with target conditions, namely the transaction data is second transaction data, otherwise, the content of the transaction data is not illegal content and accords with the target conditions, namely the transaction data is not the second transaction data. For example, the sensitive word may be xxx, the monitoring node device may query whether the first block stores transaction data carrying the sensitive word xxx, and when the transaction data in the first block carries the sensitive word xxx, the transaction data carrying the sensitive word xxx is the second transaction data. The embodiment of the present invention does not specifically limit the manner and the target condition of the supervising node device for determining whether the first block has the second transaction data.
The position information of the second transaction data on the second blockchain in the blockchain system includes the block information of the block where the first transaction data is located on the second blockchain and the serial number of the first transaction data in the block, and the block information may be the height of the block, the number of the block, and the like.
The first transaction data is used to manage second transaction data in the blockchain system, and the first transaction data may also carry a signature of the supervisory node device to indicate that the first transaction data was generated by the supervisory node device.
The first transaction data may also carry third transaction data, the third transaction data being used to replace the second transaction number to be output. The transaction content in the third transaction data may be null, that is, the field for storing the transaction content in the third transaction data is null, and then, since the transaction content in the third transaction data is null, before the second transaction data is output, the second transaction data is replaced with the third transaction data, and then, the third transaction data is output, which is equivalent to deleting the second transaction data on the second blockchain. The transaction content of the third transaction data may also be non-empty preset content, that is, a field in the third transaction data for storing the transaction content stores preset non-empty content, for example, some specific information, and then, since the transaction content in the third transaction data is non-empty, before the second transaction data is output, the second transaction data is replaced with the third transaction data, and then, the third transaction data is output, which is equivalent to modifying the second transaction data on the second blockchain, and the embodiment of the present invention does not specifically limit the non-empty preset content.
The first transaction data may further carry a blockchain identifier, where the blockchain identifier is used to indicate a blockchain storing the transaction data, and the blockchain identifier may include a first blockchain identifier and a second blockchain identifier, where the first blockchain identifier is used to indicate that the blockchain storing the transaction data is a first blockchain, where the first blockchain is a management chain in a blockchain system, and the second type identifier is used to indicate that the blockchain storing the transaction data is a second blockchain. Different blockchain identifications may be represented by different strings, e.g., a first blockchain identification is represented by 0 and a second blockchain identification is represented by 1. The embodiment of the present invention does not specifically limit the representation manner of the block chain identifier.
Since the supervision node device in the blockchain system can supervise illegal information on the second blockchain and can supervise other information, the supervision transaction data generated by the supervision node device can be of different types, the supervision transaction data of different types are used for supervising different information, the first transaction data is supervision transaction data, in order to distinguish the supervision transaction data of different types, the supervision transaction data can also carry a transaction type identifier, and the transaction type identifier is used for indicating the type of the supervision transaction data. The transaction type identifier may include multiple types of transaction type identifiers, where the different types of transaction type identifiers are used to indicate different types of supervision transaction data, and then the first transaction data may further carry a transaction type identifier, where the transaction type identifier carried by the first transaction data is used to indicate a type of the first transaction data, for example, the transaction type identifier in the first transaction data is a replacement type transaction type identifier used to indicate that the transaction data is replaced.
To facilitate understanding of the content of the first transaction data, referring to fig. 4, fig. 4 is a schematic diagram of a first transaction data according to an embodiment of the present invention. As can be known from the first transaction data in fig. 4, the first transaction data is transaction data n, where n is a serial number of the first transaction data in the second block, the first transaction data carries a transaction type (type), location (position) information, specific information (message), signature (signature) information, and other basic information, where the transaction type (type) is equivalent to a transaction type identifier, the type identifier is used to represent replacement (change) data, the location information is equivalent to location information of the second transaction data on the second block chain of the block chain system, the specific information is equivalent to third transaction data, and the signature information is equivalent to a signature of the monitoring node device.
303. The supervising node device broadcasts the first transaction data in a blockchain system.
The supervising node device broadcasts the first transaction data in the blockchain system so that other node devices except the supervising node device can receive the first transaction data.
304. The first node device receives the first transaction data.
The first node device is any node device in the blockchain system. The first transaction data received by the first node device may be the first transaction data directly broadcast to the first node device by the supervising node device, or may be the first transaction data broadcast by the other node devices based on the supervising node device.
305. When the first transaction data passes the verification, the first node equipment generates a second block, and the second block carries the first transaction data.
The first node device may receive transaction data broadcasted by any node device, and therefore the transaction data received by the first node device may be supervision transaction data or ordinary transaction data, and since the supervision transaction data needs to be stored in the first blockchain and the ordinary transaction data needs to be stored in the second blockchain, after receiving any transaction data, the first node device needs to judge the blockchain type identifier carried by the any transaction data, and judge whether the any transaction data is supervision transaction data or ordinary transaction data, then, when the blockchain type identifier carried by any transaction data is the first blockchain type identifier, the any transaction data is explained to be supervision transaction data, and the any transaction data needs to be stored in the first blockchain; when the blockchain type identifier carried by any transaction data is the second blockchain type identifier, the any transaction data is indicated to be common transaction data, and the any transaction data needs to be stored on the second blockchain.
Since the first transaction data carries the first blockchain identifier, the first transaction data needs to be stored on the first blockchain. Before the first transaction data is packaged into the second block, the first node device also needs to verify the first transaction data, when the first transaction data passes the verification, the first node device can package the first transaction data into the second block, otherwise, the first transaction data cannot be packaged into the second block.
The first node device may verify the first transaction data by verifying a signature of a supervising node device carried by the first transaction data. In one possible implementation, when the signature of the supervising node device carried by the first transaction data is verified, otherwise, the first transaction data is not verified.
The blockchain system may store public keys of all supervisory node devices in the blockchain system in the foundational block of the first blockchain so that the node devices in the blockchain system may verify whether the first transaction data was generated by the supervisory node device, and thus, the first node device may verify the signature of the supervisory node device according to the public keys of the supervisory node devices stored in the foundational block of the first blockchain. In a possible implementation manner, when the created block of the first block chain stores the public key of the supervisory node device, the signature of the supervisory node device passes verification, otherwise, the signature of the supervisory node device does not pass verification.
The first node device may verify whether the public key of the supervisory node device is stored in the created block according to whether the public key of the supervisory node device stored in the created block can decrypt the signature of the supervisory node device. In a possible implementation manner, the first node device may decrypt the signature of the monitoring node device with the public key of the monitoring node device stored in the created block, and when the signature of the monitoring node device is decrypted successfully with the public key of any monitoring node device stored in the created block, it is determined that the public key of the monitoring node device is stored in the created block, otherwise, the public key of the monitoring node device is not stored in the created block.
Then, when the signature of the supervising node device is verified, it indicates that the first transaction data is generated by the supervising node device, otherwise, the first transaction data is not generated by the supervising node device, and the first transaction data can be directly discarded by the first node device. Therefore, the validity of the first transaction data can be ensured by verifying the first transaction data, the first node equipment is prevented from processing invalid first transaction data, and the workload of the first node equipment is reduced.
When the first transaction data passes the verification, the first node device may store the first transaction data, and when the first node device stores a plurality of verified supervised transaction data, the first node device may package the first transaction data and other verified supervised transaction data to generate a second block, and then the second block stores the first transaction data.
It should be noted that, at this time, the first node device is a device that generates the second block, and of course, the device that generates the second block may also be any node device in the block chain system, and the transaction data in the second block is all supervision transaction data.
306. The first node apparatus broadcasts the second block in the block chain system.
The first node device broadcasts the second block in the block chain system so that other node devices except the first node device can receive the second block.
307. The first node device stores the second block on the first block chain of the block chain system.
Specifically, the first node device stores the second block on a first block chain configured by the first node device. In some embodiments, the first node device is capable of storing the second block on the first blockchain of the blockchain system only if the second block is agreed upon by the blockchain system.
When other node devices except the first node device in the blockchain system receive the second block, the second block can be verified, when the block height of the second block is 1 larger than the block height of the last block on the current blockchain, the second block passes the verification, otherwise, the second block does not pass the verification, or when the parent hash of the second block is consistent with the block hash of the last block on the current blockchain, the second block passes the verification, otherwise, the second block does not pass the verification. Then, when the predetermined number of node devices in the blockchain system verify the second block, the blockchain system agrees with the second block, otherwise, the second block does not agree with the second block.
In the method provided by the embodiment of the invention, the first transaction data is generated by inquiring the second transaction data which does not meet the target condition on the second blockchain of the blockchain system, and the second transaction number is stored on the first blockchain in the blockchain system. So that the node device in the blockchain system can replace the second transaction data to be browsed by the first transaction data. In addition, by inquiring the blocks on the block chain in real time, the real-time performance of inquiring the blocks can be improved. And after the preset duration, the supervision node equipment can perform one query operation on the blocks on the block chain, so that the supervision node equipment can be prevented from performing multiple query operations. Moreover, by verifying the first transaction data, the validity of the first transaction data can be ensured, the first node device is prevented from processing invalid first transaction data, and the workload of the first node device is reduced.
Through the process shown in fig. 3, after the first transaction data is stored in the first blockchain, any node device in the blockchain system can acquire the first transaction data from the first blockchain, so that when the second transaction data is to-be-browsed transaction data, the any node device can replace the to-be-browsed second transaction data according to the first transaction data. In order to embody a process of replacing the second transaction data to be browsed by the node device in the blockchain system according to the first transaction data, referring to fig. 5, fig. 5 is a flowchart of a data browsing method provided in an embodiment of the present invention, where the method flow specifically includes the following steps:
501. the first node equipment receives a block browsing request, wherein the block browsing request comprises information to be blocked.
The first node device is any node device in the blockchain system. The block information is block information of the block to be browsed, and is used to indicate the block to be browsed, where the block information may be a block number of the block to be browsed, or may also be other information indicating the block to be browsed.
The block browsing request may be triggered by a user operation, for example, when the user needs to browse a certain block, the user may input a block number in the display interface of the first node device, and click a browsing button in the display interface, and the block browsing request may be triggered, so that the first node device may receive the block browsing request.
502. The first node device obtains first transaction data corresponding to the block information from a first block chain in a block chain system based on the block information, wherein the first transaction data carries position information of second transaction data on a second block chain of the block chain system, and the second transaction data is transaction data which does not meet target conditions.
Because the position information carried by the first transaction data may include the block information of the block where the second transaction data is located, the first node device may traverse the transaction data stored in the first block chain, and when the block information in the position information carried by any transaction data is consistent with the block information in the block browsing request, the first node device may acquire the any transaction data as the first transaction data corresponding to the block information. Specifically, the first node device may compare block information in the location information carried by any transaction data with block information in the block browsing request, and determine whether the two block information are consistent according to a comparison result.
When the first node device does not acquire the first transaction data corresponding to the block information on the first block chain, it is indicated that the second transaction data is not stored in the block to be browsed, and the first node device may directly output the block content of the block to be browsed after acquiring the block content. When the first node device acquires the first transaction data corresponding to the block information on the first block chain, it indicates that the second transaction data is stored in the block to be browsed, and then, in order to avoid the user browsing the second transaction data, the first node device needs to perform the following steps.
503. And the first node equipment acquires the block content of the block corresponding to the block information on the second block chain.
The block corresponding to the block information is the block to be browsed, and the content of the block comprises at least one piece of transaction data stored in the block to be browsed. The first node device may determine, according to the block information in the block browsing request, a position of the block to be browsed on the second block chain, so that the first node device may obtain the block to be browsed on the second block chain configured by the first node device, and obtain the block content of the block to be browsed.
504. The first node device replaces the second transaction data in the block content based on the location information of the second transaction data and the first transaction data.
Since the location information of the second transaction data includes the serial number of the second transaction data, the first node device may determine the second transaction data in the tile content according to the serial number of the second transaction data, so as to replace the second transaction data in the tile content.
Considering that the first transaction data carries third transaction data, the first node device may replace the second transaction data in the block content with the third transaction data to replace the second transaction data in the block content.
505. The first node device outputs the replaced tile content.
The block content output by the first node device does not contain the second transaction data, so that the user cannot browse the second transaction data.
According to the method provided by the embodiment of the invention, the first transaction data corresponding to the block information of the block to be browsed is acquired on the first block chain, the second transaction data of the block to be browsed can be replaced according to the first transaction data, and the replaced block content is output.
To further illustrate the two processes of fig. 3 and 5, the following are summarized here:
when the block chain (normal chain, second block chain) is created at point 1, a block chain (management chain, first block chain) for managing the block chain needs to be created at the same time, and the created block of the management chain needs to be written with the verification information of the supervision node device (namely, the public key of the supervision node device) to indicate that the supervision node device written in the created block has the right to write the transaction to the management chain, and the write transaction is equivalent to generating transaction data. The blockchain system writes management transactions only when there is a management normal chain requirement (the writing of the management transactions is to generate the first transaction data), and the management chain does not need to write any management transactions even if the normal chain continuously writes the transactions when there is no management requirement.
Before the 2 nd point and any node device read data from the ordinary chain, the management information needs to be read from the management chain. Node devices other than the supervisory node can write transactions (normal transaction data) containing business logic or business data only into the normal chain.
Wherein, the management chain reading management information is equivalent to acquiring the first transaction data corresponding to the block information from the first block chain, the reading data is equivalent to acquiring the block content,
if the illegal message is stored in the common chain, the supervision node device at point 3 can generate a management transaction (namely, first transaction data) for deleting the illegal message or modifying the illegal message according to the actual service condition, and the supervision node device needs to sign the management transaction.
For example, if illegal information is stored in the block 4 of the general chain in the block chain diagram shown in fig. 6, the supervising node device may generate the corresponding first transaction data. Specifically, this type of management transaction is the first transaction data shown in fig. 4.
And 4, the supervision node equipment initiates a request for packaging management transaction, the management transaction is packaged into a management chain after being verified and signed, wherein the request for initiating the packaging management transaction is equivalent to that the supervision node equipment broadcasts first transaction data in the blockchain system.
For example, block 3 of the management chain in the block chain diagram of fig. 6 includes management transactions.
At point 5, since the management information needs to be read from the management chain before the transaction is read, and the information stored in the management chain is taken as the standard, the illegal information is replaced by the information in the management transaction (that is, the second transaction data is replaced based on the first transaction data).
Fig. 7 is a schematic structural diagram of a data browsing apparatus according to an embodiment of the present invention, where the apparatus includes:
a receiving module 701, configured to perform step 501;
an obtaining module 702, configured to perform step 502;
the obtaining module 702 is further configured to execute the step 503;
a replacing module 703, configured to perform the step 504;
an output module 704, configured to execute the step 505.
Optionally, the replacing module 704 is further configured to replace the second transaction data in the tile content with third transaction data carried by the first transaction data.
Optionally, the transaction content in the third transaction data is null or non-null preset content.
Optionally, the first transaction data further carries a blockchain identifier, where the blockchain identifier is used to indicate a blockchain storing the transaction data.
Optionally, the blockchain identifier includes a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the second blockchain.
Fig. 8 is a schematic structural diagram of a data storage device according to an embodiment of the present invention, where the data storage device includes:
a query module 801, configured to perform step 301;
a generating module 802, configured to perform the step 302;
a broadcasting module 803, configured to perform step 303;
a storage module 804, configured to execute the step 307.
Optionally, the query module 801 is further configured to:
detecting a block after each block is stored on the second chain of blocks; or the like, or, alternatively,
and detecting the blocks stored to the second block chain in the preset time after the preset time.
Optionally, the first transaction data further carries third transaction data.
Optionally, the transaction content in the third transaction data is null or non-null preset content.
Optionally, the first transaction data further carries a blockchain identifier, where the blockchain identifier is used to indicate a blockchain storing the transaction data.
Optionally, the blockchain identifier includes a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the second blockchain.
Fig. 9 is a schematic structural diagram of a data storage device according to an embodiment of the present invention, where the data storage device includes:
a receiving module 901, configured to perform step 304;
a generating module 902, configured to perform step 305;
a broadcasting module 903, configured to perform the step 306;
a storage module 904, configured to execute the step 307.
Optionally, the second transaction data further carries third transaction data.
Optionally, the transaction content in the third transaction data is null or non-null preset content.
Optionally, when the signature of the supervisory node device carried by the first transaction data passes verification, otherwise, the first transaction data fails verification.
Optionally, when the created block of the first block chain stores the public key of the supervisory node device, the signature of the supervisory node device passes verification, otherwise, the signature of the supervisory node device does not pass verification.
Optionally, the first transaction data further carries a blockchain identifier, where the blockchain identifier is used to indicate a blockchain storing the transaction data.
Optionally, the blockchain identifier includes a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used to indicate that the blockchain storing the transaction data is the second blockchain.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
It should be noted that: in the data browsing and storing device provided in the above embodiment, when browsing or storing data, only the division of the above functional modules is used for illustration, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the embodiments of the data browsing and storing method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the embodiments of the method and are not described herein again.
It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a storage medium, and the storage medium may be a read-only memory, a magnetic disk, an optical disk, or the like.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (40)

1. A method for browsing data, the method comprising:
receiving a block browsing request, wherein the block browsing request comprises block information;
based on the block information, acquiring first transaction data corresponding to the block information from a first block chain in a block chain system, wherein the first transaction data carries position information of second transaction data on a second block chain of the block chain system, and the second transaction data is transaction data which does not meet target conditions;
acquiring the block content of the block corresponding to the block information on the second block chain;
replacing the second transaction data in the tile content based on the location information of the second transaction data and the first transaction data;
and outputting the replaced block content.
2. The method of claim 1, wherein the replacing the second transaction data in the tile content comprises:
and replacing the second transaction data in the block content with third transaction data carried by the first transaction data.
3. The method according to claim 2, wherein the transaction content in the third transaction data is null or non-null preset content.
4. The method of claim 1, wherein the first transaction data further carries a blockchain identifier, wherein the blockchain identifier is used to indicate a blockchain in which the transaction data is stored.
5. The method of claim 4, wherein the blockchain identifier comprises a first blockchain identifier and a second blockchain identifier, the first blockchain identifier is used for indicating that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier is used for indicating that the blockchain storing the transaction data is the second blockchain.
6. A method of data storage, the method comprising:
querying a block on a second blockchain of the blockchain system;
when second transaction data are inquired in a first block on the second block chain, generating first transaction data, wherein the first transaction data carry position information of the second transaction data on the second block chain of the block chain system, and the second transaction data are transaction data which do not meet target conditions;
broadcasting the first transaction data in the blockchain system;
storing a second block on a first blockchain of the blockchain system, the second block carrying the first transaction data.
7. The method of claim 6, wherein querying the blockchain of the second blockchain system for the block comprises:
detecting a block after each block is stored on the second chain of blocks; or the like, or, alternatively,
and detecting the blocks stored to the second block chain in the preset time after the preset time.
8. The method of claim 6, wherein the first transaction data further carries third transaction data.
9. The method according to claim 8, wherein the transaction content in the third transaction data is null or non-null preset content.
10. The method of claim 6, wherein the first transaction data further carries a blockchain identifier, wherein the blockchain identifier is used to indicate a blockchain in which the transaction data is stored.
11. The method of claim 10, wherein the blockchain identifier comprises a first blockchain identifier and a second blockchain identifier, the first blockchain identifier indicating that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier indicating that the blockchain storing the transaction data is the second blockchain.
12. A method of data storage, the method comprising:
receiving first transaction data, wherein the first transaction data carries position information of second transaction data on a second blockchain of a blockchain system, and the second transaction data is the transaction data which does not meet target conditions;
when the first transaction data passes verification, generating a second block, wherein the second block carries the first transaction data;
broadcasting the second block in the block chain system;
storing the second block on a first blockchain of the blockchain system.
13. The method of claim 12, wherein the second transaction data further carries third transaction data.
14. The method according to claim 13, wherein the transaction content in the third transaction data is null or non-null preset content.
15. The method of claim 12, wherein the first transaction data is validated when a signature of a supervising node device carried by the first transaction data is validated, and wherein the first transaction data is not validated otherwise.
16. The method of claim 15, wherein the signature of the supervisory node device is verified when the founder block of the first block chain has the public key of the supervisory node device stored therein, and wherein the signature of the supervisory node device is not verified otherwise.
17. The method of claim 12, wherein the first transaction data further carries a blockchain identifier, wherein the blockchain identifier indicates a blockchain in which the transaction data is stored.
18. The method of claim 17, wherein the blockchain identifier comprises a first blockchain identifier and a second blockchain identifier, the first blockchain identifier indicating that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier indicating that the blockchain storing the transaction data is the second blockchain.
19. A data browsing apparatus, the apparatus comprising:
the device comprises a receiving module, a processing module and a display module, wherein the receiving module is used for receiving a block browsing request which comprises block information;
the acquisition module is used for acquiring first transaction data corresponding to the block information from a first block chain in a block chain system based on the block information, wherein the first transaction data carries position information of second transaction data on a second block chain of the block chain system, and the second transaction data is transaction data which does not meet target conditions;
the obtaining module is further configured to obtain, on the second block chain, block content of a block corresponding to the block information;
a replacement module, configured to replace the second transaction data in the tile content based on the location information of the second transaction data and the first transaction data;
and the output module is used for outputting the replaced block content.
20. The apparatus of claim 19, wherein the replacing module is further configured to replace the second transaction data in the tile content with third transaction data carried by the first transaction data.
21. The apparatus according to claim 20, wherein the transaction content in the third transaction data is null or non-null preset content.
22. The apparatus of claim 19, wherein the first transaction data further carries a blockchain identifier, wherein the blockchain identifier indicates a blockchain in which the transaction data is stored.
23. The apparatus of claim 22, wherein the blockchain identifier comprises a first blockchain identifier and a second blockchain identifier, the first blockchain identifier indicating that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier indicating that the blockchain storing the transaction data is the second blockchain.
24. A data storage device, characterized in that the device comprises:
a query module for querying a block on a second blockchain of the blockchain system;
a generating module, configured to generate first transaction data when second transaction data is queried in a first block on the second blockchain, where the first transaction data carries location information of the second transaction data on a second blockchain of the blockchain system, and the second transaction data is transaction data that does not meet a target condition;
a broadcast module for broadcasting the first transaction data in the blockchain system;
a storage module, configured to store a second block on a first block chain of the block chain system, where the second block carries the first transaction data.
25. The apparatus of claim 24, wherein the query module is further configured to:
detecting a block after each block is stored on the second chain of blocks; or the like, or, alternatively,
and detecting the blocks stored to the second block chain in the preset time after the preset time.
26. The apparatus of claim 24, wherein the first transaction data further carries third transaction data.
27. The apparatus according to claim 26, wherein the transaction content in the third transaction data is null or non-null preset content.
28. The apparatus of claim 24, wherein the first transaction data further carries a blockchain identifier, wherein the blockchain identifier indicates a blockchain in which the transaction data is stored.
29. The apparatus of claim 28, wherein the blockchain identifier comprises a first blockchain identifier and a second blockchain identifier, the first blockchain identifier indicating that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier indicating that the blockchain storing the transaction data is the second blockchain.
30. A data storage device, characterized in that the device comprises:
the receiving module is used for receiving first transaction data, the first transaction data carries position information of second transaction data on a second block chain of the block chain system, and the second transaction data is the transaction data which does not meet target conditions;
the generating module is used for generating a second block when the first transaction data passes verification, and the second block carries the first transaction data;
a broadcasting module for broadcasting the second tile in the tile-chain system;
a storage module to store the second chunk on a first chunk chain of the chunk chain system.
31. The apparatus of claim 30, wherein the second transaction data further carries third transaction data.
32. The apparatus according to claim 31, wherein the transaction content in the third transaction data is null or non-null preset content.
33. The apparatus of claim 30, wherein the first transaction data is validated when a signature of a supervising node device carried by the first transaction data is validated, and wherein the first transaction data is not validated otherwise.
34. The apparatus of claim 33, wherein the signature of the supervisory node device is verified when a founder block of the first block chain has stored therein the public key of the supervisory node device, and wherein the signature of the supervisory node device is not verified otherwise.
35. The apparatus of claim 30, wherein the first transaction data further carries a blockchain identifier, wherein the blockchain identifier indicates a blockchain in which the transaction data is stored.
36. The apparatus of claim 35, wherein the blockchain identifier comprises a first blockchain identifier and a second blockchain identifier, the first blockchain identifier indicating that the blockchain storing the transaction data is the first blockchain, and the first blockchain identifier indicating that the blockchain storing the transaction data is the second blockchain.
37. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to perform operations performed by the data browsing method of any one of claims 1 to 5.
38. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to perform operations performed by the data storage method of any one of claims 6 to 18.
39. A storage medium having stored therein at least one instruction, which is loaded and executed by a processor to perform operations performed by a data browsing method according to any one of claims 1 to 5.
40. A storage medium having stored therein at least one instruction which is loaded and executed by a processor to perform an operation performed by a data storage method according to any one of claims 6 to 18.
CN201910556174.9A 2019-06-25 2019-06-25 Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium Pending CN112215600A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910556174.9A CN112215600A (en) 2019-06-25 2019-06-25 Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910556174.9A CN112215600A (en) 2019-06-25 2019-06-25 Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112215600A true CN112215600A (en) 2021-01-12

Family

ID=74047011

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910556174.9A Pending CN112215600A (en) 2019-06-25 2019-06-25 Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112215600A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391291A (en) * 2017-03-24 2017-11-24 北京瑞卓喜投科技发展有限公司 Modification block chain is the block chain corrigenda method and system for having block volume data
CN109241192A (en) * 2018-09-18 2019-01-18 百度在线网络技术(北京)有限公司 The data modification and block verification method, device, equipment and medium of block chain
CN109542888A (en) * 2018-12-03 2019-03-29 百度在线网络技术(北京)有限公司 The data modification and synchronous method of block chain, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391291A (en) * 2017-03-24 2017-11-24 北京瑞卓喜投科技发展有限公司 Modification block chain is the block chain corrigenda method and system for having block volume data
CN109241192A (en) * 2018-09-18 2019-01-18 百度在线网络技术(北京)有限公司 The data modification and block verification method, device, equipment and medium of block chain
CN109542888A (en) * 2018-12-03 2019-03-29 百度在线网络技术(北京)有限公司 The data modification and synchronous method of block chain, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
JP7087085B2 (en) Terminal application management methods, application servers and terminals
CN111475376A (en) Method and device for processing test data, computer equipment and storage medium
CN111601293B (en) Positioning method and device based on Bluetooth beacon equipment
CN109376534B (en) Method and apparatus for detecting applications
CN109672608B (en) Method for transmitting messages according to time
CN111881209A (en) Data synchronization method and device for heterogeneous database, electronic equipment and medium
CN108763062B (en) Method for filtering buried point names and terminal equipment
US20240103928A1 (en) Information processing method and apparatus for animation resource, device, medium and product
CN112132574A (en) Block chain data checking method, data processing method, device and equipment
CN112148794A (en) Version management method and device of intelligent contract and storage medium
CN108924185A (en) Interface creation method and device
CN111597553A (en) Process processing method, device, equipment and storage medium in virus searching and killing
CN114625407A (en) Method, system, equipment and storage medium for implementing AB experiment
CN108829534B (en) Data problem repairing method, device, computer equipment and storage medium
WO2023041050A1 (en) Document processing method, apparatus and device, and medium
CN112215600A (en) Data browsing method, data storing method, data browsing device, data storing device, computer equipment and storage medium
US12001400B2 (en) Method and apparatus for synchronizing file
CN114237798A (en) Data processing method, device, server and storage medium
CN110968265B (en) Method and device for expanding capacity by fragments and electronic equipment
CN110929207B (en) Data processing method, device and computer readable storage medium
CN113918384A (en) Data saving method, device, equipment and storage medium
CN113626509A (en) Data access method and device, electronic equipment and readable storage medium
CN112162951A (en) Information retrieval method, server and storage medium
CN110839085A (en) Instruction management method, instruction management device, electronic equipment and storage medium
CN115022096B (en) Method and device for downloading software

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