CN111741000B - Data access system and method based on block chain and intelligent contract - Google Patents

Data access system and method based on block chain and intelligent contract Download PDF

Info

Publication number
CN111741000B
CN111741000B CN202010577371.1A CN202010577371A CN111741000B CN 111741000 B CN111741000 B CN 111741000B CN 202010577371 A CN202010577371 A CN 202010577371A CN 111741000 B CN111741000 B CN 111741000B
Authority
CN
China
Prior art keywords
intelligent contract
node
cache
target
cache node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010577371.1A
Other languages
Chinese (zh)
Other versions
CN111741000A (en
Inventor
刘江
张然
黄韬
刘韵洁
于非
杨丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
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 Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202010577371.1A priority Critical patent/CN111741000B/en
Publication of CN111741000A publication Critical patent/CN111741000A/en
Application granted granted Critical
Publication of CN111741000B publication Critical patent/CN111741000B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/50Network service management, e.g. ensuring proper service fulfilment according to agreements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a data access system, a data access method and a mobile base station based on a block chain and an intelligent contract, wherein the system comprises: the mobile base station comprises a plurality of cache nodes, a content providing server, a plurality of caches arranged in the mobile base station and a blockchain controller; wherein, the buffer node includes: at least one mobile edge cache node arranged in a mobile base station and at least one first user terminal cached with content data; the cache and block chain controller receives an intelligent contract deployment request and determines an intelligent contract execution node; and generating an intelligent contract description; obtaining an intelligent contract address; the target cache node is used for obtaining the intelligent contract description based on the intelligent contract address and sending target data to the second user terminal; the second user terminal receives the target data and sends a content transmission receipt to the target cache node; and the intelligent contract execution node is used for executing the intelligent contract. The embodiment of the invention can realize centralized control and scheduling.

Description

Data access system and method based on block chain and intelligent contract
Technical Field
The invention relates to the technical field of data caching, in particular to a data access system and method based on a block chain and an intelligent contract and a mobile base station.
Background
With the rapid development of internet technology and applications, the number of internet users is rapidly increasing, and with the rapid explosion of network traffic, the network traffic is not ever before. In order to effectively solve the problem of network traffic explosion, network caches are widely researched and deployed.
A conventional network cache sharing system is a peer-to-peer (P2P) cache system, which may also be referred to as a peer-to-peer network cache system, and as shown in fig. 1, generally includes a plurality of user terminals such as a user terminal 1, a user terminal 2, and a user terminal 3, and a scheduling server 110, where a corresponding relationship between each user terminal and cached content is stored in the scheduling server. For example: when the user terminal 1 needs to access the content, an access request is first sent to the scheduling server 110, the scheduling server 110 sends the information of the user terminal 2 caching the content to be accessed to the user terminal 1, the user terminal 1 pays a corresponding score to the user terminal 2 caching the content to be accessed, and the user terminal 2 sends the content to be accessed to the user terminal 1 after obtaining the score.
In the P2P cache system in the prior art, when the user terminal accesses data, it only needs to pay the corresponding credit to the user terminal that caches the content to be accessed, and after receiving the credit, the user terminal that caches the content to be accessed sends the content to be accessed to the requesting user terminal. Therefore, there is a lack of centralized management and scheduling throughout the access process.
Disclosure of Invention
The embodiment of the invention aims to provide a data access system and method based on a block chain and an intelligent contract and a mobile base station, so as to realize centralized management and control and scheduling. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a data access system based on a block chain and an intelligent contract is provided, including: the mobile base station comprises a plurality of cache nodes, a content providing server, a plurality of caches arranged in the mobile base station and a blockchain controller; wherein, the buffer node includes: at least one mobile edge cache node arranged in a mobile base station and at least one first user terminal cached with content data;
the content providing server is used for receiving a data access request containing a target data identifier sent by a second user terminal; determining whether a cache node caches target data or not based on the corresponding relation between the data content pre-stored in the block chain and the cache node; if so, sending an intelligent contract deployment request to a cache and a block chain controller of a local base station to which the second user terminal belongs;
the cache and block chain controller is used for receiving the intelligent contract deployment request, determining at least one target cache node based on the corresponding relation between the data content pre-stored in the block chain and the cache nodes, and determining at least one intelligent contract execution node from the target cache nodes; generating an intelligent contract description, and sending the intelligent contract description to the intelligent contract execution node for storage; obtaining an intelligent contract address and sending the intelligent contract address to the content providing server; the intelligent contract description carries payment information, reward information and intelligent contract execution node information; the intelligent contract address is a link address described by the intelligent contract;
the content providing server is further used for sending the intelligent contract address to the second user terminal;
the second user terminal is further configured to obtain an identifier of a target cache node based on the block chain or the intelligent contract description, and send the intelligent contract address to the target cache node;
the target cache node is used for obtaining the intelligent contract description based on the intelligent contract address and sending the target data to the second user terminal;
the second user terminal further receives the target data and sends a content transmission receipt to the target cache node;
the target cache node further sends the content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description;
the intelligent contract execution node is used for obtaining payment cost from the second user terminal and paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract; or, the system is configured to obtain payment fees from the content providing server, and pay corresponding rewards to the target cache node and the intelligent contract execution node according to the intelligent contract description, so as to execute the intelligent contract.
Optionally, the cache and blockchain controller determines at least one target cache node based on a correspondence between data content pre-stored in a blockchain and cache nodes, and determines at least one intelligent contract execution node from the target cache node, where the determining includes:
acquiring historical behavior data stored in a block chain by each target cache node; determining the credibility of each target cache node according to the historical behavior data of each target cache node; the credibility is used for representing the execution probability according to the intelligent contract description when the cache node is used as an intelligent contract execution node;
selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the credibility of each target cache node, wherein one cache node is a master intelligent contract execution node, and the other cache nodes are slave intelligent contract execution nodes;
the master intelligent contract execution node is specifically configured to: interacting with each slave intelligent contract execution node, acquiring transaction authenticity confirmation information of each slave intelligent contract execution node, and determining whether to execute the intelligent contract based on a practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the slave intelligent contract execution node and the transaction authenticity confirmation information sent by each slave intelligent contract execution node; and if the execution is determined, paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description.
Optionally, the selecting, by the cache and blockchain controller, a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the reliability of each target cache node includes:
selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to a preset expression, wherein the preset expression is as follows:
Figure BDA0002551432340000031
in the above formula, NPRepresenting a preset number, J, of said intelligent contract execution nodesΩiRepresenting the credibility of the ith intelligent contract execution node.
Optionally, the master intelligent contract execution node further pays corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description to execute an intelligent contract, and then sends a content distribution record, a transfer record and transaction authenticity confirmation information of each intelligent contract execution node for the transaction to a block chain consensus algorithm witness node, where the block chain consensus algorithm witness node is: the content providing server is selected from a plurality of cache nodes and the content providing server at regular time;
the witness node of the block chain consensus algorithm is used for:
the content distribution record, the transfer record and transaction authenticity confirmation information of each intelligent contract execution node on the transaction are used as historical behavior data and written into a new block of the block chain as the historical behavior data;
determining whether the content in the new block is real or not according to the transaction authenticity confirmation information sent by the main intelligent contract execution node;
if the content in the new block is real, adding the new block to the block chain.
Optionally, each mobile station corresponds to a plurality of buffers and a blockchain controller;
the cache and block chain controller of the local base station to which the second user terminal belongs is: and a plurality of caches corresponding to the local base station to which the second user terminal belongs and the block chain controller are selected at regular time.
Optionally, the cache and blockchain controller is further configured to:
establishing an MDP, wherein the MDP comprises the following steps: the method comprises the following steps that a preset state space, a reward function and an action space are set, and information represented by states in the state space comprises sharing intentions of all cache nodes; the reward function includes: each cache node and the relation between the flow generated when the cache node provides the cached content data to the user terminal; the action in the action space represents the corresponding relation between each cache node and the content data cached by the cache node; the sharing will is determined based on the relationship between the reward obtained by the cache node and the expected reward when the user terminal accesses the data each time;
obtaining rewards obtained by each cache node in the process of historical data access at regular time, determining new sharing willingness of each cache node based on the rewards, updating the state by using the new sharing willingness, and obtaining the updated state;
inputting the updated state into a pre-trained DQN to obtain a new action, wherein the new action represents: each cache node and the new corresponding relation of the cache content data cached by the cache node; sending the new corresponding relation to the cache node, and updating the corresponding relation stored in the block chain; the DQN is obtained by training based on a sample state space, a sample reward function and a sample action space in advance;
and the cache node is also used for updating the data content cached by the cache node according to the new corresponding relation.
In a second aspect of the embodiments of the present invention, there is provided a data access method based on a blockchain and an intelligent contract, which is applied to any one of the data access systems based on a blockchain and an intelligent contract, where the system includes: the mobile base station comprises a plurality of cache nodes, a content providing server, a plurality of caches arranged in the mobile base station and a blockchain controller; wherein, the buffer node includes: at least one mobile edge cache node arranged in a mobile base station and at least one first user terminal cached with content data;
the method comprises the following steps:
the content providing server receives a data access request containing a target data identifier sent by a second user terminal; determining whether a cache node caches target data or not based on the corresponding relation between the data content pre-stored in the block chain and the cache node; if so, sending an intelligent contract deployment request to a cache and a block chain controller of a local base station to which the second user terminal belongs;
the cache and block chain controller receives the intelligent contract deployment request, determines at least one target cache node based on the corresponding relation between the data content pre-stored in the block chain and the cache nodes, and determines at least one intelligent contract execution node from the target cache nodes; generating an intelligent contract description, and sending the intelligent contract description to the intelligent contract execution node for storage; obtaining an intelligent contract address and sending the intelligent contract address to the content providing server; the intelligent contract description carries payment information, reward information and intelligent contract execution node information; the intelligent contract address is a link address described by the intelligent contract;
the content providing server sends the intelligent contract address to the second user terminal;
the second user terminal obtains the identifier of a target cache node based on the block chain or the intelligent contract description, and sends the intelligent contract address to the target cache node;
the target cache node obtains the intelligent contract description based on the intelligent contract address and sends the target data to the second user terminal;
the second user terminal receives the target data and sends a content transmission receipt to the target cache node;
the target cache node sends the content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description;
the intelligent contract execution node obtains payment cost from the second user terminal, and pays corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract; or obtaining payment cost from the content providing server, and paying corresponding rewards to the target cache node and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract.
In another aspect of the embodiments of the present invention, there is provided a mobile base station, which is applied to any one of the above data access systems based on a block chain and an intelligent contract, where the mobile base station includes: a plurality of cache and blockchain controllers, and a mobile edge cache node, wherein the cache and blockchain controller of the local base station to which the second user terminal belongs is: and a plurality of caches corresponding to the local base station to which the second user terminal belongs and the block chain controller are selected at regular time.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a data access system, a data access method and a mobile base station based on a block chain and an intelligent contract, wherein the intelligent contract is deployed through a cache and a block chain controller to determine at least one target cache node, and at least one intelligent contract execution node is determined from the target cache node; generating an intelligent contract description, sending the intelligent contract description to the intelligent contract execution node for storage, obtaining an intelligent contract address, and sending the intelligent contract address to the content providing server; and the target cache provider sends target data to the second user terminal, receives a content transmission receipt sent by the user terminal, and pays corresponding remuneration to the target cache provider, the content providing server and the intelligent contract execution node after the intelligent contract execution node receives the content transmission receipt. In the embodiment of the invention, each time the user accesses the content data, the cache and the block chain controller are uniformly managed and scheduled.
Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a network cache sharing system provided in the prior art;
fig. 2 is a schematic structural diagram of a data access system based on a blockchain and an intelligent contract according to an embodiment of the present invention;
fig. 3 is another schematic structural diagram of a data access system based on a blockchain and an intelligent contract according to an embodiment of the present invention;
fig. 4 is an interaction diagram of a data access method based on a blockchain and an intelligent contract according to an embodiment of the present invention;
fig. 5 is another interaction diagram of a data access method based on a blockchain and an intelligent contract according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 2, an embodiment of the present invention first provides a data access system based on a blockchain and an intelligent contract, including: a plurality of cache nodes and a content providing server 280, and a plurality of cache and blockchain controllers 260 provided at the mobile base station 270; wherein, the buffer node includes: at least one moving edge cache node 250 provided in the mobile base station 270 and at least one first user terminal 210 having content data cached therein.
In the embodiment of the present invention, the content providing server is a server storing a large amount of content data, and the content providing server may be one server or one server cluster. The content providing server may be communicatively coupled to the mobile base station using a backhaul network, and the mobile base station may be a cellular base station.
As shown in fig. 3, the data access system based on the block chain and the intelligent contract according to the embodiment of the present invention further includes a network controller 290 disposed at the mobile base station, and at least one first user terminal 210 is communicatively connected to each other through a D2D (Device-to-Device) link under the control of the network controller 290.
The cache node in the embodiment of the invention comprises: the mobile edge cache node is arranged on the mobile base station, and the first user terminal is arranged on the mobile edge cache node. The mobile edge cache node may be a server provided by a third party for caching data content. As shown in fig. 2, at least one first user terminal is communicatively connected to each other, and the at least one first user terminal may be connected to the mobile base station through the wireless access point 240. Therefore, both the first user terminal and the mobile edge cache node may be configured to cache content data provided by the content providing server. Therefore, the cache resources in the whole data access system based on the block chain and the intelligent contract can be fully utilized, and the waste of the cache resources is avoided.
A content providing server for receiving a data access request containing a target data identifier sent by the second user terminal 220; determining whether a cache node caches target data or not based on the corresponding relation between the data content pre-stored in the block chain and the cache node; and if so, sending an intelligent contract deployment request to a cache and a block chain controller of a local base station to which the second user terminal belongs.
When the user terminal wants to access the data content, a data access request containing the identification of the target data can be sent to the content providing server, and the content providing server can receive the data access request.
In the data access system based on the block chain and the intelligent contract provided by the embodiment of the invention, the distributed block chain is deployed, wherein the content in the block chain can be respectively stored in each cache node, and the block chain can pre-store the corresponding relation between the data content and the cache node. The content providing server can obtain the corresponding relation through interacting with the cache nodes, and determine whether the cache nodes cache the target data according to the corresponding relation.
It should be noted here that, in the data access system based on the blockchain and the intelligent contract provided by the embodiment of the present invention, a plurality of mobile base stations may be deployed, where the number of specific deployments may be determined according to the overall internet deployment requirement. For example, according to actual requirements, a mobile base station is deployed in a plurality of different areas in a city. Wherein the mobile station communicatively connected to the second user terminal through the wireless access point 240 is a local station. Therefore, after the target data is cached in the cache node, the intelligent contract deployment request can be sent to the cache and the block chain controller of the local base station to which the second user terminal belongs, so that the consumed network flow is reduced, the cost in the data access process is reduced, and the speed of accessing the data content can be increased.
The cache and block chain controller is used for receiving the intelligent contract deployment request, determining at least one target cache node based on the corresponding relation between the data content pre-stored in the block chain and the cache node, and determining at least one intelligent contract execution node from the target cache node; generating an intelligent contract description, and sending the intelligent contract description to an intelligent contract execution node for storage; acquiring an intelligent contract address and sending the intelligent contract address to a content providing server; the intelligent contract description carries payment information, reward information and intelligent contract execution node information; the intelligent contract address is a link address described by the intelligent contract.
In the embodiment of the present invention, in the process of caching the content provided by the content providing server, when one data content is too large, the data content may be split into a plurality of sub-data contents, and the sub-data contents are respectively cached in different cache nodes; or, a data content may be respectively cached in different cache nodes, where the cache nodes may be mobile edge cache nodes located in different mobile base stations, or a first user terminal.
The cache and blockchain controller can receive an intelligent contract deployment request sent by the content providing server, and obtain the corresponding relation between the data content and the cache nodes from the blockchain, so as to determine the number of target cache nodes in which target data are cached and the identification of each target cache node. The cache and blockchain controller may determine at least one intelligent contract node from the at least one target cache node, that is, select a preset number of target cache nodes from the at least one target cache node as intelligent contract execution nodes.
The cache and blockchain controller can generate an intelligent contract description, and the intelligent contract description can carry payment information, reward information and intelligent contract execution node information. Wherein the payment information is the fee the user needs to pay to obtain the accessed target data. The reward information includes: the cache node provides consideration that the cache service should obtain, the content providing server provides consideration that the target content should obtain, and the intelligent contract execution node executes consideration that the intelligent contract should obtain. Or, the payment information is a fee to be paid by the content providing server, and accordingly, the reward information includes: the cache node provides consideration that should be obtained by the cache service, and consideration that should be obtained by the intelligent contract execution node executing the intelligent contract.
The intelligent contract execution node information is the identification of the intelligent contract execution node. In addition, the intelligent contract description can also comprise: an identification of the target data, an identification of the content providing server, and an identification of the second user terminal.
After generating the intelligent contract description, the cache and blockchain controller may send the intelligent contract description to the intelligent contract execution node for storage, where the intelligent contract execution node starts the intelligent contract, that is, starts execution of a program corresponding to the intelligent contract, and returns an intelligent contract description address to the cache and blockchain controller, where the intelligent contract description address is a link address of the intelligent contract description, for example, the intelligent contract description address may be a URL (Uniform Resource Locator). The cache and blockchain controller first sends the intelligent contract description to the content providing server.
And the content providing server is also used for sending the intelligent contract address to the second user terminal.
The content providing server, after receiving the smart contract address, may send the smart contract address to the second user terminal.
And the second user terminal is also used for obtaining the identification of the target cache node based on the block chain or the intelligent contract description and sending the intelligent contract address to the target cache node.
After receiving the intelligent contract address, the second user terminal can obtain the intelligent contract description by accessing the intelligent contract address and obtain the identification of the target cache node from the intelligent contract description. The second user terminal may also obtain an identifier of the target cache node from a correspondence between data content in the block chain and the cache node, and send the intelligent contract address to the target cache node. It should be noted here that, if there are multiple target cache nodes, the target cache node located in the local network is preferentially selected to provide the service, that is, the second user terminal sends the smart contract address to the target cache node located in the local network, that is, to the moving edge cache node located in the local base station, or to the first user terminal communicatively connected to the second user terminal through D2D.
And the target cache node is used for obtaining the intelligent contract description based on the intelligent contract address and sending target data to the second user terminal.
After receiving the intelligent contract address, the target cache node can obtain the intelligent contract description by accessing the intelligent contract address and send target data to the second user terminal. When the data amount of the target data is large, the target data may be transmitted in a plurality of times.
And the second user terminal further receives the target data and sends a content transmission receipt to the target cache node.
And after receiving the target data, the second user terminal sends a content transmission receipt to the target cache node, wherein the content transmission receipt carries the identifier of the received target data and can also carry the identifier of the target cache node sending the content transmission receipt. When the target cache node receives the content transmission receipt, it indicates that the second user terminal has successfully received the target data. And when the number of the received content transmission receipts is the same as the number of times of sending the target data, or the received content transmission receipts are the content transmission receipts corresponding to the target data sent by the target cache node for the last time, indicating that the second user terminal has completely received the target data.
And the target cache node further transmits a content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description.
And the target cache node can obtain the intelligent contract description by accessing the intelligent contract address and send a content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description.
The intelligent contract execution node is used for obtaining payment cost from the second user terminal and paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract; or the intelligent contract execution node is used for obtaining payment cost from the content providing server and paying corresponding rewards to the target cache node and the intelligent contract execution node respectively according to the intelligent contract description so as to execute the intelligent contract.
After receiving the content transmission receipt, the intelligent contract execution node may pay a payment fee obtained in advance from the second user terminal to the target cache node, the content providing server, and the intelligent contract execution node, respectively, in accordance with the intelligent contract description, to execute the intelligent contract.
Alternatively, after receiving the content transmission receipt, the intelligent contract execution node may pay corresponding consideration to the target cache node and the intelligent contract execution node, respectively, according to the intelligent contract description, for the payment fee obtained in advance from the content providing server, so as to execute the intelligent contract.
The data access system based on the block chain and the intelligent contract, provided by the embodiment of the invention, is characterized in that the intelligent contract is deployed through the cache and the block chain controller, at least one target cache node is determined, and at least one intelligent contract execution node is determined from the target cache node; generating an intelligent contract description, sending the intelligent contract description to the intelligent contract execution node for storage, obtaining an intelligent contract address, and sending the intelligent contract address to the content providing server; and the target cache provider sends target data to the second user terminal, receives a content transmission receipt sent by the user terminal, and pays corresponding remuneration to the target cache provider, the content providing server and the intelligent contract execution node after the intelligent contract execution node receives the content transmission receipt. In the embodiment of the invention, the cache and the block chain controller are uniformly managed and scheduled in the process of accessing data by a user.
As an optional implementation manner of the embodiment of the present invention, the cache and blockchain controller determines at least one target cache node based on a correspondence between data content pre-stored in a blockchain and cache nodes, and determines at least one intelligent contract execution node from the target cache nodes, including:
acquiring historical behavior data stored in a block chain by each target cache node; determining the credibility of each target cache node according to the historical behavior data of each target cache node; and the credibility is used for representing the execution probability according to the intelligent contract description when the cache node is used as an intelligent contract execution node.
Historical behavior data in each target cache node may be obtained from the blockchain, and the historical behavior data may include: and the target cache node is used as transaction authenticity confirmation information when the target cache node is used as an intelligent contract execution node in the process of accessing data by the second user terminal, and also used for recording content distribution and transfer. Wherein the transaction authenticity confirmation information is whether to agree to execute the smart contract in accordance with the smart contract.
And the cache and blockchain controller determines whether the content is distributed in the content distribution record in each transaction according to the historical access data and whether the content is consistent with the transaction authenticity confirmation information, and accordingly, the reliability is determined. For example, for a certain transaction, a target cache node exists in the content distribution record to send target data to the second user terminal, and the intelligent contract execution node should execute the intelligent contract to send a reward to the target cache node. At the moment, the transaction authenticity confirmation information of the intelligent contract execution node is checked, if the intelligent contract execution node agrees to execute, the credibility of the intelligent contract execution node is increased, and otherwise, the credibility of the intelligent contract execution node is decreased. The credibility of the intelligent contract execution node can be determined according to the ratio of the number of times of whether the content is distributed in the content distribution record, the number of times of being consistent with the transaction authenticity confirmation information and the total number of times of participation in the transaction in which each intelligent contract execution node participates.
And selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the credibility of each target cache node, wherein one cache node is a main intelligent contract execution node, and the other cache nodes are auxiliary intelligent contract execution nodes.
The plurality of cache nodes may be selected from the target cache nodes as the intelligent contract execution nodes according to the reliability of each target cache node, for example, the plurality of cache nodes with the highest reliability may be selected from the plurality of target cache nodes as the intelligent contract execution nodes according to the size of the reliability. The number of the intelligent contract execution nodes can be a preset value, so that the preset value and the cache node can be selected from all target nodes to serve as the intelligent contract execution nodes.
According to the reliability of each intelligent contract execution node, one intelligent contract execution node is selected from a plurality of intelligent contract execution points to serve as a master intelligent contract execution node, and other intelligent contract execution nodes are slave intelligent contract execution nodes.
The master intelligent contract execution node is specifically configured to: interacting with each slave intelligent contract execution node, acquiring transaction authenticity confirmation information of each slave intelligent contract execution node, and determining whether to execute the intelligent contract based on a practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the slave intelligent contract execution node and the transaction authenticity confirmation information sent by each slave intelligent contract execution node; and if the execution is determined, paying corresponding remuneration to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description.
And the main intelligent contract execution node can interact with the second user terminal, the cache node and the content providing server and obtain the payment fee from the second user terminal or obtain the payment fee from the content providing server. And the master intelligent contract execution node obtains a content transmission receipt from the target cache node and transmits content transmission data to the plurality of slave intelligent contract execution nodes, and each intelligent contract execution node determines transaction authenticity confirmation information according to the content transmission receipt, wherein the transaction authenticity confirmation information can represent whether the intelligent contract execution node confirms to execute the intelligent contract or not.
Each slave intelligent contract execution node can send respective transaction authenticity confirmation information to the master intelligent contract execution node, and the master intelligent contract execution node determines whether to agree to execute the intelligent contract or not based on the practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the master intelligent contract execution node and the transaction authenticity confirmation information sent by each slave intelligent contract execution node. The specific process can be as follows: counting a first number of intelligent contract execution nodes agreeing to execute the intelligent contract; using preset calculation formulas
Figure BDA0002551432340000131
Calculating a second number of executing nodes that least agree to execute the intelligent contract, wherein N is the number of executing nodes of the intelligent contract; judging whether the first number is larger than or equal to the second number; if so, the master intelligent contract execution node executes the intelligent contract. If not, the main intelligent contract executesThe row node does not execute the intelligent contract.
In the embodiment of the invention, the credibility of each target cache node is determined according to the historical behavior data of each target cache node, and a plurality of cache nodes are selected as intelligent contract execution nodes according to the credibility. Therefore, the reliability of the selected intelligent contract execution node is high, and the execution accuracy of the intelligent contract is also high. In addition, the master intelligent contract execution node acquires transaction authenticity confirmation information of each slave intelligent contract execution node, and determines whether to execute the intelligent contract based on the practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the master intelligent contract execution node, and the transaction authenticity confirmation information sent by each slave intelligent contract execution node. Therefore, the situation that when one intelligent contract execution node is hacked or other reasons cause wrong decision on whether to agree to execute the intelligent contract or not, and then the cache node cannot obtain corresponding reward after the cache service is provided can be avoided to a certain extent.
As an optional implementation manner of the embodiment of the present invention, the selecting, by the cache and block chain controller, a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the reliability of each target cache node includes:
selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to a preset expression, wherein the preset expression is as follows:
Figure BDA0002551432340000141
in the above formula, NPRepresenting a predetermined number of intelligent contract execution nodes, JΩiRepresenting the credibility of the ith intelligent contract execution node.
In the process of selecting a plurality of cache nodes from each target cache node as the intelligent contract execution node, a preset number of target cache nodes and the credibility of each cache node in the preset number of target cache nodes can be substituted into a preset expression to judge whether the preset expression is met, and if so, the preset number of target cache nodes can be used as the intelligent contract execution node.
In the embodiment of the invention, in the process of selecting the intelligent contract execution node, the credibility of each target cache node is fully considered, so that the credibility of the selected intelligent contract execution node is higher.
As an optional implementation manner of the embodiment of the present invention, after the main intelligent contract execution node further pays corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node respectively according to the description of the intelligent contract to execute the intelligent contract, the content distribution record, the transfer record and the transaction authenticity confirmation information of each intelligent contract execution node on the transaction are sent to the blockchain consensus algorithm witness node, where the blockchain consensus algorithm witness node is: and the content is selected from a plurality of cache nodes and a content providing server at regular time.
The main intelligent contract execution node can send the content distribution record, the transfer record and the transaction authenticity confirmation information of each intelligent contract execution node on the transaction to the blockchain consensus algorithm witness node of the local base station to which the second user terminal belongs. Wherein the content distribution record may include: in the process of accessing the target data by the second user terminal, an identifier of the target cache node is provided, and the identifier may be, for example, an ID (Identity document). The transfer record may include: a token input account, a token input amount, and an ID of an input token. Where the token may represent a fee, the input token account may be a payment account for the second user terminal when a payment is made by the second user terminal. The amount of token input represents the fee paid out and the ID of the input token represents the identity of the transaction record. The transfer record can also comprise: a token output account, a token output quantity, and an ID of the output token. When the reward is received by the content providing server, the cache node, and the intelligent contract execution node, then the output token account may be a collection account of the content providing server, the cache node, and the intelligent contract execution node. The output amount of the token represents the fee paid out and the ID of the output token represents the identity of the transaction record.
Since the blockchain consensus algorithm witness node can be selected from the plurality of cache nodes and the content providing server, the cache nodes and the content providing server can select a plurality of nodes from the plurality of cache nodes and the content providing server as the blockchain consensus algorithm witness node according to the historical behaviors of each cache node and each content providing server as the blockchain consensus algorithm witness node according to the preset time interval. The specific election process can be as follows: and the cache nodes judge whether target data is provided for the second user terminal or not according to the content distribution records stored in the blockchain blocks, but the situation that the transaction records are not stored in the blockchain blocks is avoided, and thus a plurality of cache nodes and the content providing server are elected. The content service provider may also determine whether a second user has access to the data content, but the transaction is not stored in the blockchain, and elect a plurality of cache nodes and content providing servers based thereon.
It should be noted that when the main intelligent contract execution node obtains payment from the second user terminal, the token input account in the transaction can be known. Similarly, when the main intelligent contract execution node pays a corresponding reward to the target cache node, an account corresponding to the target cache node may be acquired from the block chain in advance, and the corresponding reward is paid to the account.
The witness node of the block chain consensus algorithm is used for:
and writing the content distribution record, the transfer record and transaction authenticity confirmation information of each intelligent contract execution node to the transaction into a new block of the block chain as historical behavior data.
The witness node of the block chain consensus algorithm can write the content distribution record, the transfer record and transaction authenticity confirmation information of each intelligent contract execution node to the transaction into a new block as historical behavior data. The structure of the new block can be as shown in table 1. Wherein the new block includes: version number, block height, timestamp, parent block hash value, transaction number, Merkel root, content service list, and content token transaction record area. Wherein the content service list includes: the identification of the target data accessed by the second user terminal and the identification of the cache node caching the target data.
TABLE 1 Structure of New Block
Figure BDA0002551432340000151
Figure BDA0002551432340000161
Figure BDA0002551432340000171
The content token transaction record area includes: a transaction ID, a content distribution area, and a token transaction area. Wherein the content distribution area includes: a content ID, and an ID of a cache node that provides the content; and whether each intelligent contract execution node agrees to execute the intelligent contract.
The token transaction area includes: an input and an output; wherein the input comprises: a token input account, a token input amount, and an ID of an input token; the output includes: a token output account, a token output quantity, and an ID of the output token.
The blockchain consensus algorithm witness node may be further configured to: and determining whether the content in the new block is real or not according to the transaction authenticity confirmation information sent by the main intelligent contract execution node.
And determining whether the content in the new block is real or not according to the transaction authenticity confirmation information sent by each intelligent contract execution node. The specific process can be as follows: counting a first number of intelligent contract execution nodes agreeing to execute the intelligent contract; using preset calculation formulas
Figure BDA0002551432340000181
Calculating a second number of executing nodes that least agree to execute the intelligent contract, where N is the intelligent contractAbout the number of executing nodes; judging whether the first number is larger than or equal to the second number; if so, the blockchain consensus algorithm witness node confirms that the content in the new block is authentic. If not, the blockchain consensus algorithm witness node confirms that the content in the new block is not authentic.
The blockchain consensus algorithm witness node may be further configured to: if the content in the new block is real, the new block is added to the block chain.
If the content in the new tile is real, the new tile is added to the chain of tiles, for example, to the main chain in the chain of tiles. After the new block is added to the main chain, it is also added
Figure BDA0002551432340000182
(N1Witness the number of nodes for the blockchain consensus algorithm) blocks, the contents of the new blocks will not be modifiable.
As an optional implementation manner of the embodiment of the present invention, each mobile station corresponds to a plurality of buffers and a blockchain controller.
The buffer and block chain controller of the local base station to which the second user terminal belongs is: and a plurality of caches corresponding to the local base station to which the second user terminal belongs and the block chain controller are selected at regular time.
The cache nodes and the content providing server can elect each cache and the blockchain controller in the same mobile base station according to a preset time interval, and the concrete election process is as follows: the second user terminal may determine whether each cache and the blockchain controller timely respond to the access request and whether the target data is timely obtained from the cache node in the process of accessing the data according to the history, and select one controller from the plurality of caches and the blockchain controller according to the determination result. The mobile edge cache node may select one controller from the plurality of caches and the blockchain controller based on whether the expected reward is received after the second user terminal is provided with the target data in the process of historical data access of the second user terminal. The content provider server may select one of the plurality of cache and blockchain controllers based on whether the expected reward is obtained each time the user historically accesses the data.
One cache node may be manually designated, the selection results sent by each cache node and the content providing server are received, and one cache and controller with the largest ticket number is selected from the plurality of cache and blockchain servers as the cache and blockchain controller of the local base station to which the second user terminal belongs.
In the embodiment of the present invention, the cache and the blockchain controller of the local base station to which the second user terminal belongs are determined by electing a plurality of cache and blockchain controllers. So that the cache and the block chain controller with better historical processing capability can be selected from a plurality of cache and block chain controllers.
As an optional implementation manner of the embodiment of the present invention, the buffer and block chain controller is further configured to:
building an MDP (Markov Decision Process) including: the method comprises the following steps that a preset state space, a reward function and an action space are set, and information represented by states in the state space comprises sharing intentions of all cache nodes; the reward function includes: each cache node and the relation between the flow generated when the cache node provides the cached content data to the user terminal; the action in the action space represents the corresponding relation between each cache node and the content data cached by the cache node; the sharing intention is determined based on a relationship between a reward obtained by the cache node and an expected reward each time the user terminal accesses data.
The information represented by the states in the state space includes: the sharing willingness of each cache node can be set as an initial value in the process of establishing the MDP; the request frequency of each second user terminal in a preset time interval; the cache and block chain controller can acquire historical access records of each second user terminal according to the preference degree of each second user terminal to different content data, and comprehensively determine the preference degree of each second user terminal to different types of data content according to target data identification in the historical access records and the preset preference degree corresponding to different types of target data; the size of the historical access data content of each second user terminal; a distribution reward corresponding to each content data; acquiring link information between the second user terminals from the network controller, and determining network connectivity between the second user terminals and other second user terminals according to the link information, wherein if the second user terminals are connected, the network connectivity is 1, and if the second user terminals are not connected, the network connectivity is 0; and the available cache space of each cache node, wherein the available cache space can be acquired from each cache node.
And the cache and block chain controller is further used for acquiring rewards acquired by each cache node in the process of historical access data at regular time, determining a new sharing intention of each cache node based on the rewards, updating the state by using the new sharing intention and acquiring the updated state.
The remuneration obtained by each cache node in the historical data access process can be obtained according to the preset time interval. Wherein the total remuneration obtained from the time period from the present time to the time at which the obtained remuneration is obtained one by one can be obtained. And then, determining a new sharing intention based on the last sharing intention and the corresponding reward, wherein the last sharing intention can refer to the sharing intention obtained at the moment of obtaining the reward obtained by each cache node in the process of historical data access last time.
The relationship between reward and willingness to share is: comparing the acquired reward obtained by each cache node within a preset time with the expected reward of the cache node, and increasing the sharing willingness when the reward is greater than the preset reward; when the reward is equal to the preset reward, the sharing will not change; when the reward is less than the expected reward, the willingness to share is reduced. In addition, a corresponding relation between the obtained reward difference and the increased value of the sharing will can be preset, and the corresponding relation is searched according to the obtained reward difference and the expected reward difference, so that the increased value of the sharing will can be obtained, and a new sharing will can be obtained. After obtaining the new sharing will, the state may be updated by using the new sharing will, and an updated state is obtained, that is, the sharing will in the updated state is the new sharing will.
The cache and block chain controller is further configured to input the updated state into a DQN (Deep Q network) trained in advance, to obtain a new action, where the new action represents: each cache node and the new corresponding relation of the cache content data cached by the cache node; sending the new corresponding relation to the cache node and updating the corresponding relation stored in the block chain; the DQN is obtained in advance based on the training of the sample state space, the sample reward function and the sample action space.
The cache and block chain controller may input the updated state into the pre-trained DQN to obtain a new action, which represents: each cache node and the new corresponding relation of the cache content data cached by the cache node. After obtaining the new correspondence, the new correspondence may be sent to the cache node and the correspondence stored in the blockchain may be updated.
In the embodiment of the present invention, the DQN is obtained by training based on the sample state space, the sample action space and the sample reward function in advance. Wherein, the sample reward function may comprise: and each cache node is in relation with the flow generated when the cache node provides the cached content data to the user terminal.
It should be noted that, the DQN provided by the embodiment of the present invention may be trained by using the existing DQN training method, which is not described again in the embodiments of the present invention. In the process of DQN training, in each iteration process, a state-action value may be calculated based on traffic generated when the cache node provides content data for a second user terminal located in the local base station in the current iteration process, and a new network parameter of the policy DQN is calculated using the state-action value. In the process, the sharing intention of the cache node influences the flow generated by the cache node for providing the cache service, and the sharing intention of the cache node is related to the reward obtained by the cache node; therefore, the trained DQN may determine a new action according to the reward obtained by the cache node, that is, may determine a new action based on the sharing willingness of each cache node, and preferentially allocate the content data to the cache node with a lower sharing willingness for caching.
The cache node is further configured to update the data content cached by the cache node according to the new corresponding relationship.
After receiving the new corresponding relationship, the cache node judges whether the data content which is not needed to be cached in the cache node but is cached in the cache node exists in the new corresponding relationship, and if so, deletes the data content. And judging whether the data content which needs to be cached in the cache node in the new corresponding relation but is not cached currently exists, if so, sending a request for acquiring the data content to the content providing server, and sending the data content to the cache node for caching by the content providing server.
In the embodiment of the invention, a new corresponding relation can be determined according to the sharing desire of the cache nodes in the process of historical data access, and the content data is preferentially distributed to the cache nodes with lower sharing desire so as to balance the remuneration obtained by each cache node. In addition, the cache and blockchain controller may preferentially cache content data preferred by the second user terminal to the first user terminal communicatively connected to the second user terminal through the D2D link or a mobile convenience cache node of a local base station to which the second user terminal belongs, in the process of determining the corresponding relationship, according to the preference degree of the second user terminal for different content data, so as to improve the access speed of the second user terminal to the target data.
As shown in fig. 4, a data access method based on a blockchain and an intelligent contract is applied to any one of the above data access systems based on a blockchain and an intelligent contract, and the system includes: the mobile base station comprises a plurality of cache nodes, a content providing server, a plurality of caches arranged in the mobile base station and a blockchain controller; wherein, the buffer node includes: at least one mobile edge cache node arranged in the mobile base station and at least one first user terminal cached with content data.
The data access method of the block chain and the intelligent contract provided by the embodiment of the invention comprises the following steps:
s401, the content providing server receives a data access request containing a target data identifier sent by a second user terminal; and determining whether the cache node caches the target data or not based on the corresponding relation between the data content pre-stored in the block chain and the cache node.
And S402, if so, the content providing server sends an intelligent contract deployment request to the cache and the block chain controller of the local base station to which the second user terminal belongs.
S403, the cache and block chain controller receives the intelligent contract deployment request, determines at least one target cache node based on the corresponding relation between the data content pre-stored in the block chain and the cache node, and determines at least one intelligent contract execution node from the target cache node; and generates an intelligent contract description.
And S404, the cache and the block chain controller send the intelligent contract description to the intelligent contract execution node for storage.
S405, the cache and the block chain controller obtain the intelligent contract address.
S406, the cache and the block chain controller sends the intelligent contract address to the content providing server. The intelligent contract description carries payment information, reward information and intelligent contract execution node information; the intelligent contract address is a link address described by the intelligent contract.
And S407, the content providing server sends the intelligent contract address to the second user terminal.
And S408, the second user terminal obtains the identifier of the target cache node based on the block chain or the intelligent contract description.
And S409, the second user terminal sends the intelligent contract address to the target cache node.
And S410, the target cache node obtains the intelligent contract description based on the intelligent contract address.
S411, the target cache node sends the target data to the second user terminal.
And S412, the second user terminal receives the target data.
S413, the second user terminal sends a content transmission receipt to the target cache node.
And S414, the target cache node transmits a content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description.
And S415, the intelligent contract execution node obtains the payment fee from the second user terminal.
And S416, the intelligent contract execution node pays corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract.
Or the intelligent contract execution node obtains payment cost from the content providing server, and pays corresponding rewards to the target cache node and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract.
The data access method based on the block chain and the intelligent contract, provided by the embodiment of the invention, comprises the steps of deploying the intelligent contract through a cache and a block chain controller, determining at least one target cache node, and determining at least one intelligent contract execution node from the target cache node; generating an intelligent contract description, sending the intelligent contract description to the intelligent contract execution node for storage, obtaining an intelligent contract address, and sending the intelligent contract address to the content providing server; and the target cache provider sends target data to the second user terminal, receives a content transmission receipt sent by the user terminal, and pays corresponding remuneration to the target cache provider, the content providing server and the intelligent contract execution node after the intelligent contract execution node receives the content transmission receipt. In the embodiment of the invention, the cache and the block chain controller are uniformly managed and scheduled in the process of accessing data by a user.
As an optional implementation manner of the present invention, the step of determining at least one target cache node based on a correspondence between data content pre-stored in a block chain and cache nodes, and determining at least one intelligent contract execution node from the target cache nodes, includes:
acquiring historical behavior data stored in a block chain by each target cache node; determining the credibility of each target cache node according to the historical behavior data of each target cache node; and the credibility is used for representing the execution probability according to the intelligent contract description when the cache node is used as an intelligent contract execution node.
And selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the credibility of each target cache node, wherein one cache node is a main intelligent contract execution node, and the other cache nodes are auxiliary intelligent contract execution nodes.
The step of paying corresponding reward to the target cache node, the content providing server and the intelligent contract execution node respectively to execute the intelligent contract comprises the following steps:
the master intelligent contract execution node interacts with each slave intelligent contract execution node to acquire transaction authenticity confirmation information of each slave intelligent contract execution node, and determines whether to execute the intelligent contract or not based on a practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the master intelligent contract execution node and the transaction authenticity confirmation information sent by each slave intelligent contract execution node; and if the execution is determined, paying corresponding remuneration to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description.
As an optional implementation manner of the present invention, the step of selecting, by the cache and blockchain controller, a plurality of cache nodes from each target cache node as the intelligent contract execution node according to the reliability of each target cache node includes:
the cache and block chain controller selects a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to a preset expression, wherein the preset expression is as follows:
Figure BDA0002551432340000241
in the above formula, the first and second carbon atoms are,NPrepresenting a predetermined number of intelligent contract execution nodes, JΩiRepresenting the credibility of the ith intelligent contract execution node.
As an optional implementation manner of the present invention, after the step of paying corresponding consideration to the target cache node, the content providing server, and the intelligent contract execution node respectively according to the description of the intelligent contract to execute the intelligent contract, as shown in fig. 4, the data access method based on the blockchain and the intelligent contract provided by the embodiment of the present invention may further include:
s417, the main intelligent contract execution node sends the content distribution record, the transfer record and the transaction authenticity confirmation information of each intelligent contract execution node to the transaction to a block chain consensus algorithm witness node, wherein the block chain consensus algorithm witness node is as follows: and the content is selected from a plurality of cache nodes and a content providing server at regular time.
And S418, the witness node of the blockchain consensus algorithm writes the content distribution record and the transfer record as historical behavior data into a new block of the blockchain.
And S419, the block chain consensus algorithm witness node determines whether the content in the new block is real or not according to the transaction authenticity confirmation information sent by the main intelligent contract execution node.
S420, if the content in the new block is real, the chain of blocks witness algorithm witness node adds the new block to the chain of blocks.
As an optional implementation manner of the present invention, each mobile station corresponds to a plurality of buffers and blockchain controllers.
The buffer and block chain controller of the local base station to which the second user terminal belongs is: and a plurality of caches corresponding to the local base station to which the second user terminal belongs and the block chain controller are selected at regular time.
As an optional implementation manner of the present invention, as shown in fig. 5, the data access method based on a block chain and an intelligent contract according to the embodiment of the present invention may further include:
s501, the cache and the blockchain controller establish an MDP, where the MDP includes: the method comprises the following steps that a preset state space, a reward function and an action space are set, and information represented by states in the state space comprises sharing intentions of all cache nodes; the reward function includes: each cache node and the relation between the flow generated when the cache node provides the cached content data to the user terminal; the action in the action space represents the corresponding relation between each cache node and the content data cached by the cache node; the sharing intention is determined based on a relationship between a reward obtained by the cache node and an expected reward each time the user terminal accesses data.
S502, the cache and block chain controller regularly obtains remuneration obtained by each cache node in the process of historical access data, and determines new sharing willingness of each cache node based on the remuneration.
S503, the cache and the blockchain controller update the state with the new sharing will to obtain an updated state.
S504, the cache and block chain controller inputs the updated state into the pre-trained DQN to obtain a new action, and the new action represents: each cache node and the new corresponding relation of the cache content data cached by the cache node. The DQN is obtained in advance based on the training of the sample state space, the sample reward function and the sample action space.
S505, the cache and the blockchain controller send a new corresponding relation to the cache node.
S506, the cache and the blockchain controller update the corresponding relationship stored in the blockchain.
And S507, the cache node updates the data content cached by the cache node according to the new corresponding relation.
An embodiment of the present invention further provides a mobile base station, which is applied to any one of the above data access systems based on a block chain and an intelligent contract, and the mobile base station includes: a plurality of cache and blockchain controllers, and a mobile edge cache node, wherein the cache and blockchain controller of the local base station to which the second user terminal belongs is: and a plurality of caches corresponding to the local base station to which the second user terminal belongs and the block chain controller are selected at regular time.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (9)

1. A data access system based on blockchains and smart contracts, comprising: the mobile base station comprises a plurality of cache nodes, a content providing server, a plurality of caches arranged in the mobile base station and a blockchain controller; wherein, the buffer node includes: at least one mobile edge cache node arranged in a mobile base station and at least one first user terminal cached with content data;
the content providing server is used for receiving a data access request containing a target data identifier sent by a second user terminal; determining whether a cache node caches target data or not based on the corresponding relation between the data content pre-stored in the block chain and the cache node; if so, sending an intelligent contract deployment request to a cache and a block chain controller of a local base station to which the second user terminal belongs;
the cache and block chain controller is used for receiving the intelligent contract deployment request, determining at least one target cache node based on the corresponding relation between the data content pre-stored in the block chain and the cache nodes, and determining at least one intelligent contract execution node from the target cache nodes; generating an intelligent contract description, and sending the intelligent contract description to the intelligent contract execution node for storage; obtaining an intelligent contract address and sending the intelligent contract address to the content providing server; the intelligent contract description carries payment information, reward information and intelligent contract execution node information; the intelligent contract address is a link address described by the intelligent contract;
the content providing server is further used for sending the intelligent contract address to the second user terminal;
the second user terminal is further configured to obtain an identifier of a target cache node based on the block chain or the intelligent contract description, and send the intelligent contract address to the target cache node;
the target cache node is used for obtaining the intelligent contract description based on the intelligent contract address and sending the target data to the second user terminal;
the second user terminal further receives the target data and sends a content transmission receipt to the target cache node;
the target cache node further sends the content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description;
the intelligent contract execution node is used for obtaining payment cost from the second user terminal and paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract; or, the system is configured to obtain payment fees from the content providing server, and pay corresponding rewards to the target cache node and the intelligent contract execution node according to the intelligent contract description, so as to execute the intelligent contract.
2. The system of claim 1,
the cache and block chain controller determines at least one target cache node based on the corresponding relation between the data content pre-stored in the block chain and the cache node, and determines at least one intelligent contract execution node from the target cache node, including:
acquiring historical behavior data stored in a block chain by each target cache node; determining the credibility of each target cache node according to the historical behavior data of each target cache node; the credibility is used for representing the execution probability according to the intelligent contract description when the cache node is used as an intelligent contract execution node;
selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the credibility of each target cache node, wherein one cache node is a master intelligent contract execution node, and the other cache nodes are slave intelligent contract execution nodes;
the master intelligent contract execution node is specifically configured to: interacting with each slave intelligent contract execution node, acquiring transaction authenticity confirmation information of each slave intelligent contract execution node, and determining whether to execute the intelligent contract based on a practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the slave intelligent contract execution node and the transaction authenticity confirmation information sent by each slave intelligent contract execution node; and if the execution is determined, paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description.
3. The system of claim 2, wherein the cache and blockchain controller, based on the trustworthiness of each of the target cache nodes, selects a plurality of cache nodes from each of the target cache nodes as intelligent contract execution nodes, comprising:
selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to a preset expression, wherein the preset expression is as follows:
Figure DEST_PATH_IMAGE001
in the above formula, the first and second carbon atoms are,
Figure 579663DEST_PATH_IMAGE002
representing a preset number of said intelligent contract execution nodes,
Figure DEST_PATH_IMAGE003
is shown as
Figure 434486DEST_PATH_IMAGE004
The trustworthiness of individual intelligent contract enforcement nodes.
4. The system of claim 2,
the main intelligent contract execution node further pays corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node respectively according to the intelligent contract description so as to execute the intelligent contract, and then sends a content distribution record, a transfer record and transaction authenticity confirmation information of each intelligent contract execution node to the transaction to a block chain consensus algorithm witness node, wherein the block chain consensus algorithm witness node is as follows: the content providing server is selected from a plurality of cache nodes and the content providing server at regular time;
the witness node of the block chain consensus algorithm is used for:
the content distribution record, the transfer record and transaction authenticity confirmation information of each intelligent contract execution node on the transaction are used as historical behavior data and written into a new block of the block chain;
determining whether the content in the new block is real or not according to the transaction authenticity confirmation information sent by the main intelligent contract execution node;
if the content in the new block is real, adding the new block to the block chain.
5. The system of claim 1, wherein each mobile station has a plurality of buffers and blockchain controllers;
the cache and block chain controller of the local base station to which the second user terminal belongs is: and a plurality of caches corresponding to the local base station to which the second user terminal belongs and the block chain controller are selected at regular time.
6. The system of claim 1, wherein the cache and blockchain controller is further configured to:
establishing a Markov Decision Process (MDP), wherein the MDP comprises the following steps: the method comprises the following steps that a preset state space, a reward function and an action space are set, and information represented by states in the state space comprises sharing intentions of all cache nodes; the reward function includes: each cache node and the relation between the flow generated when the cache node provides the cached content data to the user terminal; the action in the action space represents the corresponding relation between each cache node and the content data cached by the cache node; the sharing will is determined based on the relationship between the reward obtained by the cache node and the expected reward when the user terminal accesses the data each time;
obtaining rewards obtained by each cache node in the process of historical data access at regular time, determining new sharing willingness of each cache node based on the rewards, updating the state by using the new sharing willingness, and obtaining the updated state;
inputting the updated state into a pre-trained deep Q network DQN to obtain a new action, wherein the new action represents: each cache node and the new corresponding relation of the cache content data cached by the cache node; sending the new corresponding relation to the cache node, and updating the corresponding relation stored in the block chain; the DQN is obtained by training based on a sample state space, a sample reward function and a sample action space in advance;
and the cache node is also used for updating the data content cached by the cache node according to the new corresponding relation.
7. A data access method based on a blockchain and an intelligent contract, which is applied to the data access system based on the blockchain and the intelligent contract of any one of claims 1 to 6, and the method comprises the following steps:
the content providing server receives a data access request containing a target data identifier sent by a second user terminal; determining whether a cache node caches target data or not based on the corresponding relation between the data content pre-stored in the block chain and the cache node; if so, sending an intelligent contract deployment request to a cache and a block chain controller of a local base station to which the second user terminal belongs;
the cache and blockchain controller receives the intelligent contract deployment request, determines at least one target cache node based on the corresponding relation between the data content pre-stored in the blockchain and the cache node, and determines at least one intelligent contract execution node from the target cache node; generating an intelligent contract description, and sending the intelligent contract description to the intelligent contract execution node for storage; obtaining an intelligent contract address and sending the intelligent contract address to the content providing server; the intelligent contract description carries payment information, reward information and intelligent contract execution node information; the intelligent contract address is a link address described by the intelligent contract;
the content providing server sends the intelligent contract address to the second user terminal;
the second user terminal obtains the identification of a target cache node based on the block chain or the intelligent contract description, and sends the intelligent contract address to the target cache node;
the target cache node obtains the intelligent contract description based on the intelligent contract address and sends the target data to the second user terminal;
the second user terminal further receives the target data and sends a content transmission receipt to the target cache node;
the target cache node further sends the content transmission receipt to the intelligent contract execution node according to the intelligent contract execution node information in the intelligent contract description;
the intelligent contract execution node obtains payment cost from the second user terminal, and pays corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract; or obtaining payment cost from the content providing server, and paying corresponding rewards to the target cache node and the intelligent contract execution node according to the intelligent contract description so as to execute the intelligent contract.
8. The method according to claim 7, wherein the step of determining at least one target cache node based on the correspondence between the data content pre-stored in the blockchain and the cache nodes, and determining at least one intelligent contract execution node from the target cache nodes comprises:
acquiring historical behavior data stored in a block chain by each target cache node; determining the credibility of each target cache node according to the historical behavior data of each target cache node; the credibility is used for representing the execution probability according to the intelligent contract description when the cache node is used as an intelligent contract execution node;
selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the credibility of each target cache node, wherein one cache node is a master intelligent contract execution node, and the other cache nodes are slave intelligent contract execution nodes;
the step of paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node respectively to execute the intelligent contract comprises the following steps:
the master intelligent contract execution node interacts with each slave intelligent contract execution node to acquire transaction authenticity confirmation information of each slave intelligent contract execution node, and determines whether to execute the intelligent contract or not based on a practical Byzantine fault-tolerant protocol, the transaction authenticity confirmation information of the master intelligent contract execution node and the transaction authenticity confirmation information sent by each slave intelligent contract execution node; and if the execution is determined, paying corresponding rewards to the target cache node, the content providing server and the intelligent contract execution node according to the intelligent contract description.
9. The method according to claim 8, wherein the step of the cache and blockchain controller selecting a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to the credibility of each target cache node comprises:
the cache and block chain controller selects a plurality of cache nodes from each target cache node as intelligent contract execution nodes according to a preset expression, wherein the preset expression is as follows:
Figure DEST_PATH_IMAGE005
in the above formula, the first and second carbon atoms are,
Figure 902639DEST_PATH_IMAGE002
representing a preset number of said intelligent contract execution nodes,
Figure 235531DEST_PATH_IMAGE003
is shown as
Figure 49903DEST_PATH_IMAGE004
The trustworthiness of individual intelligent contract enforcement nodes.
CN202010577371.1A 2020-06-22 2020-06-22 Data access system and method based on block chain and intelligent contract Active CN111741000B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010577371.1A CN111741000B (en) 2020-06-22 2020-06-22 Data access system and method based on block chain and intelligent contract

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010577371.1A CN111741000B (en) 2020-06-22 2020-06-22 Data access system and method based on block chain and intelligent contract

Publications (2)

Publication Number Publication Date
CN111741000A CN111741000A (en) 2020-10-02
CN111741000B true CN111741000B (en) 2021-06-22

Family

ID=72650488

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010577371.1A Active CN111741000B (en) 2020-06-22 2020-06-22 Data access system and method based on block chain and intelligent contract

Country Status (1)

Country Link
CN (1) CN111741000B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113205424B (en) * 2020-10-28 2023-08-25 支付宝(杭州)信息技术有限公司 Method and apparatus for deploying and invoking contracts in blockchain
CN112766979A (en) * 2021-01-26 2021-05-07 特斯联科技集团有限公司 Rapid electronic payment method and device
CN113821570B (en) * 2021-11-22 2022-03-01 中国信息通信研究院 Data processing method based on block chain and SQL
CN116915781B (en) * 2023-09-14 2023-12-12 南京邮电大学 Edge collaborative caching system and method based on blockchain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN206639260U (en) * 2017-04-18 2017-11-14 杜伯仁 A kind of block chain network node serve device towards multi-tiling platform chain
CN108418855A (en) * 2018-01-22 2018-08-17 北京邮电大学 Active cache method, apparatus and system based on name data network NDN
CN108769751A (en) * 2018-05-02 2018-11-06 中广热点云科技有限公司 A kind of network video based on intelligent contract listens Management Support System
CN110008738A (en) * 2019-02-21 2019-07-12 网易(杭州)网络有限公司 For the caching method of block chain contract data, device, medium and calculate equipment
CN110069295A (en) * 2019-05-06 2019-07-30 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019237126A1 (en) * 2018-06-08 2019-12-12 Gcp Ip Holdings I, Llc Blockchain overwatch
US11232446B2 (en) * 2018-10-26 2022-01-25 Hewlett Packard Enterprise Development Lp Carrier grade telecom blockchain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN206639260U (en) * 2017-04-18 2017-11-14 杜伯仁 A kind of block chain network node serve device towards multi-tiling platform chain
CN108418855A (en) * 2018-01-22 2018-08-17 北京邮电大学 Active cache method, apparatus and system based on name data network NDN
CN108769751A (en) * 2018-05-02 2018-11-06 中广热点云科技有限公司 A kind of network video based on intelligent contract listens Management Support System
CN110008738A (en) * 2019-02-21 2019-07-12 网易(杭州)网络有限公司 For the caching method of block chain contract data, device, medium and calculate equipment
CN110069295A (en) * 2019-05-06 2019-07-30 百度在线网络技术(北京)有限公司 Block chain processing method, device, equipment and medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Service-Aware Optimal Caching Placement for Named Data Networking》;Ran Zhang,et.al;《IEEE》;20191231;全文 *
《基于命名数据网络的区块链信息传输机制》;刘江等;《通信学报》;20180131;全文 *

Also Published As

Publication number Publication date
CN111741000A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN111741000B (en) Data access system and method based on block chain and intelligent contract
CN107819829B (en) Method and system for accessing block chain, block chain node point equipment and user terminal
KR102254809B1 (en) Distributed computing resources sharing system and computing apparatus thereof providing reward based on block chain
CN111727428B (en) Room inventory management system based on block chain
US20190132222A1 (en) Apparatus for providing cloud service based on cloud service brokerage and method thereof
US11064041B2 (en) Apparatus for providing cloud service using cloud service brokerage based on multiple clouds and method thereof
CN105094997B (en) Physical memory sharing method and system between a kind of cloud computing host node
CN105074702A (en) Database system providing single-tenant and multi-tenant environments
CN106464669B (en) Intelligent file prefetching based on access patterns
CN101216855B (en) Message kind business accumulated data caching method and system
JP2007528060A (en) An approach for estimating user ratings of items
CN110677462B (en) Access processing method, system, device and storage medium for multi-block chain network
CN113609167B (en) Data processing method, device and equipment based on block chain and readable storage medium
CN109088722B (en) Block chain node evolution method and block chain node
CN103067634A (en) Image forming system, image forming device, image forming method, and non-transitory computer readable medium
CN110852870A (en) Virtual resource transfer method, device, equipment and readable storage medium
US20190372825A1 (en) Communication apparatus, communication method, and recording medium
CN110381150B (en) Data processing method and device on block chain, electronic equipment and storage medium
JP7192645B2 (en) Information processing device, distributed processing system and distributed processing program
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server
CN110009320B (en) Resource conversion method, device, system, storage medium and computer equipment
CN112235345B (en) Content distribution network active cache delivery method and system
CN113760521B (en) Virtual resource allocation method and device
KR101810180B1 (en) Method and apparatus for distributed processing of big data based on user equipment
KR102140325B1 (en) Method of fact-cheching, searching and managing contents based on blockchain and system thereof

Legal Events

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