CN114880338A - Data processing method, device and equipment based on block chain and storage medium - Google Patents

Data processing method, device and equipment based on block chain and storage medium Download PDF

Info

Publication number
CN114880338A
CN114880338A CN202210564694.6A CN202210564694A CN114880338A CN 114880338 A CN114880338 A CN 114880338A CN 202210564694 A CN202210564694 A CN 202210564694A CN 114880338 A CN114880338 A CN 114880338A
Authority
CN
China
Prior art keywords
data processing
data
parameter
processing instruction
user terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210564694.6A
Other languages
Chinese (zh)
Inventor
王耿
顾费勇
赖奕宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202210564694.6A priority Critical patent/CN114880338A/en
Publication of CN114880338A publication Critical patent/CN114880338A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2308Concurrency control
    • G06F16/2336Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
    • G06F16/2343Locking methods, e.g. distributed locking or locking implementation details
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/004Error avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/80Database-specific techniques

Abstract

The application provides a data processing method, a device, equipment and a storage medium based on a block chain, wherein the data processing method comprises the following steps: responding a data protection request of a user terminal for target data, and configuring a locking parameter for protecting the target data; responding to a parameter query request aiming at the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding to the parameter information, and executing the data processing instruction to obtain the data processing result of the target data. By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.

Description

Data processing method, device and equipment based on block chain and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a data processing method, apparatus, device, and storage medium based on a block chain.
Background
The block chain is a distributed shared account book and a database, and has the characteristics of decentralization, no tampering, trace retaining in the whole process, traceability, collective maintenance, openness and transparency and the like. Based on the characteristics, the user terminal can store target data with storage value in the intelligent contract system on the same block chain, and when the user terminal needs to perform data processing on the target data, the user terminal can send various data processing requests aiming at the target data to the intelligent contract system by accessing an external interface of the intelligent contract system.
Currently, the implementation of the idempotency at the external interface mainly depends on a specifically executed data processing logic, and when the data processing logic itself has the idempotency (for example, only the data processing logic which is not modified is queried), the external interface has the idempotency; when the data processing logic itself does not have idempotency (e.g., repeatedly modifying data many times), then the external interface does not have idempotency. Therefore, the existing external interface cannot get rid of the dependency relationship between the idempotent function and the specifically executed data processing logic, is not beneficial to the access of the user terminal to the intelligent contract system, and leads to the easy error of the access of the user terminal.
Disclosure of Invention
In view of this, an object of the present application is to provide a data processing method, apparatus, device and storage medium based on a block chain, so that the implementation of an interface idempotent function can get rid of dependency on specific data processing logic, and a user terminal can conveniently access an intelligent contract system.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
In a first aspect, an embodiment of the present application provides a data processing method based on a block chain, which is applied to an intelligent contract system, where the intelligent contract system and at least one user terminal are located on the same block chain, and the data processing method includes:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain a data processing result of the target data.
In an optional implementation manner, the data processing instruction carries a block chain address of the user terminal and user signature information, and after receiving the data processing instruction of the user terminal for the target data, the data processing method further includes:
verifying the authenticity of the user signature information according to the block chain address of the user terminal;
responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result;
and refusing to execute the data processing instruction in response to the verification failure of the user signature information.
In an optional implementation manner, the detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result includes:
when the execution step of the data processing instruction does not need to carry out operation processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data;
when the execution step of the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
In an optional implementation manner, the verifying, according to the parameter value of the locking parameter at the first time, the parameter information carried in the data processing instruction includes:
when detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first moment, determining that the parameter information carried in the data processing instruction passes verification;
and when detecting that the parameter information carried in the data processing instruction is different from the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction fails to be verified.
In an optional implementation manner, after the responding to the parameter information carried in the data processing instruction is verified, the data processing method further includes:
updating the parameter value of the locking parameter at the first moment according to a preset parameter updating mode to obtain a parameter updating result of the locking parameter at the second moment;
and performing locking protection on the target data according to a parameter updating result of the locking parameter at the second moment.
In an optional implementation manner, after the receiving a data processing instruction of the user terminal for the target data, the data processing method further includes:
when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, executing the data processing instruction aiming at the target data to obtain the execution result of the data processing instruction;
and storing the execution result into a target contract corresponding to the user terminal.
In a second aspect, an embodiment of the present application provides a data processing apparatus based on a block chain, where the data processing apparatus is applied to an intelligent contract system, the intelligent contract system and at least one user terminal are located on the same block chain, and the data processing apparatus includes:
a first response module, configured to respond to a data protection request of the user terminal for target data, and configure a locking parameter for protecting the target data for the target data;
a second response module, configured to respond to a parameter query request of the user terminal for the locking parameter, and send a parameter value of the locking parameter at the first time to the user terminal;
the information verification module is used for receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and the data processing module is used for responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
In a third aspect, an embodiment of the present application provides a blockchain system, where the blockchain system includes an intelligent contract system and at least one user terminal, where the intelligent contract system is configured to:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
In a fourth aspect, the present application provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the above-mentioned data processing method based on a block chain when executing the computer program.
In a fifth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the above-mentioned data processing method based on a block chain.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
the data processing method, the device, the equipment and the storage medium based on the block chain respond to a data protection request of a user terminal for target data, and configure a locking parameter for protecting the target data for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flowchart illustrating a data processing method based on a blockchain according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a method for authenticating a user terminal according to an embodiment of the present application;
FIG. 3 is a flow chart illustrating a method for detecting whether an execution result of a data processing instruction depends on a data value of target data according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a method for performing locking protection on target data according to a parameter updating manner of a locking parameter according to an embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for directly executing data processing instructions according to an embodiment of the present application;
fig. 6 is a schematic structural diagram illustrating a data processing apparatus based on a blockchain according to an embodiment of the present application;
fig. 7 is a schematic structural diagram illustrating a blockchain system according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device 800 according to an embodiment of the present disclosure.
Detailed Description
In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
Currently, the implementation of the idempotency at the external interface mainly depends on the specifically executed data processing logic, and when the data processing logic itself has the idempotency (for example, only the data processing logic which is not modified is queried), the external interface has the idempotency; when the data processing logic itself does not have idempotency (e.g., repeatedly modifying data many times), then the external interface does not have idempotency. Therefore, the existing external interface cannot get rid of the dependency relationship between the idempotent function and the specifically executed data processing logic, is not beneficial to the access of the user terminal to the intelligent contract system, and leads to the easy error of the access of the user terminal.
Based on this, the embodiment of the present application provides a data processing method, apparatus, device and storage medium based on a block chain, which respond to a data protection request of a user terminal for target data, and configure a locking parameter for protecting the target data for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
A detailed description is given below of a data processing method, an apparatus, a device, and a storage medium based on a block chain according to an embodiment of the present application.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a block chain-based data processing method provided in an embodiment of the present application, where the data processing method includes steps S101-S104; specifically, the method comprises the following steps:
s101, responding to a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data.
S102, responding to the parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first time to the user terminal.
S103, receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data.
And S104, responding to the fact that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain a data processing result of the target data.
In the data processing method based on the block chain provided by the embodiment of the application, a data protection request of a user terminal for target data is responded, and a locking parameter for protecting the target data is configured for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
In this embodiment of the application, the data processing method based on the block chain is applied to an intelligent contract system, where the intelligent contract system and at least one user terminal are located on the same block chain, and each user terminal can access the intelligent contract system on the block chain and store electronic information with storage value in the intelligent contract system. The embodiment of the present application does not limit any specific terminal type of each ue in the block chain.
The following takes a user equipment as an example, and respectively illustrates each step in the above data processing method based on a block chain according to the embodiment of the present application:
s101, responding to a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data.
Here, each user terminal corresponds to an intelligent contract in the intelligent contract system, and the intelligent contract system may receive data to be stored sent by the user terminal and store the data to be stored in the intelligent contract corresponding to the user terminal.
The target data may be used to characterize all data stored by the user terminal in the intelligent contract system, and may also be used to characterize a part of data that needs to be protected and is specified by the user terminal from the stored data.
Specifically, the locking parameter is used for locking and protecting the target data, an initial parameter value of the locking parameter may be automatically generated by the intelligent contract system or may be set by the user terminal, and the embodiment of the present application is not limited to the initial parameter value of the locking parameter.
S102, responding to the parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first time to the user terminal.
It should be noted that the user terminal may directly communicate with the intelligent contract system by accessing an external interface of the intelligent contract system, or may send a function name of the intelligent contract to be called to the commission system, and indirectly access the intelligent contract in the intelligent contract system through the commission system.
Specifically, when the user terminal is in direct communication with the intelligent contract system, the user terminal may directly send the parameter query request to an external interface of the intelligent contract system, the intelligent contract system responds to the parameter query request, obtains a parameter value of the locking parameter at the current time from the intelligent contract corresponding to the user terminal, and sends the parameter value of the locking parameter at the current time to the user terminal as the parameter value of the locking parameter at the first time.
Specifically, when the user terminal and the intelligent contract system indirectly communicate with each other through the commission system, the user terminal may send the parameter query request and the function name of the intelligent contract to be called to the commission system, and indirectly access the intelligent contract in the intelligent contract system through the commission system, and the intelligent contract system indirectly sends the parameter value of the locking parameter at the current time as the parameter value of the locking parameter at the first time to the user terminal through the commission system.
S103, receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data.
Here, the user terminal needs to perform different data processing on the target data according to different service requirements (which is equivalent to sending different types of data processing instructions for the target data), and the embodiment of the present application is not limited in any way as to the specific data processing logic corresponding to the data processing instructions.
Illustratively, based on the data modification requirement, the user terminal may send a data modification instruction for modifying the target data to the intelligent contract system to instruct the intelligent contract system to modify the target data, so as to modify the target data into a data modification result specified in the data modification instruction; modifying requirements based on the data; based on the data increment/decrement demand, the user terminal can send a data increment/decrement instruction for performing addition and subtraction operation on the target data to the intelligent contract system so as to instruct the intelligent contract system to increase/decrease the data increment/data decrement specified in one data modification instruction on the basis of the target data.
Here, whether or not the execution result of the data processing instruction depends on the data value of the target data may be determined based on whether or not the execution result of the data processing instruction changes depending on the data value of the target data.
Specifically, for the case where the execution result of the data processing instruction does not depend on the data value of the target data, the following is exemplarily described:
for example, when the execution result of the data processing instruction is a fixed result (for example, the data processing instruction is that the target data is modified into data x), the execution result based on the data processing instruction does not change due to the difference of the data value of the target data, so that the execution result of the data processing instruction can be determined not to depend on the data value of the target data; for another example, when the data processing instruction does not involve performing arithmetic processing on the target data (for example, the data processing instruction is a data query instruction for performing data query on the target data), the execution result based on the data processing instruction does not change due to the difference of the data value of the target data, and thus it can be determined that the execution result of the data processing instruction does not depend on the data value of the target data.
It should be noted that, because the data query does not cause the data value of the target data to change at the adjacent time, the execution result of the data query instruction may also be considered to be the return of the target data, and is not related to the specific data value of the target data.
Specifically, for the case where the execution result of the data processing instruction depends on the data value of the target data, the following is exemplarily described:
for example, when the execution result of the data processing instruction is a non-fixed result and the execution result of the data processing instruction is affected by the target data (e.g. the data processing instruction is data update to the target data at fixed unit step length), the execution result based on the data processing instruction may change due to the difference of the data value of the target data, and thus it may be determined that the execution result of the data processing instruction does not depend on the data value of the target data; for another example, when the execution result of the data processing instruction involves changing from the target data to an operation result based on the target data (e.g., the data processing instruction is multiplying the target data by the data x), the execution result based on the data processing instruction may change according to the data value of the target data, and thus it may be determined that the execution result of the data processing instruction depends on the data value of the target data.
And S104, responding to the fact that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain a data processing result of the target data.
Specifically, in step S102, the user terminal obtains a parameter value of the locking parameter at the first time from the intelligent contract system through the parameter query request (that is, a parameter value of the locking parameter at the current time when responding to the parameter query request), and in the subsequently sent data processing instruction, the user terminal may send the obtained parameter value of the locking parameter at the first time as parameter information to the intelligent contract system together with the data processing instruction, so that the intelligent contract system can verify the authenticity of the data processing instruction according to the parameter information carried in the data processing instruction.
When detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction passes verification; at this time, the intelligent contract system executes the data processing instruction and sends the executed data processing result to the user terminal.
Here, when detecting that parameter information carried in a data processing instruction is different from a parameter value of a locking parameter at a first time, determining that verification of the parameter information carried in the data processing instruction fails; at this time, the intelligent contract system refuses to execute the data processing instruction, thereby ensuring.
The following detailed description is made for the specific implementation process of the above steps in the embodiments of the present application, respectively:
in the specific implementation process of step S103, considering that there may be a plurality of user terminals capable of communicating with the intelligent contract system on the block chain, at this time, after receiving a data processing instruction of the user terminal for the target data, the identity of the user terminal may be verified by the following method, so as to improve the data security performance of the target data.
As shown in fig. 2, fig. 2 is a schematic flowchart illustrating a method for authenticating an identity of a user terminal according to an embodiment of the present application, where in step S103, a data processing instruction further carries a block chain address of the user terminal and user signature information; at this time, after receiving a data processing instruction of the user terminal for the target data, the method includes steps S201 to S203; specifically, the method comprises the following steps:
s201, verifying the authenticity of the user signature information according to the block chain address of the user terminal.
Here, for the block chain address, it should be noted that: in the blockchain, when any user terminal accesses the blockchain, the identity on the blockchain is unique, and the unique identity is the blockchain address of the user terminal. Specifically, in the embodiment of the present application, the block chain address is equivalent to a corresponding unique identity address when the user terminal accesses the intelligent contract system on the block chain; that is, the blockchain address may uniquely identify each user terminal from among a plurality of user terminals included on the blockchain.
Specifically, the intelligent contract system stores the user signature of the user terminal, wherein the specific signature format of the user signature can be set by the user terminal, and the block chain address can uniquely identify the identity of the user terminal, so that the intelligent contract system can determine the unique user terminal from a plurality of user terminals according to the block chain address, and thereby the real user signature pre-stored in the intelligent contract system by the user terminal can be determined; the intelligent contract system compares the user signature information carried in the current data processing instruction with the pre-stored real user signature of the user terminal, and the identity of the user terminal can be verified.
S202, responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result.
Illustratively, the intelligent contract system determines, according to a blockchain address a carried in the data processing instruction, that the user terminal corresponding to the blockchain address a is the user terminal a, and obtains, from the intelligent contract corresponding to the user terminal a, that the real user signature of the user terminal a is a 1; at this time, if the user signature information carried in the data processing instruction is a1, it is determined that the user signature information is verified.
S203, responding to the verification failure of the user signature information, and refusing to execute the data processing instruction.
Illustratively, the intelligent contract system determines, according to a blockchain address a carried in the data processing instruction, that the user terminal corresponding to the blockchain address a is the user terminal a, and obtains, from the intelligent contract corresponding to the user terminal a, that the real user signature of the user terminal a is a 1; at this time, if the user signature information carried in the data processing instruction is B1, it is determined that the user signature information verification fails, and the intelligent contract system refuses to execute the data processing instruction.
Specifically, for the step S202, in an optional implementation, as shown in fig. 3, fig. 3 is a schematic flow chart illustrating a method for detecting whether an execution result of a data processing instruction provided in an embodiment of the present application depends on a data value of target data, where, when the step S202 is executed, the method includes steps S301 to S302; specifically, the method comprises the following steps:
s301, when the step of executing the data processing instruction does not need to perform arithmetic processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data.
Specifically, when the execution step of the data processing instruction does not need to perform the operation processing on the data value of the target data, that is, no matter how many specific data values of the target data have an influence on the execution result of the data processing instruction, it may be determined that the execution result of the data processing instruction does not depend on the data value of the target data.
For exemplary illustration, the data processing instructions are: for example, the target data X is modified to be data X2, and at this time, when the data processing instruction is executed, no operation processing is performed on the target data X, that is, no matter the specific data value of the target data X is X1 or X3, the data processing result obtained after the data processing instruction is executed is: data X2; thus, it may be determined that the result of execution of the data processing instruction does not depend on the data value of the target data.
S302, when the step of executing the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
Specifically, when the execution step of the data processing instruction needs to perform the operation processing on the data value of the target data, that is, when the same data processing instruction is executed on target data of different data values, the obtained data processing results are different, and at this time, it may be determined that the execution result of the data processing instruction depends on the data value of the target data.
For exemplary illustration, the data processing instructions are: in the case of adding data X2 to the target data X, if the specific data value of the target data X is X1 when the data processing instruction is executed, the execution result of the data processing instruction is: x1+ X2; if the specific data value of the target data X is X3, the execution result of the data processing instruction is: x3+ X2; since the data processing results obtained when the same data processing instruction is executed for target data X of different data values are different, it can be determined that the execution result of the data processing instruction depends on the data value of the target data.
Specific operation processing methods that can be performed on the data value of the target data include, but are not limited to: the present invention is not limited to the specific operation processing method performed on the data value of the target data, which is a common operation processing method such as addition, subtraction, multiplication, and division.
For the specific implementation process of the above steps S103-S104, considering that when the execution result of the data processing instruction depends on the data value of the target data, if the intelligent contract system repeatedly executes the data processing instruction for multiple times, the data processing result of the target data may change accordingly, and based on this, to avoid the above situation, as shown in fig. 4, fig. 4 shows a flowchart of a method for performing lock protection on the target data according to a parameter updating manner of a lock parameter, provided by an embodiment of the present application, where in step S104, after parameter information carried in the data processing instruction passes verification, the method includes steps S401-S402; specifically, the method comprises the following steps:
s401, according to a preset parameter updating mode, updating the parameter value of the locking parameter at the first moment to obtain a parameter updating result of the locking parameter at the second moment.
Here, the predetermined parameter updating method may be used to represent a parameter updating method for performing a stepwise updating on a parameter value of the locking parameter according to a preset fixed step length, and the specific value of the fixed step length is not limited in any way in the embodiment of the present application.
Here, the second time is used to represent the current time when the parameter value of the locking parameter at the first time completes the parameter update.
For example, taking an example that the predetermined parameter updating manner is to update the parameter value of the lock parameter in a stepwise manner with a step size of 1, if the parameter value of the lock parameter at the first time is a number 4, after updating the parameter value of the lock parameter at the first time according to the predetermined parameter updating manner, a parameter updating result of the lock parameter at the second time (i.e. the current time when the parameter is updated) can be obtained as follows: number 5.
S402, according to the parameter updating result of the locking parameter at the second moment, locking protection is carried out on the target data.
Here, for the case where the intelligent contract system repeatedly receives the same data processing instruction multiple times, it should be noted that: when the user terminal has communication delay or data transmission is blocked, the user terminal may mistakenly repeatedly send the same data processing instruction to the intelligent contract system; when the intelligent contract system is subjected to replay attack (i.e., the eavesdropper sends the eavesdropped data to the receiver without any change), the eavesdropper may repeatedly send the eavesdropped data processing instructions to the intelligent contract system.
Specifically, taking the fixed step length of 1 as an example, after the parameter information carried in the data processing instruction passes verification, adding 1 to the parameter value L of the locking parameter to obtain a parameter update result of the locking parameter at the second time as L +1, and performing data processing on the target data according to the data processing instruction to obtain a data processing result; at this time, after the data processing and the parameter updating are completed, responding to a parameter query request of the user terminal for the locking parameter, and sending the updated parameter value L +1 to the user terminal as a parameter value of the locking parameter at the first time; based on this, if the intelligent contract system receives the repeated data processing instruction again (that is, the carried parameter is still the data processing instruction of the parameter value L before the lock parameter is updated), since the parameter of the lock parameter at the current time is L +1 (that is, the parameter value of the lock parameter at the first time), when the parameter information carried in the repeatedly received data processing instruction is verified again according to the parameter value of the lock parameter at the first time in step S103, the repeated data processing instruction cannot pass the verification, so that the intelligent contract system can be effectively protected from the replay attack, and meanwhile, the idempotent function of the external interface can be realized, so as to prevent multiple repeated modifications to the target data caused by the misoperation of the user terminal.
With respect to the specific implementation process of the above steps S103-S104, considering that when the execution result of the data processing instruction does not depend on the data value of the target data, the data processing result will not change even if the data processing instruction is repeatedly executed, as shown in fig. 5, fig. 5 shows a flowchart of a method for directly executing the data processing instruction provided by the embodiment of the present application, where, in step S103, after receiving the data processing instruction of the user terminal for the target data, the method includes steps S501-S502; specifically, the method comprises the following steps:
s501, when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, the data processing instruction is executed aiming at the target data, and the execution result of the data processing instruction is obtained.
And S502, storing the execution result into a target contract corresponding to the user terminal.
Specifically, regarding the above steps S501 to S502, it should be noted that: when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, at this time, the data processing result cannot be changed even if the data processing instruction is repeatedly executed, that is, the realization of the intelligent contract interface idempotent function cannot be influenced even if the parameter verification is not performed on the locking parameter (which is equivalent to that the data processing result sent to the user terminal by the intelligent contract system cannot be changed because the data processing instruction is repeatedly sent for many times); based on this, when it is determined that the execution result of the data processing instruction is not related to the data value of the target data, it is possible to directly execute the data processing instruction without verifying whether the lock parameter is the same, and transmit the data processing result to the user terminal.
Based on the data processing method based on the block chain provided by the embodiment of the application, a data protection request of a user terminal for target data is responded, and a locking parameter for protecting the target data is configured for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
Based on the same inventive concept, the present application further provides a data processing apparatus corresponding to the above data processing method based on a block chain, and as the principle of the data processing apparatus in the embodiment of the present application for solving the problem is similar to that of the above data processing method based on a block chain in the embodiment of the present application, the implementation of the data processing apparatus may refer to the implementation of the above data processing method, and repeated details are omitted.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a data processing apparatus based on a blockchain according to an embodiment of the present application, where the data processing apparatus is applied to an intelligent contract system, where the intelligent contract system is located on the same blockchain as at least one user terminal, and the data processing apparatus includes:
a first response module 601, configured to respond to a data protection request of the user terminal for target data, and configure a locking parameter for protecting the target data for the target data;
a second response module 602, configured to respond to a parameter query request of the user terminal for the locking parameter, and send a parameter value of the locking parameter at the first time to the user terminal;
an information verification module 603, configured to receive a data processing instruction of the user terminal for the target data, and when it is determined that an execution result of the data processing instruction depends on a data value of the target data, verify parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first time;
the data processing module 604 is configured to respond that parameter information carried in the data processing instruction passes verification, and execute the data processing instruction for the target data to obtain an execution result of the data processing instruction.
In an optional implementation manner, the data processing instruction carries a block chain address of the user terminal and user signature information, and after receiving the data processing instruction of the user terminal for the target data, the information verification module 603 is further configured to:
verifying the authenticity of the user signature information according to the block chain address of the user terminal;
responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result;
and refusing to execute the data processing instruction in response to the verification failure of the user signature information.
In an optional implementation manner, when the detecting whether the execution result of the data processing instruction depends on the data value of the target data, to obtain a detection result, the information verification module 603 is configured to:
when the execution step of the data processing instruction does not need to carry out operation processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data;
when the execution step of the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
In an optional implementation manner, when the parameter information carried in the data processing instruction is verified according to the parameter value of the lock parameter at the first time, the information verification module 603 is configured to:
when detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first moment, determining that the parameter information carried in the data processing instruction passes verification;
and when detecting that the parameter information carried in the data processing instruction is different from the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction fails to be verified.
In an optional implementation manner, after responding to the parameter information carried in the data processing instruction, the data processing module 604 is further configured to:
updating the parameter value of the locking parameter at the first moment according to a preset parameter updating mode to obtain a parameter updating result of the locking parameter at the second moment;
and performing locking protection on the target data according to a parameter updating result of the locking parameter at the second moment.
In an optional implementation manner, after the receiving of the data processing instruction of the user terminal for the target data, the information verification module 603 is further configured to:
when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, executing the data processing instruction aiming at the target data to obtain the execution result of the data processing instruction;
and storing the execution result into a target contract corresponding to the user terminal.
Based on the data processing device based on the block chain provided by the embodiment of the application, a data protection request of a user terminal for target data is responded, and a locking parameter for protecting the target data is configured for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
Based on the same inventive concept, the present application further provides a block chain system corresponding to the data processing method based on the block chain, and as the principle of solving the problem of the block chain system in the embodiment of the present application is similar to that of the data processing method based on the block chain in the embodiment of the present application, the implementation of the block chain system may refer to the implementation of the data processing method, and the repeated parts are not described again.
Referring to fig. 7, fig. 7 is a schematic structural diagram illustrating a blockchain system provided in an embodiment of the present application, where the blockchain system includes an intelligent contract system 701 and at least one user terminal 702, where the intelligent contract system 701 is configured to:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
In an optional implementation manner, the data processing instruction carries a block chain address of the user terminal and user signature information, and after receiving the data processing instruction of the user terminal for the target data, the intelligent contract system 701 is further configured to:
verifying the authenticity of the user signature information according to the block chain address of the user terminal;
responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result;
and refusing to execute the data processing instruction in response to the verification failure of the user signature information.
In an optional implementation manner, when the detecting whether the execution result of the data processing instruction depends on the data value of the target data, and obtaining the detection result, the intelligent contract system 701 is configured to:
when the execution step of the data processing instruction does not need to carry out operation processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data;
when the execution step of the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
In an optional implementation manner, when the parameter information carried in the data processing instruction is verified according to the parameter value of the lock parameter at the first time, the intelligent contract system 701 is configured to:
when detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first moment, determining that the parameter information carried in the data processing instruction passes verification;
and when detecting that the parameter information carried in the data processing instruction is different from the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction fails to be verified.
In an optional implementation manner, after responding to the verification of the parameter information carried in the data processing instruction, the intelligent contract system 701 is further configured to:
updating the parameter value of the locking parameter at the first moment according to a preset parameter updating mode to obtain a parameter updating result of the locking parameter at the second moment;
and performing locking protection on the target data according to a parameter updating result of the locking parameter at the second moment.
In an optional embodiment, after the receiving the data processing instruction of the user terminal for the target data, the intelligent contract system 701 is further configured to:
when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, executing the data processing instruction aiming at the target data to obtain the execution result of the data processing instruction;
and storing the execution result into a target contract corresponding to the user terminal.
Based on the block chain system provided by the embodiment of the application, a data protection request of a user terminal for target data is responded, and a locking parameter for protecting the target data is configured for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
Fig. 8 is a schematic structural diagram of an electronic device 800 according to an embodiment of the present application, including: a processor 801, a memory 802 and a bus 803, wherein the memory 802 stores machine-readable instructions executable by the processor 801, and when the electronic device 800 executes a data processing method based on a block chain as in the embodiment, the processor 801 communicates with the memory 802 through the bus 803, and the processor 801 executes the machine-readable instructions, wherein the electronic device 800 is applied to an intelligent contract system which is located on the same block chain as at least one user terminal; the processor 801, when executing the machine-readable instructions, performs the following steps:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
In an optional implementation manner, the data processing instruction carries a block chain address of the user terminal and user signature information, and after receiving the data processing instruction of the user terminal for the target data, the processor 801 is further configured to:
verifying the authenticity of the user signature information according to the block chain address of the user terminal;
responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result;
and refusing to execute the data processing instruction in response to the verification failure of the user signature information.
In an alternative embodiment, when the detecting whether the execution result of the data processing instruction depends on the data value of the target data, obtains a detection result, the processor 801 is configured to:
when the execution step of the data processing instruction does not need to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data;
when the execution step of the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
In an optional implementation manner, when the parameter information carried in the data processing instruction is verified according to the parameter value of the locking parameter at the first time, the processor 801 is configured to:
when detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first moment, determining that the parameter information carried in the data processing instruction passes verification;
when the parameter information carried in the data processing instruction is detected to be different from the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction fails to be verified.
In an optional implementation manner, after responding to the verification of the parameter information carried in the data processing instruction, the processor 801 is further configured to:
updating the parameter value of the locking parameter at the first moment according to a preset parameter updating mode to obtain a parameter updating result of the locking parameter at the second moment;
and performing locking protection on the target data according to a parameter updating result of the locking parameter at the second moment.
In an optional implementation manner, after the receiving of the data processing instruction of the user terminal for the target data, the processor 801 is further configured to:
when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, executing the data processing instruction aiming at the target data to obtain the execution result of the data processing instruction;
and storing the execution result into a target contract corresponding to the user terminal.
Based on the electronic device provided by the embodiment of the application, a data protection request of a user terminal for target data is responded, and a locking parameter for protecting the target data is configured for the target data; responding a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first time to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
Based on the same inventive concept, the embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program is executed when executed by a processor, where the processor is applied to an intelligent contract system, and the intelligent contract system and at least one user terminal are located on the same block chain; the processor performs the steps of:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
In an optional implementation manner, the data processing instruction carries a block chain address of the user terminal and user signature information, and after receiving the data processing instruction of the user terminal for the target data, the processor is further configured to:
verifying the authenticity of the user signature information according to the block chain address of the user terminal;
responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result;
and refusing to execute the data processing instruction in response to the verification failure of the user signature information.
In an optional embodiment, when the detecting whether the execution result of the data processing instruction depends on the data value of the target data or not is performed to obtain a detection result, the processor is configured to:
when the execution step of the data processing instruction does not need to carry out operation processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data;
when the execution step of the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
In an optional implementation manner, when the parameter information carried in the data processing instruction is verified according to the parameter value of the lock parameter at the first time, the processor is configured to:
when detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first moment, determining that the parameter information carried in the data processing instruction passes verification;
when the parameter information carried in the data processing instruction is detected to be different from the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction fails to be verified.
In an optional implementation manner, after responding that the parameter information carried in the data processing instruction passes verification, the processor is further configured to:
updating the parameter value of the locking parameter at the first moment according to a preset parameter updating mode to obtain a parameter updating result of the locking parameter at the second moment;
and performing locking protection on the target data according to a parameter updating result of the locking parameter at the second moment.
In an optional implementation manner, after the receiving of the data processing instruction of the user terminal for the target data, the processor is further configured to:
when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, executing the data processing instruction aiming at the target data to obtain the execution result of the data processing instruction;
and storing the execution result into a target contract corresponding to the user terminal.
Based on the computer-readable storage medium provided by the embodiment of the application, a locking parameter for protecting target data is configured for the target data in response to a data protection request of a user terminal for the target data; responding to a parameter query request of the user terminal for the locking parameter, and sending the parameter value of the locking parameter at the first moment to the user terminal; receiving a data processing instruction of a user terminal aiming at target data, and verifying parameter information carried in the data processing instruction according to a parameter value of a locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data; and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
By the method, the realization of the interface idempotent function can get rid of the dependency on specific data processing logic, and the user terminal can conveniently access the intelligent contract system.
In the embodiment of the present application, when being executed by a processor, the computer program may further execute other machine-readable instructions to perform other data processing methods as described in the embodiment, and for the method steps and principles of specific execution, reference is made to the description of the embodiment, which is not described in detail herein.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus once an item is defined in one figure, it need not be further defined and explained in subsequent figures, and moreover, the terms "first", "second", "third", etc. are used merely to distinguish one description from another and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the present disclosure, which should be construed in light of the above teachings. Are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A data processing method based on a block chain is characterized in that the method is applied to an intelligent contract system, the intelligent contract system and at least one user terminal are located on the same block chain, and the data processing method comprises the following steps:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain a data processing result of the target data.
2. The data processing method according to claim 1, wherein the data processing instruction carries a block chain address of the user terminal and user signature information, and after receiving the data processing instruction of the user terminal for the target data, the data processing method further comprises:
verifying the authenticity of the user signature information according to the block chain address of the user terminal;
responding to the verification that the user signature information passes, and detecting whether the execution result of the data processing instruction depends on the data value of the target data to obtain a detection result;
and refusing to execute the data processing instruction in response to the verification failure of the user signature information.
3. The data processing method according to claim 1, wherein the detecting whether the execution result of the data processing instruction depends on the data value of the target data, and obtaining a detection result comprises:
when the execution step of the data processing instruction does not need to carry out operation processing on the data value of the target data, determining that the execution result of the data processing instruction does not depend on the data value of the target data;
when the execution step of the data processing instruction needs to perform operation processing on the data value of the target data, determining that the execution result of the data processing instruction depends on the data value of the target data.
4. The data processing method according to claim 1, wherein the verifying the parameter information carried in the data processing instruction according to the parameter value of the locking parameter at the first time includes:
when detecting that the parameter information carried in the data processing instruction is the same as the parameter value of the locking parameter at the first moment, determining that the parameter information carried in the data processing instruction passes verification;
and when detecting that the parameter information carried in the data processing instruction is different from the parameter value of the locking parameter at the first time, determining that the parameter information carried in the data processing instruction fails to be verified.
5. The data processing method according to claim 1, wherein after the parameter information carried in the response to the data processing instruction is verified, the data processing method further comprises:
updating the parameter value of the locking parameter at the first moment according to a preset parameter updating mode to obtain a parameter updating result of the locking parameter at the second moment;
and performing locking protection on the target data according to a parameter updating result of the locking parameter at the second moment.
6. The data processing method according to claim 2, wherein after the receiving of the data processing instruction of the user terminal for the target data, the data processing method further comprises:
when the execution result of the data processing instruction is determined to be irrelevant to the data value of the target data, executing the data processing instruction aiming at the target data to obtain the execution result of the data processing instruction;
and storing the execution result into a target contract corresponding to the user terminal.
7. A data processing device based on a block chain is applied to an intelligent contract system, the intelligent contract system and at least one user terminal are positioned on the same block chain, and the data processing device comprises:
a first response module, configured to respond to a data protection request of the user terminal for target data, and configure a locking parameter for protecting the target data for the target data;
a second response module, configured to respond to a parameter query request of the user terminal for the locking parameter, and send a parameter value of the locking parameter at the first time to the user terminal;
the information verification module is used for receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and the data processing module is used for responding that the parameter information carried in the data processing instruction passes verification, executing the data processing instruction aiming at the target data and obtaining an execution result of the data processing instruction.
8. A blockchain system, the blockchain system comprising an intelligent contract system and at least one user terminal, wherein the intelligent contract system is configured to:
responding a data protection request of the user terminal for target data, and configuring a locking parameter for protecting the target data for the target data;
responding to a parameter query request of the user terminal for the locking parameter, and sending a parameter value of the locking parameter at a first time to the user terminal;
receiving a data processing instruction of the user terminal aiming at the target data, and verifying parameter information carried in the data processing instruction according to a parameter value of the locking parameter at a first moment when the execution result of the data processing instruction is determined to depend on the data value of the target data;
and responding that the parameter information carried in the data processing instruction passes verification, and executing the data processing instruction aiming at the target data to obtain an execution result of the data processing instruction.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the data processing method according to any one of claims 1 to 6.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the data processing method according to one of claims 1 to 6.
CN202210564694.6A 2022-05-23 2022-05-23 Data processing method, device and equipment based on block chain and storage medium Pending CN114880338A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210564694.6A CN114880338A (en) 2022-05-23 2022-05-23 Data processing method, device and equipment based on block chain and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210564694.6A CN114880338A (en) 2022-05-23 2022-05-23 Data processing method, device and equipment based on block chain and storage medium

Publications (1)

Publication Number Publication Date
CN114880338A true CN114880338A (en) 2022-08-09

Family

ID=82677941

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210564694.6A Pending CN114880338A (en) 2022-05-23 2022-05-23 Data processing method, device and equipment based on block chain and storage medium

Country Status (1)

Country Link
CN (1) CN114880338A (en)

Similar Documents

Publication Publication Date Title
CN110288479B (en) Method and related equipment for consensus of block chain data
CN111163182B (en) Block chain-based device registration method and apparatus, electronic device, and storage medium
CN108183924A (en) A kind of login validation method and terminal device
CN110543488B (en) Verification node updating method, device and equipment
US20150264080A1 (en) Testing Integrity of Property Data of a Device Using a Testing Device
CN109561085A (en) A kind of auth method based on EIC equipment identification code, server and medium
CN103077345B (en) Based on software authorization method and the system of virtual machine
CN111556059A (en) Abnormity detection method, abnormity detection device and terminal equipment
CN111885050B (en) Data storage method and device based on block chain network, related equipment and medium
KR20170037612A (en) Method and system for facilitating terminal identifiers
CN110222535B (en) Processing device, method and storage medium for block chain configuration file
CN111415161A (en) Block chain-based data verification method and device and computer-readable storage medium
CN110324344B (en) Account information authentication method and device
CN113468515A (en) User identity authentication method and device, electronic equipment and storage medium
CN109885037B (en) Vehicle diagnosis method and related equipment
CN111277635A (en) Method, equipment, device and computer medium for accessing external node to block chain
CN111431908B (en) Access processing method and device, management server and readable storage medium
CN110619022B (en) Node detection method, device, equipment and storage medium based on block chain network
CN104580237A (en) Method for logging into website, server used in method for logging into website, client terminal used in method for logging into website and peripheral used in method for logging into website
CN110008758A (en) ID obtaining method and device, electronic equipment and storage medium
CN111541649B (en) Password resetting method and device, server and storage medium
CN114880338A (en) Data processing method, device and equipment based on block chain and storage medium
CN111953633A (en) Access control method and access control device based on terminal environment
CN113849802A (en) Equipment authentication method and device, electronic equipment and storage medium
CN113344598A (en) Data verification method, device, medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination