Data processing method, device, computer equipment and storage medium based on blockchain
Through side-chain filtering and sharding technology, the problem of low blockchain throughput is solved, data processing efficiency and throughput are improved, and it is suitable for high-throughput application scenarios.
Patent Information
- Application Number
- CN202011495961.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-17
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-17
AI Technical Summary
The throughput of blockchain is too small, which limits its development in certain applications, especially applications with higher throughput requirements.
Filter users' transaction information through side chains to reduce invalid data from interfering with main chain operations, and divide data processing areas based on preset main chain sharding information to improve data processing efficiency.
It improves the data processing throughput of the blockchain, reduces the server load, and enhances the system's processing capabilities.
Smart Images

Figure CN112508571B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based data processing method, device, computer equipment and storage medium. Background Art
[0002] The blockchain is a distributed ledger because the blockchain network is linked by nodes, requiring every fully participating node to verify every transaction, and these nodes must also be consistent with all other nodes in the entire network. Such a mechanism can maximize the security of the entire network, making the blockchain have great advantages in fault tolerance, security, political center and authenticity, but this approach comes at the cost of reduced scalability. At the current stage, the throughput of the public chain is extremely small, and can only process 7-15 transactions per second on average. Therefore, this has greatly hindered the development of applications that are more important to throughput on the chain. Summary of the invention
[0003] The embodiments of the present invention provide a data processing method, device, computer equipment and storage medium based on blockchain, aiming to solve the problem of low blockchain throughput existing in the prior art methods.
[0004] In a first aspect, an embodiment of the present invention provides a data processing method based on blockchain, which includes:
[0005] Obtain user transaction information;
[0006] Filter the transaction information of the user through the side chain to obtain the target data;
[0007] Obtaining preset main chain sharding information, and obtaining at least one sharding area information according to the preset main chain sharding information;
[0008] Search the corresponding sharding area information according to the target data to obtain the target sharding area;
[0009] The target data is processed through the target sharding area to obtain a processing result.
[0010] In a second aspect, an embodiment of the present invention provides a data processing device based on blockchain, comprising:
[0011] A user transaction information acquisition unit, used to acquire the user's transaction information;
[0012] A transaction information filtering unit, used to filter the transaction information of the user through the side chain to obtain target data;
[0013] A main chain information acquisition unit, used to acquire preset main chain sharding information, and obtain at least one sharding area information according to the preset main chain sharding information;
[0014] A sharding area information searching unit, configured to search the sharding area information corresponding to the target data to obtain a target sharding area;
[0015] A processing unit is used to process the target data through the target sharding area to obtain a processing result.
[0016] In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the blockchain-based data processing method described in the first aspect is implemented.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor enables the processor to execute the blockchain-based data processing method described in the first aspect above.
[0018] The embodiment of the present invention provides a data processing method, device, computer equipment and storage medium based on blockchain. The user's transaction information is filtered through the side chain to obtain the target data, thereby reducing the interference of invalid data on the main chain operation. By obtaining the preset main chain sharding information, the sharding area corresponding to the main chain to be processed can be calculated, and finally the data is allocated to the corresponding sharding area for processing, thereby improving the data processing throughput in the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0020] Figure 1-1 A flowchart of a blockchain-based data processing method provided by an embodiment of the present invention;
[0021] Figure 1-2 The side chain and main chain interaction of the blockchain-based data processing method provided in the embodiment of the present invention;
[0022] Figure 1-3 A schematic diagram of a sub-process of a blockchain-based data processing method provided in an embodiment of the present invention;
[0023] Figure 1-4A schematic diagram of another sub-process of the blockchain-based data processing method provided by an embodiment of the present invention;
[0024] Figure 1-5 A schematic diagram of another sub-process of the blockchain-based data processing method provided by an embodiment of the present invention;
[0025] Figure 1-6 A schematic diagram of another sub-process of the blockchain-based data processing method provided by an embodiment of the present invention;
[0026] Figure 1-7 A schematic diagram of another sub-process of the blockchain-based data processing method provided by an embodiment of the present invention;
[0027] Figure 1-8 A schematic diagram of another sub-process of the blockchain-based data processing method provided by an embodiment of the present invention;
[0028] Figure 2 A schematic block diagram of a blockchain-based data processing device provided in an embodiment of the present invention;
[0029] Figure 3 A schematic block diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0032] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0033] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0034] See also Figure 1-1 , Figure 1-1 It is a flowchart of a blockchain-based data processing method provided by an embodiment of the present invention. The blockchain-based data processing method is applied to a server. The method is executed by an execution program of the server. The server is a terminal device for executing the blockchain-based data processing method. The server can be a server that provides various services. It should be noted that the blockchain-based data processing method provided by an embodiment of the present invention is generally executed by a server. Accordingly, the blockchain-based data processing device is generally configured in the server. Figure 1-1 As shown, the method includes steps 101-105.
[0035] 101. Obtain the user's transaction information.
[0036] In this embodiment, the transaction information can be a plurality of raw data obtained, and the user's transaction information can be obtained through network communication or through a database. Generally, the raw data obtained contains a lot of noise and invalid data. If used directly, the computing server will calculate a lot of invalid garbage data, which makes the server's calculation easy to overload, and then cause the server to crash. Therefore, it is necessary to filter some garbage data through the side chain to reduce the load on the server.
[0037] 102. Filter the transaction information of the user through the side chain to obtain target data.
[0038] In this embodiment, the interaction between the main chain and the side chain is as follows Figure 1-2 As shown in the figure, for example, since government projects are open to all citizens or enterprises in the city, any user can fill in and apply for government projects, resulting in a lot of enterprise data that does not meet the conditions will always exist in the database (the transaction information includes a lot of invalid data), which will lead to an increase in the number of nodes in the blockchain and affect the efficiency of the blockchain. The side chain is an independent blockchain with smart contracts. Through smart contracts, all enterprises can register in the side chain. Only enterprises (the target data) preliminarily identified by the smart contract are added to the main blockchain. The side chain does not use a consensus mechanism, which can greatly improve the system's throughput (Transaction Per Second, TPS).
[0039] 103. Obtain preset main chain sharding information, and obtain at least one sharding region information according to the preset main chain sharding information.
[0040] In this embodiment, the main chain can be understood as an independent blockchain network that is officially launched. The sharding information refers to the rules of sharding, which is specifically applied to how to shard the main chain. The rules of sharding can be obtained by the SHA256 encryption algorithm. After obtaining the result of the encryption operation, a hash calculation is performed, and the sharding area information is obtained according to the result of the hash calculation. It can also be obtained by other methods, and the sharding is calculated according to the specific application scenario. Taking the Shenzhen administrative area as the sharding rule as an example, the area code of each district is encrypted by an encryption algorithm. After obtaining the encryption result, a hash operation is performed on it to obtain the corresponding result, and the shard area is divided according to the corresponding result. The main chain refers to the collective name of all blockchains that comply with the side chain protocol. The sharding area refers to the node area that processes data. For example, how to allocate fragments can be determined based on transaction sharding. Taking Shenzhen as the blockchain main chain as an example, Shenzhen has 11 districts (main chain sharding information) at this time, so it can be divided into multiple shards according to the administrative area of Shenzhen. For example, the administrative areas of Shenzhen are Nanshan District, Longhua District, Futian District and Bao'an District. Longhua District and Bao'an District can be divided into the first shard area, Nanshan District can be divided into the second shard area, and Futian District can be divided into the third shard area. The system can assign a shard according to the address of the request sender. If the data submitted by Nanshan District is verified by the smart contract, it will be added to the shard area where Nanshan District is located. All nodes in Nanshan District will store a copy. Each node is only responsible for hosting its own shard data and does not need to store the complete blockchain status.
[0041] 104. Search the corresponding sharding area information according to the target data to obtain a target sharding area.
[0042] In this embodiment, it can be specifically understood as verifying the target data through preset rules, and after verification, the corresponding target area is assigned according to the preset rules, such as the certificate number, unified social credit code, company type, legal person / natural person, and the corresponding feature data is obtained. Taking the certificate number judgment as an example, if the user's certificate is the certificate number of Nanshan District, Shenzhen, it will be automatically assigned to the node processing of Nanshan District, Shenzhen. At this time, the blockchain area where Nanshan District, Shenzhen is located is the second sharding area, and the second sharding area (the area composed of Nanshan District nodes) is the target sharding area. The sharding area is composed of multiple nodes, and the node is the place where each block is connected. Each block needs to be chained to be useful. The properties of the node include transparency, open answers, information cannot be tampered with, and decentralization. The sharding technology is to divide the chain into individual areas. One area is called a shard. Each shard assumes a full-time function, and the nodes will also be dispersed to each shard to handle the corresponding work. In this way, when processing, the transaction information will be divided into nodes on the target shard for simultaneous processing, just like the division of labor and cooperation among departments. In the end, each node only processes a small part of the transactions in the network. In this way, the processing efficiency of this chain can be greatly improved.
[0043] 105. Process the target data through the target sharding area to obtain a processing result.
[0044] In this embodiment, the processing results can provide federal services, compliance services, integrated bridge docking services, and provide multiple versions of SDKs, which are suitable for micropayments with extremely low handling fees; distributed transaction matching is completed on the chain, which is convenient for automated currency exchange; based on time events, multi-signatures and hierarchical authority control, business security is higher than network activity, and the sophisticated consensus mechanism provides external applications with access to various APIs that reach the underlying layer first, facilitating rapid access to various commercial applications.
[0045] The present invention filters the user's transaction information through the side chain to obtain the target data, thereby reducing the interference of invalid data on the main chain operation. By obtaining the preset main chain sharding information, the sharding area corresponding to the main chain to be processed can be calculated, and finally the data is allocated to the corresponding sharding area for processing, thereby improving the data processing throughput in the blockchain.
[0046] In some implementations, the obtaining of preset main chain sharding information, and obtaining at least one sharding region information according to the preset main chain sharding information, includes:
[0047] 111. Get the preset main chain sharding information;
[0048] 112. The preset main chain sharding information is hashed using the SHA256 algorithm to obtain a transaction hash, where the transaction hash includes at least the user's ID, transaction timestamp, and user's transaction information;
[0049] 113. The hash result is calculated by Const signature = SHA256 (user_id + tx_timestamp + tx_data), where user_id represents the user's id, tx_timestamp represents the transaction timestamp, tx_data represents the user's transaction information, and Const signature is the hash result;
[0050] 114. Generate a transaction proposal using the hash result through a client application programming interface;
[0051] 115. Serialize the transaction proposal into a structured text format to obtain a text transaction proposal;
[0052] 116. Generate at least one sharding area information for the text transaction proposal according to the private key of the encryption algorithm.
[0053] The above implementation mode, the flow chart is as follows Figure 1-3As shown, for example, Shenzhen has 11 districts, which can be divided into 11 shards. The system can assign a shard according to the sender's address, such as Nanshan District for calculation. A transaction hash will be generated based on the information of Nanshan District and the user's request. The transaction hash contains multiple transaction information, and then SHA256 is used for encryption calculation to obtain the final encryption result. A proposal is automatically generated through the application programming interface, and then converted into the corresponding text through serialization technology. The above method can ensure the security of the transaction.
[0054] In some implementations, after generating at least one sharding area information for the text transaction proposal according to the private key of the encryption algorithm, the method further includes:
[0055] 121. Extracting a target character segment from at least two of the target data according to a preset rule;
[0056] 122. If the target character segments are identical, the transaction is terminated.
[0057] The above implementation mode, the flow chart is as follows Figure 1-4 As shown, for example, if a trading center company wants to submit government affairs projects repeatedly and receive subsidies, one data will contain multiple transaction information, such as company name, company address, etc., but the unified social credit code (target character segment) is unique. If there are two target data, their unified social credit codes are the same. Since the unified social credit code of each enterprise is unique, it is determined that double spending has occurred in this way, and the transaction is stopped. Through the above implementation method, one transaction generates data twice, resulting in double spending.
[0058] In some implementation modes, after searching the corresponding sharding area information according to the target data to obtain the target sharding area, the method further includes:
[0059] 131. Randomly shard the nodes in the target sharding area by using a random sharding technology to obtain at least one target processing node;
[0060] The step of processing the target data through the target sharding area to obtain a processing result includes:
[0061] 132. Process the target data through the at least one target processing node to obtain a processing result.
[0062] The above implementation mode, the flow chart is as follows Figure 1-5As shown in Figure 1, another very important mechanism of sharding technology is the random allocation mechanism. Through network sharding technology, randomness is used. For example, the network can use the VRF method to randomly extract nodes to form shards to prevent malicious nodes from occupying a certain shard. After obtaining the sharding area, nodes are randomly extracted for calculation, making it impossible for hackers to accurately hack the corresponding nodes, increasing the cost of hacker intrusion, and thus improving the security of the blockchain.
[0063] In some implementations, filtering the transaction information of the user through the side chain to obtain the target data includes:
[0064] 141. Inputting the transaction information of the user into the side chain;
[0065] 142. Extracting feature data from the transaction information of the user through a side chain;
[0066] 143. Verify the transaction information of the user according to the characteristic data to obtain target data.
[0067] The above implementation mode, the flow chart is as follows Figure 1-6 As shown, first the user enters the corresponding information and saves it in the side chain. Then the side chain verifies based on some mandatory information (for example: certificate number, unified social credit code, company type, legal person / natural person...), selects the qualified data after verification, modifies the status, and synchronizes it to the main chain. For example, if only key enterprises can declare this time, then whether it is a key enterprise can be determined based on the tax amount, company size, company type, etc. Specifically, it can be understood as inputting the user's transaction information into the side chain, extracting the corresponding feature data through the preset extraction rules, such as certificate number, unified social credit code, company type, legal person / natural person, obtaining the corresponding feature data, verifying whether this part of the data is compliant, and determining it as target data if it complies with the rules.
[0068] In some implementations, extracting feature data from the user's transaction information through a side chain includes:
[0069] 151. Create a database main library and a blockchain side chain, and the blockchain side chain is multiple scalable channels;
[0070] 152. Construct a transaction proposal based on the transaction information, and send the transaction proposal to the corresponding scalable channel;
[0071] 153. Preprocessing the transaction proposal through the side chain to obtain feature data;
[0072] 154. Storing the characteristic data in the blockchain side chain;
[0073] 155. Send the blocks of the blockchain side chain to the main chain.
[0074] The above implementation mode, the flow chart is as follows Figure 1-7 As shown, each of the scalable channels corresponds to a channel database; the database is used to create a developer user table, the scalable channel is used to receive transactions from developer users, and each developer user joins one of the scalable channels.
[0075] In some implementations, after processing the target data through the target sharding area, the method further includes:
[0076] 161. Verify whether the format of the processing result is correct;
[0077] 162. If the format of the processing result is correct, verify the processing result using the public key of the encryption algorithm to obtain a verification result;
[0078] 163. If the verification result is successful, the processing result is saved in a database.
[0079] The above implementation mode, the flow chart is as follows Figure 1-8 As shown, since the data saved in the database must meet the preset rule arrangement, if the data arrangement is different, it cannot be saved to the database. When the processing result meets the database storage format, if the format meets the upload requirements, the processing result is verified by the encryption algorithm. If it cannot be decrypted by the public key, the data is not saved. Verify whether the processing result is correct in the above way. Prevent wrong results from being saved to the database.
[0080] The technical method of the present invention can be applied to application scenarios such as smart government affairs / smart urban management / smart communities / smart security / smart logistics / smart medical care / smart education / smart environmental protection / smart transportation, etc., which include blockchain-based data processing, thereby promoting the construction of smart cities.
[0081] In the blockchain-based data processing method provided in the embodiment of the present invention, the user's transaction information is obtained; the user's transaction information is filtered through the side chain to obtain the target data; the preset main chain sharding information is obtained, and at least one sharding area information is obtained according to the preset main chain sharding information; the corresponding sharding area information is searched according to the target data to obtain the target sharding area; the target data is processed through the target sharding area to obtain the processing result. The present invention is based on the data processing technology of blockchain, which belongs to the field of blockchain. The present invention divides the data in the blockchain into several subsets according to certain rules through the transaction sharding technology, and these subsets are verified by different fragments. The throughput of data processing based on blockchain is improved.
[0082] The embodiment of the present invention further provides a blockchain-based data processing device, which is used to execute any embodiment of the aforementioned blockchain-based data processing method. Figure 2 , Figure 2 1 is a schematic block diagram of a data processing device based on blockchain provided by an embodiment of the present invention. The data processing device based on blockchain can be configured in a user terminal.
[0083] like Figure 2 As shown, Figure 2 As shown, the blockchain-based data processing device 200 includes a user transaction information acquisition unit 210, a transaction information filtering unit 220, a main chain information acquisition unit 230, a sharding area information search unit 240 and a processing unit 250.
[0084] The transaction information acquisition unit 210 is used to acquire the transaction information of the user;
[0085] The transaction information filtering unit 220 is used to filter the transaction information of the user through the side chain to obtain target data;
[0086] The main chain information acquisition unit 230 is used to acquire preset main chain sharding information, and obtain at least one sharding region information according to the preset main chain sharding information;
[0087] A sharding region information search unit 240, configured to search the corresponding sharding region information according to the target data to obtain a target sharding region;
[0088] The processing unit 250 is used to process the target data through the target slice area to obtain a processing result.
[0089] In some optional implementations of this embodiment, the main chain information acquisition unit includes a main chain information acquisition subunit, a transaction hash calculation subunit, a hash result calculation subunit, a transaction proposal generation subunit, a serialization subunit, and a sharding area information generation subunit.
[0090] The main chain information acquisition subunit is used to obtain the preset main chain sharding information;
[0091] A transaction hash calculation subunit, used to perform hash calculation on the preset main chain shard information using the SHA256 algorithm to obtain a transaction hash, where the transaction hash includes at least the user's ID, transaction timestamp, and the user's transaction information;
[0092] Hash result calculation subunit, used for
[0093] The hash result is calculated by Const signature = SHA256 (user_id + tx_timestamp + tx_data), where user_id represents the user's id, tx_timestamp represents the transaction timestamp, tx_data represents the user's transaction information, and Const signature is the hash result;
[0094] A transaction proposal generation subunit, configured to generate a transaction proposal using the hash result through a client application programming interface;
[0095] A serialization subunit, used to serialize the transaction proposal into a structured text format to obtain a text transaction proposal;
[0096] The sharding area information generating subunit is used to generate at least one sharding area information for the text transaction proposal according to the private key of the encryption algorithm.
[0097] In some optional implementations of this embodiment, the above-mentioned device 200 further includes: a verification module, and the verification module includes: an extraction subunit and a judgment subunit.
[0098] An extraction subunit, used for extracting a target character segment from at least two of the target data according to a preset rule;
[0099] The judgment subunit is used to stop the transaction if the target character segments are identical.
[0100] In some optional implementations of this embodiment, the above-mentioned device 200 also includes: a sharding module, and the sharding module includes: a sharding sub-unit and a node processing sub-unit.
[0101] A sharding subunit, configured to randomly shard the nodes in the target sharding area by using a random sharding technology to obtain at least one target processing node;
[0102] The step of processing the target data through the target sharding area to obtain a processing result includes:
[0103] The node processing subunit is used to process the target data through the at least one target processing node to obtain a processing result.
[0104] In some optional implementations of this embodiment, the transaction information filtering unit includes a side chain input subunit, a user transaction information extraction subunit, and a sharding area verification subunit.
[0105] A side chain input subunit, used to input the transaction information of the user into the side chain;
[0106] A user transaction information extraction subunit, used to extract feature data from the transaction information of the user through a side chain;
[0107] The shard area verification subunit is used to verify the transaction information of the user according to the characteristic data to obtain the target data.
[0108] In some optional implementations of this embodiment, the shard area verification subunit includes a main chain side chain construction subunit, a transaction proposal construction subunit, a preprocessing subunit, a side chain storage subunit and a main chain storage subunit.
[0109] The main chain side chain construction sub-unit is used to create a database main library and a blockchain side chain. The blockchain side chain is a multiple scalable channel;
[0110] A transaction proposal construction subunit, used to construct a transaction proposal based on the transaction information, and send the transaction proposal to the corresponding scalable channel;
[0111] A preprocessing subunit, used for preprocessing the transaction proposal through the side chain to obtain feature data;
[0112] A sidechain storage subunit, used to store the feature data in the blockchain sidechain;
[0113] The main chain storage subunit is used to send the blocks of the blockchain side chain to the main chain.
[0114] In some optional implementations of this embodiment, the above-mentioned device 200 also includes: a transaction verification unit, and the transaction verification unit includes: a format verification subunit, a processing result verification subunit and an encryption algorithm verification subunit.
[0115] A format verification subunit, used to verify whether the format of the processing result is correct;
[0116] A processing result verification subunit, used to verify the processing result by using the public key of the encryption algorithm to obtain a verification result if the format of the processing result is correct;
[0117] The encryption algorithm verification subunit is used to save the target data to the database if the verification result is successful.
[0118] The blockchain-based data processing device provided in the embodiment of the present invention applies the above-mentioned blockchain-based data processing method to obtain the user's transaction information; filter the user's transaction information through the side chain to obtain the target data; obtain the preset main chain sharding information, and obtain at least one sharding area information according to the preset main chain sharding information; search for the corresponding sharding area information according to the target data to obtain the target sharding area; process the target data through the target sharding area to obtain the processing result. The present invention can calculate the sharding area corresponding to the main chain to be processed by obtaining the preset main chain sharding information, and finally assign the data to the corresponding sharding area for processing, thereby improving the throughput of data processing based on blockchain.
[0119] The above-mentioned blockchain-based data processing device can be implemented in the form of a computer program, which can be used in Figure 3 Runs on the computer device shown.
[0120] See also Figure 3 , Figure 3 is a schematic block diagram of a computer device provided in an embodiment of the present invention. The computer device may be a user terminal for executing a blockchain-based data processing method to perform blockchain-based data processing.
[0121] See also Figure 3 The computer device 300 includes a processor 302 , a memory and a network interface 305 connected via a system bus 301 , wherein the memory may include a non-volatile storage medium 303 and an internal memory 304 .
[0122] The non-volatile storage medium 303 may store an operating system 3031 and a computer program 3032. When the computer program 3032 is executed, the processor 302 may execute a data processing method based on blockchain.
[0123] The processor 302 is used to provide computing and control capabilities to support the operation of the entire computer device 300 .
[0124] The internal memory 304 provides an environment for the operation of the computer program 3032 in the non-volatile storage medium 303. When the computer program 3032 is executed by the processor 302, the processor 302 can execute a blockchain-based data processing method.
[0125] The network interface 305 is used for network communication, such as providing data information transmission, etc. Those skilled in the art will understand that Figure 3The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device 300 to which the solution of the present invention is applied. The specific computer device 300 may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0126] The processor 302 is used to run a computer program 3032 stored in the memory to implement the corresponding functions in the above-mentioned blockchain-based data processing method.
[0127] Those skilled in the art will understand that Figure 3 The embodiments of the computer device shown in the figure do not constitute a limitation on the specific composition of the computer device. In other embodiments, the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, in some embodiments, the computer device may only include a memory and a processor. In such embodiments, the structure and function of the memory and the processor are the same as those of the embodiment of the present invention. Figure 3 The embodiments shown are consistent and will not be described again here.
[0128] It should be understood that in the embodiment of the present invention, the processor 302 may be a central processing unit (CPU), and the processor 302 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0129] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps included in the above-mentioned blockchain-based data processing method are implemented.
[0130] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the above-described equipment, devices and units can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. Those of ordinary skill in the art can appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0131] In the several embodiments provided by the present invention, it should be understood that the disclosed equipment, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. Units with the same function may also be combined into one unit. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices or units, or may be an electrical, mechanical or other form of connection.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.
[0133] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a computer-readable storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a magnetic disk or an optical disk.
[0135] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A data processing method based on blockchain, characterized in that: The method comprises: Obtain user transaction information; Filter the transaction information of the user through the side chain to obtain the target data; Obtaining preset main chain sharding information, and obtaining at least one sharding area information according to the preset main chain sharding information; Search the corresponding sharding area information according to the target data to obtain the target sharding area; Processing the target data through the target sharding area to obtain a processing result; The obtaining of preset main chain sharding information, and obtaining at least one sharding area information according to the preset main chain sharding information, includes: Get the preset main chain shard information; The preset main chain shard information is hashed using the SHA256 algorithm to obtain a transaction hash, where the transaction hash includes at least the user's ID, transaction timestamp, and user's transaction information; The hash result is calculated by Const signature = SHA256 (user_id + tx_timestamp + tx_data), where user_id represents the user's id, tx_timestamp represents the transaction timestamp, tx_data represents the user's transaction information, and Const signature is the hash result; Generate a transaction proposal using the hash result through a client application programming interface; Serializing the transaction proposal into a structured text format to obtain a text transaction proposal; Generate at least one sharding area information for the text transaction proposal according to a private key of an encryption algorithm; After generating at least one sharding area information for the text transaction proposal according to the private key of the encryption algorithm, the method further includes: Extracting a target character segment from at least two of the target data according to a preset rule; If the target character segments are identical, the transaction is terminated; After searching the corresponding sharding area information according to the target data to obtain the target sharding area, the method further includes: Randomly sharding the nodes in the target sharding area by using a random sharding technology to obtain at least one target processing node; The step of processing the target data through the target sharding area to obtain a processing result includes: The target data is processed by the at least one target processing node to obtain a processing result.
2. The data processing method based on blockchain according to claim 1 is characterized in that: The filtering of the user's transaction information through the side chain to obtain the target data includes: Inputting the transaction information of the user into the side chain; Extracting feature data from the transaction information of the user through a side chain; The transaction information of the user is verified according to the characteristic data to obtain target data.
3. The data processing method based on blockchain according to claim 2 is characterized in that: The extracting feature data from the transaction information of the user through the side chain includes: Create a database main library and blockchain side chain, and the blockchain side chain is multiple scalable channels; Constructing a transaction proposal based on the transaction information, and sending the transaction proposal to the corresponding scalable channel; After preprocessing the transaction proposal through the side chain, characteristic data is obtained; Storing the feature data in the blockchain side chain; Send the blocks of the blockchain sidechain to the main chain.
4. The data processing method based on blockchain according to claim 3 is characterized in that: After the target data is processed by the target sharding area to obtain a processing result, the method further includes: Verifying whether the format of the processing result is correct; If the format of the processing result is correct, verifying the processing result by using the public key of the encryption algorithm to obtain a verification result; If the verification result is successful, the processing result is saved in the database.
5. A data processing device based on blockchain, characterized in that: The device comprises a unit for executing the method according to any one of claims 1 to 4: A user transaction information acquisition unit, used to acquire the user's transaction information; A transaction information filtering unit, used to filter the transaction information of the user through the side chain to obtain target data; A main chain information acquisition unit, used to acquire preset main chain sharding information, and obtain at least one sharding area information according to the preset main chain sharding information; A sharding area information searching unit, configured to search the sharding area information corresponding to the target data to obtain a target sharding area; A processing unit is used to process the target data through the target sharding area to obtain a processing result.
6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the blockchain-based data processing method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the blockchain-based data processing method according to any one of claims 1 to 4.
