CN115250354A - Resource allocation method, device, equipment and storage medium based on block chain network - Google Patents

Resource allocation method, device, equipment and storage medium based on block chain network Download PDF

Info

Publication number
CN115250354A
CN115250354A CN202110463310.7A CN202110463310A CN115250354A CN 115250354 A CN115250354 A CN 115250354A CN 202110463310 A CN202110463310 A CN 202110463310A CN 115250354 A CN115250354 A CN 115250354A
Authority
CN
China
Prior art keywords
internet video
resource
video application
transfer record
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110463310.7A
Other languages
Chinese (zh)
Inventor
艾立超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110463310.7A priority Critical patent/CN115250354A/en
Publication of CN115250354A publication Critical patent/CN115250354A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2181Source of audio or video content, e.g. local disk arrays comprising remotely distributed storage units, e.g. when movies are replicated over a plurality of video servers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • 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
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0251Targeted advertisements
    • G06Q30/0269Targeted advertisements based on user profile or attribute
    • G06Q30/0271Personalized advertisement
    • 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
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0241Advertisements
    • G06Q30/0277Online advertisement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/258Client or end-user data management, e.g. managing client capabilities, user preferences or demographics, processing of multiple end-users preferences to derive collaborative data
    • H04N21/25866Management of end-user data
    • H04N21/25875Management of end-user data involving end-user authentication

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Game Theory and Decision Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Graphics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention discloses a resource allocation method, a device, equipment and a storage medium based on a block chain network, wherein the method comprises the following steps: acquiring a resource transfer record, wherein the resource transfer record is used for indicating that internet video services matched with the target quantity of electronic resources are acquired in an internet video application program, and the internet video services are provided by a plurality of nodes in a matched mode; broadcasting the resource transfer record in the blockchain network to indicate the nodes in the blockchain network to perform consensus verification on the resource transfer record; if the consensus on the resource transfer record is verified and a new block including the resource transfer record is generated, a resource allocation policy is determined from the Internet video service and a target amount of electronic resources is triggered to be allocated among the plurality of nodes according to the resource allocation policy. The embodiment of the invention realizes resource allocation in the block chain network and ensures the safety and the accuracy of the resource allocation.

Description

Resource allocation method, device, equipment and storage medium based on block chain network
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a storage medium for resource allocation based on a blockchain network.
Background
Currently, domestic OTT video (OTT video is a method for transmitting video content through the internet, and may also be referred to as internet video in the following description) needs to be supervised by a radio and television bureau and a license plate party (may be referred to as a content supervisor of an internet video application in the following description) due to its special radio and television properties, and the license plate party mainly supervises and manages video content as well as goes on and off a line. Therefore, both the payment of the user in the OTT video application and the payment of the advertiser in the OTT video require settlement between the OTT video application provider and the licensor. In addition, for OTT video applications pre-installed in a offline carrier (such as internet television), OTT video application providers also need to settle revenue in OTT video applications with the carrier provider. Therefore, there is a need for OTT video applications and OTT video application providers to allocate resources to both the licensor and the carrier provider.
In view of the complex settlement system of the OTT terminal, the conventional resource allocation scheme generally records and settles all income from the background of the OTT video application provider, and then allocates the cost to the license plate party and the television manufacturer according to the pre-signed resource allocation contract. Under the resource allocation mode, all transaction records are recorded in the background of the OTT video application provider, and benefits of all parties can be damaged once the background is attacked or the income resource quantity recorded in the background is tampered. Therefore, in the field of OTT video applications, how to accurately allocate resources becomes one of the hot issues of research.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for resource allocation based on a block link network, which perform resource allocation in the block link network, ensure non-tamper-ability of resources, and improve accuracy of resource allocation.
In one aspect, an embodiment of the present invention provides a resource allocation method based on a block chain network, including:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that an internet video service matched with a target number of electronic resources is acquired in an internet video application program, and the internet video service is provided by the plurality of nodes in a mutual cooperation manner;
broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record;
and if the consensus verification of the resource transfer records passes, determining a resource allocation strategy according to the Internet video service, and triggering the electronic resources with the target quantity to be allocated among the nodes according to the resource allocation strategy.
In one aspect, an embodiment of the present invention provides a resource allocation apparatus based on a block chain network, where the resource allocation apparatus operates with the following units:
an obtaining unit, configured to obtain a resource transfer record, where the resource transfer record includes a target number of electronic resources, and the resource transfer record is used to instruct an internet video service matched with the target number of electronic resources to be obtained in an internet video application, where the internet video service is provided by the plurality of nodes in cooperation with each other;
a broadcasting unit, configured to broadcast the resource transfer record in the blockchain network to indicate a node in the blockchain network to perform consensus verification on the resource transfer record;
a determining unit, configured to determine a resource allocation policy according to an internet video service if the consensus verification on the resource transfer record passes;
and the processing unit is used for triggering the electronic resources with the target quantity to be distributed among the nodes according to the resource distribution strategy.
In one aspect, an embodiment of the present invention provides a resource allocation device based on a block chain network, where the device is characterized in that the device includes: a processor adapted to implement one or more computer programs; and a computer storage medium storing one or more computer programs adapted to be loaded by the processor and to perform:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that an internet video service matched with a target number of electronic resources is acquired in an internet video application program, and the internet video service is provided by the plurality of nodes in a mutual cooperation manner; broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record; if the consensus on the resource transfer record passes the verification, determining a resource allocation strategy according to the Internet video service; and triggering the target amount of electronic resources to be distributed among the plurality of nodes according to the resource distribution strategy.
In one aspect, an embodiment of the present invention provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the computer program is configured to perform the following steps:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that an internet video service matched with a target number of electronic resources is acquired in an internet video application program, and the internet video service is provided by the plurality of nodes in a mutual cooperation manner; broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record; and if the consensus verification of the resource transfer record passes, determining a resource allocation strategy according to the Internet video service, and triggering the target amount of electronic resources to be allocated among the plurality of nodes according to the resource allocation strategy.
In one aspect, an embodiment of the present invention provides a computer program product or a computer program, where the computer program product includes a computer program, and the computer program is stored in a computer storage medium; a processor of the resource allocation device reads the computer program from the computer storage medium, the processor executing the computer program to cause the resource allocation device to perform:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are acquired in an internet video application program, and the internet video services are provided by the plurality of nodes in a matched mode; broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record; and if the consensus verification of the resource transfer record passes, determining a resource allocation strategy according to the Internet video service, and triggering the target amount of electronic resources to be allocated among the plurality of nodes according to the resource allocation strategy.
In the embodiment of the invention, a resource transfer record is obtained, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are obtained in an internet video application program, and the internet video services are provided by mutually matching a plurality of nodes in a block chain network; further, the resource transfer record is broadcasted in the block chain network to indicate the nodes in the block chain network to perform consensus verification on the resource transfer record; and if the consensus verification on the resource transfer record passes, determining a resource allocation strategy according to the Internet video service, and triggering the allocation of a target amount of electronic resources among a plurality of nodes according to the resource allocation strategy. In the resource allocation process, a plurality of nodes providing services for the internet video application are integrated in the block chain network, and when resource allocation is needed, the resource allocation is performed in the block chain network, so that the safety and the accuracy of the resource allocation are ensured in view of the non-tamper property of the block chain network.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a schematic diagram of resource settlement in an internet video application according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a blockchain network according to an embodiment of the present invention;
FIG. 3 is a block-chain network node-to-node connection scheme according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a block chain according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a method for generating Merckel roots in a block chain according to an embodiment of the present invention;
fig. 6 is a flowchart illustrating a resource allocation method based on a blockchain network according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating another resource allocation method based on a blockchain network according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a resource allocation apparatus based on a block chain network according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a node device according to an embodiment of the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The current blockchain technology is introduced to research of distributed data secure storage as a technology with great attention, and a blockchain is a chained data structure formed by generating blocks from data according to a time sequence and combining the blocks in a sequential connection manner, and a distributed account book with data being not falsifiable and not being counterfeitable is ensured by using a cryptographic manner. The blockchain technique utilizes an encrypted chained blockstructure to verify and store data, and utilizes a distributed node consensus algorithm to generate and update data.
As can be seen from the foregoing, settlement in the current internet video application field is relatively complex, and involves multiple providers, where it is assumed that the internet video refers to OTT video, and the OTT video is installed in a television terminal, in order to obtain internet video service in the OTT video, a license plate party (which is created to enable content of the internet video to be better controlled, in other words, the license plate party is mainly used for auditing content of the internet video) may be required, and when an electronic resource (which may be paid by a user or paid by an advertisement provider) is generated in the OTT video in order to obtain a certain internet video service in the OTT video, settlement of the electronic resource involves among the license plate party, the television manufacturer, and the OTT provider, as shown in fig. 1.
Based on the above advantages of the blockchain technology and the current complex settlement situation in the field of internet video applications, embodiments of the present invention provide a resource allocation scheme based on a blockchain network, in which multiple providers related to providing internet video services are integrated as nodes in the blockchain network, and when an internet video service is obtained in an internet video application program, a target amount of electronic resources paid by the internet video service are allocated among the multiple nodes, thereby improving reliability and accuracy of resource allocation.
Before describing the resource allocation scheme of the embodiment of the present invention in detail, a block chain and related concepts in the block chain are briefly introduced. The blockchains can be classified into public chains, private chains, and alliance chains according to the participants. The public chain is a block chain which can be read by anyone all over the world, can send a transaction, can effectively confirm the transaction and can be used for participating in a consensus verification process by anyone; the private chain refers to a block chain with writing authority only in one organization, and the reading authority is open to the outside or limited to any degree; a federation chain refers to a blockchain in which a plurality of enterprises participate in management together, each enterprise runs one or more nodes, data in the federation chain only allows different enterprises in the chain to read, write and send transactions, and a plurality of enterprises in the federation chain record transaction data together.
As can be seen from the foregoing, the internet video application can provide the internet video service to the user by using the cooperation of the internet video application provider, the internet video application carrier provider, and the content manager of the internet video application. Therefore, in order to safely and accurately allocate the income of the internet video application program among the three parties in the blockchain network, the embodiment of the present invention provides a blockchain network of a federation chain, in which nodes corresponding to the three parties are integrated, and a schematic structural diagram of the blockchain network provided in the embodiment of the present invention is shown in fig. 2.
At least one node 101 corresponding to an internet video application provider (also referred to as APP provider) may be included in the blockchain network shown in fig. 2, such as an internet video application provider 1 node and an internet video application provider 2 node. Different internet video application providers are used to provide different internet video applications, such as an internet video application provider 1 for providing an internet video application 1 and an internet video application provider 2 for providing an internet video application 2. It should be noted that, in order to ensure the security and privacy of resource allocation, there may be a cooperative relationship between the internet video application providers in the federation chain shown in fig. 2, or multiple internet video providers may be negotiated with each other and then connected to the federation chain.
Optionally, the blockchain network shown in fig. 2 may further include at least one node 102 corresponding to a content manager (also referred to as a licence) of the internet video application, such as a content manager 1 node and a content manager 2 node. The node 102 corresponding to the content monitor may be a background management device of the content monitor, and different content monitors are used for monitoring contents in different internet video applications, for example, the contents in the internet video application 1 and the internet video application 2 may both be monitored by the content monitor 1, or the content in the internet video application 1 is monitored by the content monitor 1, and the content in the internet video application 2 is monitored by the content monitor 2.
In one embodiment, the blockchain network shown in fig. 2 may further include at least one node 103 corresponding to an internet video application carrier provider (e.g., a television vendor, a cell phone vendor, or a tablet vendor, etc.), such as an internet video application carrier provider 1 node and an internet video application carrier provider 2 node. The node corresponding to the internet video application provider can be a background management device of the internet video application provider. The internet video application carrier is used for installing and running an internet video application, the carrier can comprise any terminal equipment capable of playing videos, such as a mobile phone, a notebook computer, a smart car, a television and the like, and the provider of the internet video application carrier refers to a manufacturer producing the carrier, such as a television manufacturer, a mobile phone manufacturer and the like. The nodes included in fig. 2 described above are only an implementation manner provided by the embodiment of the present invention, and in practical applications, other nodes included in the blockchain network may also be set, such as a node corresponding to an advertisement provider, a node corresponding to a manager (e.g., a radio and television central office) that manages internet videos, and the like.
Optionally, the node 101 corresponding to the internet video application provider may be a background management device of the internet video application provider, the node 102 corresponding to the content manager of the internet video application may be a background management device corresponding to the content manager of the internet video application, and the node 103 corresponding to the internet video application carrier provider may be a background management device corresponding to the internet video application carrier provider; each background management device may be a terminal or a server. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart sound box, a smart watch and the like; the server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, big data and artificial intelligence platform.
In one embodiment, each node may receive a resource transfer record during normal operation, where the resource transfer record includes a target number of electronic resources, and the resource transfer record is used to indicate that an internet video service corresponding to the target number of electronic resources has been obtained in an internet video application, such as opening membership rights, placing advertisements, and the like; and maintaining shared data within the blockchain network based on the received resource transfer records. In order to ensure information intercommunication in the blockchain network, information connection can exist between each node in the blockchain network, and information transmission can be carried out between the nodes through the information connection. A schematic diagram of the communication between the nodes is shown in fig. 3. For example, when any node in the blockchain network receives the resource transfer record, other nodes in the blockchain network acquire the resource transfer record according to the consensus algorithm, and store the resource transfer record as data in the shared data, so that the data stored by all nodes in the blockchain network are consistent.
Each node in the block chain network has a corresponding node identifier, and each node in the block chain network can store the node identifiers of other nodes in the block chain network, so that information connection can be established subsequently according to the node identifiers of other nodes, and the generated block can be broadcast to other nodes in the block chain network. Each node may maintain a node identifier list as shown in table 1 below, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol ) address or any other information that can be used to uniquely identify the node, and table 1 only illustrates an IP address as an example.
TABLE 1
Node name Node identification
Node 1 117.114.151.174
Node 2 117.116.189.145
Node N xx.xx.xx.xx
In order to implement non-tamper-proof property of data, a chain structure is introduced in a block link network in units of blocks, in other words, each node in the block link network stores one same block chain, which is shown in fig. 4 and is a schematic structural diagram of a block chain provided in an embodiment of the present invention. The block chain is composed of a plurality of blocks, and the plurality of blocks comprise an initial block and a non-initial block. Each block consists of a block head and a block main body, for an initial block, the block head comprises a random number, a difficulty target, a timestamp, a version number, a Merkle Root (Merkle Root), a summary of resource transfer records and the like, and the block main body stores a plurality of resource transfer records stored in the current block; the next block of the starting block uses the starting block as a parent block, the next block also includes a block header and a block body, and the block header stores a block hash (PreBlockHash), a random number (Nonce), a version number, a difficulty target, a timestamp, a Merkle Root (Merkle Root), and a digest of a resource transfer record of the parent block. The block body stores therein a plurality of resource transfer records that occurred since the previous block. And by analogy, the block data stored in each block in the block chain is associated with the block data stored in the parent block, so that the safety of the data in the blocks is ensured.
In one embodiment, the data structure of each block header may be represented by the following code:
struct MyBlockHeader
{
string blockVersion; // version number
string previous blockhash; // parent Block Hash value
string MerkleRootNode; // Merck Tree root node
string timing; // time stamp
int difficult; // difficulty target
int nonce; // random number
string data; v/check data, including summary information of resource transfer records
};
In one embodiment, each data stored in one block header and the occupied size of each data can be seen from table 2 below.
TABLE 2
Field(s) Description of the invention Size and breadth
Version number Version of block chains 4 bytes
Block hashing of parent blocks Hash value of previous block 32 bytes
Root of mercker The Merkel root calculated by all nodes in the block 32 bytes
Time stamp Approximate time of the block generation 4 bytes
Difficulty target Generating a difficulty target for the block 4 bytes
Random number Integer for making block header hash value less than difficulty target 4 bytes
Abstract of resource transfer records Abstract information calculated based on authentication result 16 bytes
Optionally, the Merkle Root (Merkle Root) stored in each chunk header is obtained by performing a hash operation on a plurality of resource transfer records stored in the corresponding chunk body. Referring to fig. 5, for a schematic diagram of determining the mercker root in the block header according to an embodiment of the present invention, it is assumed in fig. 5 that four resource transfer records, respectively denoted as Tx1, tx2, tx3, and Tx4, are stored in the second block body; performing Hash operation on Tx1, tx2, tx3 and Tx4 respectively to obtain Hash1, hash2, hash3 and Hash4; and then carrying out Hash operation on the Hash1 and the Hash2 to obtain Hash12, carrying out Hash operation on the Hash3 and the Hash4 to obtain Hash34, and further carrying out Hash operation on the Hash12 and the Hash34 to obtain the Mercker Root Merkle Root. Since the block head stores the merkel root, whether the resource transfer records stored in the block head and the block main body are tampered or not can be verified through the merkel root, and since the block head also comprises the parent block hash, whether all blocks before the current block and before the created block are tampered or not can also be verified through the parent block hash, all block rings are buckled, and when any block is tampered, chain change of all block hashes can be caused, and due to the characteristic, data in a block chain is difficult to tamper, so that the safety of the data in the block chain can be ensured.
Each block in the block chain network needs to pass the consensus verification before being added to the block chain. Common consensus algorithms in current block-chain networks may include Proof of Work (PoW) algorithms and Practical Byzantine Fault Tolerance (PBFT) algorithms. The PoW consensus algorithm mainly guarantees the consistency and the safety of block chain data in the whole network by means of computing power competition among distributed nodes, the PoW algorithm requires that each node solves the SHA256 computation problem which is complex to solve but easy to verify based on self computing power, a proper random number is searched to enable the SHA256 hash value of the data in a block head to be smaller than the set value of the difficulty target in the block head, and the process can be represented by a formula (1):
H(n|h)≤t (1)
in formula (1), H represents an SHA256 hash function, n is a random number, H is data in a block header and mainly comprises contents such as a parent block hash value, a merkel root and the like, t is a difficulty target, and the smaller the t value, the more difficult n is to find. In the PoW algorithm, which node first finds the random number that makes equation (1) hold, the node obtains the accounting weight of the new block, i.e. the new block generated by the node will be connected to the block chain. The consensus mechanism fuses economic incentive and the consensus process, prompts more nodes to participate in ore excavation and keeps integrity, and thus actively enhances the reliability and safety of the network. However, the PoW consensus mechanism essentially trades performance for consistency and security of data, so the performance of the blockchain platform of the PoW consensus mechanism is relatively low.
The PBFT consensus algorithm avoids the consumption of a large amount of computing resources and electric power energy caused by competitiveness competition in PoW. In the PBFT consensus algorithm, a unique main node is selected from the whole network, and a new block is generated by the main node. In a specific implementation, the PBFT consensus algorithm mainly includes a pre-preparation stage, a preparation stage, and a confirmation stage. The following introduces an approximate flow of the PBFT consensus algorithm, taking data to be stored in the block chain network as a resource transfer record as an example: when a resource transfer record in an Internet video application program is received, entering a pre-preparation stage, and in the pre-preparation stage, receiving the resource transfer record by a node in a block chain network and broadcasting the resource transfer record; after receiving the broadcasted resource transfer record, the main node adds a serial number to the resource transfer record and broadcasts the resource transfer record; verifying the numbered resource transfer records by other nodes in the block chain network, wherein the verification can be understood as judging whether the node receives the numbered resource transfer records, and after confirming the numbered resource transfer records, a certain node enters a preparation stage and informs other nodes that the node enters the preparation stage; after entering the preparation stage, waiting for whether other nodes in the block chain network enter the preparation stage, if receiving a notification that a preset number of other nodes enter the preparation stage, the node enters the confirmation stage, and notifying the other nodes that the node enters the confirmation stage; after entering the confirmation stage, if receiving a notice that a preset number of other nodes enter the confirmation state, indicating that the consensus verification is completed; the master node generates a new chunk according to the above consensus process and adds the new chunk to the chunk chain.
Because the PBFT consensus algorithm avoids the consumption of a large amount of computing resources and power energy caused by competitiveness competition in PoW, the PBFT can be used as the consensus algorithm in the block chain network in the embodiment of the invention.
The resource allocation scheme provided by the embodiment of the invention can be applied to the blockchain network, and the resource allocation scheme can be executed by any node in the blockchain network, and also can be executed by a designated node in the blockchain network, for example, when the blockchain network is constructed, the designated resource allocation scheme is executed by a node corresponding to an internet video application program provider in the blockchain network. In practical applications, the node for executing the resource allocation scheme may be arbitrarily set according to product requirements, and in the following statements, the embodiment of the present invention takes the example of executing the resource allocation scheme by any node in the block chain network. In a specific implementation, any node in a blockchain network acquires a resource transfer record, wherein the resource transfer record comprises a target number of electronic resources, and the resource transfer record is used for indicating that an internet video service matched with the target number of electronic resources is acquired in an internet video application program; further, broadcasting the resource transfer record in the blockchain network to indicate the nodes in the blockchain network to perform consensus verification on the resource transfer record; if the verification passes, a target number of electronic resources are allocated among the plurality of nodes of the blockchain network.
It should be understood that the blockchain network provided in the embodiment of the present invention is a federation chain, and the node that receives the resource transfer record may be a node corresponding to an internet video application provider in the federation chain, or may be any other node; the node that receives the resource transfer record may or may not be the primary node selected in the blockchain network. In the resource allocation scheme based on the block link network provided by the embodiment of the invention, a plurality of nodes providing service for the Internet video application are integrated in the block link network, and when resource allocation is required, resource allocation is performed in the block link network.
Based on the above block chain network and the resource allocation scheme, an embodiment of the present invention provides a resource allocation method based on a block chain network, and refer to fig. 6, which is a flowchart illustrating the resource allocation method provided in the embodiment of the present invention. The blockchain network comprises a plurality of nodes, wherein the plurality of nodes comprise nodes corresponding to the internet video application program carrier provider, nodes corresponding to the content supervisor of the internet video application program and nodes corresponding to the internet video application program provider. The resource allocation method shown in fig. 6 may be performed by any node in the blockchain network, and the resource allocation method shown in fig. 6 may include the following steps:
step S601, acquiring a resource transfer record.
In one embodiment, the resource transfer record may include a target amount of electronic resources, and the resource transfer record is used to indicate that the internet video service matching the target amount of electronic resources is obtained in the internet video application, and in brief, the resource transfer record is used to indicate that the user has paid for the target amount of electronic resources in order to obtain the internet video service in the internet video application. The internet video service may include any one or more of the following: obtaining membership rights in an internet video application such as opening a member, placing advertisements in an internet video application, and obtaining viewing rights for targeted internet video content in an internet video application such as paying a purchase of a movie or television show in an internet video application, and the like.
For example, the internet video service refers to putting advertisements in an internet video application, and the internet video service involves running the internet video application and putting the advertisements in the internet video application, so that the running of the internet video application first needs to have a problem of the internet video application, namely who needs to be clearly run, and an internet video application provider is needed; in addition, the next clear problem in running internet video applications is where to run, where an internet video application carrier provider is needed; third, the advertising in the internet video application relates to what content is run in the internet video application, and it can be known from the foregoing system part embodiment that what content is run in the internet video application is responsible for a content manager of the internet video application. In summary, the internet video service of delivering the advertisement in the internet video application is provided by the internet video application provider, the internet video application carrier provider, and the content manager of the internet video application in cooperation with each other. And because the plurality of nodes in the blockchain network refer to the nodes corresponding to the three parties, it can be understood that the internet video service is completed by the cooperation of the plurality of nodes in the blockchain network.
Step S602, broadcasting the resource transfer record in the blockchain network to indicate the node in the blockchain network to perform consensus verification on the resource transfer record.
In an embodiment, after the node in the block chain network obtains the resource transfer record, the resource transfer record may be stored in the block chain to ensure that the resource transfer record is not tampered, so as to ensure fairness and reliability of the subsequent division when the target number of electronic resources in the resource transfer record are divided. Alternatively, as described in the foregoing system part embodiment, in order to store the resource transfer record in the blockchain, the resource transfer record is first subjected to consensus verification, and the resource transfer record after passing the consensus verification may be packed into a new block to be recorded on the blockchain.
In order to perform consensus verification on the resource transfer record, after any node in the blockchain network acquires the resource transfer record, the resource transfer record needs to be broadcasted in the blockchain network. Optionally, as can be seen from the foregoing description of the system embodiment, the blockchain network of the present invention is constructed based on a federation chain, and before performing consensus verification in the federation chain, a master node adds a number to a resource transfer record.
Therefore, if any node in the blockchain network is a non-master node, broadcasting the resource transfer record in the blockchain network in step S602 to indicate that the node in the blockchain network performs consensus verification on the resource transfer record may include: broadcasting the resource transfer record in the block chain network, adding a number to the resource transfer record after the main node receives the broadcasted resource transfer record, and broadcasting the resource transfer record with the added number to other nodes in the block chain network; receiving the resource transfer record added with the number by other nodes and entering a preparation stage and a confirmation stage in sequence; when a preset number of nodes enter the confirmation stage, the common identification verification of the resource transfer record is passed, and the main node can generate a block comprising the resource transfer record and add the block to the block chain; if any node in the block chain network is a master node, adding a number to the resource transfer record before broadcasting the resource transfer record in step S602; the subsequent consensus verification process is the same as the above description and is not repeated herein.
Step S603, if the consensus verification of the resource transfer record is passed, determining a resource allocation strategy according to the Internet video service, and allocating the target amount of electronic resources among a plurality of nodes according to the resource allocation strategy.
In one embodiment, after the resource transfer record is verified in the blockchain network, it indicates that the resource transfer record can be recorded on the blockchain, and the data recorded on the blockchain is not falsifiable, that is, once the resource transfer record is recorded on the blockchain, the target amount of electronic resources contained in the resource transfer record is not modified, thereby ensuring the authenticity of the resource transfer record.
Since internet video services are performed by multiple nodes cooperating with each other, the target number of electronic resources involved in the resource transfer record can be divided among the multiple nodes of the blockchain network after consensus verification. For different internet video services, the contribution made by each of the plurality of nodes may be different, for example, for the internet video service of obtaining membership rights, the contribution made by the internet video application provider and the internet video application carrier provider may be larger than the content manager of the internet video application; further, for example, for an internet video service of delivering an advertisement in an internet video application, a content manager and an internet video application provider of the internet video application may contribute more than an internet video application carrier provider.
Based on the method, when resource allocation is carried out, different resource allocation strategies can be made according to different internet video services so as to realize resource allocation according to contribution, and fairness of resource allocation is ensured. In a specific implementation, determining a resource allocation policy according to an internet video service may include: if the Internet video service means that member authority is obtained in the Internet video application program, or the Internet video service means that viewing authority for target Internet video content in the Internet video application program is obtained, the resource allocation strategy is a first allocation strategy; if the internet video service refers to the advertisement put in the internet video application program, the resource allocation strategy is a second allocation strategy;
the first allocation strategy specifies that the internet video application program provider, the internet video application program carrier provider and the content monitoring party of the internet video application program sequentially divide the electronic resources with the target quantity in the descending order of the dividing proportion: the system comprises an Internet video application program provider, an Internet video application program carrier provider and a content monitoring party of the Internet video application program; the second allocation strategy specifies that the dividing proportion is in turn from large to small as follows: the system comprises an internet video application program provider, a content monitoring party of the internet video application program and an internet video application program carrier provider.
For example, suppose that in an advertisement delivery service, if an advertisement is viewed by a user a single time, the advertisement provider needs to pay 1 yuan for the electronic resource; then it can be assumed that the ratio among the internet video application provider, the content manager of the internet video application, and the internet video application carrier provider in the second distribution policy is 6. Assuming that in the step of enabling the membership authority service by the user, the user pays 10 yuan to enable membership authority in the internet video application, and assuming that the proportion of the internet video application provider, the internet video application carrier provider and the content supervisor of the internet video application in the first distribution strategy is 5.
It should be understood that the first allocation policy and the second allocation policy are only two possible resource allocation policies listed in the embodiment of the present invention, and in practical applications, resource allocation policies meeting product characteristics may be made according to different products and different requirements, which is not limited in the embodiment of the present invention.
In one embodiment, if the resource transfer record is generated outside the blockchain network, the resource storage account to be allocated is also outside the blockchain network, but the resource allocation is performed in the blockchain network, in order to ensure that the resource allocation is successfully completed, it is required to ensure that the amount of the remaining electronic resource in the account on the third chain corresponding to the resource storage account to be allocated in the blockchain network is greater than the target amount. Therefore, in step S703, it is determined whether the amount of remaining electronic resources in the account on the third chain is greater than the target amount; and if the number of the residual electronic resources in the account on the third chain is larger than the target number, triggering to acquire the electronic resources of the target number from the account on the third chain, and distributing the electronic resources of the target number among a plurality of nodes.
In one embodiment, the target amount of electronic resources to be allocated in step S603 may be acquired together with the resource transfer record and stored in the block chain. When resource allocation is needed, the target amount of electronic resources can be acquired from the blockchain, and then the electronic resources due to each node are stored in the blockchain account corresponding to each node. Optionally, the storing of the target amount of the electronic resources in the blockchain may refer to pre-creating a resource storage account to be allocated in the blockchain network, and after the resource transfer record is obtained, extracting the target amount of the electronic resources included in the resource transfer record and storing the target amount of the electronic resources in the resource storage account to be allocated.
In the embodiment of the invention, a resource transfer record is obtained, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are obtained in an internet video application program, and the internet video services are provided by mutually matching a plurality of nodes in a block chain network; further, the resource transfer record is broadcasted in the blockchain network to indicate the nodes in the blockchain network to perform consensus verification on the resource transfer record; if the consensus on the resource transfer record is validated, then a target amount of electronic resources is triggered to be allocated among the plurality of nodes. In the resource allocation process, a plurality of nodes providing services for the internet video application are integrated in the block chain network, and when resource allocation is needed, the resource allocation is performed in the block chain network, so that the safety and the accuracy of the resource allocation are ensured in view of the non-tamper property of the block chain network. In addition, when different internet video services are provided, the contribution of the plurality of nodes is different, when the target number of electronic resources are distributed among the plurality of nodes, a resource distribution strategy is determined according to the internet video services, the resource distribution strategy specifies the division ratio among the plurality of nodes, the target number of electronic resources are distributed among the plurality of nodes according to the resource distribution strategy, the resource distribution according to the contribution is realized, and the fairness of resource distribution is ensured.
Based on the foregoing resource allocation method, an embodiment of the present invention provides another resource allocation method based on a blockchain network, and referring to fig. 7, a flowchart of the another resource allocation method based on a blockchain network provided in the embodiment of the present invention is shown. The blockchain network comprises a plurality of nodes, wherein the plurality of nodes comprise nodes corresponding to the provider of the internet video application program carrier, nodes corresponding to the content supervisor of the internet video application program and nodes corresponding to the provider of the internet video application program. The resource allocation method shown in fig. 7 may include the following steps:
and step S701, acquiring a resource transfer record.
As can be seen from the foregoing embodiments, the resource transfer record is used to indicate that an internet video service matching the target number of electronic resources is obtained in the internet video application. The target amount of electronic resources may be directly carried in the resource transfer record, or the target amount of electronic resources may be stored in a certain resource storage account. Optionally, the resource transfer record may record a target amount of electronic resource transfer, for example, the target amount of electronic resource is recorded in the resource transfer record and transferred from the account a to the account B. The electronic resource transfer recorded in the resource transfer records is different from the internet video services. In specific implementation, if the internet video service refers to obtaining member rights in an internet video application program, or the internet video service refers to obtaining viewing rights for target internet video content in the internet video application program, the electronic resources with target quantity recorded in the resource transfer records are transferred from a user resource storage account corresponding to an internet video application program carrier user to a resource storage account to be allocated; if the internet video service refers to the placement of advertisements in the internet video application program, the target quantity of electronic resources is recorded in the resource transfer record, and the electronic resources are transferred from the advertiser resource storage account of the advertisement provider to the resource storage account to be allocated, and the advertisement provider is used for placing advertisements in the internet video application program.
The resource storage account to be allocated is any one of the following: the resource storage account is obtained by negotiation of an internet video application program carrier provider, an internet video application program provider and a content supervisor of the internet video application program. In short, the electronic resources of the target quantity corresponding to the resource transfer record can be stored in the resource storage account corresponding to the internet video application provider in advance, and when resource allocation is needed, the electronic resources of the target quantity are taken out from the resource storage account corresponding to the internet video application provider for allocation; or, the target amount of electronic resources corresponding to the resource transfer record may be pre-stored in a resource storage account negotiated by multiple parties, and the negotiated resource storage account may be any one of the resource storage accounts or may be an account other than the resource storage accounts, for example, a resource storage account created by a common signature of the multiple parties.
Optionally, the blockchain network may further include an advertisement provider node in addition to the plurality of nodes, and in step S701, the resource transfer record may be generated outside the blockchain network or inside the blockchain network. In a specific implementation, if the resource transfer record is generated outside the blockchain network, the user resource storage account, the advertiser resource storage account, and the to-be-allocated resource storage account are all accounts outside the blockchain network, and since resource allocation is performed in the blockchain network, allocated resources need to be stored in the accounts in the blockchain network, and therefore if the resource transfer record is executed outside the blockchain network, a first linked account corresponding to the internet video application program carrier user, a second linked account corresponding to the advertisement provider, and a third linked account corresponding to the to-be-allocated resource storage account need to be present in the blockchain network; if the resource transfer record is generated in the blockchain network, the user resource storage account, the advertiser resource storage account and the resource storage account to be allocated are all accounts in the blockchain network.
Briefly, a user or an advertisement provider may not pay a target amount of electronic resources in an internet video application over a blockchain network to obtain internet video services, such as bank transfers, platform transfers, face-to-face payments, or the like; the user or the advertisement provider may also implement an operation of paying the target amount of the electronic resources through the blockchain network, for example, the user or the advertisement provider submits a resource transfer request to the blockchain network, each node in the blockchain network performs consensus verification on the resource transfer request, and executes the resource transfer operation after the verification is passed and generates a resource transfer record.
Step S702, broadcasting the resource transfer record in the blockchain network to indicate the node in the blockchain network to perform consensus verification on the resource transfer record.
And step S703, if the consensus on the resource transfer record passes the verification, determining a resource allocation strategy according to the Internet video service.
In an embodiment, some possible implementations included in steps S702 to S703 may refer to the related descriptions of step S602 and step S603 in fig. 6, and are not described herein again.
And step S704, triggering and executing an intelligent contract matched with the resource allocation, and allocating the electronic resources of the target quantity among the plurality of nodes according to the resource allocation strategy through the intelligent contract.
It will be appreciated that the automatic completion of resource allocation by intelligent contracts avoids the complexities of manual accounting in conventional resource allocation and reduces the probability of allocation errors. An intelligent contract is a digital agreement where algorithms and programs compile contract terms, which are deployed on a blockchain and can be automatically executed according to rules. The intelligent contract is a commercial contract written in a programming language, and can automatically enforce contract terms to achieve the goal of 'code or law' when a preset condition is met. The decentralized process of the block chain enables the intelligent contract to simultaneously run on all nodes of the whole network under the condition that no central manager participates in the intelligent contract, and any organization and person cannot forcibly stop the intelligent contract. Optionally, go and Java may be adopted as development languages in the embodiment of the present invention, and these high-level languages are not only highly flexible and mature in compiling technology, but also can alleviate the programming threshold of the contract writer.
In consideration of the fact that if malicious codes or vulnerabilities are contained in the intelligent contracts, the security of the nodes can be directly threatened, so that the intelligent contracts are not directly operated on the nodes of the block chain network, but are operated in an isolated sandbox environment, the sandboxes of the mainstream at present are divided into two types, namely virtual machines and containers, and the functions of the virtual machines and the containers are to ensure that the contract codes are executed in the sandboxs so as to isolate and limit resources used by contracts. In the embodiment of the invention, a sandbox scheme in the hyper ledger Fabric is used, a Docker container is adopted in the hyper ledger Fabric as a sandbox, and based on the isolation and security provided by Docker itself, the node is protected from being attacked by malicious contracts in the container, and the mutual influence between the containers is also prevented. As shown in fig. 2, the smart contracts run in an isolated sandbox environment, the deployed smart contracts are packaged into a Docker container image, and each node starts a new Docker container based on the container image and executes a scheme in the contracts. Based on this, triggering execution of the intelligent contract matching the resource allocation may include: acquiring a contract storage address of an intelligent contract matched with resource allocation; acquiring a container mirror image of the intelligent contract based on the contract storage address; and starting the container according to the container image, and executing the intelligent contract in the container.
In the embodiment of the invention, a resource transfer record is obtained, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are obtained in an internet video application program, and the internet video services are provided by mutually matching a plurality of nodes in a block chain network; further, the resource transfer record is broadcasted in the blockchain network to indicate the nodes in the blockchain network to perform consensus verification on the resource transfer record; if consensus of the resource transfer record is verified, a target amount of electronic resources are allocated among the plurality of nodes according to the resource allocation policy by the intelligent contract. In the resource allocation process, a plurality of nodes providing services for internet video applications are integrated in the block link network, and when resource allocation is required, resource allocation is performed in the block link network, so that the security and the accuracy of resource allocation are ensured in view of the non-tamper property of the block link network. In addition, performing allocation of a target number of electronic resources by a smart contract avoids the complexity of manual settlement in conventional resource allocation and reduces the probability of allocation errors.
Based on the above embodiment of the resource allocation method based on the blockchain network, an embodiment of the present invention provides a resource allocation apparatus based on the blockchain network, and referring to fig. 8, a schematic structural diagram of the resource allocation apparatus based on the blockchain network provided in the embodiment of the present invention is shown. The resource allocation apparatus shown in fig. 8 may operate as follows:
an obtaining unit 801 configured to obtain a resource transfer record, where the resource transfer record is used to instruct an internet video service matched with a target number of electronic resources to be obtained in an internet video application, and the internet video service is provided by the plurality of nodes in cooperation with each other;
a broadcasting unit 802, configured to broadcast the resource transfer record in the blockchain network to indicate a node in the blockchain network to perform consensus verification on the resource transfer record;
a determining unit 803, configured to determine a resource allocation policy according to the internet video service if the consensus verification on the resource transfer record passes;
a processing unit 804, configured to trigger allocation of the target number of electronic resources among the plurality of nodes according to the resource allocation policy.
In one embodiment, when the processing unit 804 triggers the allocation of the target amount of electronic resources among the plurality of nodes according to the resource allocation policy, the following steps are performed:
and triggering to execute an intelligent contract matched with resource allocation, and allocating the target quantity of electronic resources among the plurality of nodes according to the resource allocation strategy through the intelligent contract.
In one embodiment, the processing unit 804, when triggering execution of the intelligent contract matching the resource allocation, performs the following steps:
acquiring a contract storage address of an intelligent contract matched with resource allocation; acquiring a container mirror image of the intelligent contract based on the contract storage address; and starting a container according to the container image and executing the intelligent contract in the container.
In one embodiment, the internet video service comprises any one or more of: obtaining membership rights in the internet video application, placing advertisements in the internet video application, and obtaining viewing rights to target internet video content in the internet video application;
the plurality of nodes includes any one or more of: the system comprises nodes corresponding to an internet video application program carrier provider, nodes corresponding to a content monitor of the internet video application program and nodes corresponding to an internet video application program provider.
In one embodiment, if the internet video service refers to obtaining membership rights in the internet video application program, or the internet video service refers to obtaining viewing rights for target internet video content in the internet video application program, the electronic resource in the resource transfer record, in which the target amount is recorded, is transferred from a user resource storage account corresponding to the internet video application program carrier user to a resource storage account to be allocated;
if the internet video service refers to the placement of advertisements in the internet video application program, the resource transfer record records that the target quantity of electronic resources are transferred from an advertiser resource storage account of an advertisement provider to a resource storage account to be allocated, wherein the advertisement provider is used for placing advertisements in the internet video application program;
the resource storage account to be allocated is any one of the following: the resource storage account corresponding to the provider of the internet video application program and the resource storage account negotiated by the provider of the internet video application program carrier, the provider of the internet video application program and the content monitor of the internet video application program.
In one embodiment, the resource transfer record is generated outside the blockchain network, or the resource transfer record is generated within the blockchain network;
if the resource transfer record is generated outside the blockchain network, the user resource storage account, the advertiser resource storage account and the to-be-allocated resource storage account are all accounts outside the blockchain network, and a first on-chain account corresponding to the internet video application program carrier user, a second on-chain account corresponding to the advertisement provider and a third on-chain account corresponding to the to-be-allocated resource storage account exist in the blockchain network;
if the resource transfer record is generated in the blockchain network, the user resource storage account, the advertiser resource storage account and the resource storage account to be allocated are all accounts in the blockchain network.
In one embodiment, if the resource transfer record is generated outside the blockchain network, the processing unit 803 performs the following steps when triggering allocation of the target number of electronic resources among the plurality of nodes:
determining whether the number of remaining electronic resources in the account on the third chain is greater than the target number;
and if the number of the residual electronic resources in the account on the third chain is larger than the target number, triggering to acquire the electronic resources of the target number from the account on the third chain, and distributing the electronic resources of the target number among the plurality of nodes.
In one embodiment, the processing unit 803, when determining the resource allocation policy according to the internet video service, performs the following steps:
if the internet video service is to obtain membership rights in the internet video application program, or the internet video service is to obtain viewing rights of target internet video contents in the internet video application program, the resource allocation strategy is a first allocation strategy;
if the internet video service refers to the advertisement put in the internet video application program, the resource allocation strategy is a second allocation strategy;
the first allocation strategy specifies that the internet video application provider, the internet video application carrier provider and the content supervisor of the internet video application program divide the target number of electronic resources in a descending order of proportion: the internet video application provider, the internet video application carrier provider and the content supervisor of the internet video application; the second allocation strategy specifies that the dividing proportion is in turn from large to small as follows: the internet video application provider, the content monitor of the internet video application and the internet video application carrier provider.
According to an embodiment of the present invention, the steps involved in the resource allocation methods shown in fig. 6 and fig. 7 may be performed by the units in the resource allocation apparatus shown in fig. 8. For example, step S601 shown in fig. 6 may be performed by the obtaining unit 801 in the resource allocation apparatus shown in fig. 8, step S602 may be performed by the broadcasting unit 802 in the resource allocation apparatus shown in fig. 8, and step S603 may be performed by the determining unit 803 and the processing unit 804 in the resource allocation apparatus shown in fig. 8; for another example, step S701 in the resource allocation method shown in fig. 7 is performed by the obtaining unit 801 in the resource allocation apparatus shown in fig. 8, step S702 may be performed by the broadcasting unit 802 in the resource allocation apparatus described in fig. 8, and step S703 may be performed by the determining unit 803 in the resource allocation apparatus shown in fig. 8; step S704 may be performed by the processing unit 804 in the resource allocation policy shown in fig. 8.
According to another embodiment of the present invention, the units in the resource allocation apparatus shown in fig. 8 may be respectively or entirely combined into one or several other units to form another unit, or some unit(s) therein may be further split into multiple functionally smaller units to form another unit, which may implement the same operation without affecting the implementation of the technical effect of the embodiment of the present invention. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present invention, the resource-based allocation apparatus may also include other units, and in practical applications, these functions may also be implemented by being assisted by other units, and may be implemented by cooperation of multiple units.
According to another embodiment of the present invention, the resource allocation apparatus shown in fig. 8 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods shown in fig. 6 and 7 on a general-purpose computing device such as a computer including a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like, as well as a storage element, and the resource allocation method according to an embodiment of the present invention may be implemented. The computer program may be, for example, embodied on a computer-readable storage medium, and loaded and executed in the node apparatus described above via the computer-readable storage medium.
In the embodiment of the invention, a resource transfer record is obtained, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are obtained in an internet video application program, and the internet video services are provided by mutually matching a plurality of nodes in a block chain network; further, the resource transfer record is broadcasted in the blockchain network to indicate the nodes in the blockchain network to perform consensus verification on the resource transfer record; if the consensus on the resource transfer record is validated, then a target amount of electronic resources is triggered to be allocated among the plurality of nodes. In the resource allocation process, a plurality of nodes providing services for the internet video application are integrated in the block chain network, and when resource allocation is needed, the resource allocation is performed in the block chain network, so that the safety and the accuracy of the resource allocation are ensured in view of the non-tamper property of the block chain network. In addition, when different internet video services are provided, the contribution of the plurality of nodes is different, when the target number of electronic resources are distributed among the plurality of nodes, a resource distribution strategy is determined according to the internet video services, the resource distribution strategy specifies the division ratio among the plurality of nodes, the target number of electronic resources are distributed among the plurality of nodes according to the resource distribution strategy, the resource distribution according to the contribution is realized, and the fairness of resource distribution is ensured.
Based on the foregoing method embodiment and apparatus embodiment, an embodiment of the present invention further provides a node device, and referring to fig. 9, a schematic structural diagram of a node device according to an embodiment of the present invention is provided. The node device shown in fig. 9 may include a processor 901, an input interface 902, an output interface 903, and a computer storage medium 904. The processor 901, the input interface 902, the output interface 903, and the computer storage medium 904 may be connected by a bus or other means.
A computer storage medium 904 may be stored in the memory of the node device, the computer storage medium 904 being used for storing a computer program, the processor 901 being used for executing the computer program stored by the computer storage medium 904. The processor 901 (or Central Processing Unit, CPU) is a computing core and a control core of the node device, and is adapted to implement one or more computer programs, and is specifically adapted to load and execute:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are acquired in an internet video application program, and the internet video services are provided by the plurality of nodes in a matched mode; broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record; and if the consensus verification of the resource transfer record passes, determining a resource allocation strategy according to the Internet video service, and triggering the target amount of electronic resources to be allocated among the plurality of nodes according to the resource allocation strategy.
In the embodiment of the invention, a resource transfer record is obtained, wherein the resource transfer record is used for indicating that internet video services matched with a target number of electronic resources are obtained in an internet video application program, and the internet video services are provided by mutually matching a plurality of nodes in a block chain network; further, the resource transfer record is broadcasted in the block chain network to indicate the nodes in the block chain network to perform consensus verification on the resource transfer record; if the consensus on the resource transfer record is validated, then a target amount of electronic resources is triggered to be allocated among the plurality of nodes. In the resource allocation process, a plurality of nodes providing services for the internet video application are integrated in the block chain network, and when resource allocation is needed, the resource allocation is performed in the block chain network, so that the safety and the accuracy of the resource allocation are ensured in view of the non-tamper property of the block chain network. In addition, when different internet video services are provided, the contribution of the plurality of nodes is different, when the target number of electronic resources are distributed among the plurality of nodes, a resource distribution strategy is determined according to the internet video services, the resource distribution strategy specifies the division ratio among the plurality of nodes, the target number of electronic resources are distributed among the plurality of nodes according to the resource distribution strategy, the resource distribution according to the contribution is realized, and the fairness of resource distribution is ensured.
An embodiment of the present invention further provides a computer storage medium (Memory), which is a Memory device in the node device and is used to store programs and data. It is understood that the computer storage medium herein may include both a built-in storage medium of the node device and, of course, an extended storage medium supported by the node device. The computer storage medium provides a storage space that stores an operating system of the node device. Also stored in this memory space are one or more computer programs adapted to be loaded and executed by processor 901. It should be noted that the computer storage medium herein may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In one embodiment, the computer storage medium can be loaded by processor 901 and executes one or more computer programs stored in the computer storage medium to implement the corresponding steps of the resource allocation method based on the blockchain network as shown in fig. 6 and 7.
According to an aspect of the present application, an embodiment of the present invention also provides a computer product or a computer program, the computer product including a computer program, the computer program being stored in a computer readable storage medium. The processor 901 reads the computer program from the computer-readable storage medium, and the processor 901 executes the computer program, so that the node apparatus executes the resource allocation method shown in fig. 6 and 7, specifically:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that an internet video service matched with a target number of electronic resources is acquired in an internet video application program, and the internet video service is provided by the plurality of nodes in a mutual cooperation manner; broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record; and if the consensus verification of the resource transfer records passes, determining a resource allocation strategy according to the Internet video service, and triggering the electronic resources with the target quantity to be allocated among the nodes according to the resource allocation strategy.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (11)

1. A method for resource allocation based on a blockchain network, wherein the blockchain network comprises a plurality of nodes, the method comprising:
acquiring a resource transfer record, wherein the resource transfer record is used for indicating that an internet video service matched with a target number of electronic resources is acquired in an internet video application program, and the internet video service is provided by the plurality of nodes in a mutual cooperation manner;
broadcasting the resource transfer record in the blockchain network to indicate nodes in the blockchain network to perform consensus verification on the resource transfer record;
and if the consensus verification of the resource transfer records passes, determining a resource allocation strategy according to the Internet video service, and triggering the electronic resources with the target quantity to be allocated among the nodes according to the resource allocation strategy.
2. The method of claim 1, wherein the triggering the allocation of the target amount of electronic resources among the plurality of nodes according to the resource allocation policy comprises:
and triggering to execute an intelligent contract matched with resource allocation, and allocating the target quantity of electronic resources among the plurality of nodes according to the resource allocation strategy through the intelligent contract.
3. The method of claim 2, wherein the triggering execution of the intelligent contract matching the resource allocation comprises:
acquiring a contract storage address of an intelligent contract matched with resource allocation;
acquiring a container mirror image of the intelligent contract based on the contract storage address;
and starting a container according to the container image and executing the intelligent contract in the container.
4. The method of claim 1, wherein the internet video service comprises any one or more of: obtaining membership rights in the internet video application, placing advertisements in the internet video application, and obtaining viewing rights to target internet video content in the internet video application;
the plurality of nodes includes any one or more of: the node comprises a node corresponding to an internet video application program carrier provider, a node corresponding to a content supervisor of the internet video application program and a node corresponding to an internet video application program provider.
5. The method of claim 4, wherein if the internet video service is to obtain membership rights in the internet video application or the internet video service is to obtain viewing rights for target internet video content in the internet video application, the target amount of electronic resources recorded in the resource transfer record are transferred from the user resource storage account corresponding to the internet video application carrier user to the resource storage account to be allocated;
if the internet video service refers to the internet video application program for putting advertisements, the resource transfer record records that the target quantity of electronic resources are transferred from an advertiser resource storage account of an advertisement provider to a resource storage account to be allocated, wherein the advertisement provider is used for putting advertisements in the internet video application program;
the resource storage account to be allocated is any one of the following: the resource storage account corresponding to the provider of the internet video application program and the resource storage account negotiated by the provider of the internet video application program carrier, the provider of the internet video application program and the content supervisor of the internet video application program.
6. The method of claim 5, wherein the resource transfer record is generated outside of the blockchain network or the resource transfer record is generated within the blockchain network;
if the resource transfer record is generated outside the blockchain network, the user resource storage account, the advertiser resource storage account and the to-be-allocated resource storage account are all accounts outside the blockchain network, and a first on-chain account corresponding to the internet video application program carrier user, a second on-chain account corresponding to the advertisement provider and a third on-chain account corresponding to the to-be-allocated resource storage account exist in the blockchain network;
if the resource transfer record is generated in the blockchain network, the user resource storage account, the advertiser resource storage account and the resource storage account to be allocated are all accounts in the blockchain network.
7. The method of claim 6, wherein the triggering the allocation of the target number of electronic resources among the plurality of nodes if the resource transfer record is generated outside of the blockchain network comprises:
determining whether the number of remaining electronic resources in the account on the third chain is greater than the target number;
and if the number of the residual electronic resources in the account on the third chain is larger than the target number, triggering to acquire the electronic resources of the target number from the account on the third chain, and distributing the electronic resources of the target number among the plurality of nodes.
8. The method of claim 4, wherein said determining a resource allocation policy from said internet video service comprises:
if the internet video service means that a member authority is obtained in the internet video application program, or the internet video service means that a watching authority for target internet video content in the internet video application program is obtained, the resource allocation strategy is a first allocation strategy;
if the Internet video service refers to the advertisement put in the Internet video application program, the resource allocation strategy is a second allocation strategy;
the first allocation strategy specifies that the internet video application provider, the internet video application carrier provider and the content supervisor of the internet video application program divide the target number of electronic resources in a descending order of proportion: the internet video application provider, the internet video application carrier provider and the content supervisor of the internet video application; the second allocation strategy specifies that the dividing proportion is in turn from large to small as follows: the internet video application provider, the content supervisor of the internet video application, and the internet video application carrier provider.
9. An apparatus for resource allocation based on a blockchain network, the blockchain network including a plurality of nodes, the apparatus comprising:
an acquisition unit configured to acquire a resource transfer record indicating that an internet video service matching a target number of electronic resources is acquired in an internet video application, the internet video service being provided by the plurality of nodes in cooperation with each other;
a broadcasting unit, configured to broadcast the resource transfer record in the blockchain network to indicate a node in the blockchain network to perform consensus verification on the resource transfer record;
a determining unit, configured to determine a resource allocation policy according to the internet video service if the consensus verification on the resource transfer record passes;
and the processing unit is used for triggering the electronic resources with the target quantity to be distributed among the plurality of nodes according to the resource distribution strategy.
10. A node apparatus, comprising:
a processor adapted to implement one or more computer programs; and
computer storage medium storing one or more computer programs adapted to be loaded by said processor and to perform the method of resource allocation according to any of claims 1-8.
11. A computer storage medium, characterized in that the computer storage medium stores a computer program for performing the resource allocation method according to any one of claims 1-8 when the computer program is executed by a processor.
CN202110463310.7A 2021-04-27 2021-04-27 Resource allocation method, device, equipment and storage medium based on block chain network Pending CN115250354A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110463310.7A CN115250354A (en) 2021-04-27 2021-04-27 Resource allocation method, device, equipment and storage medium based on block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110463310.7A CN115250354A (en) 2021-04-27 2021-04-27 Resource allocation method, device, equipment and storage medium based on block chain network

Publications (1)

Publication Number Publication Date
CN115250354A true CN115250354A (en) 2022-10-28

Family

ID=83697475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110463310.7A Pending CN115250354A (en) 2021-04-27 2021-04-27 Resource allocation method, device, equipment and storage medium based on block chain network

Country Status (1)

Country Link
CN (1) CN115250354A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116975158A (en) * 2023-09-25 2023-10-31 腾讯科技(深圳)有限公司 Request processing method, apparatus, computer device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116975158A (en) * 2023-09-25 2023-10-31 腾讯科技(深圳)有限公司 Request processing method, apparatus, computer device and storage medium
CN116975158B (en) * 2023-09-25 2024-01-26 腾讯科技(深圳)有限公司 Request processing method, apparatus, computer device and storage medium

Similar Documents

Publication Publication Date Title
CN110009337B (en) Data processing method and device based on block chain
CN110599181B (en) Data processing method, device and equipment based on block chain and storage medium
WO2021184826A1 (en) Blockchain-based resource transfer method and apparatus, and node device and storage medium
CN112686671B (en) Intelligent contract deployment method, device, equipment and medium based on block chain
CN111445333A (en) Block generation method and device, computer equipment and storage medium
CN111309745B (en) Virtual resource processing method and device, electronic equipment and storage medium
CN110020543B (en) Data processing method and device based on block chain
CN113379422B (en) Data processing method and device based on intelligent contract and readable storage medium
CN112200568B (en) Block chain based account creation method and device and electronic equipment
CN111985007A (en) Contract signing and executing method and device based on block chain
CN111416709A (en) Voting method, device, equipment and storage medium based on block chain system
CN110659993A (en) Resource management method and device based on block chain network
CN115250354A (en) Resource allocation method, device, equipment and storage medium based on block chain network
CN112995167A (en) Kafka mechanism-based power utilization information acquisition method, block chain network and user side
CN110458541B (en) Object replacement method and device based on block chain
CN111222885B (en) Data processing request endorsement method and device, computer equipment and storage medium
CN112308700A (en) Method and device for processing enterprise credit investigation data, computer equipment and storage medium
CN112269838A (en) Block chain-based supervision method and device, electronic equipment and storage medium
CN115701078B (en) Cross-chain transaction processing method, device, electronic equipment and storage medium
CN116739596A (en) Blockchain-based transaction supervision method, device, equipment, medium and product
CN116186786A (en) Block chain-based service processing method and device, electronic equipment and readable medium
CN116804949B (en) Block chain-based data processing method, device, equipment and readable storage medium
CN115617918B (en) Method, device and system for operating piece-wise intelligent contract and storage medium
CN116708463B (en) Information processing method, device, equipment and medium based on multi-block chain
CN113240426B (en) Transaction method and system for realizing block chain user identity authentication based on intelligent contract

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