A method for information filtering, computing node and related equipment
By introducing management chains and ordinary chains into the blockchain network, and using illegal keywords and blacklist information on the management chain to filter transaction data, the problem of permanent dissemination of illegal information in the blockchain is solved, and the security of blockchain information service management is improved.
Patent Information
- Application Number
- CN201910569482.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2039-06-27
AI Technical Summary
Due to its immutable nature, blockchain technology will cause illegal information to be recorded on the blockchain, which will cause permanent dissemination, seriously affecting the security of the network environment.
By introducing management chains and ordinary chains into the blockchain network, illegal keywords and blacklist information on the management chain are used to filter transaction data on the ordinary chain, ensuring that unlinked illegal information cannot be published, and preventing illegal information that has been linked to be queried.
It effectively improves the security of blockchain information service management, prevents the spread and query of illegal information, and ensures the security and credibility of blockchain networks.
Smart Images

Figure CN112149173B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology and more particularly to a method for filtering information, a computing node and related equipment. Background Art
[0002] Blockchain is a distributed database that combines data blocks in a sequential manner in chronological order to form a chain data structure. The blockchain system usually includes multiple blockchain nodes, which can communicate with each other through wired or wireless means to query the information published by each node or to generate transactions with each node. As an emerging technology, blockchain has the characteristics of historical traceability, immutable recorded data, anonymity, etc., which makes blockchain widely used in finance, insurance, law, art, real estate, logistics and other industries.
[0003] However, while blockchain technology brings opportunities for national development and convenience to social life, it also brings certain security risks. If someone uses blockchain to spread illegal content, once the information content prohibited by laws and administrative regulations is recorded in the blockchain, due to the tamper-proof nature of blockchain, it will cause the permanent spread of illegal content and have a bad impact on the network environment. Summary of the invention
[0004] The present application provides a method, computing node and related equipment for information filtering, which can not only refuse to publish illegal information that is not on the chain, but also refuse to query illegal information that has been on the chain, thereby improving the security of blockchain information service management.
[0005] In a first aspect, a method for information filtering is provided, which is applied to a blockchain network, wherein the blockchain network includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, and the method includes:
[0006] The first node acquires transaction data, wherein the transaction data is data read by the first node from a first state database according to a transaction request sent by a client, or data to be written into the first state database;
[0007] The first node obtains an illegal keyword from the second state database, wherein the illegal keyword is added by the second node and synchronized to the second state database of the first node;
[0008] The first node matches the illegal keyword with the transaction data;
[0009] When the illegal keyword successfully matches the transaction data, the first node returns information of refusing to execute the transaction request to the client.
[0010] In a specific implementation, when the first node fails to match the illegal keyword with the transaction data, the first node determines to continue to execute the transaction according to the transaction data.
[0011] By implementing the method described in the first aspect, when the first node performs a read transaction or a write transaction process, it determines whether the read transaction or the write transaction process contains illegal information through the illegal keywords in the second state database, so that illegal information that is not on the chain cannot be published on the blockchain by users, and illegal information that has been on the chain cannot be read from the blockchain by users, thereby improving the security of blockchain information service management.
[0012] In some embodiments, before the first node obtains the transaction data, it also includes: the first node obtains a first blacklist from the second state database, wherein the first blacklist is added by the second node and synchronized to the second state database of the first node; the first node obtains a first identity from the transaction request, wherein the first identity is the identity of the client or the identity of the user using the client; the first node matches the first identity with the first blacklist; the first node obtains the transaction data, including: when the first identity fails to match the first blacklist, the first node obtains the transaction data.
[0013] In some embodiments, after the first node determines to continue to execute the transaction according to the transaction data, it also includes: the first node obtains a second blacklist from the second state database, wherein the second blacklist is added by the second node and synchronized to the second state database of the first node; the first node obtains a second identity, wherein the second identity is the identity of other nodes, and the other nodes are nodes that send information to the first node, or the first node is preparing to send information. The first node matches the second identity with the second blacklist; when the first identity and the first blacklist match successfully, the first node refuses to receive the information sent by the other nodes, or the first node refuses to send information to the other nodes.
[0014] In the above implementation, the first blacklist and the second blacklist are added to the second state database by the second node, so that users, clients and nodes in the first blacklist and the second blacklist no longer need to perform keyword matching, and their query and release of blockchain information can be denied, thereby speeding up information filtering.
[0015] In some implementations, the illegal keyword is added by a system chain code in the second node and synchronized to the second state database of the first node, and the system chain code in the second node is used to add or delete the illegal keyword in the second node.
[0016] In some implementations, when the transaction request is a write transaction request, the transaction data is an endorsement result, wherein the endorsement result is a result obtained by the first node simulating a transaction according to the transaction request; when the transaction request is a read transaction request, the transaction data is a query result, wherein the query result is a result obtained by the first node querying the first status database according to the transaction request.
[0017] In some implementations, the first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; and the second node joins the second channel.
[0018] In some implementations, the first node is provided with a first ledger and a second ledger, wherein the first ledger is a ledger corresponding to the common chain, and the second ledger is a ledger corresponding to the management chain; the second node is provided with the second ledger.
[0019] In the above implementation, since the transaction information of the blockchain network is stored in the ledger corresponding to the ordinary chain and the first state database, the illegal keywords, the first blacklist and the second blacklist information required for information filtering are stored in the ledger corresponding to the management chain and the second state database, the transaction information of the blockchain network can be managed by the blockchain administrator, and the filtering information can be managed by the government regulatory department, thereby achieving the purpose of simply and efficiently improving the security of blockchain information services.
[0020] In a second aspect, a method for information filtering is provided, which is applied to a blockchain network, wherein the blockchain network includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, the second node includes the second state database corresponding to the management chain, and the method includes:
[0021] The second node receives a first transaction request sent by a client, where the first transaction request includes an illegal keyword;
[0022] The second node calls the system chain code to perform a transaction according to the second transaction request, so as to add the illegal keyword to the second state database of the second node;
[0023] The second node synchronizes the illegal keyword into the second state database of the first node.
[0024] By implementing the method described in the first aspect, when the first node performs a read transaction or a write transaction process, it determines whether the read transaction or the write transaction process contains illegal information through the illegal keywords in the second state database, so that illegal information that is not on the chain cannot be published on the blockchain by users, and illegal information that has been on the chain cannot be read from the blockchain by users, thereby improving the security of blockchain information service management.
[0025] In some embodiments, the second node receives a second transaction request sent by the client, the second transaction request includes one or more of a first blacklist and a second blacklist, the first blacklist includes identity information of malicious clients and malicious users prohibited from conducting transactions on the blockchain network, and the second blacklist includes identity information of malicious nodes that cooperate with the malicious clients or malicious users to conduct transactions with the blockchain; the second node calls the system chain code to conduct transactions according to the second transaction request to add the first blacklist and the second blacklist to the second state database of the second node; the second node synchronizes the first blacklist and the second blacklist to the second state database of the first node.
[0026] In the above implementation, the first blacklist and the second blacklist are added to the second state database by the second node, so that users, clients and nodes in the first blacklist and the second blacklist no longer need to perform keyword matching, and their query and release of blockchain information can be denied, thereby speeding up information filtering.
[0027] In some implementations, the first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; and the second node joins the second channel.
[0028] In some implementations, the first node is provided with a first ledger and a second ledger, wherein the first ledger is a ledger corresponding to the common chain, and the second ledger is a ledger corresponding to the management chain; the second node is provided with the second ledger.
[0029] In the above implementation, since the transaction information of the blockchain network is stored in the ledger corresponding to the ordinary chain and the first state database, the illegal keywords, the first blacklist and the second blacklist information required for information filtering are stored in the ledger corresponding to the management chain and the second state database, the transaction information of the blockchain network can be managed by the blockchain administrator, and the filtering information can be managed by the government regulatory department, thereby achieving the purpose of simply and efficiently improving the security of blockchain information services.
[0030] In a third aspect, a blockchain node is provided, the blockchain node being a first node of a blockchain network, the blockchain network including a common chain and a management chain, the common chain including a first node, the management chain including a first node and a second node, the first node including a first state database corresponding to the common chain and a second state database corresponding to the management chain, the blockchain node including:
[0031] a first acquisition unit, configured to acquire transaction data, wherein the transaction data is data read by the first node from the first state database according to the transaction request sent by the client, or data to be written into the first state database;
[0032] a second acquiring unit, the second acquiring unit being used to acquire an illegal keyword from the second state database, wherein the illegal keyword is added by the second node and synchronized to the second state database of the first node;
[0033] a matching unit, the matching unit being used to match the illegal keyword with the transaction data;
[0034] A returning unit, wherein the returning unit is used to return information of refusing to execute the transaction request to the client when the illegal keyword successfully matches the transaction data.
[0035] In some embodiments, the second acquisition unit is further used to acquire a first blacklist from the second state database before acquiring the transaction data, wherein the first blacklist is added by the second node and synchronized to the second state database of the first node; the first acquisition unit is further used to acquire a first identity from the transaction request, wherein the first identity is an identifier of the client or an identifier of a user using the client; the matching unit is further used to match the first identity with the first blacklist.
[0036] In some implementations, the node further includes a determination unit, configured to determine to continue executing the transaction according to the transaction data when the illegal keyword fails to match the transaction data.
[0037] In some embodiments, the second acquisition unit is also used to obtain a second blacklist from the second state database after determining to continue executing the transaction according to the transaction data, wherein the second blacklist is added by the second node and synchronized to the second state database of the first node; the first acquisition unit is also used to obtain a second identity, wherein the second identity is the identity of other nodes, and the other nodes are nodes that send information to the first node, or nodes to which the first node is preparing to send information; the matching unit is also used to match the second identity with the second blacklist; the matching unit is also used for the first node to refuse to receive information sent by the other nodes, or the first node to refuse to send information to the other nodes when the first identity and the first blacklist match successfully.
[0038] In some implementations, the illegal keyword is added by a system chain code in the second node and synchronized to the second state database of the first node, and the system chain code in the second node is used to add or delete the illegal keyword in the second node.
[0039] In some implementations, when the transaction request is a write transaction request, the transaction data is an endorsement result, wherein the endorsement result is a result obtained by the first node simulating a transaction according to the transaction request; when the transaction request is a read transaction request, the transaction data is a query result, wherein the query result is a result obtained by the first node querying the first status database according to the transaction request.
[0040] In some implementations, the first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; and the second node joins the second channel.
[0041] In some implementations, the first node is provided with a first ledger and a second ledger, wherein the first ledger is a ledger corresponding to the common chain, and the second ledger is a ledger corresponding to the management chain; the second node is provided with the second ledger.
[0042] In a fourth aspect, a blockchain node is provided, wherein the blockchain node is a second node of a blockchain network, the blockchain includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, the second node includes the second state database corresponding to the management chain, and the node includes:
[0043] A receiving unit, the receiving unit is used to receive a first transaction request sent by a client, the first transaction request includes an illegal keyword;
[0044] A calling unit, configured to call a system chain code to perform a transaction according to the second transaction request, so as to add the illegal keyword to a second state database of the second node;
[0045] A synchronization unit is used to synchronize the illegal keyword to a second state database of the first node.
[0046] In some embodiments, the receiving unit is further used to receive a second transaction request sent by the client, the second transaction request including one or more of a first blacklist and a second blacklist, the first blacklist including identity information of malicious clients and malicious users prohibited from conducting transactions on the blockchain network, and the second blacklist including identity information of malicious nodes that cooperate with the malicious clients or malicious users to conduct transactions with the blockchain; the calling unit is further used to call the system chain code to conduct transactions according to the second transaction request, so as to add the first blacklist and the second blacklist to the second state database of the second node; the synchronization unit is further used to synchronize the first blacklist and the second blacklist to the second state database of the first node.
[0047] In some implementations, the first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; and the second node joins the second channel.
[0048] In some implementations, the first node is provided with a first ledger and a second ledger, wherein the first ledger is a ledger corresponding to the common chain, and the second ledger is a ledger corresponding to the management chain; the second node is provided with the second ledger.
[0049] In a fifth aspect, a computer program product is provided. When the computer program product is read and executed by a computing device, the computer program product is used to implement the method described in the first aspect above.
[0050] In a sixth aspect, a computer program product is provided. When the computer program product is read and executed by a computing device, the computer program product is used to implement the method described in the second aspect above.
[0051] In a seventh aspect, a computer non-volatile storage medium is provided, comprising instructions, which, when executed on a computing device, implement the method described in the first aspect above.
[0052] In an eighth aspect, a computer non-volatile storage medium is provided, comprising instructions, which, when executed on a computing device, implement the method described in the second aspect above.
[0053] In a ninth aspect, a computing node is provided, comprising a processor and a memory, wherein the processor executes a code in the memory to perform the method described in the first aspect.
[0054] In a tenth aspect, a computing node is provided, comprising a processor and a memory, wherein the processor executes a code in the memory to perform the method described in the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0056] Figure 1A-1B It is a schematic diagram of the structure of a blockchain network;
[0057] Figure 2A-2B It is a flowchart of the steps for writing transactions in a blockchain network;
[0058] Figure 3 It is a flowchart of the steps for reading transactions in a blockchain network;
[0059] Figure 4A-4C It is a human-computer interaction flow chart of using an information filtering method provided by the present application in an application scenario;
[0060] Figure 5 It is a structural diagram of a blockchain network provided by this application;
[0061] Figure 6 It is a flowchart of an information filtering method provided by this application;
[0062] Figure 7A-7B This is a flowchart of an information filtering method provided by this application in a writing transaction scenario;
[0063] Figure 8 This is a flowchart of an information filtering method provided by the present application in a reading transaction scenario;
[0064] Fig. 9 It is a structural diagram of a blockchain network system provided by this application. DETAILED DESCRIPTION
[0065] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0066] In order to facilitate understanding of the technical solution of the embodiment of the present application, first of all, Figure 1A-1B Taking the structural diagram of a blockchain network shown in FIG. 1 as an example, the system architecture of the blockchain is briefly described.
[0067] A blockchain network may include one or more blockchains. A blockchain includes multiple blockchain nodes. A blockchain node includes a ledger instance and a chaincode. The ledger instance is used to record transactions in the blockchain network. The chaincode, which may be called a smart contract, is used for the blockchain node to query transactions in the ledger instance and to add transactions in the ledger instance. The number of chaincodes may be one or more. A blockchain may correspond to a channel. A channel has the following characteristics: blockchain nodes that join the same channel may conduct transactions or share ledgers; the same blockchain node may join one or more channels. When the blockchain node joins a channel, the node holds one ledger. When the blockchain node joins multiple channels, the node holds multiple ledgers.
[0068] For example, Figure 1A The blockchain network N in includes blockchain nodes P1, P2 and P3. The blockchain network includes two blockchains, blockchain 1 and blockchain 2. Blockchain 1 includes blockchain nodes P1 and P2, and the corresponding channel is C1. The blockchain nodes P1 and P2 share the ledger L1. Blockchain 2 includes blockchain nodes P1 and P3, and the corresponding channel is C2. The blockchain nodes P1 and P3 share the ledger L2. Chaincode S1 and chaincode S2 are set on blockchain node P1, chaincode S1 is set on blockchain node P2, and chaincode S2 is set on blockchain node P3. Blockchain node P1 accesses the ledger L1 on this node through chaincode S1, accesses the ledger L2 on this node through chaincode S2, blockchain node P2 accesses the ledger L1 on this node through chaincode S1, and blockchain node P3 accesses the ledger L2 on this node through chaincode S2.
[0069] The blockchain network can be managed by one or more organizations. Each organization can include one or more organization nodes, which are managed by an organization administrator. The organization nodes in the same organization can be blockchain nodes on the same blockchain or on different blockchains. For example, Figure 1AThe blockchain nodes P1 and P2 in the blockchain can belong to the organization O1, and the blockchain node P3 can belong to the organization O2. Alternatively, the blockchain node P1 can belong to the organization O1, and the blockchain node P2 and P3 can belong to the organization O2. Each organization can develop different clients or applications (Application) by itself, where the client represents the entity operated by the end user and needs to connect to a certain blockchain node to communicate with the blockchain network, so that users can query information on the blockchain or conduct transactions through the client. In a specific implementation, the client can be various software programs in a user terminal or computer, or a browser (Browser) in a B / S architecture product. The administrator of the organization will assign digital certificates to the nodes within the organization, so that each node can verify its identity through a digital certificate when accessing the blockchain network. Organization administrators can also create, start, stop, reconfigure and delete nodes through their own organization's clients, for example, Figure 1B As shown, the administrator of organization O1 creates a blockchain node P4, adds it to channel C1, assigns O1's digital certificate to blockchain node P4, and installs chain code S1 on the blockchain node P4, so that node P4 can access ledger L1 through chain code S1 and become a node on blockchain 1. It should be noted that since each organization may have different concerns about the same ledger, different organizations sharing the same ledger use different clients. Add an example.
[0070] It should be understood that Figure 1A-1B The blockchain network shown is for illustration only. The blockchain network may also include more nodes and chain codes, etc., which are not specifically limited in this application.
[0071] The following is based on Figure 1A The blockchain system architecture shown in the figure provides a detailed description of the two main application scenarios of blockchain: information publishing process and information query process.
[0072] (I) Information release process (writing transaction process)
[0073] The blockchain nodes on the blockchain can be logically divided into different roles, and each role assumes different functions in a transaction process. Blockchain nodes can be mainly divided into endorsement nodes (Endorser), sorting nodes (Orderer) and committer nodes (Committer). The following is a brief introduction to the detailed process of writing transactions and the functions of various blockchain nodes.
[0074] Figure 2A This is a schematic diagram of a transaction flow provided by this application. Figure 2A It can be seen that the transaction writing process can be divided into the following steps:
[0075] S201: The client or application generates a transaction proposal and sends the transaction proposal to the endorsing node.
[0076] In the specific implementation, the transaction proposal includes the endorsement chaincode function name, endorsement node list, identity information (client signature) and the user's specific transaction content. The endorsement node list is determined based on the endorsement policy pre-set in the endorsement chaincode. For example, the endorsement policy set by the endorsement chaincode needs to be endorsed by the signatures of endorsement nodes A and B, so the address information of the two endorsement nodes A and B is added to the endorsement node list. The transaction proposal will be sent to the two endorsement nodes A and B for endorsement.
[0077] S202: The endorsement node simulates a transaction according to the transaction proposal and generates an endorsement result, sends the endorsement result to the client, and the client receives the endorsement result.
[0078] In the specific implementation, the endorsement node first verifies the client signature in the transaction proposal to determine whether the client has the right to perform the transaction operation. After the verification is passed, the endorsement node simulates the transaction according to the transaction proposal, that is, obtains the endorsement chain code to be executed this time according to the endorsement chain code function name in the transaction proposal, "simulates" the execution of the business logic in the endorsement chain code according to the transaction content, and generates an endorsement result or proposal response (ProposalResponse) for representing the result of the simulated transaction, that is, the endorsement result. And return it to the client, where the endorsement chain code is used for the endorsement node to execute and generate the endorsement result. It should be noted that the account book data will not be updated during the endorsement process, only a simulated transaction is performed to obtain the result of the simulated transaction.
[0079] S203: The client generates transaction information according to the endorsement result sent by the endorsement node, and sends the transaction information to the sorting node, and the sorting node receives the transaction information.
[0080] In the specific implementation, the client first confirms whether the number of endorsement results received from the endorsing node reaches the preset threshold. If the number of transaction proposals received does not reach the preset threshold, the transaction is terminated. If the number of transaction proposals received reaches the preset threshold, the endorsement results returned by each node are compared to determine whether they are consistent, and whether the transaction proposals returned by each node are the endorsement results obtained by executing the correct endorsement strategy. After confirming that the endorsement results returned by each node are consistent and each proposal is the endorsement result obtained by executing the correct endorsement strategy, all endorsement results are packaged and the successfully verified signature is added to generate transaction information and send it to the sorting node.
[0081] S204: The sorting node generates a new block according to the transaction information, and sends the block to the committing node, which receives the block. Specifically, the sorting node sorts the transaction information and other transaction information on the channel according to the transaction time, generates a new block, and sends the packaged block to the committing node.
[0082] S205: The submitting node appends the block to the local blockchain, so that the blockchain nodes on all channels can update the blockchain.
[0083] Combine the following Figure 2B , the write transaction process described in the above S201-S205 is described in detail.
[0084] In a specific embodiment, Figure 2B As shown, the data stored in each node in the blockchain includes ledger data and state data (State Database), where the ledger data is stored in blocks and the state data is stored in the state database (State DB). It should be understood that since reading the ledger data of the blockchain requires traversing the blocks starting from the genesis block, as the blockchain grows, the workload of reading the ledger by traversing the blocks is very large. Therefore, in addition to maintaining the ledger data, each node in the blockchain will also maintain an additional state database to independently store some important data or data that needs to be frequently accessed, so that some businesses can quickly obtain the required data. Therefore, in Figure 2B In the same channel, nodes P1, P2 and P3 maintain not only a ledger L1, but also a state database D1. It should be noted that the ledger data in the block is immutable data, but the state data in the state database records the results of each transaction, so transactions can be added continuously to modify the state data, and the state data is modifiable data.
[0085] In a specific implementation, the state data stored in the state database may be the relevant data of the most recent transaction in the current account book. In order to facilitate quick query of the data required for the current business, the state data is generally stored in the form of key-value pairs (K, V), where K represents the key and V represents the value corresponding to the key, such as K = Xiao Ming, V = 14 years old. This storage method greatly reduces the amount of stored data, and the data required for the business can be obtained simply through single-key query, combination key query, and range key query. The above examples are for illustration only and do not constitute specific limitations.
[0086] Therefore, if Figure 2B As shown, after the client generates a transaction proposal, it sends the transaction proposal to the endorsing node ( Figure 2A Step S201, Figure 2B Step 1), the endorsing node generates the endorsement result in conjunction with the state database D1 ( Figure 2A Step S202, Figure 2B The specific process of steps 1 to 4) is as follows: first, according to the transaction content, the state data 210 in the state database D1 is read to obtain the latest key-value pair of the current ledger transaction, that is, the value corresponding to the K1 key is V1, the value corresponding to the K2 key is V2, and version = 1 represents that the key-value pair is the first version of the key-value pair; then, the endorsement node P1 can simulate the transaction according to the transaction proposal and the key-value pair, execute the chain code to generate a new key-value pair, and form a read-write set 220 (Read-Write Set), wherein the result of the simulated transaction is that the value corresponding to the K1 key is modified to V12, and the value corresponding to the K2 key is modified to V22 ( Figure 2B Step 3 in the above example); Finally, the endorsing node P1 signs the read-write set, generates an endorsement result, and sends it to the client ( Figure 2B It should be understood that since the transaction execution in the endorsement process is only a simulated transaction, the result of the transaction execution (read-write set 230) will not be written into the current state database D1, and the account book will not be updated.
[0087] The sorting node generates blocks in conjunction with the state database ( Figure 2A Steps S203-S204, Figure 2B The specific process of steps 5 to 7) is as follows: after receiving the read-write set 230 sent by the above-mentioned multiple endorsement nodes P1, the client will compare whether these read-write sets are consistent. If they are consistent, it means that the transaction has been recognized by multiple endorsement nodes and is a transaction without problems. Therefore, the read-write set 230 can be packaged into real transaction information and sent to the sorting node P2 for sorting (step 5). The sorting node calls the sorting chain code to sort the transaction according to the transaction information and then generates a new block (steps 6 to 7). In short, after the read-write set 230 goes through steps 4 to 8, if it is determined that the transaction is an executable transaction, the submitting node P3 will record the information of the new transaction in the ledger data according to the read-write set in step 8, and update the status data 230 in the status database accordingly, modify the value corresponding to the K1 key to V12, the value corresponding to the K2 key to V22, and the version to the second version; otherwise, the transaction will be terminated. After the submitting node adds the new block to the blockchain and updates the state database D1, all other blockchain nodes on the channel will also update the ledger L1 and state database D1 maintained by their own nodes, thus ending the transaction.
[0088] Need to explain, Figure 2BIt is only used for illustration. In the specific implementation, the endorsement node can be multiple nodes, the chain code installed on each node, the maintained ledger and the maintained state database can also be multiple, the state database and the state database in the read-write set can also be multiple, and the key-value pairs in the state database and the read-write set are only used for illustration. The key K, version version and value V can correspond to different meanings and formats according to the business scenario, and this application does not make specific limitations.
[0089] (II) Information query process (reading transaction process)
[0090] Below Figure 3 Take the example to explain the process of information query (read transaction). Figure 3 It can be seen that the information query process can be divided into the following steps:
[0091] S301: The client generates a query proposal for querying the target ledger, sends the query proposal to the blockchain node P1, and the blockchain node P1 receives the query proposal. The blockchain node P1 here is a node with the query chain code S1 installed, wherein the query chain code is used for the blockchain node P1 to execute and query the ledger L1 to obtain the query result.
[0092] S302: Blockchain node P1 calls and executes the corresponding query chain code S1 according to the query proposal.
[0093] S303: Blockchain node P1 queries the state database D1 and generates a query result. In the specific implementation, blockchain node P1 can call the getstate function in the query chain code to obtain the state data of the ledger. It should be noted that Figure 3 Only the state database (StateDB) used to store the relevant data of the most recent transaction in the current ledger is shown. In the specific implementation, each node can also maintain other databases according to business needs, such as the ID database (IDstore), which is used to store the chain code ID, so that users can quickly query which ledgers exist in the node, and the history database (HistoryDB), which is used to store the version changes of the key-value pairs in the state database, so that users can quickly query historical transaction information, etc. This application will not go into details.
[0094] S304: Blockchain node P1 returns the query result to the client, and the client receives the query result.
[0095] It is understandable that since each node in the blockchain stores ledger data and status data, in the information query process, it is only necessary to query the status database stored locally at the node to obtain the query result without accessing other nodes. Figure 3 For details not shown or described in Figure 2A-2B The description of the transaction process will not be repeated here.
[0096] In summary, there are no relevant steps for handling illegal information in the information publishing process and information query process of the blockchain, which allows malicious users in the blockchain system to directly publish, record, store, and disseminate illegal information. Once the illegal information is published, it will be permanently tamper-proof. Other users in the blockchain system can also directly access the illegal information, causing the permanent dissemination of illegal information, which greatly reduces the security of blockchain information management.
[0097] In order to solve the problem of low security of blockchain information management mentioned above, the present application provides a method of information filtering, which can not only refuse to publish illegal information that is not on the chain, but also refuse to query illegal information that has been on the chain, thereby improving the security of blockchain information service management.
[0098] Below Figure 4A-4C Taking as an example, an application scenario in which a user uses the information filtering method provided by this application to query blockchain information (read transactions) is illustrated. Figure 4A As shown, assuming that the user currently needs to query all transaction information of a blockchain wallet with an address of "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413" through the blockchain client 410, the user Figure 4A After the wallet address is entered into the search box 411, the blockchain client 410 will display the following Figure 4B The interface shown in FIG. 4 shows the account name, available balance and transaction record 412 of the wallet address to the user. The user clicks on any transaction record 412 to view the detailed information of the transaction. If the detailed information of the transaction does not contain illegal information, the blockchain client 410 will display the detailed information of the transaction; if the detailed information of the transaction contains illegal information, the blockchain client 410 will return the following information: Figure 4C The interface shown reminds the user that the transaction contains a lot of malicious content and cannot be accessed.
[0099] It should be noted that illegal information may be information prohibited by laws and administrative regulations, such as endangering national security, disrupting social order, and infringing upon the legitimate rights and interests of others, such as information containing illegal words such as "drugs", "pornography", and "guns"; it can also be information with sensitive political tendencies (or anti-ruling party tendencies), violent tendencies, unhealthy words or uncivilized language, such as information containing malicious words such as insults, abuse of others, and racial discrimination. This application does not make specific limitations.
[0100] It can be understood that the application scenario in which the user uses the information filtering method provided by this application to perform blockchain transactions is similar to the above application scenario. When the blockchain client 410 detects that the transaction information uploaded by the user contains illegal information, the blockchain client 410 will return the following information: Figure 4C The interface shown will not be described in detail here.
[0101] In order to realize the above application scenario, that is, in order to realize the above process of identifying illegal information and denying access when performing information query (read transaction) or information release (write transaction) in the blockchain network, the present application provides a method of information filtering. The main principles involved in this method include: by adding a management chain to the blockchain network and storing illegal keywords on the management chain, each node can first read the illegal keywords stored on the management chain when performing read transactions and write transaction processes. When the obtained read transaction content contains illegal keywords, the read transaction process is terminated, so that the illegal information on the chain cannot be read by the user from the blockchain; when the obtained write transaction content contains illegal keywords, the write transaction process is terminated, so that the illegal information not on the chain cannot be published by the user on the blockchain, thereby improving the security of blockchain information service management.
[0102] The information filtering method provided by the present application is described in detail below with reference to the accompanying drawings.
[0103] Figure 5 This application provides a blockchain network that can implement the information filtering method provided by this application, wherein the blockchain network includes a management chain and an ordinary chain, wherein the first ledger stores the transaction information of the blockchain network, and the second ledger stores illegal keywords and blacklist information. In a specific implementation, the ordinary chain includes a first node, and the management chain includes a first node and a second node. The first node joins a first channel and a second channel, wherein the first channel is the channel corresponding to the ordinary chain, and the second channel is the channel corresponding to the management chain; the second node joins the second channel. The first node is provided with a first ledger and a second ledger, wherein the first ledger is the ledger corresponding to the ordinary chain, and the second ledger is the ledger corresponding to the management chain; the second node is provided with the second ledger. That is to say, Figure 5 As shown, the channel of the common chain is C1, the maintained account book is L1, the channel of the management chain is C2, and the maintained account book is L2. Account book L1 is the account book corresponding to the common chain, and account book L2 is the account book corresponding to the management chain, which records illegal keywords and blacklist information that are not allowed to appear in transactions on the blockchain network. The first node may include the endorsement node, sorting node, and submission node mentioned above, which may be Figure 5P1 and P3 in the chain. The second node P2 is installed with a system chain code S, which is used to add or delete illegal keywords, and add or delete blacklist information. It should be noted that although the first nodes P1 and P3 on the ordinary chain are connected to the management chain channel C2, since the system chain code S1 is not installed, they do not have the function of adding or deleting sensitive keywords, adding or deleting blacklist information. However, the first nodes P1 and P3 both maintain the ledger L1 and the ledger L2, so the first nodes P1 and P3 can query the information of the ledger L1 and the ledger L2. Since the management node P2 is not connected to the ordinary chain channel C1, it cannot access the information of the ledger L1 on the ordinary chain. Referring to the foregoing content, it can be seen that each blockchain node maintains a state database, so the first node also includes a first state database corresponding to the ordinary chain and a second state database corresponding to the management chain, and the second node also includes the second state database corresponding to the management chain. In other words, Figure 5 As shown, the first nodes P1 and P3 further include state databases D1 and D2, and the second node P2 includes a state database D2.
[0104] It is understandable that the first node can be managed by a general chain administrator, and the second node can be managed by a management chain administrator, wherein the general chain administrator who manages the first node can be the organization administrator mentioned above, that is, the provider of a business information service in the blockchain network, and the management chain administrator who manages the second node can be the government department or regulatory department corresponding to the business. For example, if a company provides a blockchain network for cross-border logistics information, then the general chain account book can be a record of all logistics and warehousing information of goods from production by manufacturers to delivery to cross-border consumers. The general chain administrator can be the staff of the company who maintains the blockchain network, and the management chain administrator can be the staff of the General Administration of Customs, who will add some users, clients and nodes that provide false information, forged goods, data or sell counterfeit products to the blacklist. It should be understood that the above examples are for illustration only and do not constitute specific limitations.
[0105] Figure 6 is a flow chart of the information filtering method provided by the present application, which can Figure 5 The blockchain network shown is implemented in the following Figure 5 as well as Figure 6 The information filtering method provided by this application is described as follows:
[0106] S601: The client sends a target transaction request to the first node P1, and the first node P1 receives the transaction request sent by the client, wherein the target transaction request includes a read transaction request or a write transaction request.
[0107] S602: The first node calls the corresponding target chain code to perform the target transaction according to the target transaction request and obtains transaction data. The transaction data is the data read by the first node from the first state database according to the transaction request sent by the client, or the data to be written into the first state database. When the target transaction request is a write transaction request, the target chain code is the endorsement chain code; when the target transaction request is a read transaction request, the target chain code is the query chain code. In a specific implementation, when the target transaction request is a write transaction request, the transaction data is the endorsement result (endorsement result) of the first node; when the target transaction request is a read transaction request, the transaction data is the query result.
[0108] S603: The first node obtains an illegal keyword from the second state database, and matches the illegal keyword with the transaction data, wherein the illegal keyword is added by the second node and synchronized to the second state database of the first node. If the illegal keyword successfully matches the transaction data, step S604 is executed; if the illegal keyword fails to match the transaction data, step S605 is executed.
[0109] S604: The first node terminates the target transaction and returns information to the client that refuses to execute the target transaction request. Figure 4C This application does not specifically limit the interface shown, or other similar information.
[0110] S605: The first node determines to continue to execute the transaction according to the transaction data. In a specific implementation, when the target transaction request is a write transaction request, the first node returns the generated endorsement result to the client, and when the target transaction request is a read transaction request, the first node returns the query result to the client.
[0111] In a specific implementation, the management chain is also used to store blacklist information, and the target transaction request also includes the identity information of the client. Before the first node obtains the transaction data (after step S601 and before step S602), the method also includes: the first node obtains the blacklist information stored in the management chain and matches the identity information with the blacklist information; if the identity information matches the blacklist information successfully, the first node returns the target transaction termination information to the client (i.e., executes step S603); if the identity information fails to match the blacklist information, the first node calls the corresponding target chain code according to the target transaction request to perform the target transaction and obtain the transaction data (i.e., executes step S602). It can be understood that if some clients or first nodes query or publish illegal information multiple times, they can be added to the blacklist, so that the target transaction termination information can be returned without executing steps S602-S603, thereby speeding up the information filtering.
[0112] Among them, the illegal information can be the illegal information in the aforementioned content, and the blacklist information includes a first blacklist and a second blacklist, wherein the first blacklist includes the identity information of malicious clients and malicious users that are prohibited from trading on the blockchain network, and the second blacklist includes the identity information of malicious nodes that cooperate with the malicious clients or malicious users to trade with the blockchain. For example, the first blacklist can be the user name, client address, etc. of the client for trading, and the second blacklist can be the node name, node address, etc. of the node, or other unique identity information of the client, user and node, which is not specifically limited here. For example, the user name of the malicious user who has published or queried illegal information is added to the blacklist so that it can no longer query or publish any information to the blockchain. For another example, the malicious node that actively cooperates with the malicious user to query and publish illegal information is added to the blacklist so that it can no longer provide services to other malicious users who are not in the blacklist, thereby improving the speed of information filtering at the root. Blacklist information and illegal information can also be added according to the business needs of the blockchain network, such as adding the IP address of a business competitor to the blacklist, etc., which is not specifically limited in this application.
[0113] Furthermore, the blacklist information and illegal keywords can be set by the administrator of the management chain based on experience, or can be obtained through algorithms such as machine learning and logical reasoning. For example, a neural network is trained using a large amount of historical transaction information of blacklist nodes to learn the transaction characteristics of blacklist nodes, thereby predicting new blacklist information based on the transaction information of other nodes. It should be understood that the above examples are for illustration only and are not specifically limited in this application.
[0114] Need to explain, Figure 5 The blockchain network shown is only for illustration. The blockchain network may also include more management nodes, first nodes, ordinary chain channels, chain codes, etc. It may also include only one channel, that is, the blockchain network has only one blockchain, which is both a management chain and an ordinary chain. This application does not make specific limitations.
[0115] In summary, by implementing the technical solution of the embodiment of the present application, illegal keywords and blacklist information can be added to the management chain, so that when the first node performs a read transaction or a write transaction process, it can determine whether the read transaction or the write transaction process contains illegal information through the illegal keywords and the blacklist information, so that illegal information that is not on the chain cannot be published on the blockchain by users, and illegal information that has been on the chain cannot be read from the blockchain by users, thereby improving the security of blockchain information service management.
[0116] The following uses the application scenario of writing a transaction process (information publishing process) as an example to describe the information filtering method provided by this application. Fig. 7A , the method can be described by the following steps:
[0117] S701: The client or application generates a transaction proposal and sends the transaction proposal to one or more endorsement nodes. The endorsement node can be any first node that has an endorsement chain code installed. The content of the transaction proposal and the definition of the endorsement node can refer to the above Figure 2A-2B The contents in the embodiments will not be described in detail here.
[0118] S702: Each of the one or more endorsing nodes simulates a transaction according to the transaction proposal and generates an endorsement result, and sends the endorsement result to the client, which receives the endorsement result. Figure 2A-2B The contents in the embodiments will not be described in detail here.
[0119] S703: The endorsement node obtains the illegal keyword stored in the management chain and matches the illegal keyword with the endorsement result. If the illegal keyword matches the endorsement result successfully, execute steps S704-S705; if the illegal keyword fails to match the endorsement result, execute step S706.
[0120] S704: The endorsing node terminates the endorsement and returns endorsement failure information to the client, and the client receives the endorsement failure information.
[0121] S705: The client displays the transaction failure information to the user. In the specific implementation, the client can generate the following Figure 4CThe interface shown, or other similar information, notifies the user that the current transaction information contains non-compliant information, which is not specifically limited in this application.
[0122] S706: The endorsement node sends the endorsement result to the client. After receiving the endorsement node, the client executes Figure 2A Steps S203-S205 in the embodiment thus complete a complete transaction. For details, please refer to the above embodiment, which will not be repeated here.
[0123] In a specific implementation, the target transaction request also includes the identity information of the client. After the first node receives the target transaction request sent by the client (after step S701 and before step S702), the method further includes: the first node obtains the blacklist information in the management chain account book and matches the identity information with the blacklist information; if the identity information matches the blacklist information successfully, the first node returns the target transaction termination information to the client (i.e., executes step S704); if the identity information fails to match the blacklist information, the first node calls the corresponding target chain code according to the target transaction request to perform the target transaction and obtains the transaction data that needs to be returned to the client (i.e., executes step S702). It can be understood that if some clients or first nodes query or publish illegal information multiple times, they can be added to the blacklist, so that step S704 is directly executed without executing steps S702-S703, thereby speeding up the information filtering.
[0124] In a specific implementation, the management chain administrator can also add malicious nodes that actively cooperate with the malicious user to query and publish illegal information to the blacklist, so that they can no longer provide services to other malicious users who are not on the blacklist, thereby further improving the accuracy of information filtering. Therefore, after step S706, any first node in the blockchain can also block any information from the blacklist node based on the blacklist information, and not send any information to the blacklist node. It can be understood that when each node sends or receives information, the identity information of the destination node and the identity information of the sending node are attached to the information, and the identity information of the destination node and the identity information of the sending node are matched with the blacklist node. In the case of a successful match, the first node terminates the transaction and returns the transaction termination information to the client. In the case of a failed match, the first node continues the current transaction.
[0125] For example, assuming that during the current write transaction, the identity information of the client and the user name are not in the blacklist information, and the read-write set generated by the endorsement node does not contain illegal keywords, then the endorsement node can send the endorsement result to the client. After the client receives the endorsement node, it will execute Figure 2A In simple terms, steps S203-205 in the embodiment are as follows: the client generates transaction information according to the endorsement result and sends the transaction information to the sorting node; the sorting node generates a new block according to the transaction information and sends the block to the submission node; when the submission node receives the block sent by the sorting node, it matches the identity information of the sorting node with the blacklist. If the match fails, the submission node executes step S205 to complete a transaction; if the match succeeds, it means that the sorting node has actively cooperated with malicious users to query and publish illegal information, so the block submission will be terminated, and the transaction termination information will be returned to the client, thereby avoiding the publication of illegal information to the greatest extent.
[0126] Combine the following Figure 7B , the write transaction process described in the above S701-S706 is described in detail.
[0127] In a specific implementation, the blacklist information and illegal keywords are stored in the ledger and state database of the node connected to the channel of the management chain. The management node can modify the blacklist information and illegal keywords in the state database by performing management transactions on the management chain, wherein the management transactions are specifically adding illegal keywords, deleting illegal keywords, adding blacklist user names, deleting blacklist user names, and the like. Referring to the foregoing content, it can be seen that the ledger data in the block records the operation records of the transaction, which is data that cannot be tampered with, but the state data in the state database records the results of each transaction, so the state data can be modified by continuously adding transactions. For example, the first transaction performed by the management node on the management chain is to add account A to the blacklist. After executing this transaction, the state database will have A's blacklist information. Therefore, when filtering, the present application performs information filtering based on the blacklist information and illegal keywords in the state database.
[0128] In the specific implementation, Figure 7BAs shown, in addition to maintaining the management chain ledger L1 and the management chain ledger L2, each node of the ordinary chain also maintains a management chain state database D1 and an ordinary chain state database D2. Therefore, the specific method of combining the state database and the first blacklist for information filtering can be as follows: the first node obtains the first blacklist from the second state database, wherein the first blacklist is added by the second node and synchronized to the second state database of the first node; the first node obtains the first identity from the transaction request, wherein the first identity is the identifier of the client or the identifier of the user using the client; the first node matches the first identity with the first blacklist; the first node obtains transaction data, including: when the first identity fails to match the first blacklist, the first node obtains transaction data. Referring to the above content, it can be seen that after the endorsement node (i.e., the first node) receives the transaction proposal sent by the client, the endorsement node can obtain the blacklist information and illegal keywords stored in the management chain state database D1, and match the identity information in the transaction proposal with the blacklist information. Match the identity information in the transaction proposal with the blacklist information ( Figure 7B Step 2 in ). If the identity information matches the blacklist information successfully, the endorsement node returns endorsement failure information to the client ( Figure 7B In step 3 of ). In the case where the identity information fails to match the blacklist information, the endorsement node executes the endorsement chain code according to the transaction proposal to generate a read-write set 720 ( Figure 7B Step 4), wherein the process of generating the read-write set 720 can refer to Figure 2B The embodiments are not described here in detail. For example, Figure 7B In the management chain status data 730, the blacklist information is {Key = ID, Value = ID1, version = 1}. If the identity information in the transaction proposal is "ID = ID1", it means that the user ID in the transaction proposal has been pulled into the blacklist, so step 3 will be executed to return the endorsement failure information; if the identity information in the transaction proposal is "ID = ID2", it means that the user ID in the transaction proposal has not been pulled into the blacklist, so step 4 will be executed to continue the transaction endorsement. It can be understood that the specific method of combining the status database and the blacklist information for information filtering is to filter the user identity information and the client identity information in the blacklist information.
[0129] Similarly, the method for filtering information for the second blacklist information may be as follows: after the first node determines to continue to execute the transaction according to the transaction data, it also includes: the first node obtains the second blacklist from the second state database, wherein the second blacklist is added by the second node and synchronized to the second state database of the first node; the first node obtains a second identity identifier, wherein the second identity identifier is the identity identifier of other nodes, and the other nodes are nodes that send information to the first node, or the first node is preparing to send information. The first node matches the second identity identifier with the second blacklist; when the first identity identifier and the first blacklist match successfully, the first node refuses to receive the information sent by the other nodes, or the first node refuses to send information to the other nodes. In the specific implementation, you can also refer to the above content to match the second identity identifier of the other node that receives or sends information with the second blacklist in the state data 730 of the management chain, which will not be repeated here. It should be understood that the above-mentioned examples of identity information and Figure 7B The key-value pairs in the examples are for illustration only and do not constitute specific limitations.
[0130] Similarly, the method of combining the state database and illegal keywords to filter illegal information is as follows: Figure 7B As shown, the endorsement node queries the common chain state database 720 according to the transaction proposal and generates a read-write set ( Figure 7B After step 4 in the above, the read-write set is matched with the illegal keyword in the management chain state data 730. If the read-write set 720 successfully matches the illegal keyword, the endorsement node returns the endorsement failure information to the client ( Figure 7B In step 5 of ). In the case where the read-write set 720 fails to match the illegal keyword, the endorsement node generates an endorsement result based on the read-write set 720 and returns it to the client ( Figure 7B Step 6) in the client to execute Figure 2A Steps S203-S205 in the embodiment complete a complete transaction. For details, please refer to the above embodiment, which will not be repeated here. For example, Figure 7B In the management chain status data 730, the illegal keyword is {Key = K1, Value = V12, version = 1}, and Figure 7B The read-write set 720 contains {write Key = "K1", Value = "V12"}, which means that part of the information in this transaction contains illegal keywords, so step 5 will be executed and the endorsement failure information will be returned. It can be understood that if the read-write set contains illegal keywords, step 6 will be executed to continue the transaction.
[0131] Need to explain, Figure 7B It is only used for illustration. In the specific implementation, the endorsement node can be multiple nodes, the chain code installed on each node, the maintained ledger and the maintained state database can also be multiple, the state database and the state database in the read-write set can also be multiple, and the key-value pairs in the state database and the read-write set are only used for illustration. The key K, version version and value V can correspond to different meanings and formats according to the business scenario, and this application does not make specific limitations.
[0132] It can be understood that by implementing the information filtering method provided in the present application, illegal keywords and blacklist information can be added to the management chain, so that when the first node writes a transaction (information release), it can determine whether the current transaction content contains illegal information through the illegal keywords and blacklist information, thereby preventing illegal transactions, malicious information and other non-compliant content from being published by users on the blockchain, thereby improving the security of blockchain information service management.
[0133] The following uses the application scenario of reading transaction process (information query process) as an example to describe the information filtering method provided by this application. Figure 8 , the method can be described by the following steps:
[0134] S801: The client generates a query proposal and sends the query proposal to the first node P1. The first node P1 receives the query proposal, and the query proposal includes the identity information of the client.
[0135] S802: Query the management chain status database 820 to obtain blacklist information and illegal keywords.
[0136] S803: If the blacklist contains the identity information, return a query failure message. For example, Figure 8 In the management chain status data 810, the blacklist information is {Key=ID, Value=ID1, version=1}. If the identity information in the transaction proposal is "ID=ID1", it means that the user ID in the transaction proposal has been added to the blacklist, then step S803 will be executed and the query failure information will be returned.
[0137] S804. When the blacklist does not contain the identity information, the query chain code is called to query the common chain state database 810 according to the query proposal, and a read set is constructed.
[0138] S805: If the read set contains illegal keywords, the query failure message is returned. Figure 8In the query, the illegal keyword is {Key=K1, Value=V12, version=1}, and the read set 820 contains {Key=K1, Value=V12, version=1}, which means that the transaction content of this query contains illegal keywords, so the query failure information is returned.
[0139] S806: If the read set does not contain illegal keywords, generate a query result based on the read set and return the query result to the client. Figure 3 The embodiments will not be described in detail here.
[0140] It is understandable that since each node in the blockchain stores ledger data and status data, in the information query process, it is only necessary to query the status database stored locally at the node to obtain the query result without accessing other nodes. Figure 8 For details not shown or described in Figure 7A-7B The description of the transaction process will not be repeated here.
[0141] In a specific implementation, the illegal keywords, the first blacklist, and the second blacklist can be added by the system chain code in the second node and synchronized to the second state database of the first node. The system chain code in the second node is used to add and delete the illegal keywords in the second node. The specific method of adding illegal keywords can be as follows: the second node receives a first transaction request sent by the client, and the first transaction request includes an illegal keyword; the second node calls the system chain code to conduct a transaction based on the second transaction request to add the illegal keyword to the second state database of the second node; the second node synchronizes the illegal keyword to the second state database of the first node. Similarly, the first blacklist information and the second blacklist information can be added to the second state database of the second node by calling the system chain code for a transaction, which will not be repeated here.
[0142] In the specific implementation, for a blockchain network that originally has no information filtering function, it only needs to add one or more second nodes, and install the system chain code for adding blacklist information and illegal keywords on the second node, and then notify the ordinary chain administrator to uniformly upgrade all ordinary chain nodes, so that each first node executes the information filtering method provided by this application when performing read transactions and write transaction processes, and the above-mentioned process of identifying illegal information and denying access when performing information query (read transaction) or information release (write transaction) processes in the blockchain network can be realized. The entire upgrade process is fast, simple to operate, and has a good user experience.
[0143] It can be understood that by implementing the information filtering method provided in the present application, illegal keywords and blacklist information can be added to the management chain, so that when the first node reads the transaction (information query), it can determine whether the transaction content currently being queried contains illegal information through the illegal keywords and blacklist information, thereby making it impossible for users to query illegal transactions, malicious information and other non-compliant content stored on the blockchain, thereby improving the security of blockchain information service management.
[0144] Combined with the above Figure 1A-Figure 8 The relevant embodiments shown are described below, and the relevant devices, equipment and systems involved in the embodiments of the present application are described below.
[0145] See also Fig. 9 , Fig. 9 9 is a schematic diagram of the structure of a blockchain network system provided by the present application, wherein the blockchain network system 900 includes one or more second nodes 910 and one or more first nodes 920. The first node 910 may be the first node in the foregoing content, and the second node 920 may be the second node in the foregoing content.
[0146] The second node 910 may be the second node in the aforementioned content, and the second node 910 includes one or more processors 911, a communication interface 912, and a memory 913. The processor 911, the communication interface 912, and the memory 913 may be connected via a bus 914. The bus 914 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 914 may be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0147] The processor 911 includes one or more general-purpose processors, wherein the general-purpose processor can be any type of device capable of processing electronic instructions, including a central processing unit (CPU), a microprocessor, a microcontroller, a main processor, a controller, and an ASIC (Application Specific Integrated Circuit), etc. The processor 911 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 913, which enables the computing device to provide a wide variety of services. For example, the processor 911 implements processing functions by calling program codes in the memory 913, including adding or deleting illegal keywords, adding or deleting blacklist information, maintaining a status database, etc.
[0148] The communication interface 912 may be a wired interface (e.g., an Ethernet interface) for communicating with other devices or modules. For example, the communication interface 912 is used to support communication between the second node 910 and the first node 920, so that after the second node 910 updates the status database of the management chain, the first node 920 can be updated accordingly, and / or used to perform other steps of the technology described herein.
[0149] The memory 913 may include a volatile memory, such as a random access memory (RAM); the memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD). The memory may also include a combination of the above-mentioned types of memory. The memory 913 may store program code and program data. For example, a system chain code for adding or deleting illegal keywords, adding or deleting blacklist information, a state database for storing illegal keywords and blacklist information, and the like.
[0150] The first node 920 may be the first node in the aforementioned content. The first node 920 includes one or more processors 921, a communication interface 922, and a memory 923. The processor 921, the communication interface 922, and the memory 923 may be connected via a bus 924. The bus 924 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 924 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0151] The processor 921 includes one or more general-purpose processors, wherein the general-purpose processor can be any type of device capable of processing electronic instructions, including a central processing unit (CPU), a microprocessor, a microcontroller, a main processor, a controller, and an ASIC (Application Specific Integrated Circuit). The processor 921 executes various types of digital storage instructions to implement the functions of the transaction execution module and the filtering module. The transaction execution module can implement the following functions: Figure 2A , Figure 2B as well as Figure 3 In the write transaction process and the read transaction process in the embodiment, the filtering module can implement any step with the endorsement node, the sorting node and the submission node as the main body as follows: Figure 6 , Fig. 7A Figure 7B as well as Figure 8 Any steps with the first node or the endorsing node as the main body, and / or other steps for executing the technology described in this document.
[0152] The communication interface 922 may be a wired interface (eg, an Ethernet interface) for communicating with other devices or modules. For example, the communication interface 921 is used to support the first node 920 to execute Figure 6 In step S601, Fig. 7A Steps S701, S704, and S706, and / or other steps for performing the techniques described herein.
[0153] The memory 923 may include a volatile memory, such as a random access memory (RAM); the memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD). The memory may also include a combination of the above-mentioned types of memory. The memory 913 may store program code and program data. For example, the processor 921 may call the program code in the memory 923 to implement the functions of the transaction execution module and the filtering module, which may be as described above. Figure 2A , Figure 2B , Figure 3 , Figure 6 , Fig. 7A , Figure 7B or Figure 8 Part or all of the implementation steps described in any of the method embodiments with the first node 920 as the execution entity.
[0154] Need to explain, Fig. 9 This is only a possible implementation of the embodiment of the present application. In actual applications, the blockchain network system may include more or fewer components, and the blockchain node may include more or fewer components, which are not limited here. For content not shown or described in the embodiment of the present application, please refer to the aforementioned Figure 1A-Figure 8 The relevant explanations in the embodiments are not repeated here.
[0155] The embodiment of the present invention further provides a computer non-transient storage medium, wherein the computer non-transient storage medium stores instructions, and when the instructions are executed on a processor, Figure 6 , Fig. 7A , Figure 7B or Figure 8 Any of the method processes described in is implemented.
[0156] An embodiment of the present invention further provides a computer program product. When the computer program product is run on a processor, Figure 6 , Fig. 7A , Figure 7B or Figure 8 Any of the method processes described in is implemented.
[0157] The steps of the method or algorithm described in conjunction with the disclosed content of the embodiments of the present invention can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (Random Access Memory, RAM), a flash memory, a read-only memory (Read Only Memory, ROM), an erasable programmable read-only memory (Erasable Programmable ROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), a register, a hard disk, a mobile hard disk, a read-only compact disk (CD-ROM) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist in a computing device as discrete components.
[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.
Claims
1. A method for information filtering, characterized in that: Applied in a blockchain network, the blockchain network includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, the method includes: The first node acquires transaction data, wherein the transaction data is data read by the first node from a first state database according to a transaction request sent by a client, or data to be written into the first state database; The first node obtains an illegal keyword from the second state database, wherein the illegal keyword is added by the second node and synchronized to the second state database of the first node; The first node matches the illegal keyword with the transaction data; When the illegal keyword successfully matches the transaction data, the first node returns information of refusing to execute the transaction request to the client.
2. The method according to claim 1, characterized in that Before the first node obtains the transaction data, the method further includes: The first node obtains a first blacklist from the second state database, wherein the first blacklist is added by the second node and synchronized to the second state database of the first node; The first node obtains a first identity identifier from the transaction request, wherein the first identity identifier is an identifier of the client or an identifier of a user using the client; The first node matches the first identity with the first blacklist; The first node obtains transaction data, including: When the first identity identifier and the first blacklist fail to match, the first node obtains transaction data.
3. The method according to claim 2, characterized in that When the first node fails to match the illegal keyword with the transaction data, the first node determines to continue to execute the transaction according to the transaction data.
4. The method according to claim 3, characterized in that After the first node determines to continue to execute the transaction according to the transaction data, the method further includes: The first node obtains a second blacklist from the second state database, wherein the second blacklist is added by the second node and synchronized to the second state database of the first node; The first node acquires a second identity, wherein the second identity is an identity of another node, the other node is a node that sends information to the first node, or a node to which the first node is preparing to send information; The first node matches the second identity with the second blacklist; When the first identity identifier successfully matches the first blacklist, the first node refuses to receive information sent by the other nodes, or the first node refuses to send information to the other nodes.
5. The method according to claim 1, characterized in that The illegal keyword is added by the system chain code in the second node and synchronized to the second state database of the first node. The system chain code in the second node is used to add and delete the illegal keyword in the second node.
6. The method according to claim 1, characterized in that When the transaction request is a write transaction request, the transaction data is an endorsement result, wherein the endorsement result is a result obtained by the first node performing a simulated transaction according to the transaction request; When the transaction request is a read transaction request, the transaction data is a query result, wherein the query result is a result obtained by the first node querying the first status database according to the transaction request.
7. The method according to claim 1, characterized in that The first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; The second node joins the second channel.
8. The method according to any one of claims 1 to 7, characterized in that: The first node is provided with a first account book and a second account book, wherein the first account book is the account book corresponding to the common chain, and the second account book is the account book corresponding to the management chain; The second node is provided with the second account book.
9. A method for information filtering, characterized in that: Applied in a blockchain network, the blockchain network includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, the second node includes the second state database corresponding to the management chain, the method includes: The second node receives a first transaction request sent by a client, where the first transaction request includes an illegal keyword; The second node calls the system chain code to perform a transaction according to the second transaction request, so as to add the illegal keyword to the second state database of the second node; The second node synchronizes the illegal keyword into the second state database of the first node.
10. The method according to claim 9, characterized in that The method further comprises: The second node receives a second transaction request sent by the client, the second transaction request includes one or more of a first blacklist and a second blacklist, the first blacklist includes identity information of malicious clients and malicious users prohibited from conducting transactions on the blockchain network, and the second blacklist includes identity information of malicious nodes that cooperate with the malicious clients or malicious users to conduct transactions with the blockchain; The second node calls the system chain code to perform a transaction according to the second transaction request, so as to add the first blacklist and the second blacklist to the second state database of the second node; The second node synchronizes the first blacklist and the second blacklist to a second state database of the first node.
11. The method according to claim 9, characterized in that The first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; The second node joins the second channel.
12. The method according to any one of claims 9 to 11, characterized in that: The first node is provided with a first account book and a second account book, wherein the first account book is the account book corresponding to the common chain, and the second account book is the account book corresponding to the management chain; The second node is provided with the second account book.
13. A blockchain node, characterized in that: The blockchain node is the first node of the blockchain network, the blockchain network includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, and the blockchain node includes: a first acquisition unit, configured to acquire transaction data, wherein the transaction data is data read by the first node from the first state database according to the transaction request sent by the client, or data to be written into the first state database; a second acquiring unit, the second acquiring unit being used to acquire an illegal keyword from the second state database, wherein the illegal keyword is added by the second node and synchronized to the second state database of the first node; a matching unit, the matching unit being used to match the illegal keyword with the transaction data; A returning unit, wherein the returning unit is used to return information of refusing to execute the transaction request to the client when the illegal keyword successfully matches the transaction data.
14. The node according to claim 13, characterized in that: The second acquisition unit is further used to acquire a first blacklist from the second state database before acquiring the transaction data, wherein the first blacklist is added by the second node and synchronized to the second state database of the first node; The first acquisition unit is further used to acquire a first identity identifier from the transaction request, wherein the first identity identifier is an identifier of the client or an identifier of a user using the client; The matching unit is further configured to match the first identity identifier with the first blacklist.
15. The node according to claim 14, characterized in that: The node further includes a determining unit, which is used to determine to continue executing the transaction according to the transaction data when the illegal keyword fails to match the transaction data.
16. The node according to claim 15, characterized in that The second acquisition unit is further configured to acquire a second blacklist from the second state database after determining to continue to execute the transaction according to the transaction data, wherein the second blacklist is added by the second node and synchronized to the second state database of the first node; The first acquisition unit is further used to acquire a second identity, wherein the second identity is an identity of another node, the other node is a node that sends information to the first node, or a node to which the first node is about to send information; The matching unit is further used to match the second identity identifier with the second blacklist; The matching unit is further configured to, when the first identity identifier matches the first blacklist successfully, cause the first node to refuse to receive information sent by the other nodes, or cause the first node to refuse to send information to the other nodes.
17. The node according to claim 13, characterized in that: The illegal keyword is added by the system chain code in the second node and synchronized to the second state database of the first node. The system chain code in the second node is used to add and delete the illegal keyword in the second node.
18. The node according to claim 13, characterized in that: When the transaction request is a write transaction request, the transaction data is an endorsement result, wherein the endorsement result is a result obtained by the first node performing a simulated transaction according to the transaction request; When the transaction request is a read transaction request, the transaction data is a query result, wherein the query result is a result obtained by the first node querying the first status database according to the transaction request.
19. The node according to claim 13, characterized in that The first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; The second node joins the second channel.
20. The node according to any one of claims 13 to 19, characterized in that: The first node is provided with a first account book and a second account book, wherein the first account book is the account book corresponding to the common chain, and the second account book is the account book corresponding to the management chain; The second node is provided with the second account book.
21. A blockchain node, characterized in that: The blockchain node is a second node of the blockchain network, the blockchain includes a common chain and a management chain, the common chain includes a first node, the management chain includes a first node and a second node, the first node includes a first state database corresponding to the common chain and a second state database corresponding to the management chain, the second node includes the second state database corresponding to the management chain, and the node includes: A receiving unit, the receiving unit is used to receive a first transaction request sent by a client, the first transaction request includes an illegal keyword; A calling unit, the calling unit being configured to call a system chain code to perform a transaction according to a second transaction request, so as to add the illegal keyword to a second state database of the second node; A synchronization unit is used to synchronize the illegal keyword to a second state database of the first node.
22. The node according to claim 21, characterized in that The receiving unit is further used to receive a second transaction request sent by the client, the second transaction request includes one or more of the first blacklist and the second blacklist, the first blacklist includes identity information of malicious clients and malicious users prohibited from conducting transactions on the blockchain network, and the second blacklist includes identity information of malicious nodes that cooperate with the malicious clients or malicious users to conduct transactions with the blockchain; The calling unit is further used to call the system chain code to perform a transaction according to the second transaction request, so as to add the first blacklist and the second blacklist to the second state database of the second node; The synchronization unit is further configured to synchronize the first blacklist and the second blacklist to a second status database of the first node.
23. The node according to claim 22, characterized in that The first node joins a first channel and a second channel, wherein the first channel is a channel corresponding to the common chain, and the second channel is a channel corresponding to the management chain; The second node joins the second channel.
24. The node according to any one of claims 21 to 23, characterized in that: The first node is provided with a first account book and a second account book, wherein the first account book is the account book corresponding to the common chain, and the second account book is the account book corresponding to the management chain; The second node is provided with the second account book.
25. A computer program product, characterized in that When the computer program product is read and executed by a computing device, the method according to any one of claims 1 to 8 will be performed.
26. A computer program product, characterized in that When the computer program product is read and executed by a computing device, the method according to any one of claims 9 to 12 will be performed.
27. A computer non-transitory storage medium, characterized in that: The method comprises instructions, which, when executed on a computing device, cause the computing device to execute the method according to any one of claims 1 to 8.
28. A computer non-transitory storage medium, characterized in that: The method comprises instructions, which, when executed on a computing device, cause the computing device to perform the method according to any one of claims 9 to 12.
29. A computing node, characterized in that: The method comprises a processor and a memory, wherein the processor executes the code in the memory to perform the method according to any one of claims 1 to 8.
30. A computing node, characterized in that: The method comprises a processor and a memory, wherein the processor executes the code in the memory to perform the method according to any one of claims 9 to 12.
Citation Information
Patent Citations
Public opinion detection platform construction method based on block chain technology
CN107018146A
Block chain data display method, block chain browser, user node and medium
CN109697367A