Blockchain-based data processing method and device
A blockchain node receives transaction data and formatted information corresponding to the transaction data. The blockchain node determines, based on a transaction type corresponding to the transaction data and a predetermined relationship between the transaction type and a processing policy, a processing policy corresponding to the transaction data, where the processing policy includes a data attribute used for conversion and a conversion rule corresponding to the data attribute. The blockchain node converts the formatted information into an attribute value based on the conversion rule. A data attribute corresponding to the attribute value is determined. The blockchain node verifies received transaction data based on the attribute value of the data attribute and the attribute value of the data attribute.
1. A computer-implemented method for processing blockchain-based data, the computer-implemented method comprising:
receiving, by a first blockchain node and from a second blockchain node, transaction data and encrypted binary formatted information corresponding to the transaction data, wherein the transaction data comprises a first attribute value corresponding to a data attribute, wherein the encrypted binary formatted information comprises serialization of the first attribute value by the second blockchain node, and wherein operating systems or compilation languages supported by the first blockchain node are different from operating systems or compilation languages supported by the second blockchain node;
decrypting, by the first blockchain node and using a public key associated with the second blockchain node, the encrypted binary formatted information to obtain binary formatted information corresponding to the transaction data;
determining, by the first blockchain node, a transaction type corresponding to the transaction data and a transaction feature from the transaction type;
selecting, from the transaction data, at least one data attribute that represents the transaction feature;
generating, based on the at least one data attribute and a conversion rule corresponding to the data attribute, a processing policy corresponding to the transaction data, wherein the processing policy comprises the at least one data attribute and the conversion rule corresponding to the data attribute;
converting, by the first blockchain node, the binary formatted information into a second attribute value based on the conversion rule;
determining, by the first blockchain node, the data attribute corresponding to the second attribute value; and
in response to a determination that the first attribute value matches the second attribute value, determining, by the first blockchain node, that the transaction data passes a verification.
2. The computer-implemented method of claim 1 , further comprising:
processing, by the first blockchain node, the transaction data based on the binary formatted information.
3. The computer-implemented method of claim 2 , further comprising:
before processing, by the first blockchain node, the transaction data based on the binary formatted information:
determining whether the processing policy comprises more than one data attribute;
in response to determining the processing policy comprises more than one data attribute, obtaining formatted information corresponding to each extracted attribute value; and
sorting, by the first blockchain node, the formatted information based on a sorting rule of the data attribute.
4. The computer-implemented method of claim 2 , wherein processing, by the first blockchain node, the transaction data based on the binary formatted information, comprises:
broadcasting, by the first blockchain node to a third blockchain node in a blockchain network, the binary formatted information and the transaction data, wherein the third blockchain node performs consensus processing on the transaction data based on the binary formatted information.
5. The computer-implemented method of claim 2 , wherein processing, by the first blockchain node, the transaction data based on the binary formatted information comprises:
encrypting, by the first blockchain node, the binary formatted information to obtain an encryption result; and
sending the encryption result and the transaction data to another blockchain node in a blockchain network, to perform consensus processing on the transaction data.
6. The computer-implemented method of claim 1 , further comprising:
performing, by the first blockchain node, an operation on the first attribute value based on a conversion algorithm, to obtain a string corresponding to the first attribute value.
7. The computer-implemented method of claim 1 , further comprising, when the first blockchain node receives the transaction data:
receiving, by the first blockchain node, a predetermined relationship between the transaction type and the processing policy that is sent by a blockchain node that processes the transaction data.
8. The computer-implemented method of claim 1 , wherein the binary formatted information is associated with a sorting sequence included in the processing policy.
9. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:
receiving, by a first blockchain node and from a second blockchain node, transaction data and encrypted binary formatted information corresponding to the transaction data, wherein the transaction data comprises a first attribute value corresponding to a data attribute, wherein the encrypted binary formatted information comprises serialization of the first attribute value by the second blockchain node, and wherein operating systems or compilation languages supported by the first blockchain node are different from operating systems or compilation languages supported by the second blockchain node;
decrypting, by the first blockchain node and using a public key associated with the second blockchain node, the encrypted binary formatted information to obtain binary formatted information corresponding to the transaction data;
determining, by the first blockchain node, a transaction type corresponding to the transaction data and a transaction feature from the transaction type;
selecting, from the transaction data, at least one data attribute that represents the transaction feature;
generating, based on the at least one data attribute and a conversion rule corresponding to the data attribute, a processing policy corresponding to the transaction data, wherein the processing policy comprises the at least one data attribute and the conversion rule corresponding to the data attribute;
converting, by the first blockchain node, the binary formatted information into a second attribute value based on the conversion rule;
determining, by the first blockchain node, the data attribute corresponding to the second attribute value; and
in response to a determination that the first attribute value matches the second attribute value, determining, by the first blockchain node, that the transaction data passes a verification.
10. The non-transitory, computer-readable medium of claim 9 , further comprising:
processing, by the first blockchain node, the transaction data based on the binary formatted information.
11. The non-transitory, computer-readable medium of claim 10 , further comprising:
before processing, by the first blockchain node, the transaction data based on the binary formatted information:
determining whether the processing policy comprises more than one data attribute;
in response to determining the processing policy comprises more than one data attribute, obtaining formatted information corresponding to each extracted attribute value; and
sorting, by the first blockchain node, the formatted information based on a sorting rule of the data attribute.
12. The non-transitory, computer-readable medium of claim 10 , wherein processing, by the first blockchain node, the transaction data based on the binary formatted information, comprises:
broadcasting, by the first blockchain node to a third blockchain node in a blockchain network, the binary formatted information and the transaction data, wherein the third blockchain node performs consensus processing on the transaction data based on the binary formatted information.
13. The non-transitory, computer-readable medium of claim 10 , wherein processing, by the first blockchain node, the transaction data based on the binary formatted information comprises:
encrypting, by the first blockchain node, the binary formatted information to obtain an encryption result; and
sending the encryption result and the transaction data to another blockchain node in a blockchain network, to perform consensus processing on the transaction data.
14. The non-transitory, computer-readable medium of claim 9 , further comprising:
performing, by the first blockchain node, an operation on the first attribute value based on a conversion algorithm, to obtain a string corresponding to the first attribute value.
15. The non-transitory, computer-readable medium of claim 9 , further comprising, when the first blockchain node receives the transaction data:
receiving, by the first blockchain node, a predetermined relationship between the transaction type and the processing policy that is sent by a blockchain node that processes the transaction data.
16. The non-transitory, computer-readable medium of claim 9 , wherein the binary formatted information is associated with a sorting sequence included in the processing policy.
17. A computer-implemented system, comprising:
a plurality of computers; and
one or more computer memory devices interoperably coupled with the plurality of computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the plurality of computers, perform one or more operations comprising:
receiving, by a first blockchain node and from a second blockchain node, transaction data and encrypted binary formatted information corresponding to the transaction data, wherein the transaction data comprises a first attribute value corresponding to a data attribute, wherein the encrypted binary formatted information comprises serialization of the first attribute value by the second blockchain node, and wherein operating systems or compilation languages supported by the first blockchain node are different from operating systems or compilation languages supported by the second blockchain node;
decrypting, by the first blockchain node and using a public key associated with the second blockchain node, the encrypted binary formatted information to obtain binary formatted information corresponding to the transaction data;
determining, by the first blockchain node, a transaction type corresponding to the transaction data and a transaction feature from the transaction type;
selecting, from the transaction data, at least one data attribute that represents the transaction feature;
generating, based on the at least one data attribute and a conversion rule corresponding to the data attribute, a processing policy corresponding to the transaction data, wherein the processing policy comprises the at least one data attribute and the conversion rule corresponding to the data attribute;
converting, by the first blockchain node, the binary formatted information into a second attribute value based on the conversion rule;
determining, by the first blockchain node, the data attribute corresponding to the second attribute value; and
in response to a determination that the first attribute value matches the second attribute value, determining, by the first blockchain node, that the transaction data passes a verification.
18. The computer-implemented system of claim 17 , including one or more operations comprising:
determining whether the processing policy comprises more than one data attribute;
in response to determining the processing policy comprises more than one data attribute, obtaining formatted information corresponding to each extracted attribute value;
sorting, by the first blockchain node, the formatted information based on a sorting rule of the data attribute to produce sorted information; and
processing, by the first blockchain node, the transaction data based on the sorted information.
19. The computer-implemented system of claim 17 , including one or more operations comprising:
broadcasting, by the first blockchain node to a third blockchain node in a blockchain network, the binary formatted information and the transaction data, wherein the third blockchain node performs consensus processing on the transaction data based on the binary formatted information.
20. The computer-implemented system of claim 17 , including one or more operations comprising:
performing, by the first blockchain node, an operation on the first attribute value based on a conversion algorithm, to obtain a string corresponding to the first attribute value.
21. The computer-implemented system of claim 17 , including one or more operations comprising:
when the first blockchain node receives the transaction data, receiving, by the first blockchain node, a predetermined relationship between the transaction type and the processing policy that is sent by a blockchain node that processes the transaction data.