CN117390694A - Block chain-based data processing method, device and equipment, medium and product - Google Patents

Block chain-based data processing method, device and equipment, medium and product Download PDF

Info

Publication number
CN117390694A
CN117390694A CN202311393525.1A CN202311393525A CN117390694A CN 117390694 A CN117390694 A CN 117390694A CN 202311393525 A CN202311393525 A CN 202311393525A CN 117390694 A CN117390694 A CN 117390694A
Authority
CN
China
Prior art keywords
contract
target
data
target object
token
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
CN202311393525.1A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311393525.1A priority Critical patent/CN117390694A/en
Publication of CN117390694A publication Critical patent/CN117390694A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • 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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a data processing method, a device, equipment, a medium and a product based on a blockchain, wherein the method comprises the following steps: acquiring data to be processed of a target object; acquiring an authorization token of a target object; the authorization token is generated according to the contract use authority expiration time of the target object and the on-chain address; determining a first contract call parameter according to the authorization token; calling a target intelligent contract through the first contract calling parameter so as to facilitate uplink processing of the data to be processed through the target intelligent contract; the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed. According to the method and the device for processing the uplink of the call completion data of the intelligent contract, the uplink processing of the call completion data of the intelligent contract can be conveniently realized based on the authorization token.

Description

Block chain-based data processing method, device and equipment, medium and product
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a blockchain-based data processing method and apparatus, a computing device, a computer readable storage medium, and a computer program product.
Background
With the continuous development and application of computer technology, the blockchain technology is also rapidly developed, and as the information stored on the blockchain cannot be forged and tampered, the processing of business data by using the blockchain technology becomes a current development trend. In the process of transaction data uplink, consensus is an important stage in which intelligent contracts can be used to implement a consensus mechanism. A smart contract is an executable computer program by which trusted transactions can be effected.
The developer can generate the intelligent contract through manual writing and the like, and takes time and effort to complete testing and verification of the intelligent contract so as to ensure the accuracy and stability of the operation of the intelligent contract. In the current smart contract application process, there is a payment of a certain contract execution fee to motivate developers. How to define the smart contract invoking mechanism makes the invoking of the smart contract well completed on the premise of being able to motivate the developer become a research hotspot.
Disclosure of Invention
The application provides a data processing method, device, equipment, medium and product based on a blockchain, which can conveniently realize the uplink processing of calling completion data of an intelligent contract based on an authorization token.
In one aspect, the present application provides a blockchain-based data processing method, the method including:
acquiring data to be processed of a target object;
acquiring an authorization token of the target object; the authorization token is generated according to the contract use authority expiration time of the target object and the address on the chain;
determining a first contract invoking parameter according to the authorization token;
calling a target intelligent contract through the first contract calling parameter so as to facilitate uplink processing of the data to be processed through the target intelligent contract;
the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
In another aspect, the present application provides another blockchain-based data processing method, the method including:
acquiring transaction data carrying data to be processed and target contract calling parameters; the target contract invoking parameter comprises a token to be verified aiming at a target intelligent contract, wherein the token to be verified is used for verifying whether the target intelligent contract can be invoked to store the transaction data;
Generating block data to be uplinked according to the transaction data, and carrying out consensus processing on the block data to be uplinked; the process of the consensus process comprises the step of calling the target intelligent contract through the target contract calling parameter to perform uplink verification operation according to the token to be verified, and determining that the verification of the transaction data is passed when the obtained uplink verification result is verification passing;
and if the result of the consensus processing is determined to be that the consensus passes, the block data is uplink.
In another aspect, the present application provides a blockchain-based data processing device, the device including:
the acquisition module is used for acquiring the data to be processed of the target object;
the acquisition module is further used for acquiring the authorization token of the target object; the authorization token is generated according to the contract use authority expiration time of the target object and the address on the chain;
the processing module is used for determining a first contract calling parameter according to the authorization token;
the data uplink module is used for calling a target intelligent contract through the first contract calling parameter so as to facilitate uplink processing of the data to be processed through the target intelligent contract;
The first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
In yet another aspect, the present application provides another blockchain-based data processing device, the device including:
the acquisition module is used for acquiring transaction data carrying data to be processed and target contract calling parameters; the target contract invoking parameter comprises a token to be verified aiming at a target intelligent contract, wherein the token to be verified is used for verifying whether the target intelligent contract can be invoked to store the transaction data;
the consensus processing module is used for generating block data to be uplinked according to the transaction data and carrying out consensus processing on the block data to be uplinked; the process of the consensus process comprises the step of calling the target intelligent contract through the target contract calling parameter to perform uplink verification operation according to the token to be verified, and determining that the verification of the transaction data is passed when the obtained uplink verification result is verification passing;
and the uplink module is used for uplink the block data if the consensus processing result is determined to be the consensus passing.
Accordingly, the present application provides a computing device comprising a processor, a memory and a network interface, the processor, the memory and the network interface being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to implement the steps of the blockchain-based data processing method.
Accordingly, the present application provides a computer readable storage medium storing a computer program comprising program instructions for execution by a processor to perform the steps of the blockchain-based data processing method.
Accordingly, the present application provides a computer program product comprising a computer program or computer instructions for execution by a processor to perform the steps of a blockchain-based data processing method as described above.
The method comprises the steps of obtaining data to be processed of a target object and an authorization token; the first contract calling parameter is determined according to the authorization token, the target intelligent contract is called through the first contract calling parameter, and the target intelligent contract can carry out verification operation on the authorization token in the execution process, so that the falsified or tampered authorization token can be prevented, and the authenticity and the effectiveness of the authorization token are ensured. After verification operation is passed, the target intelligent contract is used for carrying out uplink processing on the data to be processed, so that the data of a target object which is legally authorized by the intelligent contract owner can be ensured to be uplink only in the authorization validity period, the intelligent contract permission rights of the intelligent contract owner are ensured to a certain extent, and the intelligent contract can be conveniently used by a contract user in the legal authorization period through an authorization token without paying cost each time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1A is a schematic diagram of a block chain based data processing system according to an embodiment of the present application;
FIG. 1B is a block chain architecture diagram according to one embodiment of the present application;
FIG. 1C is a schematic diagram of a process for generating a new block according to an embodiment of the present application;
FIG. 2 is a flow chart of a data processing method based on a blockchain according to an embodiment of the present application;
FIG. 3 is a flow chart of another method for processing data based on blockchain according to an embodiment of the present application;
FIG. 4A is an interface interaction diagram of a ul storage procedure according to an embodiment of the present application;
fig. 4B is an interface interaction schematic diagram of a subscription billing process according to an embodiment of the present application;
FIG. 4C is an interface interaction diagram of a single billing process according to an embodiment of the present application;
FIG. 4D is a block chain based shopping platform architecture diagram provided in an embodiment of the present application;
FIG. 5 is a flow chart of yet another data processing method based on blockchain provided in an embodiment of the present application;
FIG. 6 is a flow chart of a blockchain-based data uplink process provided by an embodiment of the present application;
FIG. 7 is a schematic block diagram of a blockchain-based data processing device provided by the embodiments herein;
FIG. 8 is a schematic block diagram of another blockchain-based data processing device provided by the embodiments of the present disclosure;
fig. 9 is a schematic block diagram of a computing device provided by an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, are intended to be within the scope of the present application based on the embodiments herein.
The embodiment of the application provides a data processing method based on a blockchain, on one hand, a contract user (or called a target object) needs to apply for an authorization token to a contract owner (or called a contract owned object), and can acquire the use permission of an intelligent contract for a period of time in a digital asset purchase mode and the like to obtain the authorization token, and on the other hand, the authorization token is submitted by the target object and is used for verifying the contract use permission based on the contract use permission expiration time and the authorization token generated by an address on the chain, so that the contract use permission can be verified efficiently, and lower contract storage overhead is generated. The present application will be illustrated by the following examples.
Referring to FIG. 1A, a block chain based data processing system is provided, and includes a block chain network 10, a plurality of nodes 101, and clients 102, wherein:
the blockchain network 10 refers to a network for data sharing from node to node, and may include a plurality of nodes 101 therein, wherein the plurality of nodes 101 may include consensus nodes therein. Each node 101 may receive input information during normal operation and maintain shared data (i.e., blockchains) within the blockchain network based on the received input information. Each node in the blockchain network stores an identical blockchain, and the blockchain includes a series of blocks (blocks) that are consecutive to each other according to the chronological order of generation, such as Block 1, block M-1, etc. shown in fig. 1A, and the new Block is not removed once it is added to the blockchain, and the Block records the record data submitted by the node in the blockchain network. In order to ensure the information intercommunication in the blockchain network, information connection can exist between every two nodes, point-to-point communication can be realized between any two nodes, and particularly, point-to-point communication can be performed through a wired communication link or a wireless communication link. For example, when any node in the blockchain network receives input information, other nodes acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all nodes in the blockchain network are consistent.
The client 102 may access the blockchain network and may communicate with nodes in the blockchain network, e.g., send transaction data to the nodes, etc. Of course, in some possible implementations, the client 102 may also be one of the nodes in the blockchain network. The computing device where the client 102 is located may be a smart phone, a tablet computer, a notebook computer, a desktop computer, an on-board smart terminal, and the like, which is not limited in this embodiment. The client 102 may be applied in a computing device that applies for and uses the target object of the smart contract, as well as in a computing device of the contract owner.
It should be noted that the number of nodes shown in fig. 1A is merely illustrative, and any number of nodes may be deployed according to actual needs, where the nodes may refer to any form of computing device in an access network, for example, a server, and an object terminal may all join to become nodes.
For each node in the blockchain network, the node identification corresponding to the node identification is provided, and each node in the blockchain network can store the node identifications of other nodes in the blockchain network so as to broadcast the generated blocks to other nodes in the blockchain network according to the node identifications of the other nodes. Each node may maintain a node identifier list as shown in table 1 below, and the node names and node identifiers may be stored in the node identifier list. The node identification may be an internet protocol (Internet Protocol, IP) address, as well as any other information that can be used to identify the node, with the node identification in table 1 being by way of example only.
TABLE 1
Node name Node identification
Node 1 000.000.000.00a
Node 2 000.000.000.00b
Node N 000.000.000.00c
Each node in the blockchain network stores one and the same blockchain. The blockchain is composed of a plurality of blocks, referring to fig. 1B, the blockchain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the father block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
When each block in the blockchain is generated, referring to fig. 1C, when the node where the blockchain is located receives input information, checking the input information, after the checking is completed, storing the input information into a memory pool, and updating a hash tree used for recording the input information; then, updating the update time stamp to the time of receiving the input information, trying different random numbers, and calculating the characteristic value for a plurality of times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
Wherein SHA256 is a eigenvalue algorithm used to calculate eigenvalues; version (version number) is version information of the related block protocol in the block chain; the prev_hash is the block header characteristic value of the parent block of the current block; the merkle_root is a characteristic value of input information; ntime is the update time of the update timestamp; the nbits is the current difficulty, is a fixed value in a period of time, and is determined again after exceeding a fixed period of time; x is a random number; TARGET is a eigenvalue threshold that can be determined from nbits.
Thus, when the random number meeting the formula is calculated, the information can be correspondingly stored to generate the block head and the block main body, and the current block is obtained. And then, the node where the blockchain is located sends the newly generated blocks to other nodes in the blockchain network where the newly generated blocks are located according to the node identifications of other nodes in the blockchain network, the other nodes verify the newly generated blocks, and the newly generated blocks are added into the blockchain stored in the newly generated blocks after the verification is completed.
Wherein, the node of the blockchain network can run intelligent contracts, and various transactions can be realized by calling the intelligent contracts. The intelligent contract is a non-tamperable and automatically executed computer program running on the blockchain, the intelligent contract is a code implementation for executing when a certain condition is met, a development object can define contract logic through a programming language, issue the contract logic to the blockchain (intelligent contract registration), call a key or other event trigger to execute according to the logic of contract clauses, complete the contract logic, and simultaneously provide functions of upgrading, logging off and the like for the intelligent contract.
In one possible implementation manner, any node 101 of the blockchain network may obtain transaction data of the client, where the transaction data may carry an identity of the client, where the identity may be determined according to an identity certificate of the client, the node 101 may query the identity certificate of the client from the smart contract according to the identity, and if the identity certificate of the client is queried from the smart contract, and it is determined according to the identity certificate that the client has authority to execute a transaction operation corresponding to the transaction data with respect to the blockchain, the node 101 may execute the transaction operation corresponding to the transaction data with respect to the blockchain, and may determine the identity certificate corresponding to the client by using a mapping relationship between the identity certificate carried by the transaction data and the identity certificate recorded in the smart contract, and perform the transaction operation according to the authority indicated in the identity certificate, thereby improving security of data processing on the blockchain. Only the identity mark is carried in the transaction data, so that the data volume of the transaction data can be reduced relative to the whole identity mark carried in the transaction data under the condition of ensuring that the corresponding identity mark can be acquired, and the quick transmission of the transaction data is facilitated.
Generally, a transaction block is generated for transaction data, and the block is uplink (the block is stored on a blockchain), so that the data size of the transaction data can be reduced relative to the whole identity certificate carried in the transaction data under the condition that the corresponding identity certificate can be obtained due to the fact that the identity certificate is only carried, so that data compression to a certain extent is realized, and consumption of blockchain storage resources can be reduced.
It will be appreciated that in the specific embodiments of the present application, related data such as pending data, authorization tokens, contract invoking information, etc. are related, when the embodiments of the present application apply the above data to specific products or technologies, the subject permission or consent is required, and the collection, use and processing of related data is required to comply with related laws and regulations and standards of related regions.
Implementation details of the technical solutions of the embodiments of the present application will be described in detail below:
referring to fig. 2, fig. 2 is a flowchart of a data processing method based on a blockchain according to an embodiment of the present application, where the data processing method is described in terms of a management server, and the management server is connected to a blockchain network, and the management server may be one of nodes in the blockchain network, and the blockchain network includes a plurality of blockchain nodes. As shown in fig. 2, the blockchain-based data processing method may include:
S201, obtaining data to be processed of a target object. The data to be processed is data which corresponds to the target object and needs to be subjected to uplink processing, for example, the data to be processed can be purchase information of the target object on a transaction platform, and the purchase information can comprise purchased goods, transaction details, payment information and the like. And the data to be processed of the target object is subjected to uplink processing, so that the safety and traceability of the purchase information can be ensured, and the purchase information stored on the verification chain can be passed later, so that shopping disputes can be avoided.
In the embodiment of the application, the data to be processed of the target object is obtained in advance, so that subsequent fast uplink processing is performed on the data to be processed after verification operation of the authorization token of the target object is passed.
S202, acquiring an authorization token of a target object; the authorization token is generated based on the contract usage rights expiration time of the target object and the on-chain address. An authorization token is a credential that is used to authorize a target object's access rights to a target smart contract. The contract use right expiration time of the target object is used for indicating the expiration time of the use right of the target object for the target intelligent contract, namely, the target object is considered to have the contract use right before the contract use right expiration time. The on-chain address of the target object refers to the unique identification of the target object in the blockchain network.
In the embodiment of the application, the chain address of the target object is unique, and the authorization token is generated based on the contract use authority expiration time of the target object and the chain address, so that the uniqueness of the generated authorization token is ensured. And obtaining an authorization token of the target object so as to facilitate the subsequent generation of a first contract calling parameter based on the authorization token, and calling the target intelligent contract through the first contract calling parameter to realize the uplink processing of the data to be processed.
In one possible implementation, the contract possession object may digitally sign the contract usage rights expiration time of the target object and the on-chain address to obtain a unique authorization token. And the contract usage rights expiration time refers to: after the target object pays the related fee to the smart contract owner through digital assets and the like, a valid time which can allow the target object to legally use the corresponding smart contract is generated for the target object by the computing device where the smart contract owner is located according to a certain authorization policy.
S203, determining a first contract calling parameter according to the authorization token. The first contract calling parameter is used for calling the target intelligent contract to realize corresponding contract functions, and the first contract calling parameter can comprise: the original contract calling parameters and the authorization token can include contract addresses, calling methods, verification parameters and the like, and correct calling of the contract can be achieved by using the original contract calling parameters.
In the embodiment of the application, the first contract calling parameter is determined according to the authorization token, so that the target intelligent contract can verify the authorization token in the first contract calling parameter, the uplink processing of the data to be processed can be ensured only after the authorization token verification operation is passed, and illegal operation of the data by unauthorized or fake contract calling requests can be prevented, thereby ensuring the security of the data.
S204, calling a target intelligent contract through a first contract calling parameter so as to facilitate uplink processing of data to be processed through the target intelligent contract; the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
The target smart contract is a smart contract that the target object needs to use, such as a data storage smart contract for the uplink processing of data to be processed. The verification operation of the authorization token is a part of logic in the target intelligent contract, and the target intelligent contract is about before the uplink processing of the data to be processed, the verification operation of the authorization token in the first contract calling parameters is needed first, so that only the data of the object with the contract use authority can be ensured to be uplink processed. Since the data to be processed is already transferred to the target smart contract as a part of the transaction data, the target smart contract processes the data to be verified according to the data processing rule or protocol in the smart contract after the authorization token is verified, so that after the operations such as consensus and the like are completed, the block corresponding to the transaction data including the data to be processed is added to the blockchain, that is, after the authorization token is verified, the subsequent uplink process can be normally performed on the transaction data corresponding to the data to be processed and the block.
In the embodiment of the application, the management server can call the target intelligent contract through the first contract call parameter, and the target intelligent contract can verify the authorization token in the execution process, so that the falsified or tampered authorization token can be prevented, and the authenticity and the validity of the authorization token are ensured. After the verification operation is passed, the management server performs uplink processing on the data to be processed, so that the data of a target object which is legally authorized by the intelligent contract owner can be ensured to be uplink only in the authorization validity period, the intelligent contract permission rights of the intelligent contract owner are ensured to a certain extent, and the intelligent contract can be conveniently used by a contract user in the legally authorized authorization period through an authorization token without paying the expense when the intelligent contract is used each time.
Referring to fig. 3, fig. 3 is a flowchart of another blockchain-based data processing method according to an embodiment of the present application, where the data processing method according to the embodiment of the present application is described in terms of a management server side, and the blockchain-based data processing method may include:
s301, obtaining data to be processed of a target object. For the specific implementation of step S301, please refer to the related description of step S201, which is not described herein.
In one possible implementation, after performing step S301, the management server may further perform the following steps:
(1) And acquiring storage indication information of the data to be processed.
(2) And if the storage rule indicated by the storage indication information is that the uplink processing is carried out on the data to be processed, triggering and executing the authorization token of the acquisition target object.
In the above steps (1) - (2), the storage instruction information is information for instructing a storage rule of the data to be processed, the storage rule may include: the method comprises the steps of carrying out uplink processing on data to be processed, carrying out database storage processing on the data to be processed and the like. When the management server detects that the storage rule indicated by the storage indication information is that the data to be processed is processed in a uplink mode, the execution of the authorization token for acquiring the target object is triggered. Triggering the execution of the authorization token of the acquisition target object may refer to continuing to perform step S302 and subsequent steps, or triggering the execution of the authorization token of the acquisition target object may refer to continuing to perform step S202 and subsequent steps in the foregoing embodiments. By the method, the management server can determine a proper storage mode for the data to be processed according to the actual requirement of the target object by storing the indication information, so that the flexibility of data storage and the diversity of storage modes are ensured. For the target object, whether payment is needed for uplink storage or ordinary storage can be selected according to the storage requirement, the target object can select some important data, such as important transaction data, transfer data and the like, for uplink processing, and some ordinary data, such as commodity preview pictures downloaded by transactions and the like, can be stored in an ordinary storage mode.
The uplink processing is carried out on the data to be processed, so that the safety of the data can be enhanced, the decentralization, the non-tamper property and the traceability of the data are realized, and the corresponding storage cost is higher. The data to be processed is selected to be subjected to database storage processing, so that the method has higher performance for large-scale data processing and query, is more focused on data structuring, is more efficient and flexible in data query, management and analysis, and has lower corresponding storage cost. The specific selection of which storage rule is stored can be that the target object is selected on the corresponding terminal equipment according to the actual requirement, and then the corresponding storage rule is determined by the management server according to the selection operation.
In one possible implementation, after the data to be processed is determined, the storage indication information is allowed to be generated by selecting a storage rule for the data to be processed on the rule selection interface displayed, so as to indicate the storage of the data to be processed by the generated storage indication information.
Referring to fig. 4A, fig. 4A is an interface interaction schematic diagram of a ul storage process provided in the embodiment of the present application, where the interface corresponding to (1) in fig. 4A is a rule selection interface, and the rule selection interface includes selection controls corresponding to multiple storage rules, for example, a selection control corresponding to "ul storage" and a selection control corresponding to "database storage". After the target object is purchased successfully, when the target object triggers the selection control corresponding to the 'uplink storage', the management server performs uplink processing on the data to be processed, and when the target object triggers the selection control corresponding to the 'database storage', the management server performs database storage processing on the data to be processed, such as storing shopping information in an object information database corresponding to the shopping platform. It should be noted that, the event of selecting the storage rule may occur before the target object purchases the commodity, during the process of purchasing the commodity, or after the commodity is successfully purchased, and the corresponding storage rule is obtained by the management server after the event occurs, which is not limited in the embodiment of the present application.
S302, acquiring the charging type of the uplink processing of the data to be processed. The charging type refers to a charging mode adopted when uplink processing is carried out on the data to be processed, and the charging type can comprise a subscription charging type and a single charging type. The subscription charging type is a type of charging that can be used when the target object has purchased a usage right for a period of time of the target smart contract by subscription, in which case a verification operation by means of an authorization token is required. The single charging type is a charging type that can be used when the target object does not purchase the usage rights for the target smart contract for a period of time, in which case it is necessary to separately charge the target smart contract for the current usage and perform a verification operation through the single payment token.
In one possible implementation, the target object may also choose to charge separately if the target smart contract has been purchased for a period of time, where it is also necessary to charge separately for the current use of the target smart contract and perform the verification operation with a single payment token.
In one possible implementation, after determining that the storage rule of the data to be processed is to perform uplink processing on the data to be processed, the charging type is allowed to be selected for the data to be processed by being selected on the charging type selection interface. As shown in fig. 4A, the interface corresponding to (2) in fig. 4A is a charging type selection interface, where the charging type selection interface includes selection controls corresponding to multiple charging types, such as a selection control corresponding to "subscription charging" and a selection control corresponding to "single charging". When the target object triggers the selection control corresponding to the subscription charging, the management server performs subscription charging related processing on the data to be processed, namely, executes the method corresponding to the steps S303-S305, and when the target object triggers the selection control corresponding to the single charging, the management server performs single charging related processing on the data to be processed, namely, executes the method corresponding to the steps S306-S308.
S303, if the charging type is a subscription charging type, acquiring an authorization token of the target object; the authorization token is generated based on the contract usage rights expiration time of the target object and the on-chain address.
In one possible implementation, when it is determined that the target object has initiated a usage rights purchase request for the target smart contract and an authorization token fed back in response to the usage rights purchase request is successfully acquired, the charging type is determined to be a subscription charging type.
The target object initiates a request for purchasing the use right of the target intelligent contract to the management server, and performs purchasing operation, after purchasing is successful, the management server notifies the contract possession object to generate a current use right purchasing event, then the contract possession object determines the contract use right expiration time corresponding to the current use right purchasing request, generates an authorization token according to the determined contract use right expiration time and the on-chain address of the target object, and sends the generated authorization token to the management server. And when the management server successfully acquires an authorization token fed back by the contract possession object in response to the use right purchase request, determining that the charging type is a subscription charging type.
In one possible implementation manner, the storage indication information carries the smart contract identifier, and then the management server obtains the authorization token of the target object, which can be implemented according to the following steps:
(1) Determining an intelligent contract corresponding to the intelligent contract identification, and taking the determined intelligent contract as a target intelligent contract. The smart contract identifier is used for uniquely indicating one smart contract, and the management server can determine the smart contract corresponding to the smart contract according to the smart contract identifier and take the smart contract as a target smart contract.
(2) And acquiring the authorization token matched with the target intelligent contract from the authorization tokens stored for the target object. One or more authorization tokens for the target object may be stored in the management server, each authorization token corresponding to the target object's usage rights for one of the smart contracts. After determining the target intelligent contract that the target object needs to use, the management server acquires an authorization token of the target object, which is matched with the target intelligent contract, namely, acquires an authorization token for the target intelligent contract that the target object has purchased, wherein the authorization token indicates that the target object has use rights for the target intelligent contract.
The smart contract identification may be selectively determined by a selection operation on a contract selection interface on which a smart contract identification capable of supporting uplink storage of data to be processed is displayed.
According to the method and the device for processing the data, the management server can accurately determine the target intelligent contracts which are needed to be used by the target object through the intelligent contract identification, and avoid the selection of wrong intelligent contracts or mismatched intelligent contracts, so that the success rate of uplink processing of the data to be processed based on the target intelligent contracts is guaranteed.
Referring to fig. 4B, fig. 4B is an interface interaction schematic diagram of a subscription billing process provided in the embodiment of the present application, where (1) in fig. 4B is a billing type selection interface, and when a target object triggers a selection control corresponding to "subscription billing", the process jumps to a contract selection interface corresponding to (2) in fig. 4B. The contract selection interface displays an intelligent contract identifier capable of supporting uplink storage of the data to be processed, and the intelligent contract identifier can comprise: the identification corresponding to the smart contract may be used, and the identification corresponding to the smart contract may not be used. The usable smart contracts refer to smart contracts which are purchased by a target object and can support uplink storage of data to be processed, such as smart contract 1 and smart contract 2. Unusable smart contracts refer to smart contracts that are not purchased by the target object but are capable of supporting the uplink storage of the data to be processed, such as smart contract 3, smart contract 4, smart contract 5, and the like.
The intelligent contract identification is determined through selection operation on a contract selection interface, when a target object is used for storing the data to be processed in a uplink manner by using the intelligent contract when the target object selects a use control corresponding to the intelligent contract to be used, the intelligent contract is determined to be the target intelligent contract, and the management server acquires an authorization token of the target object, which is matched with the target intelligent contract.
It should be noted that, for the identifier corresponding to the unavailable intelligent contract in the contract selection interface, a corresponding "purchase" control may be provided, and when the "purchase" control corresponding to a certain unavailable intelligent contract is triggered, the corresponding contract purchase interface may be skipped to realize that the target object purchases the corresponding intelligent contract. It should be noted that, according to the actual service requirement, only the intelligent contract which can be used may be displayed in the contract selection interface, which improves the flexibility of the contract selection interface in data presentation, which is not limited in the embodiment of the present application.
S304, determining a first contract calling parameter according to the authorization token. The implementation of step S304 is described in the foregoing step S203, and will not be described herein.
In one possible implementation, before performing step S304, the management server may further perform the following steps:
(1) Acquiring the contract use permission expiration time, and determining the interval time between the contract use permission expiration time and the current time. The contract use authority expiration time can be obtained by decrypting the authorization token by the management server, or can be obtained by simultaneously receiving the authorization token sent by the contract possession object and the expiration time to be verified corresponding to the authorization token by the management server, then decrypting the authorization token to obtain the decrypted contract use authority expiration time, comparing the decrypted contract use authority expiration time with the expiration time to be verified, and determining the expiration time to be verified as the contract use authority expiration time after the comparison is consistent.
(2) And if the interval time is greater than the first interval threshold, triggering execution to determine a first contract calling parameter according to the authorization token.
In the steps (1) - (2), the interval time indicates the remaining validity period of the target object for the target intelligent contract, and when the interval time is greater than the first interval threshold, the management server executes step S304 and subsequent steps, which ensures that subsequent related steps of uplink processing on the data to be processed are performed when the target object has contract use authority, and avoids waste of computing resources. The first interval threshold may take a value of 0, and the interval time is greater than 0, which indicates that the target object has a validity period for the target intelligent contract. In other implementations, the first interval threshold may be set in units of hours or in units of days, and the object with the authorization token may manually set the first interval threshold according to needs to facilitate subsequent alerts such as fast expiration of the authorization token (or fast expiration of the contract usage rights expiration time) according to the respective needs.
Based on this, the management server may further perform the steps of: and if the interval time is smaller than the second interval threshold, sending second prompt information to the target object, wherein the second prompt information is used for indicating the target object to carry out renewal processing on the target intelligent contract.
The first interval threshold and the second interval threshold may be the same or different, for example. The second interval threshold can be flexibly set according to service requirements, for example, the value is 1 day, the interval time is less than 1 day, the validity period of the target object aiming at the target intelligent contract is short, and at the moment, the target can be prompted to carry out renewal treatment aiming at the target intelligent contract.
In the embodiment of the application, the management server sends the renewal prompt information to the target object to remind the target object that the contract is about to expire and needs to conduct renewal treatment in time, so that continuity of the contract using of the target object is guaranteed, contract using experience is improved, and problems of service interruption or data loss and the like caused by contract expiration are avoided.
S305, calling a target intelligent contract through a first contract calling parameter, and carrying out uplink processing on data to be processed through the target intelligent contract; the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
The steps S303-S305 describe the processing steps when the charging type is the subscription charging type, if the charging type is the single charging type, the management server may perform the uplink processing on the data to be processed according to the single uplink rule, and the processing steps S306-S308 are described below:
and S306, if the charging type is the single charging type, sending third prompt information to the contract possession object of the target intelligent contract, wherein the third prompt information is used for indicating the contract possession object to generate a single payment token through the private key of the contract owner object. The single payment token is a special token generated by the contract owner object through its private key, and is used as a credential when the charging type is a single charging type, and the data to be processed is processed through the credential in a uplink manner.
In one possible implementation, the charging type is determined to be a single charging type when it is determined that a single purchase request is received for the target object to initiate usage rights for the target smart contract on a single purchase interface and a single payment token is obtained.
Referring to fig. 4C, fig. 4C is an interface interaction schematic diagram of a single billing process provided in the embodiment of the present application, where (1) in fig. 4C is a billing type selection interface, and when a target object triggers a selection control corresponding to "single billing", the process jumps to a single purchase interface corresponding to (2) in fig. 4C. One or more smart contract identifications capable of supporting uplink storage of data to be processed, such as smart contract 1, smart contract 2, smart contract 3, smart contract 4, smart contract 5, and the like, are displayed on the single purchase interface. The target object can realize single purchase of the use permission of the target intelligent contract by triggering a single purchase control corresponding to one intelligent contract identifier, and uplink processing is carried out on the data to be processed through the intelligent contract corresponding to the intelligent contract identifier after the purchase is successful.
S307, receiving a single payment token returned in response to the third prompt message, and determining a second contract calling parameter according to the single payment token. The second contract calling parameter is used for calling the target intelligent contract to realize corresponding contract functions, and the second contract calling parameter can comprise: original contract call parameters and a single payment token, the original contract call parameters may include contract addresses, calling methods, verification parameters, etc., by using the original contract call parameters to ensure correct invocation of the contract.
In the embodiment of the application, the second contract invoking parameter is determined according to the single payment token, so that the target intelligent contract can verify the single payment token in the second contract invoking parameter, the uplink processing of the data to be processed can be ensured only after the single payment token is verified, and the illegal operation of the data by unauthorized or fake contract invoking requests can be prevented, thereby ensuring the security of the data.
S308, calling a target intelligent contract through a second contract calling parameter so as to facilitate uplink processing of data to be processed through the target intelligent contract; the second contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the single payment token so as to carry out uplink processing on the data to be processed after the single payment token passes the verification operation.
In the embodiment of the application, the management server can call the target intelligent contract through the second contract call parameter, and the target intelligent contract can carry out verification operation on the single payment token in the execution process, so that the falsified or tampered authorization token can be prevented, and the authenticity and the validity of the single payment token are ensured. After the verification operation is passed, the management server performs uplink processing on the data to be processed, so that the uplink processing of the data is conveniently realized based on the authorization token, and only the data of the target object which is legally authorized can be ensured to be uplink, thereby ensuring the safety and traceability of the data. The method does not need to store contract use permission expiration time of each object in the intelligent contract to verify the contract use permission, but verifies whether the object has the contract use permission or not by verifying the form of the single payment token in the second contract call parameter, thereby efficiently verifying the contract use permission of the object and ensuring lower contract storage overhead.
In addition, each single purchase request correspondingly generates a unique single payment token, each single payment token is generated by the contract owner object by using the private key of the single payment token, and the target intelligent contract can verify the single payment token in the execution process, so that the single payment token can be prevented from being forged. Meanwhile, the single payment token is only used for a single purchase request, cannot be reused once the single payment token is used or expired, or is deleted after one verification is completed, which ensures the security of the target object when the target object is subjected to the uplink processing of the data to be processed through the single purchase contract.
In one possible implementation, the management server may further perform the steps of:
(1) And acquiring the use permission purchase request of the target object for the target intelligent contract.
(2) Sending first prompt information to a contract possession object of the target intelligent contract; the first prompt information is used for indicating the contract possession object to determine contract use permission expiration time for the target object, and signing the determined contract use permission expiration time and the on-chain address of the target object through the private key of the contract possession object to obtain the authorization token of the target object.
In the steps (1) - (2), the target object sends a usage right purchase request for the target intelligent contract to the management server, the management server responds to the usage right purchase request and sends first prompt information to a contract possession object of the target intelligent contract, the contract possession object responds to the first prompt information to determine contract usage right expiration time for the target object, the target object is ensured to obtain the usage right of the target intelligent contract in a proper time range, then the determined contract usage right expiration time and the on-chain address of the target object are signed through a private key of the target object, an authorization token of the target object is obtained, and finally the generated authorization token is returned to the management server by the contract possession object.
The purchase period can be carried in the use right purchase request, when the management server sends the first prompt information to the contract possession object of the target intelligent contract, the purchase period can be carried in the first prompt information, and then the contract possession object determines the contract use right expiration time of the target object according to the purchase period. Of course, the usage rights purchase request may also carry only payment and corresponding package, and the management server determines a contract usage rights expiration time according to the payment cost and the package, and generates the authorization token in combination with the on-chain address of the target object.
(3) And receiving the authorization token of the target object returned by the contract possession object based on the first prompt information and the contract use permission expiration time, and storing the authorization token of the target object and the contract use permission expiration time.
The management server stores the received authorization token of the target object and the contract usage rights expiration time for subsequent use and verification. The method realizes the processing of the contract use permission of the target object, and generates the corresponding authorization token after the purchase is successful, so that when the target object performs the uplink processing on the data to be processed based on the purchased intelligent contract, the contract use permission of the target object can be verified rapidly and effectively, and the data uplink can be realized by calling the corresponding intelligent contract after the verification is passed.
In one possible implementation, the contract usage right expiration time of the target object is denoted as timestamp, the address on the chain of the target object is denoted as address, and the contract possession object digitally signs the contract usage right expiration time and the address { address, timestamp } on the chain of the target object by the private key of the contract possession object to obtain the authorization token of the target object.
In one possible implementation, the management server may further perform the steps of:
(1) And acquiring contract call information generated by uplink processing of the data to be processed through the target intelligent contract, and determining whether call operation is compliant according to the contract call information. The contract calling information refers to related calling information for calling a target intelligent contract to perform uplink processing on data to be processed, and the contract calling information can comprise parameters, execution results, triggering time and the like of contract calling. The management server can judge whether the contract calling operation is in compliance or not according to the contract calling information. Whether or not the authorization token is authorized may be determined for packages or services purchased by the usage rights purchase request, e.g., some packages or services specify that there is not only an authorized validity period, but also a limit on the number of times, e.g., no more than 10 times per day (a threshold of times), and if the authorization token of a certain object is authorized to be within the validity period before the contract usage rights expire time, but the number of times the target smart contract is invoked per day exceeds 10, then the authorization token is considered to be out of compliance, and corresponding modifications to the authorization token are required, e.g., adjustment of the contract usage rights expire time, etc., in accordance with the contract agreement of the package or service.
(2) And if the calling operation is determined to be not legal, generating evidence storage transaction data according to the contract calling information, and carrying out uplink processing on the evidence storage transaction data.
When the management server determines that the calling operation is not compliant, the evidence is generated to store transaction data and is linked to store the evidence of the contract calling non-compliance and ensure the traceability and the integrity of the data so as to facilitate the follow-up inquiry and audit of related data. Meanwhile, the evidence storage transaction data is uplink after the multi-node consensus passes, so that the authenticity of the data is ensured.
(3) And adjusting the stored authorization token of the target object according to the contract calling information.
The management server can adjust the authorization token of the target object according to the contract calling information, such as adjusting the contract use permission expiration time corresponding to the authorization token, so as to realize more refined contract use permission management.
In one possible implementation, adjusting the stored authorization token for the target object includes at least two types: updating the stored authorization token of the target object, and deleting the stored authorization token of the target object. When the target object (such as a contract user account) generates less serious violations, the adjustment may be updating, in which case, the management server may send a fifth prompt message to the contract-owned object, where the fifth prompt message is used to prompt the contract-owned object to generate an updated authorization token after updating the contract-use permission expiration time (such as advancing or delaying the term) of the target object, and then the management server receives the updated authorization token of the target object and the contract-use permission expiration time returned by the contract-owned object based on the fifth prompt message, and stores the updated authorization token of the target object and the contract-use permission expiration time.
When the target object generates serious illegal actions, the adjustment can be deletion, in which case, the management server can delete the stored authorization token of the target object and the contract use permission expiration time, thereby limiting the contract use permission of the target object. By deleting the authorization token of the target object, the target object can be controlled to continuously carry out illegal use on the contract, the system safety is improved, and the risk is reduced.
(4) And sending fourth prompt information to the target object, wherein the fourth prompt information is used for prompting that the contract use permission expiration time of the target object is adjusted. After adjusting the stored authorization token of the target object, the management server informs the target object that the contract use authority expiration time related to the authorization token of the target object is adjusted, so that the target object can timely know and adapt to the adjusted contract use period authorization condition. Meanwhile, the target object can check the data of the evidence storage transaction which is already in the chain, so as to clear the violation information generated by the target object.
In the embodiment of the application, the management server performs compliance judgment on the contract call information and adjusts the authorization token of the target object when the contract call information is not compliant, so that the uplink processing of data is ensured to meet the related rules and requirements, the scheme can meet the requirement change under different business scenes, more flexible and more refined contract use permission management is provided, and meanwhile, the capability of targeted and differentiated resource management and object relation management can be provided for contract owned objects. And, the data of the evidence storage transaction are uplink, so that the traceability and the integrity of the evidence can be ensured.
The data processing method provided in the embodiment of the present application will be described below by way of example:
referring to fig. 4D, fig. 4D is a schematic diagram of a shopping platform based on a blockchain provided in the embodiment of the present application, and it is assumed that there is one shopping platform, and a server corresponding to the shopping platform is the management server, where the management server is connected to terminal devices corresponding to multiple contract owned objects (such as terminal devices corresponding to a contract owned object a, a contract owned object B, etc.), terminal devices corresponding to multiple contract used objects (such as terminal devices corresponding to a target object), and a blockchain network. Wherein different contract possession objects can provide different smart contracts to the management server and the management server stores the different smart contracts in a consensus node in the blockchain network. For the target object, the temporary use authority of the intelligent contract can be purchased at the shopping platform (such as signing by means of package year and package month), or the contract can be used by paying separately each time the shopping information needs to be stored in a uplink manner.
The target object (e.g., a purchaser) may purchase goods on a shopping platform that uses a token-based smart contract resource admission authorization mechanism to authorize temporary access rights of the target object to the smart contract, thereby using functionality provided by the smart contract, such as data-on-link functionality provided by a data-storage smart contract. The target object may purchase temporary usage rights for the smart contract through the shopping platform and determine a contract usage rights expiration time. Wherein, the contract owning object can set different types of temporary use rights of the intelligent contract through the shopping platform, such as use of package year, package month and package day. After the target object purchases the temporary use authority of the intelligent contract, the corresponding intelligent contract can be used for storing the shopping information in a uplink mode before the expiration time of the contract use authority, so that the safety and traceability of data are ensured, and shopping disputes can be avoided.
The following will exemplify the purchase procedure initiated by the target object, the purchase information uplink procedure, and the main steps are as follows:
1. contract users purchase goods on the shopping platform through target objects (such as accounts of the contract users).
2. After the server corresponding to the shopping platform determines that the target object is paid, a piece of purchase information is generated, wherein the purchase information can comprise commodity information, seller information, buyer information, payment information and the like corresponding to the transaction. The purchase information may be used as data to be processed.
3. The server corresponding to the shopping platform firstly determines whether the target object needs to perform uplink processing on the purchase information, and when the uplink processing is determined to be required, the charging type of the uplink processing is judged. Whether the purchase information needs to be uploaded can be judged by analyzing storage indication information of the purchase information, for example, a server corresponding to the shopping platform determines whether the target object needs to upload the purchase information according to triggering operation of a charging type selection interface, and the charging type selection interface can be displayed before, during and after the purchase operation is successful. When it is determined that the purchase information does not need to be processed in a uplink manner, the server corresponding to the shopping platform can store the purchase information into the database.
4. And selecting a corresponding method to perform uplink processing on the purchase information by the server corresponding to the shopping platform according to the charging type. When the charging type is the subscription charging type, the server corresponding to the shopping platform acquires an authorization token of the target object, and invokes the target intelligent contract through a first contract invoking parameter generated based on the authorization token, so that the target intelligent contract performs verification operation according to the authorization token, and performs uplink processing on the purchase information after the verification operation is passed. In this case, the target object has contract access rights, so that additional payment of the data uplink fee is not required.
When the charging type is the single charging type, the server corresponding to the shopping platform determines a second contract calling parameter according to the received single payment token, and calls a target intelligent contract through the second contract calling parameter, so that the target intelligent contract can verify according to the single payment token, and the purchasing information is uplink processed after the single payment token passes the verification operation.
5. The target object can inquire the storage condition of the purchase information on the blockchain through a data interface or interface provided by the shopping platform.
Through the token-based intelligent contract resource access authorization mechanism, the server corresponding to the shopping platform can easily manage the temporary access rights of all objects (such as all accounts) for the intelligent contract without recording the access rights information of each object in the intelligent contract, so that the expense of contract storage is reduced. The object can select to store the purchase information in a uplink manner, so that the safety and traceability of the data are ensured, and shopping disputes can be avoided. In addition, the mechanism can be suitable for other scenes, such as temporarily accessing the contents of a certain online course, a document library, a video platform and the like, and can be flexibly customized and expanded according to specific requirements.
When the charging type is a single charging type, the shopping platform can inform the contract possession object of the event, the contract possession object can generate a random character string corresponding to the single payment, then digitally sign the random character string and the on-chain address of the target object to generate a single payment token (token), the contract possession object finally returns the single payment token to the server corresponding to the shopping platform, and the server corresponding to the shopping platform stores the single payment token into the target intelligent contract. Meanwhile, logic exists in the target smart contract: after the verification of the single payment token passes, only one time of purchase information uplink processing is executed, and related data in the contract is deleted after the one time of purchase information uplink processing is executed, so that the contract caller cannot continue to carry out the single payment operation through the single payment token again.
Referring to fig. 5, fig. 5 is a flowchart of another blockchain-based data processing method according to the embodiment of the present application, where a block node is described on one side of the block node, it may be understood that the block node may be the same computing device as the above-mentioned management server, that is, the relevant content of the embodiment corresponding to fig. 5 and the relevant content implemented by the management server in fig. 2, 3, etc. may be executed by one computing device. The blockchain-based data processing method may include:
s501, acquiring transaction data carrying data to be processed and target contract calling parameters; the target contract invocation parameters include a token to be validated for the target smart contract.
In a blockchain network, each node performs basic verification operations on received transaction data, such as verifying the validity of a transaction, validity of input and output, and the like. The output block node is generally selected from the nodes according to a common consensus mechanism, such as Proof of Work (PoW), proof of equity (PoS), and the like, and is responsible for packaging the transaction data to be processed into block data to be uplink according to a certain rule, and the packaging process generally includes: the plurality of transaction data are sequentially constructed into block data, block header information is added, and the like.
The transaction data is sent by the management server into the blockchain network, specifically, the management server generates the transaction data according to the data to be processed and the target contract invoking parameters, and then sends the transaction data into the blockchain network so that each node in the blockchain network can receive the transaction data.
The token to be verified is used for verifying whether the target intelligent contract can be called to store transaction data, and the intelligent contract in the output block node can perform uplink verification operation on the token to be verified in the executing process.
It should be noted that the target contract call parameter may be a first contract call parameter, and the token to be verified is an authorization token. The target contract invocation parameter may also be a second contract invocation parameter, and the token to be verified is a single payment token.
S502, generating block data to be uplinked according to transaction data, and carrying out consensus processing on the block data to be uplinked; and in the process of the consensus process, the method comprises the step of calling a target intelligent contract through a target contract calling parameter to perform uplink verification operation according to the token to be verified, and determining that the verification of the transaction data is passed when the obtained uplink verification result is verification passing.
In the embodiment of the application, the block-out node invokes the target intelligent contract through the target contract invoking parameter to perform the uplink verification operation according to the token to be verified in the process of performing the consensus processing on the block data to be uplink, so that the transaction data can be ensured to conform to the predefined legal rule, for example, whether a sender has enough authority or qualification to perform the specific operation or whether the transaction content conforms to the rule of the contract can be verified. At the same time, by verifying the token to be verified, unauthorized transactions may be prevented from being stored in the blockchain, thereby ensuring data security and integrity on the blockchain.
When the verification of the transaction data is determined to pass, the block output node continues to perform relevant consensus processing on the block data to be uplinked so as to ensure that the block data is consensus and credible, thereby maintaining the consistency and the authenticity of the data in the whole block chain network.
And S503, if the result of the consensus processing is determined to be that the consensus is passed, the block data is uplink. The consensus processing result comprises: and when the consensus passes and the consensus does not pass, the block-out node can perform subsequent block data uplink operation only when the consensus passes, and the block data comprises data to be processed, so that the data to be processed is permanently stored in a block chain and cannot be tampered.
In one possible implementation manner, the token to be verified is an authorization token, the target contract call parameter is a first contract call parameter, the authorization token is generated according to the contract use authority expiration time of the target object for the target intelligent contract and the on-chain address of the target object, and the first contract call parameter further includes: the expiration time is to be verified.
The expiration time to be verified is determined by the management server in the process of generating the authorization token. In one manner, the verification expiration time may be obtained from a database by the management server, specifically, after the target object purchases the target smart contract, the contract possession object generates the authorization token and the expiration time to be verified for the target object and sends the authorization token and the expiration time to be verified to the management server, which stores the authorization token and the expiration time to be verified in the database. And when the target object needs to use the target intelligent contract, the management server acquires an authorization token corresponding to the target object and the expiration time to be verified from the database. In another approach, the verification expiration time may be obtained by the management server parsing the authorization token.
Since the verification expiration time may be generated by forgery, which causes the verification expiration time to be inconsistent with the contract usage rights expiration time that is true for the target object, verification of the authenticity of the expiration time to be verified is required. Meanwhile, the block-out node also needs to verify the authorization token so as to ensure the authenticity of the authorization token.
Based on the above, the target intelligent contract is called through the target contract calling parameter to perform the uplink verification operation according to the token to be verified, which can be realized according to the following steps:
(a1) And performing a first verification operation on the authorization token to obtain a first verification result. The first verification operation is a process of verifying the authorization token, in which the target smart contract checks the validity, integrity, authenticity of the authorization token, thereby ensuring that the authorization token is legitimate and preventing the authorization token from being tampered with or counterfeited.
(a2) And after the first verification result indicates that the first verification operation is passed, performing a second verification operation on the expiration time to be verified to obtain a second verification result. The second verification operation is a process of verifying the expiration time to be verified, in which the target smart contract determines whether the authorization token has expired according to the expiration time to be verified, thereby judging whether the authorization token is still valid.
(a3) And after the second verification result indicates that the second verification operation is passed, determining that the uplink verification result is passed.
In the embodiment of the invention, the block-out node performs the first verification operation and the second verification operation through the target intelligent contract, so that the uplink processing of the data can be ensured only by legal and unexpired authorization tokens, the security and the credibility of the data in the blockchain network are enhanced, and invalid or expired authorization tokens are prevented from being used for the uplink processing of the data.
In one possible implementation manner, the first verification operation on the authorization token is performed to obtain a first verification result (i.e. step a 1), which may be implemented according to the following steps:
(a11) And taking the chain address of the target object as the chain address to be verified. The on-chain address of the target object can be carried in the first contract calling parameter and acquired by the target intelligent contract; the on-chain address of the target object may also be determined by the out-block node according to the related data of the target object on the blockchain, which is not limited in the embodiment of the present application.
(a12) And deducing and determining the public key to be verified according to the expiration time to be verified, the address on the chain to be verified and the authorization token. For example, the target smart contract may combine the expiration time to be verified and the address on the chain to be verified, calculate a first feature value (e.g., a hash value) of the combined result, calculate a second feature value of the authorization token, and derive the public key to be verified according to the first feature value and the second feature value.
(a13) And determining the chain address of the contract possession object according to the to-be-verified public key derivation. For example, the target smart contract may perform hash calculation on the public key to be verified to obtain a hash value, then determine an address prefix and a check code, and finally splice the address prefix, the hash value and the check code into an address on a chain of the contract owned object.
(a14) The chain address of the contract possession object determined by the derivation is compared with the chain address of the contract possession object stored in the target smart contract. The on-chain address of the contract owned object stored in the target smart contract is real and verified by each node.
(a15) Determining a first verification result according to the comparison result; if the comparison results are consistent, the first verification result is verification passing, and if the comparison results are inconsistent, the first verification result is verification failure.
By means of steps (a 11) - (a 15) verification of authenticity of the authorization token can be achieved, preventing data-upload processing by counterfeit or tampered authorization tokens.
In one possible implementation manner, after the first verification result indicates that the first verification operation is passed, performing a second verification operation on the expiration time to be verified to obtain a second verification result (i.e. step a 2), which may be implemented according to the following steps:
(a21) And after the first verification result indicates that the first verification operation is passed, determining the contract use permission expiration time in the authorization token according to the public key to be verified. The target intelligent contract can recover the contract use authority expiration time from the authorization token through the public key to be verified, and the contract use authority expiration time is used for subsequent time consistency comparison.
(a22) And comparing the time consistency of the contract use authority expiration time in the determined authorization token with the expiration time to be verified. Because the expiration time to be verified is not necessarily true, the target smart contract can determine whether the expiration time to be verified is consistent with the current time, if so, the expiration time to be verified is accurate, and then the target smart contract can continue with subsequent time limit verification. If there is no agreement, indicating that the expiration time to be verified is counterfeit or tampered with, then the target smart contract may stop subsequent processing for the authorization token.
(a23) And if the time consistency comparison results are consistent, determining a time limit verification result according to the expiration time to be verified and the current time.
(a24) And determining a second verification result according to the time limit verification result.
In the steps (a 23) - (a 24), the target smart contract may determine a time limit verification result by determining a relationship between the expiration time to be verified and the current time, where the time limit verification result is used to indicate whether the authorization token is within the validity period, thereby verifying the validity of the authorization token, and obtaining a corresponding verification result.
If the expiration time to be verified is before the current time, the authorization token is not expired, the corresponding time limit verification result is passed, and the corresponding second verification result is passed; if the expiration time to be verified is after the current time, the authorization token is expired, the corresponding time limit verification result is not passed, and the corresponding second verification result is not passed, so that the validity of the authorization token is effectively verified based on the expiration time to be verified.
In one possible implementation, the token to be verified is a single payment token, the target contract call parameter is a second contract call parameter, and the single payment token is generated by the contract owner object of the target smart contract through the private key of the contract owner object when the charging type of the data to be processed is a single charging type.
Based on the above, the target intelligent contract is called through the target contract calling parameter to perform the uplink verification operation according to the token to be verified, which can be realized according to the following steps:
(b1) And performing a third verification operation on the single payment token according to the public key to obtain a third verification result. The third verification operation is a process of verifying the single payment token, in which the target smart contract uses the public key to verify the validity, integrity and authenticity of the single payment token, thereby ensuring that the single payment token is legal and preventing the single payment token from being tampered or forged.
(b2) And after the third verification result indicates that the third verification operation is passed, determining that the uplink verification result is passed.
In the embodiment of the application, the target contract calling parameter verifies the single payment token by using the public key, and when the third verification operation passes, the target contract calling parameter can identify that the single payment token is valid, so that subsequent data uplink processing is executed; when the third validation operation fails, the target contract invocation parameters may identify that the single payment token is counterfeit or tampered with, thereby refusing to perform subsequent data-up processing. Meanwhile, after the uplink verification result is that the verification is passed, the single payment token may be deleted or marked as used, so that the reuse of the single payment token is avoided.
In one possible implementation, each time the target object selects a single billing type for data uplink processing, the management server stores the corresponding single payment token into the target smart contract.
Based on the above, the target intelligent contract is called through the target contract calling parameter to perform the uplink verification operation according to the token to be verified, which can be realized according to the following steps: judging whether a single payment token matched with a single payment token included in the target contract calling parameter exists in the target intelligent contract, and determining a fourth verification result according to the judgment result; if the fourth verification result is verification passing, and after the fourth verification result indicates that the fourth verification operation passes, determining that the uplink verification result is verification passing. And after the fourth verification result passes the verification, deleting the single payment token stored in the target intelligent contract by the target intelligent closing date so as to prevent repeated verification and use of the single payment token.
The data processing method provided in the embodiment of the present application will be illustrated by way of example below:
referring to fig. 6, fig. 6 is a flowchart of a data uplink process based on a blockchain according to an embodiment of the present application, and the main steps are as follows:
1. the contract user sends a contract purchase request for the target smart contract to the management server through a target object (such as an account of the contract user).
2. The management server sends a contract purchase request to the contract possession object. The contract purchase request may carry a contract identifier corresponding to the target intelligent contract.
3. The contract possession object signs address, timestamp of the target object based on the contract purchase request, resulting in a token. Address represents the address on the chain of the target object, timestamp represents the contract use authority expiration time corresponding to the target intelligent contract purchased by the target object, and token represents the signed authorization token.
4. The contract possession object sends the token and the timestamp to the management server. After receiving the token and the timestamp, the management server takes the timestamp as the expiration time to be verified of the target object, and then stores the token and the timestamp.
5. The target object sends a data uplink processing request for data uplink processing through the target intelligent contract to the management server.
6. The management server calls the target intelligent contract through the contract calling parameter so as to facilitate verification operation of the target intelligent contract. The contract invocation parameters include: token, timestamp, etc.
7. The target smart contract performs a first validation operation on an authorization token (token).
8. After the first verification operation is passed, the target smart contract performs a second verification operation on the expiration time to be verified (timestamp).
9. After the second verification operation is passed, the target intelligent contract returns verification passing information to the management server. In addition, the management server may return information that passes the verification to the target object.
10. And the target intelligent contract performs uplink processing on the data to be processed.
The implementation manner of each step is referred to the related description in the foregoing embodiments, and will not be repeated here.
It should be noted that, the contract purchase request may be a purchase request for a plurality of intelligent contracts, and accordingly, the contract purchase request may carry contract identifiers corresponding to the plurality of intelligent contracts. Similarly, when the target intelligent contract is called through the contract calling parameter, the contract calling parameter can also comprise the corresponding token of each of the plurality of intelligent contracts and the corresponding timestamp of each token.
Fig. 7 is a schematic structural diagram of a data processing apparatus based on a blockchain according to an embodiment of the present application. The data processing apparatus described in the present embodiment is applicable to a computing device, for example, in the above-mentioned management server, and includes:
an acquiring module 701, configured to acquire data to be processed of a target object;
the acquiring module 701 is further configured to acquire an authorization token of the target object; the authorization token is generated according to the contract use authority expiration time of the target object and the address on the chain;
a processing module 702, configured to determine a first contract invoking parameter according to the authorization token;
a data uplink module 703, configured to invoke a target smart contract through the first contract invocation parameter, so as to perform uplink processing on the data to be processed through the target smart contract;
the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
In one possible implementation, the processing module 702 is further configured to:
Acquiring a use right purchase request of the target object aiming at the target intelligent contract;
sending first prompt information to a contract possession object of the target intelligent contract; the first prompt information is used for indicating the contract possession object to determine contract use authority expiration time for the target object, and signing the determined contract use authority expiration time and the address on the chain of the target object through a private key of the contract possession object to obtain an authorization token of the target object;
and receiving an authorization token of the target object returned by the contract possession object based on the first prompt information and the contract use permission expiration time, and storing the authorization token of the target object and the contract use permission expiration time.
In one possible implementation, before the determining the first contract call parameter according to the authorization token, the processing module 702 is further configured to:
acquiring contract use authority expiration time, and determining the interval time between the contract use authority expiration time and the current time;
if the interval time is greater than a first interval threshold, triggering execution of determining a first contract calling parameter according to the authorization token;
The processing module 702 is further configured to: and if the interval time is smaller than a second interval threshold value, sending second prompt information to the target object, wherein the second prompt information is used for indicating the target object to carry out renewal processing on the target intelligent contract.
In one possible implementation, the processing module 702 is further configured to:
acquiring the charging type of the uplink processing of the data to be processed;
if the charging type is a subscription charging type, triggering and executing to acquire the authorization token of the target object; when the target object is determined to have initiated a use right purchase request for the target intelligent contract and an authorization token fed back in response to the use right purchase request is successfully acquired, determining that the charging type is a subscription charging type;
if the charging type is a single charging type, carrying out uplink processing on the data to be processed according to a single uplink rule; and when the target object is determined to be received to initiate a single purchase request aiming at the use authority of the target intelligent contract on a single purchase interface and obtain a single payment token, determining that the charging type is a single charging type.
In one possible implementation, the processing module 702 is further configured to:
sending third prompt information to a contract possession object of the target intelligent contract, wherein the third prompt information is used for indicating the contract possession object to generate a single payment token through a private key of the contract owner object;
receiving a single payment token returned in response to the third prompt message;
the uplink processing for the data to be processed according to the single uplink rule comprises the following steps: determining a second contract invoking parameter according to the single payment token; calling the target intelligent contract through the second contract calling parameter so as to facilitate the uplink processing of the data to be processed through the target intelligent contract;
the second contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the single payment token, so that the data to be processed are subjected to uplink processing after the single payment token is passed through the verification operation.
In one possible implementation, the processing module 702 is further configured to:
acquiring contract calling information generated by uplink processing of the data to be processed through the target intelligent contract, and determining whether calling operation is in compliance or not according to the contract calling information;
If the calling operation is determined to be not legal, generating evidence storage transaction data according to the contract calling information, and carrying out uplink processing on the evidence storage transaction data;
adjusting the stored authorization token of the target object according to the contract calling information;
and sending fourth prompting information to the target object, wherein the fourth prompting information is used for prompting that the contract use permission expiration time of the target object is adjusted.
In one possible implementation, the processing module 702 is further configured to:
acquiring storage indication information of the data to be processed;
if the storage rule indicated by the storage indication information is that the data to be processed is subjected to uplink processing, triggering and executing to obtain the authorization token of the target object;
after the data to be processed is determined, storage instruction information is allowed to be generated by selecting a storage rule for the data to be processed on a rule selection interface displayed, so that the data to be processed is instructed to be stored by the generated storage instruction information.
In one possible implementation manner, the storage indication information carries an intelligent contract identifier; the processing module 702 is specifically configured to, when configured to obtain the authorization token of the target object:
Determining an intelligent contract corresponding to the intelligent contract identification, and taking the determined intelligent contract as a target intelligent contract;
acquiring an authorization token matched with the target intelligent contract from the authorization tokens stored for the target object;
the intelligent contract identification is selected and determined through a selection operation on the contract selection interface, and the intelligent contract identification capable of supporting uplink storage of the data to be processed is displayed on the contract selection interface.
Referring to fig. 8, a schematic diagram of another block chain-based data processing apparatus according to an embodiment of the present application is shown. The data processing apparatus described in this embodiment is applicable to the above-mentioned management server, and includes:
an obtaining module 801, configured to obtain transaction data carrying data to be processed and target contract invoking parameters; the target contract invoking parameter comprises a token to be verified aiming at a target intelligent contract, wherein the token to be verified is used for verifying whether the target intelligent contract can be invoked to store the transaction data;
the consensus processing module 802 is configured to generate block data to be uplink according to the transaction data, and perform consensus processing on the block data to be uplink; the process of the consensus process comprises the step of calling the target intelligent contract through the target contract calling parameter to perform uplink verification operation according to the token to be verified, and determining that the verification of the transaction data is passed when the obtained uplink verification result is verification passing;
The uplink module 803 is configured to uplink the block data if it is determined that the result of the consensus process is that the consensus passes.
In one possible implementation manner, the token to be verified is an authorization token, the target contract call parameter is a first contract call parameter, the authorization token is generated according to a contract usage right expiration time of the target object for the target intelligent contract and a link address of the target object, and the first contract call parameter further includes: an expiration time to be verified;
the consensus processing module 802, when configured to invoke the target smart contract through the target contract invocation parameter to perform a uplink authentication operation according to the token to be authenticated, is specifically configured to:
performing a first verification operation on the authorization token to obtain a first verification result;
after the first verification result indicates that the first verification operation is passed, performing a second verification operation on the expiration time to be verified to obtain a second verification result;
and after the second verification result indicates that the second verification operation is passed, determining that the uplink verification result is passed.
In one possible implementation manner, the consensus processing module 802 is specifically configured to, when configured to perform a first verification operation on the authorization token to obtain a first verification result:
Taking the address on the chain of the target object as the address on the chain to be verified;
deducing and determining a public key to be verified according to the expiration time to be verified, the address on the chain to be verified and the authorization token;
deducing and determining the chain address of the contract owned object according to the public key to be verified;
comparing the chain address of the contract possession object determined by deduction with the chain address of the contract possession object stored in the target intelligent contract;
determining a first verification result according to the comparison result; and if the comparison results are inconsistent, the first verification result is verification failure.
In one possible implementation manner, the consensus processing module 802 is specifically configured to, after the first verification result indicates that the first verification operation is passed, perform a second verification operation on the expiration time to be verified, and obtain a second verification result:
after the first verification result indicates that the first verification operation is passed, determining contract use permission expiration time in the authorization token according to the public key to be verified;
comparing the determined contract use authority expiration time in the authorization token with the expiration time to be verified in a time consistency manner;
If the time consistency comparison result is consistent, determining a time limit verification result according to the expiration time to be verified and the current time;
and determining a second verification result according to the time limit verification result.
In one possible implementation manner, the token to be verified is a single payment token, the target contract call parameter is a second contract call parameter, and when the single payment token is a single charging type of the data to be processed, the contract owned object of the target intelligent contract is generated by the private key of the contract owner object; the consensus processing module 802, when configured to invoke the target smart contract through the target contract invocation parameter to perform a uplink authentication operation according to the token to be authenticated, is specifically configured to:
performing a third verification operation on the single payment token according to the public key to obtain a third verification result;
and after the third verification result indicates that the third verification operation is passed, determining that the uplink verification result is passed.
It should be noted that, the functions of each functional module of the data processing apparatus in the embodiments of the present application may be specifically implemented according to the method in the embodiments of the method, and the specific implementation process may refer to the related description of the embodiments of the method, which is not repeated herein.
In a possible embodiment, the blockchain-based data processing device provided in the embodiments of the present application may be implemented in a software manner, and the blockchain-based data processing device may be stored in a memory, and may be software in the form of a program, a plug-in unit, or the like, and include a series of units, including a processing unit and a communication unit; the processing unit and the communication unit are used for realizing the data processing method based on the block chain.
In other possible embodiments, the blockchain-based data processing device provided by the embodiments of the present application may also be implemented in a combination of hardware and software, and by way of example, the blockchain-based data processing device provided by the embodiments of the present application may be a processor in the form of a hardware decoding processor that is programmed to perform the blockchain-based data processing method provided by the embodiments of the present application, e.g., the processor in the form of a hardware decoding processor may employ one or more application specific integrated circuits (ASIC, application Specific Integrated Circuit), DSPs, programmable logic devices (PLD, programmable Logic Device), complex programmable logic devices (CPLD, complex Programmable Logic Device), field programmable gate arrays (FPGA, field-Programmable Gate Array), or other electronic components.
Fig. 9 is a schematic structural diagram of a computing device according to an embodiment of the present application. The computing device described in this embodiment includes: processor 901, memory 902, and network interface 903. Data may be interacted between the processor 901, the memory 902, and the network interface 903. For example, by one or more communication buses, which are used to effect a communication connection between these components.
The processor 901 may be a central processing unit (Central Processing Unit, CPU) which may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 902 may include read only memory and random access memory and provide program instructions and data to the processor 901. The memory 902 may include volatile memory (RAM), such as random-access memory (RAM); the memory 902 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a Solid State Drive (SSD), etc.; the memory 902 may also include a combination of the above types of memory. In a possible embodiment, the computing device may be applied to an embodiment. The processor 901, when calling the program instruction, is configured to perform the following operations:
Acquiring data to be processed of a target object;
acquiring an authorization token of the target object; the authorization token is generated according to the contract use authority expiration time of the target object and the address on the chain;
determining a first contract invoking parameter according to the authorization token;
calling a target intelligent contract through the first contract calling parameter so as to facilitate uplink processing of the data to be processed through the target intelligent contract;
the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
In one possible implementation, the processor 901 is further configured to:
acquiring a use right purchase request of the target object aiming at the target intelligent contract;
sending first prompt information to a contract possession object of the target intelligent contract; the first prompt information is used for indicating the contract possession object to determine contract use authority expiration time for the target object, and signing the determined contract use authority expiration time and the address on the chain of the target object through a private key of the contract possession object to obtain an authorization token of the target object;
And receiving an authorization token of the target object returned by the contract possession object based on the first prompt information and the contract use permission expiration time, and storing the authorization token of the target object and the contract use permission expiration time.
In one possible implementation, before determining the first contract call parameter according to the authorization token, the processor 901 is further configured to:
acquiring contract use authority expiration time, and determining the interval time between the contract use authority expiration time and the current time;
if the interval time is greater than a first interval threshold, triggering execution of determining a first contract calling parameter according to the authorization token;
the above processor 901 is further configured to: and if the interval time is smaller than a second interval threshold value, sending second prompt information to the target object, wherein the second prompt information is used for indicating the target object to carry out renewal processing on the target intelligent contract.
In one possible implementation, the processor 901 is further configured to:
acquiring the charging type of the uplink processing of the data to be processed;
if the charging type is a subscription charging type, triggering and executing to acquire the authorization token of the target object; when the target object is determined to have initiated a use right purchase request for the target intelligent contract and an authorization token fed back in response to the use right purchase request is successfully acquired, determining that the charging type is a subscription charging type;
If the charging type is a single charging type, carrying out uplink processing on the data to be processed according to a single uplink rule; and when the target object is determined to be received to initiate a single purchase request aiming at the use authority of the target intelligent contract on a single purchase interface and obtain a single payment token, determining that the charging type is a single charging type.
In one possible implementation, the processor 901 is further configured to:
sending third prompt information to a contract possession object of the target intelligent contract, wherein the third prompt information is used for indicating the contract possession object to generate a single payment token through a private key of the contract owner object;
receiving a single payment token returned in response to the third prompt message;
the uplink processing for the data to be processed according to the single uplink rule comprises the following steps: determining a second contract invoking parameter according to the single payment token; calling the target intelligent contract through the second contract calling parameter so as to facilitate the uplink processing of the data to be processed through the target intelligent contract;
the second contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the single payment token, so that the data to be processed are subjected to uplink processing after the single payment token is passed through the verification operation.
In one possible implementation, the processor 901 is further configured to:
acquiring contract calling information generated by uplink processing of the data to be processed through the target intelligent contract, and determining whether calling operation is in compliance or not according to the contract calling information;
if the calling operation is determined to be not legal, generating evidence storage transaction data according to the contract calling information, and carrying out uplink processing on the evidence storage transaction data;
adjusting the stored authorization token of the target object according to the contract calling information;
and sending fourth prompting information to the target object, wherein the fourth prompting information is used for prompting that the contract use permission expiration time of the target object is adjusted.
In one possible implementation, the processor 901 is further configured to:
acquiring storage indication information of the data to be processed;
if the storage rule indicated by the storage indication information is that the data to be processed is subjected to uplink processing, triggering and executing to obtain the authorization token of the target object;
after the data to be processed is determined, storage instruction information is allowed to be generated by selecting a storage rule for the data to be processed on a rule selection interface displayed, so that the data to be processed is instructed to be stored by the generated storage instruction information.
In one possible implementation manner, the storage indication information carries an intelligent contract identifier; the processor 901, when configured to obtain the authorization token of the target object, is specifically configured to:
determining an intelligent contract corresponding to the intelligent contract identification, and taking the determined intelligent contract as a target intelligent contract;
acquiring an authorization token matched with the target intelligent contract from the authorization tokens stored for the target object;
the intelligent contract identification is selected and determined through a selection operation on the contract selection interface, and the intelligent contract identification capable of supporting uplink storage of the data to be processed is displayed on the contract selection interface.
In a possible embodiment, the computing device may be applied to another embodiment. The processor 901, when calling the program instruction, is configured to perform the following operations:
acquiring transaction data carrying data to be processed and target contract calling parameters; the target contract invoking parameter comprises a token to be verified aiming at a target intelligent contract, wherein the token to be verified is used for verifying whether the target intelligent contract can be invoked to store the transaction data;
Generating block data to be uplinked according to the transaction data, and carrying out consensus processing on the block data to be uplinked; the process of the consensus process comprises the step of calling the target intelligent contract through the target contract calling parameter to perform uplink verification operation according to the token to be verified, and determining that the verification of the transaction data is passed when the obtained uplink verification result is verification passing;
and if the result of the consensus processing is determined to be that the consensus passes, the block data is uplink.
In one possible implementation manner, the token to be verified is an authorization token, the target contract call parameter is a first contract call parameter, the authorization token is generated according to a contract usage right expiration time of the target object for the target intelligent contract and a link address of the target object, and the first contract call parameter further includes: an expiration time to be verified;
the processor 901, when configured to invoke the target smart contract through the target contract invocation parameter to perform a uplink authentication operation according to the token to be authenticated, is specifically configured to:
performing a first verification operation on the authorization token to obtain a first verification result;
After the first verification result indicates that the first verification operation is passed, performing a second verification operation on the expiration time to be verified to obtain a second verification result;
and after the second verification result indicates that the second verification operation is passed, determining that the uplink verification result is passed.
In one possible implementation manner, the processor 901 is specifically configured to, when configured to perform a first verification operation on the authorization token to obtain a first verification result:
taking the address on the chain of the target object as the address on the chain to be verified;
deducing and determining a public key to be verified according to the expiration time to be verified, the address on the chain to be verified and the authorization token;
deducing and determining the chain address of the contract owned object according to the public key to be verified;
comparing the chain address of the contract possession object determined by deduction with the chain address of the contract possession object stored in the target intelligent contract;
determining a first verification result according to the comparison result; and if the comparison results are inconsistent, the first verification result is verification failure.
In one possible implementation manner, the processor 901 is configured to, after the first verification result indicates that the first verification operation is passed, perform a second verification operation on the expiration time to be verified, and obtain a second verification result, where the second verification result is specifically configured to:
after the first verification result indicates that the first verification operation is passed, determining contract use permission expiration time in the authorization token according to the public key to be verified;
comparing the determined contract use authority expiration time in the authorization token with the expiration time to be verified in a time consistency manner;
if the time consistency comparison result is consistent, determining a time limit verification result according to the expiration time to be verified and the current time;
and determining a second verification result according to the time limit verification result.
In one possible implementation manner, the token to be verified is a single payment token, the target contract call parameter is a second contract call parameter, and when the single payment token is a single charging type of the data to be processed, the contract owned object of the target intelligent contract is generated by the private key of the contract owner object; the processor 901, when configured to invoke the target smart contract through the target contract invocation parameter to perform a uplink authentication operation according to the token to be authenticated, is specifically configured to:
Performing a third verification operation on the single payment token according to the public key to obtain a third verification result;
and after the third verification result indicates that the third verification operation is passed, determining that the uplink verification result is passed.
In specific implementation, the processor 901, the memory 902 and the network interface 903 described in the embodiments of the present application may perform the implementation described in the related embodiments of the data processing method provided in fig. 2, fig. 3 or fig. 5 of the embodiments of the present application, or may also perform the implementation described in the related embodiments of the data processing apparatus provided in fig. 7 or fig. 8 of the embodiments of the present application, which are not repeated herein.
In the several embodiments provided in the present application, it should be understood that the disclosed method, apparatus, and system may be implemented in other manners. For example, the device embodiments described above are merely illustrative; for example, the division of the units is only one logic function division, and other division modes can be adopted in actual implementation; for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
Embodiments of the present application also provide a computer readable storage medium having stored therein program instructions, which when executed may include some or all of the steps of a blockchain-based data processing method as in the embodiments described above.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may take other order or occur simultaneously in accordance with the present application. Further, it should be understood by those skilled in the art that the embodiments described in the specification are all preferred embodiments, and the acts and modules referred to are not necessarily required in the present application.
It should be noted that the descriptions of "first," "second," and the like in the embodiments of the present application are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a technical feature defining "first", "second" may include at least one such feature, either explicitly or implicitly.
Those of ordinary skill in the art will appreciate that all or a portion of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
Embodiments of the present application also provide a computer program product comprising a computer program or computer instructions stored in a computer-readable storage medium. The processor of the server reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the server performs the steps performed in the above-described method embodiments.
The foregoing has described in detail the methods, apparatuses, devices and media for processing data based on blockchain in the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the methods and core ideas of the present application; meanwhile, as for the general technical objects in the art, there are changes in the specific embodiments and the application scope according to the ideas of the present application, and the contents of the present specification should not be construed as limitations of the present application in view of the above.

Claims (17)

1. A method of blockchain-based data processing, the method comprising:
acquiring data to be processed of a target object;
acquiring an authorization token of the target object; the authorization token is generated according to contract use permission expiration time of the target object and an on-chain address;
determining a first contract invoking parameter according to the authorization token;
invoking a target intelligent contract through the first contract invoking parameter so as to facilitate uplink processing of the data to be processed through the target intelligent contract;
the first contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the authorization token so as to carry out uplink processing on the data to be processed after the verification operation is passed.
2. The method of claim 1, wherein the method further comprises:
acquiring a use right purchase request of the target object aiming at the target intelligent contract;
sending first prompt information to a contract possession object of the target intelligent contract; the first prompt information is used for indicating the contract possession object to determine contract use authority expiration time for the target object, and signing the determined contract use authority expiration time and the on-chain address of the target object through a private key of the contract possession object to obtain an authorization token of the target object;
And receiving an authorization token of the target object returned by the contract possession object based on the first prompt information and the contract use permission expiration time, and storing the authorization token of the target object and the contract use permission expiration time.
3. The method of claim 1, wherein prior to determining the first contract invocation parameters from the authorization token, the method further comprises:
acquiring contract use authority expiration time, and determining interval time between the contract use authority expiration time and current time;
if the interval time is greater than a first interval threshold, triggering execution to determine a first contract calling parameter according to the authorization token;
the method further comprises the steps of: and if the interval time is smaller than a second interval threshold, sending second prompt information to the target object, wherein the second prompt information is used for indicating the target object to carry out renewal processing on the target intelligent contract.
4. A method according to any one of claims 1-3, wherein the method further comprises:
acquiring the charging type of the uplink processing of the data to be processed;
if the charging type is a subscription charging type, triggering and executing to acquire the authorization token of the target object; when the target object is determined to have initiated a use right purchase request for the target intelligent contract and an authorization token fed back in response to the use right purchase request is successfully acquired, determining that the charging type is a subscription charging type;
If the charging type is a single charging type, carrying out uplink processing on the data to be processed according to a single uplink rule; and when the target object is determined to receive a single purchase request of the target intelligent contract on a single purchase interface, and a single payment token is obtained, determining that the charging type is a single charging type.
5. The method of claim 4, wherein the method further comprises:
sending third prompt information to a contract possession object of the target intelligent contract, wherein the third prompt information is used for indicating the contract possession object to generate a single payment token through a private key of the contract owner object;
receiving a single payment token returned in response to the third prompt message;
and the step of carrying out uplink processing on the data to be processed according to a single uplink rule comprises the following steps: determining a second contract invoking parameter according to the single payment token; invoking the target intelligent contract through the second contract invoking parameter so as to facilitate uplink processing of the data to be processed through the target intelligent contract;
the second contract calling parameter is used for triggering the target intelligent contract to carry out verification operation according to the single payment token, so that the data to be processed are subjected to uplink processing after the single payment token is subjected to verification operation.
6. A method according to any one of claims 1-3, wherein the method further comprises:
acquiring contract calling information generated by uplink processing of the data to be processed through the target intelligent contract, and determining whether calling operation is in compliance or not according to the contract calling information;
if the calling operation is determined to be not legal, generating evidence storage transaction data according to the contract calling information, and carrying out uplink processing on the evidence storage transaction data;
adjusting the stored authorization token of the target object according to the contract calling information;
and sending fourth prompt information to the target object, wherein the fourth prompt information is used for prompting that the contract use permission expiration time of the target object is adjusted.
7. A method according to any one of claims 1-3, wherein the method further comprises:
acquiring storage indication information of the data to be processed;
if the storage rule indicated by the storage indication information is that the data to be processed is subjected to uplink processing, triggering and executing to obtain the authorization token of the target object;
wherein after the data to be processed is determined, the storage instruction information is allowed to be generated by selecting a storage rule for the data to be processed on the displayed rule selection interface, so that the data to be processed is instructed to be stored by the generated storage instruction information.
8. The method of claim 7, wherein the storage indication information carries an intelligent contract identification; the obtaining the authorization token of the target object comprises the following steps:
determining an intelligent contract corresponding to the intelligent contract identification, and taking the determined intelligent contract as a target intelligent contract;
acquiring an authorization token matched with the target intelligent contract from the authorization tokens stored for the target object;
the intelligent contract identification is selected and determined through a selection operation on the contract selection interface, and the intelligent contract identification capable of supporting uplink storage of the data to be processed is displayed on the contract selection interface.
9. A method of blockchain-based data processing, the method comprising:
acquiring transaction data carrying data to be processed and target contract calling parameters; the target contract calling parameter comprises a token to be verified aiming at a target intelligent contract, and the token to be verified is used for verifying whether the target intelligent contract can be called to store the transaction data;
generating block data to be uplinked according to the transaction data, and carrying out consensus processing on the block data to be uplinked; the method comprises the steps of calling the target intelligent contract through the target contract calling parameter to perform uplink verification operation according to the token to be verified, and determining that verification of the transaction data is passed when the obtained uplink verification result is verification passing;
And if the result of the consensus processing is determined to be that the consensus passes, the block data is uplink.
10. The method of claim 9, wherein the token to be verified is an authorization token, the target contract call parameter is a first contract call parameter, the authorization token is generated according to a contract usage rights expiration time of a target object for the target smart contract, and a chain address of the target object, and the first contract call parameter further includes: an expiration time to be verified;
the step of calling the target intelligent contract through the target contract calling parameter to perform the uplink verification operation according to the token to be verified comprises the following steps:
performing a first verification operation on the authorization token to obtain a first verification result;
after the first verification result indicates that the first verification operation is passed, performing a second verification operation on the expiration time to be verified to obtain a second verification result;
and after the second verification result indicates that the second verification operation is passed, determining that the uplink verification result is verification passed.
11. The method of claim 10, wherein performing a first verification operation on the authorization token to obtain a first verification result comprises:
Taking the address on the chain of the target object as the address on the chain to be verified;
deducing and determining a public key to be verified according to the expiration time to be verified, the address on the chain to be verified and the authorization token;
deducing and determining the chain address of the contract owned object according to the public key to be verified;
comparing the chain address of the contract possession object determined by deduction with the chain address of the contract possession object stored in the target intelligent contract;
determining a first verification result according to the comparison result; and if the comparison results are inconsistent, the first verification result is verification failure.
12. The method of claim 11, wherein performing a second verification operation on the expiration time to be verified after the first verification result indicates that the first verification operation is passed, to obtain a second verification result, comprises:
after the first verification result indicates that the first verification operation is passed, determining contract use permission expiration time in the authorization token according to the public key to be verified;
comparing the determined contract use authority expiration time in the authorization token with the expiration time to be verified in a time consistency manner;
If the time consistency comparison results are consistent, determining a time limit verification result according to the expiration time to be verified and the current time;
and determining a second verification result according to the time limit verification result.
13. The method of claim 9, wherein the token to be validated is a single payment token and the target contract invocation parameter is a second contract invocation parameter, the single payment token being generated by a contract possession object of the target smart contract with a private key of the contract owner object when the charging type of the data to be processed is a single charging type; the step of calling the target intelligent contract through the target contract calling parameter to perform the uplink verification operation according to the token to be verified comprises the following steps:
performing a third verification operation on the single payment token according to the public key to obtain a third verification result;
and after the third verification result indicates that the third verification operation is passed, determining that the uplink verification result is verification passed.
14. A blockchain-based data processing device comprising means for implementing the blockchain-based data processing method of any of claims 1-8 or means for implementing the blockchain-based data processing method of any of claims 9-13.
15. A computing device comprising a processor, a memory, and a network interface, the processor, memory, and network interface being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to implement the blockchain-based data processing method of any of claims 1-8, or to implement the blockchain-based data processing method of any of claims 9-13.
16. A computer readable storage medium storing a computer program comprising program instructions that, when executed by a processor, cause a computing device having the processor to implement the blockchain-based data processing method of any of claims 1-8 or to implement the blockchain-based data processing method of any of claims 9-13.
17. A computer program product comprising a computer program or computer instructions which, when executed by a processor, implement the blockchain-based data processing method of any of claims 1-8 or the blockchain-based data processing method of any of claims 9-13.
CN202311393525.1A 2023-10-25 2023-10-25 Block chain-based data processing method, device and equipment, medium and product Pending CN117390694A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311393525.1A CN117390694A (en) 2023-10-25 2023-10-25 Block chain-based data processing method, device and equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311393525.1A CN117390694A (en) 2023-10-25 2023-10-25 Block chain-based data processing method, device and equipment, medium and product

Publications (1)

Publication Number Publication Date
CN117390694A true CN117390694A (en) 2024-01-12

Family

ID=89437014

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311393525.1A Pending CN117390694A (en) 2023-10-25 2023-10-25 Block chain-based data processing method, device and equipment, medium and product

Country Status (1)

Country Link
CN (1) CN117390694A (en)

Similar Documents

Publication Publication Date Title
CN109376504B (en) Picture privacy protection method based on block chain technology
CN109274652B (en) Identity information verification system, method and device and computer storage medium
CN113537984A (en) Content verification method and device based on block chain and electronic equipment
CN111027028A (en) Copyright data processing method and device based on intelligent contract
CN111444273B (en) Data authorization method and device based on block chain
CN111538784B (en) Digital asset transaction method, device and storage medium based on blockchain
CN111314172B (en) Block chain-based data processing method, device, equipment and storage medium
CN110246039B (en) Transaction monitoring method and device based on alliance chain and electronic equipment
CN111414434B (en) Block chain-based data transaction management network, transaction device and storage medium
CN109861996B (en) Block chain-based relationship proving method, device, equipment and storage medium
CN111292174A (en) Tax payment information processing method and device and computer readable storage medium
CN110661779B (en) Block chain network-based electronic certificate management method, system, device and medium
CN111125778B (en) Copyright transaction information processing method and device
CN110708162B (en) Resource acquisition method and device, computer readable medium and electronic equipment
EP4092984A1 (en) Data processing method and apparatus, device and medium
CN110674531A (en) Residence information management method, device, server and medium based on block chain
CN110599311A (en) Resource processing method and device, electronic equipment and storage medium
CN111274597B (en) Data processing method and device
CN110941840B (en) Data processing method, system and terminal
CN110766403A (en) Data processing device and method based on block chain and storage medium
CN110599184A (en) Method and device for network service account transaction, server and storage medium
CN117390694A (en) Block chain-based data processing method, device and equipment, medium and product
CN114124515A (en) Bidding transmission method, key management method, user verification method and corresponding device
CN112766755A (en) Service processing method, device, equipment and medium
CN112163917A (en) Bill processing method, device, medium and electronic equipment based on block chain

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication