CN112818414B - Data processing method, data processing device, computer equipment and storage medium - Google Patents

Data processing method, data processing device, computer equipment and storage medium Download PDF

Info

Publication number
CN112818414B
CN112818414B CN202110416421.2A CN202110416421A CN112818414B CN 112818414 B CN112818414 B CN 112818414B CN 202110416421 A CN202110416421 A CN 202110416421A CN 112818414 B CN112818414 B CN 112818414B
Authority
CN
China
Prior art keywords
target
service block
application
service
transaction record
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.)
Active
Application number
CN202110416421.2A
Other languages
Chinese (zh)
Other versions
CN112818414A (en
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 CN202110416421.2A priority Critical patent/CN112818414B/en
Publication of CN112818414A publication Critical patent/CN112818414A/en
Application granted granted Critical
Publication of CN112818414B publication Critical patent/CN112818414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2137Time limited access, e.g. to a computer or data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2151Time stamp

Abstract

The application discloses a data processing method, a data processing device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a target transaction record of a target user in an application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit; performing consensus on the target transaction record in the service block chain; if the target transaction record passes the consensus, managing a target service block associated with the target user on a service block chain according to the target transaction record; and the target service block is used for verifying the application authority of the target user aiming at the application client. By the method and the device, the verification accuracy of the application permission of the target user in the application client can be improved.

Description

Data processing method, data processing device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, a computer device, and a storage medium.
Background
With the continuous development of computer networks, various application clients are in conflict with each other, and users can perform payment operation in the application clients to acquire application rights in the application clients.
In the prior art, when a terminal device to which a user belongs verifies an application right of the user in an application client, history data may be obtained from the application client in an application background of the terminal device, where the history data generally includes right verification information for verifying the application right of the user in the application client. Therefore, the terminal device can verify the application authority of the user in the application client through the authority verification information acquired from the historical data, namely, judge whether the user has the application authority of the application client. Since the history data of the application client in the application background of the terminal device is usually easy to be tampered, the result obtained by verifying the application authority of the user in the application client through the authority verification information obtained from the history data is not accurate.
Disclosure of Invention
The application provides a data processing method, a data processing device, computer equipment and a storage medium, which can improve the verification accuracy of the application permission of a target user in an application client.
One aspect of the present application provides a data processing method, including:
acquiring a target transaction record of a target user in an application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit;
performing consensus on the target transaction record in the service block chain;
if the target transaction record is identified, managing a target service block associated with the target user on a service block chain according to the target transaction record; and the target service block is used for verifying the application authority of the target user aiming at the application client.
One aspect of the present application provides a data processing apparatus, including:
the record acquisition module is used for acquiring a target transaction record of a target user in the application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit;
the consensus module is used for performing consensus on the target transaction records in the service block chain;
the management module is used for managing a target service block associated with a target user on a service block chain according to the target transaction record if the target transaction record passes the consensus; and the target service block is used for verifying the application authority of the target user aiming at the application client.
Optionally, the method for the management module to manage the target service block associated with the target user on the service block chain according to the target transaction record includes:
if the business block chain does not contain the historical business block associated with the target user, generating a target business block on the business block chain according to the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the target period.
Optionally, the method for the management module to manage the target service block associated with the target user on the service block chain according to the target transaction record includes:
if the service block chain contains a historical service block associated with the target user, acquiring the validity period of the application authority aiming at the application client end, which is recorded by the historical service block and is possessed by the target user;
generating a target service block on a service block chain according to the validity period recorded by the historical service block and the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the sum of the valid period and the target period recorded by the historical service block.
Optionally, the apparatus further comprises:
a removal query module, configured to broadcast block removal query information for a historical service block in a service block chain after a target service block is generated on the service block chain;
and the removing module is used for removing the historical service blocks from the service block chain when the confirmation information aiming at the broadcasted block removal inquiry information is acquired.
Optionally, the method for the management module to manage the target service block associated with the target user on the service block chain according to the target transaction record includes:
if the service block chain comprises a historical service block associated with the target user, updating the historical service block according to the target transaction record, and determining the updated historical service block as the target service block;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the sum of the valid period recorded by the historical service block before updating and the target period.
Optionally, the target service block is configured to record an expiration date of an application permission of the target user for the application client, and the target service block includes a permission valid state of the application permission of the target user for the application client;
the above-mentioned device still includes:
the timing module is used for starting timing from the generation timestamp of the target service block based on the intelligent contract to obtain timing duration;
and the state updating module is used for updating the authority valid state in the target service block into the authority invalid state based on the intelligent contract when the timing duration is detected to be equal to the duration indicated by the validity period recorded in the target service block based on the intelligent contract.
Optionally, the timing module starts timing from the generation timestamp of the target service block based on the intelligent contract to obtain a timing duration, including:
creating a contract running container at the time indicated by the generation timestamp of the target service block;
initializing an intelligent contract in a contract running container to obtain an initialized intelligent contract;
and starting timing based on the initialized intelligent contract to obtain timing duration.
Optionally, the service block chain includes a consensus node;
the mode that the consensus module performs consensus on the target transaction record in the service block chain comprises the following steps:
acquiring N transaction records in a target time period; the N transaction records comprise target transaction records, and N is a positive integer;
acquiring a transaction timestamp of each transaction record in the N transaction records;
sequencing the N transaction records according to the transaction timestamp of each transaction record to obtain N sequenced transaction records;
and broadcasting the sequenced N transaction records to the consensus node so that the consensus node performs consensus operation on the sequenced N transaction records.
Optionally, the method for broadcasting the sequenced N transaction records to the consensus node by the consensus module includes:
generating transaction summary information according to the N sequenced transaction records;
and broadcasting the transaction summary information and the sequenced N transaction records to the consensus node so that the consensus node generates verification summary information according to the sequenced N transaction records, and confirming that the sequenced N transaction records are consensus-passed when the verification summary information is the same as the transaction summary information.
Optionally, the service block chain is a service alliance chain; the service alliance chain comprises service distribution nodes;
the method for acquiring the target transaction record of the target user in the application client by the record acquisition module comprises the following steps:
acquiring a target transaction record broadcasted by a service distribution node; the target transaction record is the transaction record sent to the service distribution node by the application client;
the target transaction record comprises the transaction resource amount of the target user in the application client; the target transaction record is a transaction record broadcast by the service distribution node upon detecting that the transfer of the transaction resource indicated by the application client to the amount of the transaction resource was successful.
Optionally, the application client includes a video client; the video client is used for generating an authority verification request when triggering video playing operation and sending the authority verification request to the service distribution node;
the service distribution node is used for acquiring a target service block from the service alliance chain according to the authority verification request; the service distribution node is used for generating authority verification information according to the obtained target service block and returning the authority verification information to the video client;
and the video client is used for executing video playing operation when the target user is verified to have the application right aiming at the application client according to the right verification information.
An aspect of the application provides a computer device comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to perform the method of an aspect of the application.
An aspect of the application provides a computer-readable storage medium having stored thereon a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the above-mentioned aspect.
According to an aspect of the application, a computer program product or computer program is provided, comprising computer instructions, the computer instructions being stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternatives of the above aspect and the like.
The method and the device can acquire the target transaction record of the target user in the application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit; and can carry on the consensus to the goal transaction record in the business block chain; if the target transaction record is identified, managing a target service block associated with the target user on the service block chain according to the target transaction record; and the target service block is used for verifying the application authority of the target user aiming at the application client. Therefore, the method provided by the application can manage the target service block associated with the target user on the service block chain through the target transaction record, the managed target service block can be used for verifying the application authority of the target user for the application client, and the target service block can ensure that the target service block cannot be tampered in the block chain, so that the application authority of the target user for the application client can be accurately verified through the target service block.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a network architecture for rights verification according to an embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a data processing method provided herein;
FIG. 3 is a schematic diagram of a management block scenario provided in the present application;
FIG. 4 is a schematic diagram of a scenario of application permission verification provided in the present application;
FIG. 5 is a schematic diagram of a scenario of application permission verification provided in the present application;
FIG. 6 is a schematic flow chart diagram illustrating a transaction consensus method provided herein;
FIG. 7 is a block consensus scenario provided herein;
fig. 8 is a flowchart illustrating a block management method according to the present application;
FIG. 9 is a block diagram of the present application;
FIG. 10 is a schematic diagram of a data processing apparatus provided in the present application;
fig. 11 is a schematic structural diagram of a computer device provided in the present application.
Detailed Description
The technical solutions in the present application will be described clearly and completely with reference to the accompanying drawings in the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The present application relates to the field of block chaining. The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer. The Block chain comprises a series of blocks (blocks) which are mutually connected according to the generated chronological order, once a new Block is added into the Block chain, the new Block cannot be removed, and the recorded data submitted by the nodes in the Block chain system are recorded in the blocks. In the application, the transaction record of the target user in the application client can be stored through the block chain, and the application authority of the target user in the application client can be verified through the transaction record stored on the block chain.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a network architecture for rights verification according to an embodiment of the present disclosure. As shown in fig. 1, the network architecture may include a plurality of (at least two) terminal devices in block 100a, a plurality of traffic distribution nodes in block 101a, a plurality of consensus nodes in block 102a, and a master node 103 a. The plurality of service distribution nodes in the frame 101a, the plurality of consensus nodes in the frame 102a, and the master node 103a may form a service block chain, the plurality of service distribution nodes in the frame 101a, the plurality of consensus nodes in the frame 102a, and the master node 103a all belong to a block link point in the service block chain, and each block link point in the service block chain may be formed by a server.
The servers forming each block chain node in the service block chain may be independent physical servers, may also be a server cluster or distributed system formed by a plurality of physical servers, and may also be cloud servers providing basic cloud computing services such as cloud service, cloud databases, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and artificial intelligence platforms, and the like. The terminal device as shown in fig. 1 may be: the intelligent terminal comprises intelligent terminals such as a smart phone, a tablet computer, a notebook computer, a desktop computer and an intelligent television.
Each terminal device in block 100a may include an application client, which may be any client. The terminal device may generate a payment record in response to a payment operation of a user in the application client, and may send the payment record to the service distribution node. The purpose of the payment operation performed by the user in the application client may be to obtain an application right of the application client, for example, the application right may be a membership right in the application client. The service distribution node may broadcast the payment record to the consensus node and the host node in the service blockchain upon detecting that the user paid successfully for the amount indicated by the payment record.
Further, the host node 103a may instruct the consensus node to perform consensus on the payment record, where a specific process of instructing the consensus node to perform consensus on the payment record may be described in the following description of step S102 in the corresponding embodiment of fig. 2. Step s 1: when the host node 103a detects that the consensus node agrees with the payment record, the host node 103a may generate a block from the payment record, which may include the payment record. Step S2: the master node 103a may add the generated tiles to the traffic tile chain. Step S3: when the terminal device needs to verify whether the user has the application right in the application client, the verification can be performed through the generated blocks on the service block chain.
Here, the block added on the service block chain according to the payment record may be a target service block in the following corresponding embodiment of fig. 2, and the payment record may be a target transaction record in the following corresponding embodiment of fig. 2. Therefore, the specific description of how to add the target service block to the service block chain and how to verify the application authority of the user (e.g. the target user) in the application client through the target service block can be referred to the following specific description in the corresponding embodiment of fig. 2.
Because the data in the service block chain can ensure that the data cannot be tampered, the application authority of the user in the application client is verified through the service block chain, and the accuracy of the obtained verification result can be ensured.
Referring to fig. 2, fig. 2 is a schematic flow chart of a data processing method provided in the present application. The execution subject in the embodiment of the present application may be one computer device or a computer device cluster formed by a plurality of computer devices. The computer equipment can be a server or terminal equipment. Therefore, the execution subject in the embodiment of the present application may be a server, or may be a terminal device, or may be formed by the server and the terminal device together. As shown in fig. 2, the method may include:
step S101, acquiring a target transaction record of a target user in an application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit;
in the application, the transaction record of the target user can be uplinked through the alliance chain, and further the application authority of the target user in the application client can be verified through the alliance chain. Because the background full-network devices of the application client are usually very many, and the alliance chain can only include a plurality of devices selected from the background full-network devices of the application client as blockchain nodes, and the blockchain does not need to be constructed on the background full-network devices, the application executes the verification related service of the user aiming at the application authority in the application client by adopting the alliance chain mode, and can reduce the device overhead and the calculation overhead aiming at the verification related service.
The federation chain may be referred to as a service blockchain, and the federation chain may include service distribution nodes, logical layer nodes, and master nodes, all of which are blockchain nodes in the federation chain. In other words, the service distribution node may directly communicate with the application client, and the logical layer node and the master node do not normally directly communicate with the application client. Furthermore, the logical layer node can be used as a consensus node in the federation chain, and the consensus node can be a node promoted through the whole network. The primary node may be a node in the federation chain for uplink of the block, and may be referred to as a billing node in the service block chain. Each blockchain node in the federation chain may be formed from one or more computer devices, and the executing entity in an embodiment of the present application may be a master node in the federation chain.
The application client may be any client, for example, the application client may be any video client, information flow client, or communication client. The target user may be any user having a user account registered in the application client, the terminal device to which the target user belongs may have the application client installed therein and may access the installed application client, or the terminal device to which the target user belongs may access the web page side of the application client in the form of a web page, and the application client (which may be in the form of software or a web page) in the terminal device to which the target user belongs may have the user account of the target user logged therein.
Therefore, the master node may obtain a target transaction record of the target user in the application client, where the target transaction record may be a payment record of the target user in the application client through the terminal device to which the target user belongs, and the payment record indicates that the target user has performed a payment operation in the application client through the terminal device to obtain (i.e., purchase) the application right in the application client through the performed payment operation. The application authority of the application client can be a member authority or a resource use authority in the application client.
For example, if the application client is a video client, the application right of the application client may be a member right of the video client, and thus when a user (such as a target user) having the member right of the video client plays a video in the video client, the video may be played without an advertisement, or the video may be played by skipping an advertisement, or video data that only a member in the video client can play may be played. For another example, if the application client is a video client, the application right of the application client may be a playing right of a video that needs to be paid for to be played in the video client, so that when a user having the application right of the video client plays the video in the video client, the user can play the video based on the video data paid for by the target transaction record in the video client.
For example, if the application client is a communication client, the application authority of the application client may be a member-decorating authority of the communication client, and thus, when a user having the application authority of the communication client performs decorating on a client page of the communication client, the user may perform decorating by applying a skin that can be used only with the member-decorating authority.
Thus, the target transaction record may be used to determine that the target user has application rights of the application client within the target time limit. For example, if the application client is a video client, the payment rule of the membership right of the video client may be 10 pieces of money per month, and when the target transaction record records that the target user paid for 20 pieces of money in the application client, the target transaction record indicates that payment is started from the target user, and the time that the target user has the application right of the application client is two months, that is, the target time limit indicates a time limit of two months after the target user completes payment of the transaction resource (e.g., the 20 pieces of money).
As can be seen from the above, the target transaction record may record a transaction resource amount of the transaction resource that the target user transacts in the application client, where the transaction resource amount may refer to the amount of money paid (e.g. 20 money as described above), and the target transaction record may further include a transaction time of the target user at the application client, where the transaction time is a time when the transaction of the transaction resource indicated by the target transaction record is successful, and the transaction time may be understood as an effective starting time of the application right purchased through the transaction resource indicated by the target transaction record. The target transaction record may also include a duration of authority for the application authority purchased through the indicated transaction resource (e.g., the two month duration described above), or the target transaction record may also include an expiration time for the authority for the application authority purchased through the indicated transaction resource (e.g., a two month time count from the validation start time described above). The specific numerical value of the transaction resource amount of the transaction resource indicated by the target transaction record may be determined according to an actual application scenario, and is not limited thereto.
For example, if the application authority in the application client is 10 pieces of money per month, and the target user pays 50 pieces of money in the application client in 1 month and 1 day, indicating that the target user purchases the application authority in 5 months in the application client, the target transaction record may record the transaction resource amount 50, the transaction time (i.e., the lifetime start time) in 1 month and 1 day, the authority end time in 6 months and 1 day, and the authority duration in 5 months. In this scenario, the target period is 1 month 1 day to 6 months 1 day.
Since the service distribution node in the federation chain is a node for interfacing with the application client, the target transaction record acquired by the master node may be a transaction record broadcasted by the service distribution node. Specifically, after detecting that the target user successfully pays at the application client through the user account to which the target user belongs, the terminal device to which the target user belongs may generate the target transaction record according to a payment result (e.g., payment amount, time, and the like), and the terminal device to which the target user belongs may send the target transaction record to the service distribution node through the application client, and sending the target transaction record to the service distribution node by the terminal device to which the target user belongs may be understood as sending the target transaction record to the service distribution node by the application client.
Furthermore, since the transaction resource amount (e.g., the payment amount) of the target user in the application client is recorded in the target transaction record, after acquiring the target transaction record, the service distribution node may detect whether the application client has successfully transferred the transaction resource (e.g., money represented by the payment amount) indicated by the transaction resource amount, and if the service distribution node detects that the transaction resource indicated by the application client by the transaction resource amount has successfully transferred, the service distribution node may broadcast the acquired target transaction record to other nodes in the service federation chain, e.g., to the above logic layer node and the host node.
Step S102, carrying out consensus on the target transaction records in the service block chain;
in the application, after obtaining the target transaction record indicated by the service distribution, the host node may indicate a consensus node (the number of the consensus nodes is determined according to an actual application scenario) in the service block chain to perform consensus on the target transaction record, and after the consensus node finishes the consensus on the target transaction record, the host node may further obtain a consensus result obtained after the consensus on the target transaction record, where the consensus node may include a consensus passing result and a consensus failing result. The algorithm used for identifying the target transaction records may be a Practical Byzantine Fault Tolerance (PBFT) identification algorithm, and the specific process for identifying the target transaction records may also be described in the following embodiment corresponding to fig. 6. Since the PBFT consensus algorithm does not need to infer the node for accounting through a large amount of data calculation, but accounts through a designated master node (i.e., blocks are generated on a service block chain), the present application can also reduce the calculation overhead in the consensus process of transaction records by using the PBFT consensus algorithm.
Step S103, if the target transaction record is identified, managing a target service block associated with the target user on a service block chain according to the target transaction record; the target service block is used for verifying the application authority of a target user aiming at the application client;
in this application, if the host node detects that the consensus on the target transaction record passes, if the obtained consensus result for the target transaction record is the consensus passing result, the host node may manage the target service block associated with the target user on the service block chain according to the target transaction record. The manner of managing the target transaction record can be described in the following:
the master node may detect whether a historical service block associated with the target user is included in the chain of service blocks, where the property of the historical service block is the same as that of the target service block, except that the historical service block is a service block acquired according to a transaction record of the target user before the target transaction record of the application client, in other words, the historical service block is a service block acquired before the target service block is acquired.
Therefore, it can be understood that if no other transaction record exists in the application client by the target user before the target transaction record is acquired, no historical service block associated with the target user exists in the service block chain. On the contrary, if the target user has other transaction records in the application client before the target transaction record is obtained, the historical service block associated with the target user exists in the service block chain. In other words, if the target user purchases the application authority of the application client (i.e. pays for the application authority of the application client), there is a historical service block in the service block chain.
Thus, when the master node detects that the traffic block chain does not contain historical traffic blocks associated with the target user, the master node may generate a target traffic block on the traffic block chain according to the target transaction record. Since the block chain is a distributed account book, after the master node generates a target service block on the service block chain, each block chain node in the service block chain may record the target service block. The target transaction record may be recorded in the target service block, and information such as a valid period of an application right for the application client, which is possessed by the target user, may be recorded in the target service block.
It can be understood that the validity period recorded by the target service block is evaluated according to the current time (i.e. the latest time), so that when the master node generates the target service block on the service block chain, the validity period recorded by the target service block is equal to the target period, and as time passes, if two days of time have elapsed after the master node generates the target service block on the service block chain, the validity period recorded by the target service block on the service block chain at this time is the period obtained by subtracting the elapsed two days of time from the target period. In other words, the term of validity mentioned in this embodiment (including the term of validity recorded by the historical service block and the term of validity recorded by the target service block) is the term of the application authority of the application client possessed by the target user evaluated by the current time, and the current time is updated continuously as time passes, so the term of validity is also changed continuously. It should be noted that the valid period recorded by the service block (e.g., history also deblocking and target service block) may not be directly recorded by the service block, but may be calculated according to the current time and the data (e.g., the authority end time or the authority duration) recorded in the service block.
More specifically, when the master node detects that a historical service block associated with a target user exists in the service block chain, the master node manages the target service block in two ways, one is to update the existing historical service block to obtain the target service block without generating a new block, and the other is to generate a new block based on the historical service block, and use the new block as the target service block, please refer to the following description:
the first management mode of the main node to the target service block is as follows: the master node may update the historical service blocks according to the target transaction record, and use the updated historical service blocks as target service blocks. In this case, the validity period of the application authority of the target user for the application client recorded in the target service block is equal to the sum of the validity period recorded in the history service block before updating and the target period. It can be understood that, in this case, if the valid period of the application authority of the target user recorded in the historical service block for the application client is 0, the valid period recorded in the target service block is the target period, and if the valid period recorded in the historical service block is not 0, the start time of the valid period recorded in the target service block is the start time of the valid period recorded in the historical service block, and the end time of the valid period recorded in the target service block is the end time of the valid period recorded in the target service block.
The first management of the target traffic block by the master node may be: the target user always only has one service block corresponding to the service block chain, and even if the target user has a new transaction record, the target user is updated on the basis of the existing service block (such as the historical service block) to obtain an updated service block (such as the target service block), so that a new service block cannot be generated.
The second management mode of the main node to the target service block is as follows: the master node may generate the target service block on the service block chain according to the expiration date recorded by the historical service block and the target transaction record, in which case, the target service block is not the same as the historical service block, and the target service block is a regenerated block. The target service block can record the transaction record in the historical service block and the target transaction record, and the valid period recorded by the target service block is equal to the sum of the valid period recorded by the historical service block and the target period.
It is understood that, in the second management manner for the target service block, the number of service blocks associated with the target user may be more than one, and after the target user generates the target service block on the service block chain, the historical service blocks have no effect. Thus, the master node may broadcast a tile removal query message for historical traffic tiles on the traffic tile chain, e.g., the master node may broadcast the tile removal query message to all tile link points on the traffic tile chain.
Thus, when the master node obtains acknowledgement information for the block link node on the traffic block chain to the broadcasted block removal query information, the master node may remove the historical traffic block from the traffic block chain. The acknowledgement information for the tile removal inquiry information may be acknowledgement information of tile link points in the service tile chain exceeding a specified number (e.g., 2/3). In other words, historical service blocks may be removed from the service block chain when a majority of the block chain nodes in the service block chain (e.g., more than 2/3 block chain nodes) confirm that historical service blocks are approved for removal from the service block chain. By removing historical service blocks from the service block chain, memory space on the service block chain may be saved.
Referring to fig. 3, fig. 3 is a schematic view of a management block scenario provided in the present application. As shown in fig. 3, the management manner of the target service block may include 3 manners. The first management mode for the target service block is as follows: if the service block chain 100b does not include the historical service block associated with the target user, the master node may perform operation 101b, that is, the master node may generate the target service block on the service block chain 100b according to the target transaction record, to obtain a service block chain 102b including the target service block.
The second management mode for the target service block is as follows: if the service block chain 103b includes a historical service block associated with the target user, the master node may perform operation 104b, that is, the master node may update the historical service block according to the target transaction record, and may use the updated historical service block as the target service block to obtain a service block chain 105b including the target service block. In this case, the service block chain 105b generates no new block compared to the service block chain 103b, and only updates the historical service blocks in the service block chain 103b as the target service blocks.
In a third management manner for the target service block, if the service block chain 106b includes a historical service block associated with the target user, the master node may also perform operation 107b, that is, the master node may generate the target service block on the service block chain 106b according to the target transaction record and the historical service block, so as to obtain a service block chain 108b including the target service block. In this case, the service block chain 108b generates a new block, which is the target service block, compared to the service block chain 106 b.
It can be understood that, when a new transaction record of the target user in the application client is obtained after the target transaction record, the target service block on the service block chain at this time may be used as the historical service block, and the new target service block is obtained again in the same manner as the target service block is obtained.
More, the target service block on the service block chain is used to verify the application authority of the target user in the application client, and it can be known that the service distribution node belongs to a node on the service block chain, so that the service distribution node records complete information (including the target service block) on the service block chain. Therefore, the application client can request the service distribution node to verify the application authority of the target user in the application client.
For example, the application client may be a video client, and when the video client triggers a video playing operation, the video client may send a permission verification request for a target user to the service distribution node, where the permission verification request is used to request to verify whether the target user currently has an application permission of the application client.
Therefore, after acquiring the permission verification request sent by the video client, the service distribution node can acquire the target service block. The service distribution node may obtain the target service block including the user identifier according to the user identifier in the permission verification request. Furthermore, the service distribution node may generate the permission verification information through the acquired target service block, and may send the permission verification information to the video client.
Optionally, the permission verification information may be two types, one type is that the service distribution node may directly determine, according to the target service block, whether the target user is within the valid period of the application permission for the application client, and may directly send the determination result to the video client as the permission verification information, so that the video client may directly know whether the target user currently has the application permission of the application client. The other is that the service distribution node can obtain the valid period of the application permission of the target user for the application client currently recorded by the target service block, and can send the valid period to the video client as permission verification information, so that the video client can also judge whether the target user has the application permission of the application client according to the valid period.
The application permission of the video client can be that the video data which the user wants to play can be directly played without playing advertisement data when the video data is played. Therefore, when the video client verifies that the target user has the application right for the application client according to the obtained right verification information, the video client can directly execute the video playing operation to play the video data which the user wants to play without playing the advertisement data.
Referring to fig. 4, fig. 4 is a schematic view of a scenario of application permission verification provided in the present application. As shown in FIG. 4, steps S1-S2: when the application client triggers an operation requiring application rights (such as the video playback operation described above), the application client may send a rights verification request to the service distribution node. After the service distribution node obtains the permission verification request, the service distribution node may obtain a target service block according to the permission verification request, and may generate permission verification information according to the target service block. The permission verification information is used for verifying the application permission of the target user at the application client.
Therefore, step S3: the service distribution node may send the permission verification information to the application client. Step S4: after the application client acquires the permission verification information, whether the target user currently has the application permission of the application client can be verified through the permission verification information. When the application client detects that the target user has the application authority of the application client, the application client may perform an operation (such as the video playing operation described above) triggered by the application client. The video playing operation here means that the video data triggered to be played by the target user can be directly played without playing the advertisement data.
Referring to fig. 5, fig. 5 is a schematic view of a scenario of application permission verification provided in the present application. As shown in fig. 5, the application client may be a video client, and the terminal page 101c of the terminal device 100c to which the target user belongs is a client page in the video client. The terminal page 101c includes a video play list, which may include a plurality of video data that can be played by clicking, and the plurality of video data may include video data 101d, video data 102d, and video data 103 d.
The terminal device 100c may send an authorization verification request to the service distribution node 102c in response to a click-to-play operation of the target user on the video data 101d, and may acquire authorization verification information returned by the service distribution node 102c according to the authorization verification request.
When the terminal device 100c detects that the target user has an application right (such as a membership right) for the video client according to the acquired right verification information, the terminal device 100c may switch and display from the terminal page 101c to the terminal page 103c, where the terminal page 103c is a playing page for the video data 101d, and when the terminal page 103c plays the video data 101d, the target user has the membership right of the video client, so that the video data 101d may be directly played without playing advertisement data before the video data 101d is played; alternatively, the advertisement data may be played before the video data 101d is played, but the terminal device 100c may close the played advertisement data in response to the advertisement skipping operation of the target user and directly play the video data 101 d.
By adopting the method provided by the application, the transaction record of the target user in the application client can be uplinked in the form of the service block and stored in the service block chain, so that the transaction record of the target user in the application client is not falsifiable, and the validity period of the application authority of the target user in the application client is not falsified, and therefore the application authority of the target user for the application client can be accurately verified through the service block (such as the target service block) in the service block chain. It can be understood that several users may be registered in the application client (the target user may be any user among the several users), and therefore, the master node may manage the service blocks of the respective users through the transaction record of each user registered in the application client in the same management manner as that of the target service block through the target transaction record of the target user, and may verify the application authority of the respective users in the application client through the service blocks of the respective users.
The method and the device can acquire the target transaction record of the target user in the application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit; and can carry on the consensus to the goal transaction record in the business block chain; if the target transaction record is identified, managing a target service block associated with the target user on the service block chain according to the target transaction record; and the target service block is used for verifying the application authority of the target user aiming at the application client. Therefore, the method provided by the application can manage the target service block associated with the target user on the service block chain through the target transaction record, the managed target service block can be used for verifying the application authority of the target user for the application client, and the target service block can ensure that the target service block cannot be tampered in the block chain, so that the application authority of the target user for the application client can be accurately verified through the target service block.
For a specific process of making a consensus on a target transaction record, refer to fig. 6 below, where fig. 6 is a schematic flow chart of a transaction consensus method provided in the present application. The transaction consensus method may be performed by a master node in the service block chain, as shown in fig. 6, and the method includes:
step S201, performing consensus on target transaction records in a service block chain;
in this application, the master node may agree on the target transaction record in the service blockchain. In the same time period (for example, 1 second, which may be referred to as a target time period) during which the target transaction record is obtained, the host node may obtain other transaction records besides the target transaction record, where the other transaction records may not be sent by the terminal device to which the target user belongs, but may be sent by any terminal device to which the user registered the user account at the application client belongs.
Therefore, the master node may obtain N transaction records in a target time period, where the N transaction records include the target transaction record, that is, the target transaction record may be one of the N transaction records, N is a positive integer, and a specific value of N is determined according to an actual application scenario. Therefore, when the master node agrees on the target transaction record, the master node agrees on the N transaction records simultaneously.
The master node may also obtain a transaction timestamp for each of the N transaction records, which may be the time at which the respective transaction record was generated. Therefore, the master node may sequence the N transaction records in sequence according to the sequence of the transaction time stamp of each transaction record in the N transaction records, so as to obtain the sequenced N transaction records.
The master node may also generate the transaction summary information according to the N ordered transaction records, for example, the N ordered transaction records are spliced according to the arrangement order thereof to obtain the spliced transaction record, and then calculate a hash value of the spliced transaction record, and use the hash value as the transaction summary information. The master node may broadcast the transaction summary information and the sorted N transaction records to a consensus node in the service blockchain.
When the consensus node acquires the transaction summary information broadcasted by the main node and the sequenced N transaction records, the main node can recalculate the summary information of the sequenced N transaction records in the same way that the main node calculates the transaction summary information. The summary information of the N sorted transaction records computed by the consensus node may be referred to as verification summary information. The consensus node can compare the calculated verification summary information with the acquired transaction summary information, and when the verification summary information is the same as the transaction summary information, the consensus of the N transaction records can be confirmed to pass. The consensus node may return consensus results for the N transaction records, which may include a consensus passed result and a consensus failed result, to the master node. Since there may be a plurality of consensus nodes (at least two), when the master node obtains consensus passing results for N transaction records sent by more than a sufficient number (e.g., a number greater than 2/3) of consensus nodes, it may finally confirm that the N transaction records are agreed.
It will be appreciated that a consensus on N transaction records indicates a consensus on each of the N transaction records, and thus a consensus on N transaction records indicates a consensus on the target transaction record.
Step S202, if the target transaction record is identified, managing a target service block associated with the target user on a service block chain according to the target transaction record;
in this application, if the host node detects that the consensus on the target transaction record passes, the host node may manage the target service block associated with the target user on the service block chain according to the target transaction record. The specific process of managing the target service block may refer to step S103 in the embodiment corresponding to fig. 2.
It can be understood that, since the master node performs consensus on the N transaction records, the master node may respectively manage the corresponding service blocks on the service block chain according to each transaction record in the N transaction records in the same manner as the master node manages the target service block according to the target transaction record. The process of managing the corresponding service block according to each transaction record in the N transaction records can be independent and not interfered with each other.
Referring to fig. 7, fig. 7 is a schematic view of a block consensus provided in the present application. As shown in fig. 7, the master node 100e may obtain N transaction records in the target time period, where the N transaction records include transaction records 1 to N in the box 101e, and the N transaction records include the target transaction record.
The master node 100e may obtain the transaction timestamp of each transaction record in the N transaction records, and the master node 100e may sequence the N transaction records in sequence according to the time sequence of the transaction timestamps of the transaction records, so as to obtain the N sequenced transaction records 102 e.
Further, master node 100e may generate transaction summary information 103e for the sorted N transaction records 102 e. Master node 100e may broadcast the ordered N transaction records 102e and transaction summary information 103e to consensus node 104 e. After the consensus node 104e performs consensus on the N sorted transaction records 102e through the transaction summary information 103e, a consensus result may be obtained, and the consensus result may be returned to the master node 100 e.
After the host node 100e detects that the N transaction records are agreed according to the consensus result returned by the consensus node 104e, the host node 100e may manage the target service block on the service block chain according to the target transaction record.
By the method, the transaction records can be identified simultaneously, and the service blocks corresponding to the transaction records can be acquired respectively (if the transaction records are target transaction records, the service blocks are the target service blocks).
After the target service block is obtained from the service block chain, the target service block may be further managed by an intelligent contract, please refer to fig. 8, where fig. 8 is a flowchart illustrating a block management method provided in the present application. The block management method may also be executed by a master node in the service block chain, as shown in fig. 8, and the method may include:
step S301, starting timing from a generation time stamp of a target service block based on an intelligent contract to obtain timing duration;
in the application, each block chain node in the service block chain can be deployed with an intelligent contract, and the intelligent contract can be used for settling the application permission of a target user for an application client. In particular, the master node may create a contract run container for running the intelligent contract at the time indicated by the generation timestamp of the target traffic block.
The intelligent contract is a digital agreement which is compiled by an algorithm and a program, is deployed on a blockchain and can be automatically executed according to rules, is a business contract which is compiled by a programming language, and can automatically and forcibly execute the contract clauses when a preset condition is met so as to realize the target of code law. The decentralized processing of the blockchain enables the intelligent agent to run on all nodes of the whole network simultaneously without the participation of a central manager, and any organization or person cannot forcibly stop the intelligent agent.
In this application, intelligent contract does not directly run on the blockchain node, because if contain malicious code or vulnerability in the contract, will directly threaten the security of blockchain node, consequently can run intelligent contract in the sandbox environment of isolation in this application to improve the security of blockchain node.
Because the main design targets of the Hyperhedge Fabric are modular design, component replacement and the intelligent contract running in the Docker (open source application container engine), the block-out time can be controlled by time and transaction, and the Hyperhedge Fabric can be more suitable for application development in the application, for example, the development of the application client in the application, so that the relevant transaction records of the application client can be stored and verified in the blockchain.
Because HyperLegend Fabric is adopted in the application, the intelligent contracts deployed at each block link point can be packaged into Docker images, and each block link node can start a new Docker container based on the images and execute an initialization method in the intelligent contract and then wait for being called. The new Docker container started based on the image may be referred to as the contract running container, so that the master node may initialize the intelligent contract in the started contract running container at the time indicated by the generation timestamp of the target service block (i.e., execute the initialization method in the intelligent contract), and obtain the initialized intelligent contract. Wherein initializing the smart contract may be understood as invoking the smart contract. Each block link point in the service block chain can obtain an intelligent contract initialized by itself. The generation timestamp of the target service block may refer to time when the master node completes management of the target service block in the service block chain, that is, time for acquiring the target service block on the service block chain. And the time indicated by the generation timestamp of the target traffic block may be the time of the generation timestamp.
The target service block can also comprise a permission valid state of the target user for the application permission of the application client, and the permission valid state indicates that the target user is within the valid period of the application permission of the application client. Therefore, the master node can start timing at the generation timestamp of the target service block through the self-initialized intelligent contract to obtain the timing duration, and the timing duration obtained by the initialized intelligent contract is continuously updated along with the lapse of time, namely is continuously prolonged. The validity status of the right in the target service block can be updated and settled through the timing duration, please refer to the following description.
Step S302, when detecting that the timing duration is equal to the duration indicated by the validity period recorded in the target service block based on the intelligent contract, updating the authority valid state in the target service block to the authority invalid state based on the intelligent contract;
in the application, when the master node detects that the timing duration is equal to the duration indicated by the validity duration recorded by the target service block (i.e. the duration included by the validity duration) based on the intelligent contract, indicating that the duration of the application authority of the application client possessed by the target user has expired, the master node can inquire other nodes on the service block chain whether to change the authority valid state in the target service block or not through the initialized intelligent contract, when the master node detects that most block chain nodes (e.g. block chain nodes with the number exceeding 2/3) on the service block chain agree to change the authority valid state in the target service block, the master node can change the authority valid state in the target service block on the service block chain into the authority invalid state, wherein the authority invalid state indicates that the target user is not in the valid duration of the application authority of the possessed application client, in other words, the rights invalid state indicates that the target user does not already have the application rights of the application client.
It can be understood that, since each blockchain node (including the master node, the consensus node and the service distribution node) on the service blockchain is deployed with an intelligent contract, therefore, the inquiry about whether to change the valid state of the authority in the target service block is not initiated by the master node, any block chain node in the service block chain can obtain the timing duration in the same way as the master node through the self-deployed intelligent contract, and when detecting that the self-timed time duration is equal to the time duration indicated by the validity period recorded by the target service block, it can be queried from other block link points on the service block chain whether to change the valid state of the right in the target service block, and if so, each block chain node can change the authority valid state recorded by the node in the target service block into the authority invalid state.
According to the method and the device, Go (a computer programming language) and Java (a computer programming language) can be used as the development language, and because the development language Go and the development language Java have graphic completeness, the programming threshold aiming at the intelligent contract can be relieved by adopting the development language Go and the development language Java. In the smart contract, the application may also define different payment modes according to the transaction channel (such as an account for paying the application client) or the license plate party (such as a platform for paying the application client), and the payment mode may include a mode for dividing payment for a third party (such as a platform or an account for paying the application client), for example, how much money is rewarded for the platform or the account for paying the payment. When a new block (such as a target service block) is generated, the operation of payment data saving (such as saving of a target transaction record) and payment settlement at the time of expiration (such as updating and settlement of the authority valid state of a target user) can be triggered in time through an intelligent contract, so that the generation and the updating of the target service block can be performed spontaneously depending on the intelligent contract, and the tamper resistance of the target service block is ensured.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a block provided in the present application. As shown in fig. 9, the target traffic block 101f may include a block header 100f and a block body 102 f. The block header 100f may include a version number of the target service block, a hash value of a block before the target service block in the service block chain, a merck tree root obtained according to the target transaction record in the target service block (the merck tree root may be the hash value of the target transaction record), a generation timestamp of the target service block, a difficulty target for generating the target service block, a random number, and a payment digest. The paid chronological summary may be summary information derived from data in the block 102f other than the target transaction record.
As shown in fig. 9, the block body 102f may include information such as a target transaction record, an authority state (which may be an authority valid state or an authority invalid state), an authority start time (which may be a start time of a validity period recorded in the target service block when the management of the target service block is completed), an authority duration (which may be a duration of a validity period recorded in the target service block when the management of the target service block is completed), an authority end time (which may be an end time of a validity period recorded in the target service block when the management of the target service block is completed), and a user identifier of the target user.
The authority state in the block 102f of the target service block 101f may be automatically updated by an intelligent contract, and the specific process of the update may be as described in the embodiment corresponding to fig. 8.
By adopting the method provided by the application, the authority states (including the authority valid state and the authority invalid state) of the application authority of the target user in the application client can be automatically updated and settled through the intelligent contract, so that the non-tamper property and the accuracy of the authority states of the application authority of the target user in the application client are ensured.
Referring to fig. 10, fig. 10 is a schematic structural diagram of a data processing apparatus provided in the present application. The data processing apparatus may be a computer program (including program code) running on a computer device, for example, the data processing apparatus is an application software, and the data processing apparatus may be configured to execute corresponding steps in the methods provided by the embodiments of the present application. As shown in fig. 10, the data processing apparatus 1 may include: a record acquisition module 11, a consensus module 12 and a management module 13.
The record acquisition module 11 is configured to acquire a target transaction record of a target user in an application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit;
a consensus module 12, configured to perform consensus on the target transaction record in the service block chain;
the management module 13 is configured to manage a target service block associated with the target user on the service block chain according to the target transaction record if the target transaction record passes the consensus; and the target service block is used for verifying the application authority of the target user aiming at the application client.
Optionally, the mode that the management module 13 manages the target service block associated with the target user on the service block chain according to the target transaction record includes:
if the business block chain does not contain the historical business block associated with the target user, generating a target business block on the business block chain according to the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the target period.
Optionally, the mode that the management module 13 manages the target service block associated with the target user on the service block chain according to the target transaction record includes:
if the service block chain contains a historical service block associated with the target user, acquiring the validity period of the application authority aiming at the application client end, which is recorded by the historical service block and is possessed by the target user;
generating a target service block on a service block chain according to the validity period recorded by the historical service block and the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the sum of the valid period and the target period recorded by the historical service block.
Optionally, the apparatus 1 further includes:
a removal query module 14, configured to broadcast block removal query information for historical service blocks in a service block chain after a target service block is generated on the service block chain;
a removing module 15, configured to remove the historical service block from the service block chain when the acknowledgement information for the broadcasted block removal inquiry information is acquired.
Optionally, the mode that the management module 13 manages the target service block associated with the target user on the service block chain according to the target transaction record includes:
if the service block chain comprises a historical service block associated with the target user, updating the historical service block according to the target transaction record, and determining the updated historical service block as the target service block;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the sum of the valid period recorded by the historical service block before updating and the target period.
Optionally, the target service block is configured to record an expiration date of an application permission of the target user for the application client, and the target service block includes a permission valid state of the application permission of the target user for the application client;
the above apparatus 1 further comprises:
the timing module 16 is configured to start timing from the generation timestamp of the target service block based on the intelligent contract to obtain a timing duration;
and the state updating module 17 is used for updating the authority valid state in the target service block into the authority invalid state based on the intelligent contract when the timing duration is detected to be equal to the duration indicated by the validity period recorded in the target service block based on the intelligent contract.
Optionally, the timing module 16 starts timing from the generation timestamp of the target service block based on the intelligent contract to obtain a timing duration, including:
creating a contract running container at the time indicated by the generation timestamp of the target service block;
initializing an intelligent contract in a contract running container to obtain an initialized intelligent contract;
and starting timing based on the initialized intelligent contract to obtain timing duration.
Optionally, the service block chain includes a consensus node;
the way that the consensus module 12 performs consensus on the target transaction record in the service block chain includes:
acquiring N transaction records in a target time period; the N transaction records comprise target transaction records, and N is a positive integer;
acquiring a transaction timestamp of each transaction record in the N transaction records;
sequencing the N transaction records according to the transaction timestamp of each transaction record to obtain N sequenced transaction records;
and broadcasting the sequenced N transaction records to the consensus node so that the consensus node performs consensus operation on the sequenced N transaction records.
Optionally, the manner in which the consensus module 12 broadcasts the N sorted transaction records to the consensus node includes:
generating transaction summary information according to the N sequenced transaction records;
and broadcasting the transaction summary information and the sequenced N transaction records to the consensus node so that the consensus node generates verification summary information according to the sequenced N transaction records, and confirming that the sequenced N transaction records are consensus-passed when the verification summary information is the same as the transaction summary information.
Optionally, the service block chain is a service alliance chain; the service alliance chain comprises service distribution nodes;
the method for acquiring the target transaction record of the target user in the application client by the record acquisition module 11 includes:
acquiring a target transaction record broadcasted by a service distribution node; the target transaction record is the transaction record sent to the service distribution node by the application client;
the target transaction record comprises the transaction resource amount of the target user in the application client; the target transaction record is a transaction record broadcast by the service distribution node upon detecting that the transfer of the transaction resource indicated by the application client to the amount of the transaction resource was successful.
Optionally, the application client includes a video client; the video client is used for generating an authority verification request when triggering video playing operation and sending the authority verification request to the service distribution node;
the service distribution node is used for acquiring a target service block from the service alliance chain according to the authority verification request; the service distribution node is used for generating authority verification information according to the obtained target service block and returning the authority verification information to the video client;
and the video client is used for executing video playing operation when the target user is verified to have the application right aiming at the application client according to the right verification information.
According to an embodiment of the present application, the steps involved in the data processing method shown in fig. 2 may be performed by respective modules in the data processing apparatus 1 shown in fig. 10. For example, step S101 shown in fig. 2 may be performed by the record obtaining module 11 in fig. 10, and step S102 shown in fig. 2 may be performed by the consensus module 12 in fig. 10; step S103 shown in fig. 2 may be performed by the management module 13 in fig. 10.
The method and the device can acquire the target transaction record of the target user in the application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit; and can carry on the consensus to the goal transaction record in the business block chain; if the target transaction record is identified, managing a target service block associated with the target user on the service block chain according to the target transaction record; and the target service block is used for verifying the application authority of the target user aiming at the application client. Therefore, the device provided by the application can manage the target service block associated with the target user on the service block chain through the target transaction record, the managed target service block can be used for verifying the application authority of the target user for the application client, and the target service block can ensure that the target service block cannot be tampered in the block chain, so that the application authority of the target user for the application client can be accurately verified through the target service block.
According to an embodiment of the present application, each module in the data processing apparatus 1 shown in fig. 10 may be respectively or entirely combined into one or several units to form the unit, or some unit(s) therein may be further split into multiple sub-units with smaller functions, which may implement the same operation without affecting implementation of technical effects of the embodiment of the present application. The modules are divided based on logic functions, and in practical application, the functions of one module can be realized by a plurality of units, or the functions of a plurality of modules can be realized by one unit. In other embodiments of the present application, the data processing apparatus 1 may also include other units, and in practical applications, the functions may also be implemented by being assisted by other units, and may be implemented by cooperation of a plurality of units.
According to an embodiment of the present application, the data processing apparatus 1 as shown in fig. 10 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the corresponding method as shown in fig. 2 on a general-purpose computer device such as a computer including a processing element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and a storage element, and implementing the data processing method of the embodiment of the present application. The computer program may be recorded on a computer-readable recording medium, for example, and loaded into and executed by the computing apparatus via the computer-readable recording medium.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device provided in the present application. As shown in fig. 11, the computer device 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 11, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the computer device 1000 shown in fig. 11, the network interface 1004 may provide a network communication function; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring a target transaction record of a target user in an application client; the target transaction record is used for determining that the target user has the application authority of the application client within the target time limit;
performing consensus on the target transaction record in the service block chain;
if the target transaction record is identified, managing a target service block associated with the target user on a service block chain according to the target transaction record; and the target service block is used for verifying the application authority of the target user aiming at the application client.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the data processing method in the embodiment corresponding to fig. 2, and may also perform the description of the data processing apparatus 1 in the embodiment corresponding to fig. 10, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores the aforementioned computer program executed by the data processing apparatus 1, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method in the embodiment corresponding to fig. 2 can be performed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer storage medium referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
By way of example, the program instructions described above may be executed on one computer device, or on multiple computer devices located at one site, or distributed across multiple sites and interconnected by a communication network, which may comprise a blockchain network.
The computer readable storage medium may be the data processing apparatus provided in any of the foregoing embodiments or an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, provided on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the computer device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the computer device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
A computer program product or computer program is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and executes the computer instruction, so that the computer device executes the description of the data processing method in the embodiment corresponding to fig. 2, which is described above, and therefore, the description thereof will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application.
The terms "first," "second," and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (15)

1. A method of data processing, the method comprising:
acquiring a target transaction record of a target user in an application client; the target transaction record is used for determining that the target user has the application authority of the application client within a target period;
performing consensus on the target transaction record in a service block chain;
if the target transaction records are identified, managing a target service block associated with the target user on the service block chain according to the target transaction records; the target service block is used for recording the valid period of the application authority aiming at the application client side, which is possessed by the target user;
the service block chain comprises service distribution nodes, the target service block exists in the service distribution nodes, the service distribution nodes are used for returning authority verification information aiming at the target user to the application client through the validity period recorded by the target service block when acquiring an authority verification request aiming at the target user and sent by the application client, and the application client is used for verifying the application authority aiming at the application client by the target user according to the authority verification information.
2. The method of claim 1, wherein managing the target service block associated with the target user on the service block chain according to the target transaction record comprises:
if the business block chain does not contain the historical business block associated with the target user, generating the target business block on the business block chain according to the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the target period.
3. The method of claim 1, wherein managing the target service block associated with the target user on the service block chain according to the target transaction record comprises:
if the service block chain comprises a historical service block associated with the target user, acquiring the valid period of the application authority, which is recorded by the historical service block and is provided by the target user, aiming at the application client;
generating the target service block on the service block chain according to the validity period recorded by the historical service block and the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the sum of the valid period recorded by the historical service block and the target period.
4. The method of claim 3, further comprising:
broadcasting block removal query information for the historical service blocks in the service block chain after the target service block is generated on the service block chain;
removing the historical traffic blocks from the traffic block chain when acknowledgement information for the block removal query information that was broadcast is obtained.
5. The method of claim 1, wherein managing the target service block associated with the target user on the service block chain according to the target transaction record comprises:
if the service block chain comprises a historical service block associated with the target user, updating the historical service block according to the target transaction record, and determining the updated historical service block as the target service block;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the sum of the valid period recorded by the historical service block before updating and the target period.
6. The method according to claim 1, wherein the target service block is used for recording the valid period of the application authority of the target user for the application client, and the target service block comprises the authority valid state of the application authority of the target user for the application client;
the method further comprises the following steps:
starting timing from the generation timestamp of the target service block based on the intelligent contract to obtain timing duration;
when detecting that the timing duration is equal to the duration indicated by the validity period recorded in the target service block based on the intelligent contract, updating the permission valid state in the target service block to a permission invalid state based on the intelligent contract.
7. The method of claim 6, wherein timing from the generation timestamp of the target service block based on the smart contract to obtain a timing duration comprises:
creating a contract running container at the time indicated by the generation timestamp of the target business block;
initializing the intelligent contract in the contract running container to obtain the initialized intelligent contract;
and starting timing based on the initialized intelligent contract to obtain the timing duration.
8. The method of claim 1, wherein the traffic block chain comprises a consensus node;
the consensus of the target transaction record in the service blockchain comprises:
acquiring N transaction records in a target time period; the N transaction records comprise the target transaction record, and N is a positive integer;
acquiring a transaction timestamp of each transaction record in the N transaction records;
sequencing the N transaction records according to the transaction timestamp of each transaction record to obtain the sequenced N transaction records;
broadcasting the sequenced N transaction records to the consensus node so that the consensus node performs consensus operation on the sequenced N transaction records.
9. The method of claim 8, wherein broadcasting the ordered N transaction records to the consensus node comprises:
generating transaction summary information according to the N sequenced transaction records;
broadcasting the transaction summary information and the N sequenced transaction records to the consensus node so that the consensus node generates verification summary information according to the N sequenced transaction records, and confirming that the N sequenced transaction records are commonly recognized when the verification summary information is the same as the transaction summary information.
10. The method of claim 1, wherein the service block chain is a service federation chain;
the obtaining of the target transaction record of the target user in the application client includes:
acquiring the target transaction record broadcasted by the service distribution node; the target transaction record is a transaction record sent by the application client to the service distribution node;
wherein the target transaction record contains the amount of transaction resources of the target user in the application client; the target transaction record is a transaction record broadcast by the service distribution node upon detecting that the transfer of transaction resources indicated by the application client for the amount of transaction resources was successful.
11. The method of claim 10, wherein the application client comprises a video client; the video client is used for generating an authority verification request when triggering video playing operation and sending the authority verification request to the service distribution node;
the service distribution node is used for acquiring the target service block from the service alliance chain according to the authority verification request; the service distribution node is used for generating authority verification information according to the obtained target service block and returning the authority verification information to the video client;
and the video client is used for executing the video playing operation when the target user is verified to have the application right aiming at the application client according to the right verification information.
12. A data processing apparatus, characterized in that the apparatus comprises:
the record acquisition module is used for acquiring a target transaction record of a target user in the application client; the target transaction record is used for determining that the target user has the application authority of the application client within a target period;
a consensus module for performing consensus on the target transaction record in a service block chain;
the management module is used for managing a target service block associated with the target user on the service block chain according to the target transaction record if the target transaction record is identified in common; the target service block is used for recording the valid period of the application authority aiming at the application client side, which is possessed by the target user;
the service block chain comprises service distribution nodes, the target service block exists in the service distribution nodes, the service distribution nodes are used for returning authority verification information aiming at the target user to the application client through the validity period recorded by the target service block when acquiring an authority verification request aiming at the target user and sent by the application client, and the application client is used for verifying the application authority aiming at the application client by the target user according to the authority verification information.
13. The apparatus of claim 12, wherein the management module is configured to:
if the business block chain does not contain the historical business block associated with the target user, generating the target business block on the business block chain according to the target transaction record;
the target service block is used for recording the valid period of the application authority of the target user aiming at the application client, and the valid period recorded by the target service block is equal to the target period.
14. A computer arrangement comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, causes the processor to carry out the steps of the method according to any one of claims 1-11.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program adapted to be loaded by a processor and to perform the method of any of claims 1-11.
CN202110416421.2A 2021-04-16 2021-04-16 Data processing method, data processing device, computer equipment and storage medium Active CN112818414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110416421.2A CN112818414B (en) 2021-04-16 2021-04-16 Data processing method, data processing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110416421.2A CN112818414B (en) 2021-04-16 2021-04-16 Data processing method, data processing device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112818414A CN112818414A (en) 2021-05-18
CN112818414B true CN112818414B (en) 2021-07-13

Family

ID=75863676

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110416421.2A Active CN112818414B (en) 2021-04-16 2021-04-16 Data processing method, data processing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112818414B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656499B (en) * 2021-08-16 2024-04-02 工银科技有限公司 Value transfer method and device based on block chain
CN115225716B (en) * 2022-07-15 2023-08-01 中国联合网络通信集团有限公司 Data processing method and device and electronic equipment
WO2024045053A1 (en) * 2022-08-31 2024-03-07 北京京东方技术开发有限公司 Resource distribution method and apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108053315A (en) * 2017-11-29 2018-05-18 广东中科南海岸车联网技术有限公司 Method of commerce and system based on block chain Internet of Things
CN108711052A (en) * 2018-05-18 2018-10-26 电子科技大学 A kind of information authentication system based on block chain
CN109886694A (en) * 2019-03-26 2019-06-14 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment based on block chain
CN111127205A (en) * 2019-12-23 2020-05-08 卓尔智联(武汉)研究院有限公司 Intelligent contract generation method and device, computer equipment and storage medium
CN111327669A (en) * 2019-10-30 2020-06-23 谢卓鹏 Decentralized block chain solution method

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106656974B (en) * 2016-10-17 2019-07-16 江苏通付盾科技有限公司 The grouping common recognition method and system of block chain
CN107273760A (en) * 2017-06-09 2017-10-20 济南浪潮高新科技投资发展有限公司 One kind is based on many CA application authentication methods of block chain
CN107360001B (en) * 2017-07-26 2021-12-14 创新先进技术有限公司 Digital certificate management method, device and system
CN111242678A (en) * 2020-01-07 2020-06-05 腾讯科技(深圳)有限公司 Data processing method, data processing device, computer equipment and storage medium
CN111882385A (en) * 2020-07-10 2020-11-03 浙江中新电力工程建设有限公司自动化分公司 Electric power market trading and evaluating method based on weak centralized alliance block chain
CN112200570A (en) * 2020-10-09 2021-01-08 支付宝(杭州)信息技术有限公司 Resource distribution method and device based on block chain and electronic equipment
CN112395110A (en) * 2020-11-20 2021-02-23 湖南智慧政务区块链科技有限公司 Block chain acceleration response method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108053315A (en) * 2017-11-29 2018-05-18 广东中科南海岸车联网技术有限公司 Method of commerce and system based on block chain Internet of Things
CN108711052A (en) * 2018-05-18 2018-10-26 电子科技大学 A kind of information authentication system based on block chain
CN109886694A (en) * 2019-03-26 2019-06-14 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment based on block chain
CN111327669A (en) * 2019-10-30 2020-06-23 谢卓鹏 Decentralized block chain solution method
CN111127205A (en) * 2019-12-23 2020-05-08 卓尔智联(武汉)研究院有限公司 Intelligent contract generation method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
面向区块链数据隐私保护的可搜索加密研究;赵锦波;《中国优秀硕士学位论文全文数据库 信息科技辑》;20200215;第I138-119页 *

Also Published As

Publication number Publication date
CN112818414A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
CN112818414B (en) Data processing method, data processing device, computer equipment and storage medium
CN111444210B (en) Block chain consensus node management method, device, equipment and storage medium
CN112600841B (en) Credit record sharing method and device based on block chain and electronic equipment
CN113032490B (en) Contract data processing method, related equipment and medium
CN108764870B (en) Transaction processing method and device based on block chain and electronic equipment
CN109819443B (en) Registration authentication method, device and system based on block chain
CN111445333B (en) Block generation method, device, computer equipment and storage medium
CN109150943B (en) Information transmission method, device and system
CN110443075B (en) Method and device for verifying and deploying block chain intelligent contracts
CN111291060B (en) Method, device and computer readable medium for managing blockchain nodes
CN107392618B (en) Method and equipment for implanting intelligent contract
US20180183687A1 (en) System and Method for Managing Services and Licenses Using a Blockchain Network
KR20180115727A (en) Block Chain Implementation Counting System and Method for Use in Security Voting and Distribution
US20190354968A1 (en) Utilization Management Method, Utilization Management System, and Node
CN110602125B (en) Data processing method, device, terminal and storage medium
CN111884807B (en) Article reservation method, apparatus, device and medium based on block chain
CN112596754B (en) Block chain intelligent contract deployment method and device
CN108961055B (en) Block consensus award and punishment method, device, equipment and storage medium
CN100527144C (en) Method and device for accurate charging in digital copyright management
CN111209338A (en) Advertisement frequency control method and device, electronic equipment and storage medium
CN107682376B (en) Wind control data interaction method and device
CN110738783A (en) System, method, device, equipment and readable storage medium for updating voting data
CN113656209A (en) Resource processing method, device, equipment and storage medium
Tran et al. Machine‐as‐a‐Service: Blockchain‐based management and maintenance of industrial appliances
CN111369277A (en) Advertisement data processing method, device and equipment based on block chain and readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40044190

Country of ref document: HK