Data processing method, apparatus, node device, and storage medium

By authenticating and changing the data processing method in the blockchain, the problem of illegal tampering in the DApp is solved, and data security and reliability are improved.

CN111367923BActive Publication Date: 2025-07-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010120591.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-26
Publication Date
2025-07-25
Estimated Expiration
2040-02-26

AI Technical Summary

Technical Problem

In DApp, when users view business data, there is a problem that data is illegally tampered with, which makes it difficult to guarantee data security and reliability.

Method used

By obtaining the data change request of the target user, after authentication, the first distributed application associated with the business contract is called to change the original data, and the changed data is written to the blockchain, and read and output to the user terminal using the second distributed application.

Benefits of technology

It increases the security of user changes in data and ensures the reliability of data reading, preventing illegal tampering and display of false data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111367923B_ABST
    Figure CN111367923B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a data processing method, apparatus, node device, and storage medium. The method includes: obtaining a data change request of a target user for original data; authenticating the target user according to the data change request; when the authentication is successful, invoking a first distributed application associated with the business contract, and changing the original data through the first distributed application; using the changed original data as target data, and writing the target data into a blockchain associated with the business contract; reading the target data on the blockchain through a second distributed application associated with the business contract, and outputting the target data to a user terminal corresponding to the target user. By adopting the embodiment of the present application, the security of user data change can be increased, and the reliability of data reading can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular, to a data processing method, apparatus, node device, and storage medium. Background Art

[0002] With the increasing maturity of blockchain technology, many applications developed relying on the core of blockchain technology have emerged, namely distributed applications (DApps).

[0003] Currently, when a user views the business data corresponding to a DApp, the business data corresponding to the DApp needs to be obtained from the blockchain, and the obtained business data is processed by the DApp and then displayed on the user terminal interface for the user to view the business data. However, during the process of the DApp processing the obtained business data, there may be a problem of illegal data tampering. For example, there is a phenomenon that other users (such as illegal users) illegally view and change the business data corresponding to the DApp, making it difficult to ensure the security of the business data. In addition, after the illegal user illegally changes the business data, the business data displayed on the user terminal interface will be the tampered business data (i.e., false data), making it difficult to ensure the reliability of the business data viewed by the user.

[0004] Application Content

[0005] The embodiments of this application provide a data processing method, apparatus, node device, and storage medium, which can increase the security of user data changes and ensure the reliability of data reading.

[0006] On the one hand, the embodiments of this application provide a data processing method, including:

[0007] Obtain a data change request of a target user for the original data; the original data is the data in the business database corresponding to the business contract;

[0008] Authenticate the target user according to the data change request;

[0009] When the authentication is successful, call the first distributed application associated with the business contract, and change the original data through the first distributed application;

[0010] Use the changed original data as the target data, and write the target data into the blockchain associated with the business contract;

[0011] Read the target data on the blockchain through the second distributed application associated with the business contract, and output the target data to the user terminal corresponding to the target user.

[0012] One aspect of the embodiments of the present application provides a data processing device, including:

[0013] An acquisition module, configured to acquire a data change request of a target user for original data; the original data is data in a business database corresponding to a business contract;

[0014] An authentication module, configured to authenticate the target user according to the data change request;

[0015] A change module, configured to, when the authentication is successful, call a first distributed application associated with the business contract, and change the original data through the first distributed application;

[0016] A writing module, configured to use the changed original data as target data, and write the target data into a blockchain associated with the business contract;

[0017] An output module, configured to read the target data on the blockchain through a second distributed application associated with the business contract, and output the target data to a user terminal corresponding to the target user.

[0018] Wherein, the data change request includes a blockchain address corresponding to the target user;

[0019] The authentication module includes:

[0020] An acquisition unit, configured to acquire blockchain address information associated with the original data; the blockchain address information includes access address information of an authorized user for changing the original data;

[0021] A first search unit, configured to search for access address information matching the blockchain address in the blockchain address information;

[0022] A first authentication unit, configured to, if access address information matching the blockchain address is found in the blockchain address information, the authentication is successful;

[0023] A second authentication unit, configured to, if no access address information matching the blockchain address is found in the blockchain address information, the authentication fails.

[0024] Wherein, a first business logic associated with the first distributed application is stored in the business contract;

[0025] The change module includes:

[0026] A first determination unit, configured to, when the authentication is successful, determine that the target user has the right to change the original data;

[0027] A second determination unit, configured to call the service contract and determine a first distributed application associated with the service contract based on the first service logic in the service contract;

[0028] An alteration unit, configured to alter the original data through the first distributed application to obtain the altered original data.

[0029] Wherein, the apparatus further includes:

[0030] A determination module, configured to determine that the target user does not have the permission to alter the original data when the authentication fails;

[0031] An information sending module, configured to send a failure prompt message corresponding to the data alteration request to the target user.

[0032] Wherein, the writing module includes:

[0033] A third determination unit, configured to determine the altered original data as target data;

[0034] A fourth determination unit, configured to determine signature information corresponding to the target data according to the private key of the target user;

[0035] An uploading unit, configured to upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to a blockchain network, so that the blockchain network verifies the signature of the target data according to the public key;

[0036] An adding unit, configured to add a data alteration block including the target data to a blockchain associated with the service contract if the signature verification passes.

[0037] Wherein, a second service logic associated with a second distributed application is stored in the service contract;

[0038] The output module includes:

[0039] A fifth determination unit, configured to obtain a first hash value corresponding to the target data and determine a first root hash value in an authentication path to which the first hash value belongs;

[0040] A second search unit, configured to search for a second root hash value matching the first root hash value in the blockchain, and use the block to which the second root hash value belongs as a data alteration block associated with the target data;

[0041] A sixth determination unit, configured to determine a second distributed application associated with the service contract according to the second service logic in the service contract;

[0042] An output unit, configured to read the target data from the data change block through the second distributed application, and output the target data to the user terminal corresponding to the target user.

[0043] Wherein, the second search unit includes:

[0044] An acquisition subunit, configured to acquire the root hash value information corresponding to each block in the blockchain;

[0045] A search subunit, configured to search for the root hash value information that matches the first root hash value in the root hash value information;

[0046] A matching subunit, configured to use the found root hash value information that matches the first root hash value as the second root hash value, and use the block corresponding to the second root hash value as the data change block associated with the target data.

[0047] On the one hand, the present application provides a node device, including: a processor, a memory, and a network interface;

[0048] The processor is connected to the memory and the network interface. Among them, the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program to execute the method in the above-mentioned aspect in the embodiment of the present application.

[0049] On the one hand, the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions, and when the program instructions are executed by a processor, the method in the above-mentioned aspect in the embodiment of the present application is executed.

[0050] In the embodiment of the present application, the server node can authenticate the target user for the data change request of the target user, which can increase the security of the user's changed data; at the same time, after the server node changes the original data through the first distributed application, the target data can be obtained. At this time, the target data is written into the blockchain, and the target data on the blockchain is read through the second distributed application, thereby ensuring the reliability of data reading. Description of the Drawings

[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0052] Figure 1 It is a schematic structural diagram of a network architecture provided by an embodiment of the present application;

[0053] Figure 2 It is a schematic diagram of a scenario for data processing provided by an embodiment of the present application;

[0054] Figure 3 It is a schematic flowchart of a data processing method provided by an embodiment of the present application;

[0055] Figure 4 It is a schematic diagram of a service contract provided by an embodiment of the present application;

[0056] Figure 5 It is a schematic diagram of authenticating a target user provided by an embodiment of the present application;

[0057] Figure 6 It is a schematic diagram of generating a data change block provided by an embodiment of the present application;

[0058] Figure 7 It is a schematic flowchart of a data processing method provided by an embodiment of the present application;

[0059] Figure 8 It is a schematic diagram of a first root hash value provided by an embodiment of the present application;

[0060] Figure 9 It is a schematic diagram of determining a data change block provided by an embodiment of the present application;

[0061] Figure 10 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application;

[0062] Figure 11 It is a schematic structural diagram of a node device provided by an embodiment of the present application. Detailed implementation manners

[0063] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0064] Please refer to Figure 1 which is a schematic structural diagram of a network architecture provided by an embodiment of the present application. As Figure 1As shown, the network architecture may include a blockchain node system for running a blockchain network and a user terminal cluster. Among them, the blockchain corresponding to the blockchain network may be a blockchain associated with a business contract. The blockchain node system may refer to a system for data sharing between nodes. The blockchain node system may include multiple nodes. As Figure 1 shown, the blockchain node system may specifically include node 100a, node 100b, node 100c, …, node 100n. The user terminal cluster may include multiple user terminals. As Figure 1 shown, it may specifically include user terminal 3000a, user terminal 3000b, user terminal 3000c, …, user terminal 3000n.

[0065] Among them, in the blockchain node system, when each node is working properly, it can obtain the target data of the user terminal associated with the node (the user terminal corresponding to the target user) to maintain the shared data in the blockchain node system. To ensure information intercommunication in the blockchain node system, network connections can be established between each node in the blockchain node system to perform data transmission through these network connections. For example, when any node in the blockchain node system obtains the target business record information, other nodes in the blockchain node system can obtain the target business record information according to the consensus algorithm and store the target business record information as data in the shared data, so that the data stored on all nodes in the blockchain node system is consistent.

[0066] For each node in the blockchain node system, it has a corresponding node identifier, and each node in the blockchain node system can store the identifiers of other nodes that have a network connection relationship with the current node, so as to broadcast the generated block to other nodes in the blockchain node system according to the identifiers of other nodes later. Each node can maintain a node identifier list as shown in the following table, and store the node name and node identifier in the node identifier list correspondingly. Among them, the node identifier can be an IP (Internet Protocol) address and any other information that can be used to identify the node. Only the IP address is used as an example in Table 1 for illustration.

[0067] Node Name Node Identifier Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258

[0068] It should be understood that each node in the blockchain node system can perform data interaction with each user terminal in the user terminal cluster. It can be understood that the embodiments of this application can be Figure 1Select a node from the blockchain node system shown as the server node in the blockchain network. Among them, the server node can be a node running the first distributed application and the second distributed application. For example, in the embodiment of the present application, the node 100a in the blockchain node system can be used as the server node. The server node can perform data interaction with each user terminal in the user terminal cluster.

[0069] Among them, as Figure 1 shown, each user terminal in the user terminal cluster can include intelligent terminals with business data access functions such as smart phones, tablet computers, and desktop computers. It can be understood that in the embodiment of the present application, Figure 1 select a user terminal from multiple user terminals in the user terminal cluster shown as the user terminal corresponding to the target user associated with the server node (node 100a). For example, in the embodiment of the present application, the user terminal 3000a in the user terminal cluster can be used as the user terminal corresponding to the target user.

[0070] It should be understood that when the target user needs to change the original data, a data change request can be sent to node 100a through user terminal 3000a. At this time, node 100a can obtain the data change request of the target user for the original data. Among them, the original data is the data in the business database corresponding to the business contract. It should be understood that the business contract can be a smart contract storing the first business logic associated with the first distributed application and the second business logic associated with the second distributed application. Among them, the smart contract can be understood as a computer program running on a distributed ledger (i.e., blockchain), with preset rules, state, and conditional responses, which can encapsulate, verify, and execute complex behaviors of distributed nodes, and complete information exchange, value transfer, and asset management. It should be understood that the business contract can be used to maintain the first application logic and the second application logic. It can be understood that the business contract in the embodiment of the present application is a smart contract jointly participated by the user terminal and the blockchain node. Each blockchain node (for example, node 100a) can trigger and execute the business contract, that is, can provide a running environment for the business contract. It should be understood that the business database can be a database for storing business data associated with the business contract. For example, the business database can be a blockchain database. It can be understood that when node 100a obtains the data change request, it needs to authenticate whether the target user has the permission to change the original data.

[0071] Further, the node 100a may authenticate the target user according to the data change request. It should be understood that the data change request may include the blockchain address of the target user. Among them, the blockchain address of the target user may be obtained by operating on the public key of the target user. It can be understood that the node 100a may authenticate the target user according to the blockchain address of the target user. If the authentication is successful, it is determined that the target user has the permission to change the original data, and the target user is permitted to change the original data; if the authentication fails, it is determined that the target user does not have the permission to change the original data, and the target user is not permitted to change the original data.

[0072] Further, when the authentication is successful, the node 100a may determine that the target user has the permission to change the original data and obtain the original data in the business database. It should be understood that the node 100a may call the business contract and determine the first distributed application associated with the business contract based on the first business logic in the business contract. Among them, the first application logic may be a piece of code with a write operation function. It can be understood that the first distributed application may be a distributed application with a write operation function. Among them, the write operation may include change operations (for example, changing the original data) and write operations (for example, writing business data into the business database), etc. Further, the node 100a may change the original data through the first distributed application to obtain the changed original data. It should be understood that after the node 100a calls the above business contract, it can use the service corresponding to the first distributed application (for example, changing the original data).

[0073] Further, the node 100a may use the changed original data as the target data and write the target data into the blockchain associated with the business contract. It should be understood that the node 100a may determine the signature information corresponding to the target data according to the private key of the target user. It should be understood that the node 100a may upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network so that the blockchain network verifies the signature of the target data according to the public key. At this time, if the signature verification passes, it means that the target data has not been tampered with during the upload process, and the node 100a may add the data change block containing the target data to the blockchain associated with the business contract.

[0074] Further, the node 100a can read the target data on the blockchain through a second distributed application associated with the service contract, and output the target data to the user terminal 3000a corresponding to the target user. It should be understood that the node 100a can call the service contract and determine a second distributed application associated with the service contract based on the second application logic in the service contract. Among them, the second application logic can be a piece of code with a read operation function. Among them, the second distributed application can be a distributed application with a read operation function. Among them, the read operation can include a read operation (for example, reading target data), a view operation (witness operation), and so on. Further, the node 100a can read the target data on the blockchain through the second distributed application and convert the data format corresponding to the target data into visual data (for example, the target data that can be directly displayed on the user terminal 3000a and directly viewed by the target user). It should be understood that the node 100a can output the target data to the user terminal 3000a corresponding to the target user. It can be understood that the target user can view the target data on the user terminal 3000a and send a reception success message for the target data to the node 100a. The reception success message can include the viewing result of the target data, which is convenient for the node 100a to view the reception success message in a timely manner.

[0075] For ease of understanding, further, please refer to Figure 2 , which is a schematic diagram of a scenario for data processing provided by an embodiment of the present application. As Figure 2 shown, in the embodiment of the present application, node A can be a server node, and the server node can be the node 100a in the blockchain node system shown above Figure 1 . The user terminal C can be a user terminal corresponding to the target user B associated with the server node, and the user terminal can be the user terminal 3000a in the user terminal cluster corresponding to the above Figure 1 .

[0076] It should be understood that when the target user B needs to change the original data 10a, a data change request can be sent to node A. Among them, the original data 10a can be the data in the business database corresponding to the business contract. It should be understood that the business contract can be a smart contract that stores the first business logic associated with the first distributed application and the second business logic associated with the second distributed application. At this time, node A can obtain the data change request of target user B for the original data 10a, and this data change request is used to request to change the original data 10a. For example, the data change request can be to change the historical business data of the target user (such as the original data 10a). It should be understood that before node A changes the original data 10a, it is necessary to identify whether target user B has the permission to change the original data 10a. After determining that target user B's authentication is successful, the original data 10a is changed. It can be understood that node A can determine whether target user B is the authorized user to change the original data 10a according to the blockchain address in the data change request, so as to achieve the purpose of authenticating target user B. That is to say, if it is determined that target user B is the authorized user, the authentication is successful, and it is determined that target user B can change the original data 10a; if it is determined that target user B is not the authorized user, the authentication fails, and it is determined that target user B cannot change the original data 10a. It can be understood that when the authentication is successful, node A can determine that target user B has the permission to change the original data 10a, obtain the original data 10a (such as historical business data) in the business database (such as the blockchain database), and further change the original data 10a.

[0077] Furthermore, node A can call the first distributed application associated with the business contract to change the original data 10a through this first distributed application. It should be understood that if node A needs to use the business corresponding to the first distributed application (such as updating historical business data), it needs to call the business contract, and then use the business corresponding to the first distributed application. It should be understood that node A can call the business contract and determine the first distributed application associated with the business contract based on the first business logic in the business contract. Among them, the first application logic can be a piece of code with write operation function. It can be understood that the first distributed application can be a distributed application with write operation function. Among them, the write operation can include change operations (such as changing historical business data) and write operations (such as writing the changed business data into the business database), etc. Furthermore, node A can change the original data 10a through this first distributed application to obtain the changed original data (that is, the target data 10b, such as the changed business data).

[0078] It can be understood thatFigure 2 The blockchain 1 shown can be the blockchain corresponding to the blockchain network in the above Figure 1 and this blockchain 1 can be a blockchain associated with the business contract. This blockchain 1 can be the same blockchain shared by each node in the blockchain network corresponding to node A. Each node can obtain the information stored in this blockchain in this blockchain 1. Among them, this blockchain 1 includes block 10a, block 10b, …, block 10n and data change blocks. This block 10a can be called the genesis block of this blockchain 1. It can be understood that the data change block in this blockchain 1 can include the above-mentioned target data 10b. For example, the target data 10b can be changed business data, updated business corresponding to the business contract, and so on.

[0079] Among them, this node A can write the target data 10b into the blockchain 1 associated with the business contract. In other words, this node A can obtain the block 10n with the largest generation timestamp from this blockchain 1. It should be understood that this node A can determine the signature information corresponding to the target data 10b according to the private key of the target user B, and upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network, so that the blockchain network verifies the signature of the target data according to the public key. Further, if the signature verification passes, this node A can generate a data change block to be written into this blockchain 1 according to the target data 10b. At this time, this node A broadcasts the data change including the target data 10b to all blockchain nodes in the blockchain network (for example, consensus nodes for consensus processing). When it is determined that the blockchain nodes reach a consensus, the data change block can be added to the above-mentioned blockchain 1, that is, this data change block is used as the next block of block 10n.

[0080] It can be understood that after node A writes the target data 10b to the blockchain 1 associated with the business contract, it can read the target data 10b on the blockchain 1 through a second distributed application associated with the business contract and output the target data 10b to the user terminal C corresponding to the target user. It should be understood that node A can call the business contract and determine the second distributed application associated with the business contract based on the second application logic in the business contract. Among them, the second application logic can be a piece of code with a read operation function. Among them, the second distributed application can be a distributed application with a read operation function. Among them, the read operation can include a read operation (for example, reading target data), a viewing operation (i.e., a witnessing operation), and so on. At this time, node A can read the target data 10b from the data change block on the blockchain 1 through the second distributed application and output the target data 10b (for example, visualized data) to the user terminal C corresponding to the target user B. It can be understood that the target user B can view the target data 10b on the user terminal C, so as to determine that the target data 10b is consistent with the business requirements corresponding to the data change request, and send a reception success message for the target data 10b to node A, which is convenient for node A to view the above reception success message in time.

[0081] It can be seen that in the embodiment of the present application, the server node can authenticate the target user for the data change request of the target user, which can increase the security of user data change; at the same time, after the server node changes the original data through the first distributed application, the target data can be obtained. At this time, the target data is written to the blockchain, and the target data on the blockchain is read through the second distributed application, thus ensuring the reliability of data reading.

[0082] Among them, the specific implementation manner in which the server node changes the original data to obtain the target data by calling the business contract and outputs the read target data to the user terminal can be seen in the following Figures 3 - 9 corresponding embodiment.

[0083] Further, please refer to Figure 3 , which is a schematic flowchart of a data processing method provided by an embodiment of the present application. As Figure 3 shown, the method may include:

[0084] S101, obtain a data change request of a target user for original data.

[0085] Specifically, the original data is the data in the business database corresponding to the business contract. When the target user (such as the above Figure 2When the target user B) in the corresponding embodiment needs to modify the data (such as raw data) in the business database, a data modification request can be sent to the server node. It should be understood that the business database can be the database corresponding to the business contract. Among them, the business contract can be a smart contract storing the first business logic associated with the first distributed application and the second business logic associated with the second distributed application. Among them, the smart contract can be understood as a computer program running on a distributed ledger (i.e., blockchain), with preset rules, state, and conditional responses, which can encapsulate, verify, and execute complex behaviors of distributed nodes, and complete information exchange, value transfer, and asset management. It can be understood that the business contract in the embodiment of the present application is a smart contract jointly participated by the user terminal and the server node, and the server node can trigger and execute the business contract, that is, both can provide a running environment for the business contract. It should be understood that the server node can be a node with the function of calling the business contract (i.e., running the first distributed application and the second distributed application).

[0086] For ease of understanding, please refer to Figure 4 , which is a schematic diagram of a business contract provided by the embodiment of the present application. As Figure 4 shown, the business contract 40 may include the first business logic 4a associated with the first distributed application A, the second business logic 4b associated with the first distributed application B, and the unrelated business logic 4c (that is, the business logic in the business contract 40 other than the first business logic 4a and the second business logic 4b). Among them, the first business logic 4a can be a piece of code with the business function (i.e., write operation function) corresponding to the first distributed application A. Among them, the second business logic 4b can be a piece of code with the business function (i.e., read operation function) corresponding to the second distributed application B. Among them, the unrelated business logic 4c can be a piece of code that has nothing to do with the business function corresponding to the first distributed application A and the business function corresponding to the second distributed application B. It can be understood that the server node can call the business contract 40 and use the business function corresponding to the first distributed application A (such as modifying the raw data) based on the first business logic 4a in the business contract 40. It can be understood that the server node can call the business contract 40 and use the business function corresponding to the second distributed application B (such as reading the target data on the blockchain) based on the second business logic 4b in the business contract 40.

[0087] Among them, the server node in the embodiment of the present application can be the above-mentioned Figure 2 corresponding node A, and the node A can also be the above-mentioned Figure 1The corresponding node 100a. At this time, the server node can obtain the data change request sent by the target user for the original data, and needs to authenticate whether the target user has the permission to change the original data, that is, perform the following step S102.

[0088] S102, authenticate the target user according to the data change request.

[0089] Specifically, the data change request may include the blockchain address corresponding to the target user, and the blockchain address can be obtained by calculating the public key of the target user. It should be understood that when the server node authenticates the target user, it can first obtain the blockchain address information associated with the original data. Among them, the blockchain address information contains the access address information of the authorized user for changing the original data. It should be understood that one authorized user can correspond to one access address information, and the access address information corresponding to each authorized user is different. Among them, the blockchain address information can store the mapping relationship between the authorized user and the access address information. Among them, the access address information can be the blockchain address corresponding to the authorized user. For example, the authorized user and the access address information can be stored in the blockchain address information in the form of key-value pairs, that is, user 1 corresponds to access address information 1, user 2 corresponds to access address information 2, user 3 corresponds to access address information 3, and so on.

[0090] Further, the server node can search for the access address information that matches the blockchain address in the blockchain address information. It should be understood that the server node can traverse all the access address information in the blockchain address information to search for the access address information that matches the blockchain address. For example, the blockchain address information may include access address information 1 of user 1, access address information 2 of user 2,..., access address information n of user n. The above server node can search for the access address information that matches the blockchain address corresponding to the target user from the access address information (such as access address information 1, access address information 2,..., access address information n) in the blockchain address information, so as to authenticate whether the target user has the permission to change the original data.

[0091] Further, if the server node can find access address information that matches the blockchain address in the blockchain address information, the authentication is successful. It should be understood that when there is access address information in the blockchain address information that matches the blockchain address corresponding to the target user, that is, when the server node can find access address information that matches the blockchain address in the blockchain address information, the authentication is successful, indicating that the target user has the permission to modify the original data. At this time, the server node can obtain the original data from the business database and modify the original data.

[0092] It can be understood that if the server node cannot find access address information that matches the blockchain address in the blockchain address information, the authentication fails. It should be understood that when there is no access address information in the blockchain address information that matches the blockchain address corresponding to the target user, that is, when the server node cannot find access address information that matches the blockchain address in the blockchain address information, the authentication fails, indicating that the target user does not have the permission to modify the original data and thus cannot modify the original data.

[0093] It can be understood that when the authentication fails, the server node can determine that the target user does not have the permission to modify the original data. Further, the server node can send a failure prompt message corresponding to the data change request to the target user. For example, the failure prompt message can be "Data change request failed!".

[0094] For ease of understanding, please refer to Figure 5 , which is a schematic diagram of authenticating a target user provided by an embodiment of the present application. As Figure 5As shown, the blockchain address information 50 may include the access address information of all authorized users, that is, the access address information 1 of authorized user 1, the access address information 2 of authorized user 2, …, the access address information n of authorized user n. The above server node may traverse all the access address information in the blockchain address information 50 (for example, access address information 1, access address information 2, …, and access address information n), so as to find the access address information 2 that matches the blockchain address a of the target user. At this time, the blockchain address a is the same as the access address information 2. In other words, after the server node finds the access address information 2 that matches the blockchain address a, the authentication is successful, and it is determined that the target user (that is, authorized user 2) has the permission to modify the original data. It can be understood that when the server node traverses all the access address information in the blockchain address information 50 (for example, access address information 1, access address information 2, …, and access address information n) and does not find the access address information that matches the blockchain address a, that is, there is no access address information in all the access address information that is the same as the blockchain address a, the authentication fails, and it is determined that the target user does not have the permission to modify the original data.

[0095] S103, when the authentication is successful, call the first distributed application associated with the business contract, and modify the original data through the first distributed application.

[0096] Specifically, the first business logic associated with the first distributed application is stored in the business contract. It should be understood that when the authentication is successful, the server node can determine that the target user has the permission to modify the original data and allow the target user to modify the original data. It can be understood that before the server node uses the first distributed application to modify the original data, it needs to call the business contract and determine the first distributed application associated with the business contract based on the first business logic in the business contract. Among them, the first application logic may be a piece of code with a write operation function. It can be understood that the first distributed application may be a distributed application with a write operation function. Among them, the write operation may include a modification operation (for example, modifying the original data) and a write operation (for example, writing business data into a business database), etc.

[0097] Furthermore, the server node may modify the original data through the first distributed application to obtain the modified original data. It should be understood that the server node may modify the original data through the service corresponding to the first distributed application (for example, the modification operation) to obtain the modified original data.

[0098] S104. Use the changed original data as the target data and write the target data into the blockchain associated with the business contract.

[0099] Specifically, the server node can determine the changed original data as the target data (i.e., the data to be uploaded to the chain), and obtain the private key of the target user and the public key corresponding to the private key. At this time, the server node can determine the signature information corresponding to the target data according to the private key of the target user. It should be understood that the server node can perform a hashing operation on the target data through a hashing algorithm to obtain the first hash value (i.e., the first digital digest) corresponding to the target data, and encrypt the first hash value with the private key of the target user, and use the encrypted first hash value as the signature information corresponding to the target data. It should be understood that the server node can perform an operation on the first hash value through a digital signature algorithm to obtain the signature information corresponding to the target data. Among them, the digital signature algorithm can include, but is not limited to: RSA (a signature algorithm), DSA (a signature algorithm), ECDSA (a signature algorithm), etc.

[0100] Further, the server node can upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network, so that the blockchain network can verify the signature of the target data according to the public key. It should be understood that the blockchain network can decrypt the signature information corresponding to the target data through the public key of the target user to obtain the second hash value (i.e., the second digital digest); if the first hash value is the same as the second hash value, it means that the target data has not been tampered with during the upload process, and the signature verification passes; if the first hash value is different from the second hash value, it means that the target data may have been tampered with during the upload process, and the signature verification fails.

[0101] Further, if the signature verification passes, the server node can add the data change block containing the target data to the blockchain associated with the business contract. Specifically, if the signature verification passes, the server node can package the target data into a block to be verified and send the block to be verified to the consensus nodes in the blockchain network for consensus. Among them, the block to be verified can be a block that has not passed the consensus of the consensus nodes in the blockchain network.

[0102] Further, the service node can obtain the consensus confirmation information returned by the consensus nodes in the blockchain network. It should be understood that after the service node sends the block to be verified to the consensus nodes in the blockchain network for consensus, if the consensus nodes verify the block to be verified and pass, the consensus nodes can return the consensus confirmation information to the service node. At this time, the server node can obtain the consensus confirmation information returned by the consensus nodes in the blockchain network. Among them, one consensus node can correspond to one consensus confirmation information.

[0103] Further, if the server node counts that the total number of the consensus confirmation messages is greater than the consensus threshold of the consensus node, it determines that the consensus is completed, and determines the to-be-verified block that passes the verification as the data change block, and adds the data change block to the blockchain associated with the business contract. For example, if the number of consensus nodes is A, the server node counts that the total number of the consensus confirmation messages is B, and the consensus threshold of the consensus node is 0.8A. At this time, if the total number B of the consensus confirmation messages is greater than 0.8A, it is determined that the consensus is completed.

[0104] For ease of understanding, please refer to Figure 6 , which is a schematic diagram of the generation of a data change block provided by an embodiment of the present application. As Figure 6 shown, when generating a data change block in a blockchain, the blockchain node corresponding to the blockchain can verify the target data when receiving the target data (for example, it can verify the signature information corresponding to the target data), and after completing the verification (for example, the target data passes the signature verification), store the target data in the memory pool and update the hash tree used to record the target data; then, update the timestamp to the time when the target data is received, and try different random numbers, perform eigenvalue calculations multiple times, and make the calculated eigenvalue satisfy the following formula (1):

[0105] SHA256(SHA256(version + prev_hash + merkle_root + ntime + nbits + x)) < TARGET, (1)

[0106] where SHA266 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the target data; ntime is the update time of the updated timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, and the eigenvalue threshold can be determined according to nbits.

[0107] It can be understood that when a random number satisfying the above formula is calculated, the information can be correspondingly stored to generate a block header and a block body, obtaining a block to be verified. Subsequently, the server node sends the block to be verified to other nodes (such as consensus nodes) in its blockchain network according to the node identifiers of other nodes in the blockchain network. Other nodes verify the block to be verified (for example, the consensus nodes in the blockchain network conduct consensus on the block to be verified), and obtain a data change block after the verification is completed, and add the data change block to the blockchain associated with the business contract stored by it (such as the blockchain 1 in the corresponding embodiment above) Figure 2 ).

[0108] For example, as Figure 2 shown, the server node can determine the changed original data as the target data 10b and write the target data 10b into the blockchain 1.

[0109] It should be understood that Figure 2 the blockchain 1 shown can be the blockchain corresponding to the above Figure 1 blockchain network, and the blockchain 1 can be a blockchain associated with the business contract. The blockchain 1 can be the same blockchain shared by each node in the blockchain network corresponding to node A. Each node can obtain the information stored in the blockchain in this blockchain 1. Among them, the blockchain 1 includes block 10a, block 10b,..., block 10n and data change blocks. The block 10a can be called the genesis block of the blockchain 1. It can be understood that the data change block in the blockchain 1 can include the above target data 10b. For example, the target data 10b can be changed business data, updated business corresponding to the business contract, and so on.

[0110] Among them, the node A can write the target data 10b into the blockchain 1 associated with the business contract. In other words, the node A can obtain the block 10n with the maximum generation timestamp from the blockchain 1. It should be understood that the node A can determine the signature information corresponding to the target data 10b according to the private key of the target user B, and upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network, so that the blockchain network verifies the signature of the target data according to the public key. Further, if the signature verification passes, the node A can generate a data change block to be written into the blockchain 1 according to the target data 10b. At this time, the node A broadcasts the data change including the target data 10b to all blockchain nodes in the blockchain network (for example, consensus nodes for consensus processing). When it is determined that the blockchain nodes reach a consensus, the data change block can be added to the above-mentioned blockchain 1, that is, the data change block is used as the next block of the block 10n. Among them, in the embodiment of the present application, writing the target data into the blockchain associated with the business contract can ensure the authenticity of the target data and prevent others from maliciously tampering with it.

[0111] S105, read the target data on the blockchain through a second distributed application associated with the business contract, and output the target data to the user terminal corresponding to the target user.

[0112] Specifically, the business contract stores a second business logic associated with the second distributed application. It should be understood that the server node can call the business contract and determine the second distributed application associated with the business contract based on the first business logic in the business contract. It should be understood that the second application logic can be a piece of code with a read operation function. Among them, the second distributed application can be a distributed application with a read operation function. The read operation can include a read operation (for example, reading target data), a view operation (i.e., a witness operation), and so on. At this time, the server node can read the target data from the data change block on the blockchain through the second distributed application and output the target data (for example, visualization data) to the user terminal corresponding to the target user. Among them, in the embodiment of the present application, the user terminal can be the user terminal C corresponding to the above Figure 2 and the user terminal C can also be the user terminal 3000a corresponding to the above Figure 1 It should be understood that the target user can view the target data on the user terminal, so as to determine that the target data is consistent with the business requirements corresponding to the data change request, and send a reception success message for the target data to the server node.

[0113] In the embodiment of the present application, the server node can authenticate the target user for the data change request of the target user, which can increase the security of the user's changed data. At the same time, after the server node changes the original data through the first distributed application, the target data can be obtained. At this time, the target data is written into the blockchain, and the target data on the blockchain is read through the second distributed application, thereby ensuring the reliability of data reading.

[0114] Further, please refer to Figure 7 , which is a schematic flowchart of a data processing method provided by an embodiment of the present application. As Figure 7 shown, the method may include:

[0115] S201, Obtain a data change request of a target user for the original data.

[0116] Wherein, the original data is the data in the business database corresponding to the business contract.

[0117] Specifically, the business contract may be a smart contract storing the first business logic associated with the first distributed application and the second business logic associated with the second distributed application. It should be understood that the business database may be a database for storing business data associated with the business contract.

[0118] Wherein, the server node in the embodiment of the present application may be the above-mentioned Figure 2 corresponding node A, and this node A may also be the above-mentioned Figure 1 corresponding node 100a. The server node may be a node having the function of invoking the business contract (that is, running the first distributed application and the second distributed application).

[0119] S202, Authenticate the target user according to the data change request.

[0120] Specifically, the server node may obtain blockchain address information associated with the original data. Wherein, the blockchain address information includes access address information of an authorized user for changing the original data. Further, the server node may search for access address information matching the blockchain address in the blockchain address information. At this time, if the server node finds access address information matching the blockchain address in the blockchain address information, the authentication is successful. At this time, if the server node does not find access address information matching the blockchain address in the blockchain address information, the authentication fails.

[0121] S203, When the authentication is successful, call the first distributed application associated with the business contract, and change the original data through the first distributed application.

[0122] Among them, the service contract stores the first business logic associated with the first distributed application.

[0123] Specifically, when the authentication is successful, the server node can determine that the target user has the permission to modify the original data. Further, the server node can invoke the service contract and determine the first distributed application associated with the service contract based on the first business logic in the service contract. Further, the server node can use the first distributed application to modify the original data to obtain the modified original data.

[0124] S204: Use the modified original data as the target data and write the target data into the blockchain associated with the service contract.

[0125] Specifically, the server node can determine the modified original data as the target data. Further, the server node can determine the signature information corresponding to the target data according to the private key of the target user. Further, the server node can upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network so that the blockchain network can verify the signature of the target data according to the public key. Further, if the signature verification passes, the server node can add the data change block containing the target data to the blockchain associated with the service contract.

[0126] Among them, for the specific implementation manners of steps S201 - S204, reference can be made to the descriptions of steps S101 - S104 in the corresponding embodiments above, which will not be elaborated here. Figure 3 The descriptions of steps S101 - S104 in the corresponding embodiments above, which will not be elaborated here.

[0127] S205: Obtain the first hash value corresponding to the target data and determine the first root hash value under the authentication path to which the first hash value belongs.

[0128] Specifically, the server node can perform a hash operation on the target data through a hash algorithm to obtain the first hash value corresponding to the target data, thereby determining the first root hash value under the authentication path to which the first hash value belongs. It should be understood that each block in the blockchain (for example, the data change block) has a uniquely determined root hash value. Therefore, the server node can determine the data change block according to the first root hash value.

[0129] For ease of understanding, please refer to Figure 8 , which is a schematic diagram of a first root hash value provided by an embodiment of the present application. As Figure 8As shown, the root hash value G is obtained by combining the hash value C and the hash value F, where the hash value C is obtained by combining the hash value A and the hash value B, and the hash value F is obtained by combining the hash value D and the hash value E. It should be understood that the hash value A, the hash value B, the hash value D, and the hash value E can all be hash values corresponding to business data (such as target data). Among them, the first hash value corresponding to the target data in the embodiments of the present application can be any one of the hash value A, the hash value B, the hash value D, and the hash value E. It should be understood that any one of the hash value A, the hash value B, the hash value D, and the hash value E has a unique authentication path to which it belongs. For example, the hash value A can be the first hash value corresponding to the target data, that is, the authentication path to which the hash value A (i.e., the first hash value) belongs can be hash value A - hash value C - root hash value G, so that the root hash value G can be determined as the first root hash value.

[0130] S206. Search for a second root hash value that matches the first root hash value in the blockchain, and use the block to which the second root hash value belongs as the data change block associated with the target data.

[0131] Specifically, the server node can obtain the root hash value information corresponding to each block in the blockchain. Further, the server node can search for the root hash value information that matches the first root hash value in the root hash value information. Further, the server node can use the found root hash value information that matches the first root hash value as the second root hash value, and then use the block corresponding to the second root hash value as the data change block associated with the target data.

[0132] For ease of understanding, please refer to Figure 9 , which is a schematic diagram of determining a data change block provided by an embodiment of the present application. As Figure 9As shown, Blockchain A can be a blockchain associated with a business contract. Blockchain A may include Block 10a, Block 10b, …, Block 10n. Among them, the root hash value information contained in Block 10a is root hash value a, the root hash value information contained in Block 10b is root hash value b, …, and the root hash value information contained in Block 10n is root hash value n. It should be understood that the root hash value information B may include the root hash value information contained in each block in Blockchain A (for example, root hash value a, root hash value b, …, root hash value n). It can be understood that the server node can traverse all the root hash value information in the root hash value information B, search for the root hash value information that matches the first root hash value, and then determine that root hash value b matches the first root hash value, and use root hash value b as the second root hash value. It should be understood that the server node can use the block 10b (i.e., the second root hash value) to which root hash value b belongs as the data change block associated with the target data.

[0133] S207, according to the second business logic in the business contract, determine the second distributed application associated with the business contract.

[0134] Specifically, the server node can call the business contract and, based on the second business logic in the business contract, determine the second distributed application associated with the business contract. Among them, the second application logic can be a piece of code with a read operation function. Among them, the second distributed application can be a distributed application with a read operation function. The read operation may include a read operation (for example, reading target data), a view operation (i.e., a witness operation), and so on.

[0135] S208, read the target data from the data change block through the second distributed application, and output the target data to the user terminal corresponding to the target user.

[0136] Specifically, the server node can read the target data from the data change block through the second distributed application and output the target data to the user terminal corresponding to the target user. It can be understood that the target user can view the target data on the user terminal, thereby determining that the target data is consistent with the business requirements corresponding to the data change request, and send a reception success message for the target data to the server node, facilitating the server node to view the above reception success message in a timely manner.

[0137] In an embodiment of the present application, the server node can authenticate the target user for a data change request of the target user, which can enhance the security of user data change. Meanwhile, after the server node changes the original data through the first distributed application, target data can be obtained. At this time, the target data is written into the blockchain, and the target data on the blockchain is read through the second distributed application, thereby ensuring the reliability of data reading.

[0138] Further, please refer to Figure 10 , which is a schematic structural diagram of a data processing device provided by an embodiment of the present application. The data processing device can be a computer program (including program code) running in a node device. For example, the data processing device is an application software. The data processing device can be used to execute the corresponding steps in the method provided by the embodiment of the present application. As Figure 10 shown, the data processing device 1 can run on the server node, and the server node can be the node A in the corresponding embodiment above. Figure 2 The data processing device 1 can include: an acquisition module 10, an authentication module 20, a determination module 30, an information sending module 40, a change module 50, a writing module 60, and an output module 70.

[0139] The acquisition module 10 is used to acquire a data change request of the target user for the original data. The original data is the data in the business database corresponding to the business contract.

[0140] The authentication module 20 is used to authenticate the target user according to the data change request.

[0141] Among them, the data change request includes the blockchain address corresponding to the target user.

[0142] The authentication module 20 includes: an acquisition unit 201, a first search unit 202, a first authentication unit 203, and a second authentication unit 204.

[0143] The acquisition unit 201 is used to acquire blockchain address information associated with the original data. The blockchain address information includes access address information of the authorized user for changing the original data.

[0144] The first search unit 202 is used to search for access address information matching the blockchain address in the blockchain address information.

[0145] The first authentication unit 203 is used to authenticate successfully if access address information matching the blockchain address is found in the blockchain address information.

[0146] The second authentication unit 204 is used to fail the authentication if no access address information matching the blockchain address is found in the blockchain address information.

[0147] The specific implementation of the acquisition unit 201, the first search unit 202, the first authentication unit 203 and the second authentication unit 204 can refer to the above Figure 3 The description of step S102 in the corresponding embodiment will not be repeated here.

[0148] The changing module 50 is used to call the first distributed application associated with the business contract when the authentication is successful, and to change the original data through the first distributed application.

[0149] The business contract stores a first business logic associated with the first distributed application;

[0150] The changing module 50 includes: a first determining unit 501 , a second determining unit 502 and a changing unit 503 .

[0151] The first determination unit 501 is used to determine whether the target user has the authority to change the original data when the authentication is successful;

[0152] The second determining unit 502 is used to call the business contract and determine a first distributed application associated with the business contract based on the first business logic in the business contract;

[0153] The changing unit 503 is used to change the original data through the first distributed application to obtain changed original data.

[0154] The specific implementation of the first determining unit 501, the second determining unit 502 and the changing unit 503 can refer to the above Figure 3 The description of step S103 in the corresponding embodiment will not be repeated here.

[0155] The writing module 60 is used to take the changed original data as target data and write the target data into the blockchain associated with the business contract.

[0156] The writing module 60 includes: a third determining unit 601 , a fourth determining unit 602 , an uploading unit 603 and an adding unit 604 .

[0157] The third determining unit 601 is used to determine the changed original data as the target data;

[0158] The fourth determining unit 602 is used to determine the signature information corresponding to the target data according to the private key of the target user;

[0159] The uploading unit 603 is used to upload the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network, so that the blockchain network verifies the signature of the target data according to the public key;

[0160] The adding unit 604 is used to add the data change block containing the target data to the blockchain associated with the business contract if the signature verification is passed.

[0161] The specific implementation of the third determining unit 601, the fourth determining unit 602, the uploading unit 603 and the adding unit 604 can refer to the above Figure 3 The description of step S104 in the corresponding embodiment will not be repeated here.

[0162] The output module 70 is used to read the target data on the blockchain through a second distributed application associated with the business contract, and output the target data to a user terminal corresponding to the target user.

[0163] The business contract stores a second business logic associated with the second distributed application;

[0164] The output module 70 includes: a fifth determining unit 701 , a second searching unit 702 , a sixth determining unit 703 and an output unit 704 .

[0165] The fifth determining unit 701 is configured to obtain a first hash value corresponding to the target data, and determine a first root hash value under an authentication path to which the first hash value belongs.

[0166] The second search unit 702 is used to search for a second root hash value matching the first root hash value from the blockchain, and use the block to which the second root hash value belongs as a data change block associated with the target data.

[0167] The second searching unit 702 includes: an acquiring subunit 7021 , a searching subunit 7022 , and a matching subunit 7023 .

[0168] The acquisition subunit 7021 is used to obtain the root hash value information corresponding to each block in the blockchain;

[0169] The search subunit 7022 is used to search the root hash value information for the root hash value information that matches the first root hash value;

[0170] The matching subunit 7023 is configured to use the root hash value information found to match the first root hash value as the second root hash value, and use the block corresponding to the second root hash value as the data change block associated with the target data.

[0171] Among them, the specific implementation manners of the obtaining subunit 7021, the searching subunit 7022, and the matching subunit 7023 can be referred to the description of step S206 in the corresponding embodiment above, and details will not be described herein again. Figure 7 The corresponding embodiment of step S206 will not be elaborated here.

[0172] The sixth determining unit 703 is configured to determine a second distributed application associated with the service contract according to the second service logic in the service contract;

[0173] The output unit 704 is configured to read the target data from the data change block through the second distributed application and output the target data to the user terminal corresponding to the target user.

[0174] Among them, the specific implementation manners of the fifth determining unit 701, the second searching unit 702, the sixth determining unit 703, and the output unit 704 can be referred to the description of steps S205 - S208 in the corresponding embodiment above, and details will not be described herein again. Figure 7 The corresponding embodiment of steps S205 - S208 will not be elaborated here.

[0175] Among them, the data processing device 1 further includes:

[0176] The determining module 30 is configured to determine that the target user does not have the permission to change the original data when the authentication fails;

[0177] The information sending module 40 is configured to send a failure prompt message corresponding to the data change request to the target user.

[0178] Among them, the specific implementation manners of the obtaining module 10, the authentication module 20, the determining module 30, the information sending module 40, the change module 50, the writing module 60, and the output module 70 can be referred to the description of steps S101 - step S105 in the corresponding embodiment above and / or the description of steps S201 - step S208 in the corresponding embodiment above, and details will not be described herein again. In addition, the description of the beneficial effects of using the same method will not be elaborated either. Figure 3 The description of step S101 - step S105 in the corresponding embodiment above and / or Figure 7 The description of steps S201 - step S208 in the corresponding embodiment above will not be elaborated here. In addition, the description of the beneficial effects of using the same method will not be elaborated either.

[0179] Further, please refer to Figure 11 , which is a schematic structural diagram of a node device provided by an embodiment of the present application. As Figure 11 shown, the node device 1000 can be the above-mentioned Figure 2For node A in the corresponding embodiment, the node device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen and a keyboard. Optionally, the network interface 1004 may include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. Optionally, the memory 1005 may also be at least one storage device located far from the aforementioned processor 1001. As Figure 11 shown, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application program.

[0180] In Figure 11 the node device 1000 shown, the network interface 1004 is mainly used for network communication; the user interface 1003 is mainly used to provide an input interface for users; and the processor 1001 may be used to call the device control application program stored in the memory 1005 to implement:

[0181] Obtain a data change request of a target user for the original data; the original data is the data in the business database corresponding to the business contract;

[0182] Authenticate the target user according to the data change request;

[0183] When the authentication is successful, call the first distributed application associated with the business contract, and change the original data through the first distributed application;

[0184] Use the changed original data as the target data, and write the target data into the blockchain associated with the business contract;

[0185] Read the target data on the blockchain through the second distributed application associated with the business contract, and output the target data to the user terminal corresponding to the target user.

[0186] It should be understood that the node device 1000 described in the embodiments of the present application may execute the description of the data processing method in the corresponding embodiments in the foregoing Figure 3 and Figure 7 and may also execute the foregoing Figure 10The description of the data processing device 1 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated either.

[0187] In addition, it should be noted here that: The embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium stores the computer program executed by the aforementioned data processing device 1. The computer program includes program instructions. When the processor executes the program instructions, it can execute the Figure 3 or Figure 7 description of the data processing method in the corresponding embodiment. Therefore, it will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated either. For the technical details not disclosed in the embodiments of the computer-readable storage medium involved in the present application, please refer to the description of the method embodiments of the present application. As an example, the program instructions can be deployed to be executed on a computing device, or on multiple computing devices located at one location. Or, on multiple computing devices distributed at multiple locations and interconnected through a communication network. The multiple computing devices distributed at multiple locations and interconnected through a communication network can form a blockchain system.

[0188] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The above 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 methods. Among them, the above storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.

[0189] The above-disclosed are only the preferred embodiments of the present application. Of course, the scope of rights of the present application cannot be limited by this. Therefore, equivalent changes made according to the claims of the present application still fall within the scope covered by the present application.

Claims

1. A data processing method, characterized in that, The method is executed by a server node in a blockchain network. The server node is a node running a first distributed application and a second distributed application, and can be used to provide a running environment for a business contract. The business contract is a smart contract used to store and maintain a first business logic associated with the first distributed application and a second business logic associated with the second distributed application. The method includes: Obtain a data change request of a target user for original data. The original data is historical business data of the target user associated with the business contract stored in a business database corresponding to the business contract. Authenticate the target user according to the data change request. When the authentication is successful, call the business contract, determine a first distributed application associated with the business contract based on the first business logic in the business contract, and change the original data through the first distributed application. Among them, the first distributed application is a distributed application with a write operation function, and the write operation includes an operation of changing the historical business data and an operation of writing the changed business data obtained by changing the historical business data into the business database. Use the changed original data as target data and write the target data into a blockchain associated with the business contract. Determine a second distributed application associated with the business contract based on the second business logic in the business contract, read the target data in a data change block on the blockchain through the second distributed application, and output the target data to a user terminal corresponding to the target user.

2. The method according to claim 1, wherein The data change request includes a blockchain address corresponding to the target user. The authenticating the target user according to the data change request includes: Obtain blockchain address information associated with the original data. The blockchain address information includes access address information of an authorized user for changing the original data. Search for access address information matching the blockchain address in the blockchain address information. If access address information matching the blockchain address is found in the blockchain address information, the authentication is successful. If no access address information matching the blockchain address is found in the blockchain address information, the authentication fails.

3. The method according to claim 2, wherein The business contract stores a first business logic associated with the first distributed application. When the authentication is successful, calling the business contract, determining a first distributed application associated with the business contract based on the first business logic in the business contract, and changing the original data through the first distributed application includes: When the authentication is successful, determine that the target user has the permission to change the original data. Call the business contract and determine a first distributed application associated with the business contract based on the first business logic in the business contract. Change the original data through the first distributed application to obtain the changed original data.

4. The method according to claim 2, characterized in that The method further includes: When the authentication fails, determining that the target user does not have the permission to modify the original data; Sending a failure prompt message corresponding to the data change request to the target user.

5. The method according to claim 1, characterized in that, The step of using the modified original data as target data and writing the target data into the blockchain associated with the service contract includes: Determining the modified original data as the target data; Determining the signature information corresponding to the target data according to the private key of the target user; Uploading the target data, the signature information corresponding to the target data, and the public key corresponding to the private key to the blockchain network, so that the blockchain network verifies the signature of the target data according to the public key; If the signature verification passes, adding a data change block containing the target data to the blockchain associated with the service contract.

6. The method according to claim 5, characterized in that The service contract stores a second business logic associated with a second distributed application; The step of reading the target data in the data change block on the blockchain through the second distributed application and outputting the target data to the user terminal corresponding to the target user includes: Obtaining a first hash value corresponding to the target data and determining a first root hash value under the authentication path to which the first hash value belongs; Searching in the blockchain for a second root hash value that matches the first root hash value, and using the block to which the second root hash value belongs as the data change block associated with the target data; Reading the target data from the data change block through the second distributed application and outputting the target data to the user terminal corresponding to the target user.

7. The method according to claim 6, characterized in that The step of searching in the blockchain for a second root hash value that matches the first root hash value and using the block to which the second root hash value belongs as the data change block associated with the target data includes: Obtaining the root hash value information corresponding to each block in the blockchain; Searching in the root hash value information for the root hash value information that matches the first root hash value; If the found root hash value information that matches the first root hash value is used as the second root hash value, then using the block corresponding to the second root hash value as the data change block associated with the target data.

8. A data processing device, characterized in that, The device runs on a server node in a blockchain network. The server node is a node running a first distributed application and a second distributed application, and the server node can be used to provide a running environment for a service contract. The service contract is a smart contract used to store and maintain a first business logic associated with the first distributed application and a second business logic associated with the second distributed application. The device includes: An obtaining module, configured to obtain a data change request of a target user for original data. The original data is historical business data of the target user associated with the service contract stored in a business database corresponding to the service contract; An authentication module, configured to authenticate the target user according to the data change request; A change module, which is used to call the business contract when the authentication is successful, determine the first distributed application associated with the business contract based on the first business logic in the business contract, and change the original data through the first distributed application; wherein, the first distributed application refers to a distributed application with a write operation function, and the write operation includes an operation of changing the historical business data and an operation of writing the changed business data obtained by changing the historical business data into the business database; A writing module, which is used to use the changed original data as target data and write the target data into the blockchain associated with the business contract; An output module, which is used to determine the second distributed application associated with the business contract based on the second business logic in the business contract, read the target data in the data change block on the blockchain through the second distributed application, and output the target data to the user terminal corresponding to the target user.

9. A node device, characterized in that, Comprising: A processor, a memory, and a network interface; The processor is connected to the memory and the network interface. Among them, the network interface is used to provide data communication functions, the memory is used to store computer programs, and the processor is used to call the computer programs to execute the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the method according to any one of claims 1-7 is executed.

Citation Information

Patent Citations

  • Block chain-based account password management method, device and apparatus and storage medium

    CN109359976A

  • Service processing method and device, terminal and storage medium

    CN109840146A

  • Operation data processing method, blockchain node and storage medium

    CN110321730A