A kind of resource in block chain uploads and resource request method
Technical field
It uploads and provides the present embodiments relate to the resource in block chain data processing field more particularly to a kind of block chain
Source requesting method.
Background technique
With the development of communication technology, the application of content distributing network (Content Delivery Network, CDN) is got over
Come more extensive.Existing content distribution mechanism generally too relies on centralization platform, and such platform possesses excessively powerful control
Power, so that the competition between the traffic-operating period of platform itself, platform all unavoidably influences whether the normal use of user.
Centralization platform is mostly used to carry out storage distribution, center to the content resource of upload in existing content distributing network greatly
Change platform inside hold storage distribution when, due to the centralized management of content resource, not can guarantee not only user copyright and each angle
The vital interests of color user, each Role Users can be content uploading person, message sender or content reader etc. also limit
The propagation of content in a network, and there is the risks that data are lost at any time.
The seriousness of the above problem is various, such as:
1, copyright information is difficult to really weigh.The copyright ownership information of original content need to be guaranteed by content distribution platform rather than
User itself, user are difficult to guarantee the copyright interest of itself by effective means, can only platform dependent fairness, other users
Supervision and the various aspects such as laws and regulations constrained;Secondly, the copyright proof of original content is also relied on content platform
Technology robustness.Therefore, the attaching problem that user itself does not have effective means to prove copyright.
2, copyright interest distribution is opaque.In centralization platform, all the elements resource is distributed by platform, and information is not
Symmetrically, opaque, seriously endanger the interests of ordinary user;Meanwhile message sender, advertisement readers etc. are a series of to obtain
Take the role of income that can not all obtain due income;Even if the corresponding benefit crowd in platform side has carried out distribution of interests, should benefit
The problems such as crowd is also difficult to grasp whether itself benefit meets distribution principle, and whether platform is annexed;Therefore, centralization platform lacks
The a series of validity such as the distribution of interests that distribution of interests rule proves, can trace to the source prove.
3, content resource centralization stores.Existing content platform is respectively independent, respectively possesses the system architecture of itself.And it is each
The technical level of platform is different, it is likely that it can be on the hazard because of the robustness of system architecture, for example system is attacked, it is interior
Hold resource maliciously to be deleted;After system is rejected service (Denial of Service, DoS) attack paralysis, it can not be mentioned for user
For service;System function is there are loophole, a series of problems, such as certain functions are not available.Meanwhile the availability of data not only can
Because technical problem is not available, can also because of platform itself traffic-operating period and be not available, such as when small-to-medium business without
After method maintains, their content resource would not may continue to store, and cause the loss of content resource, greatly compromise use
Family interests.
Summary of the invention
It is uploaded the embodiment of the invention provides the resource in a kind of block chain and resource request method, reduction resource flow is gone wrong
Danger.
In a first aspect, the embodiment of the invention provides the resource method for uploading in a kind of block chain, this method comprises:
Super node in service-domain receives the content resource that user node uploads;
The super node stores memory node fragment of the content resource in this service-domain;
The resource characteristic value that the super node generates the content resource returns to the user node, the super section
Point stores resource characteristic value and fragment the storage information of the content resource to alliance's chain;
The user node calls distribution of interests rule of the intelligent contract by the resource characteristic value and the content resource
It is uploaded to publicly-owned chain.
Second aspect, the embodiment of the invention provides the resource request methods in a kind of block chain, this method comprises:
Super node in service-domain receives the resource request of user node, includes in the resource request of the user node
Resource characteristic value;
The super node searches the fragment storage letter of corresponding content resource according to the resource characteristic value in alliance's chain
Breath returns to the user node;The super node calls the corresponding intelligent contract statement of resource characteristic value described in publicly-owned chain
This resource service process;
The user node stores information according to the fragment and downloads resource data;The user node calls in publicly-owned chain
The corresponding intelligent contract of the resource characteristic value pays each side's income of this resource service process.
Resource in a kind of block chain provided in an embodiment of the present invention uploads and resource request method, by alliance's chain
Fragment of the content resource of search request when uploading stores information, and downloads corresponding resource data, and in request process
Middle super node calls the corresponding intelligent contract of the resource characteristic value of the content resource in publicly-owned chain to state this resource service mistake
Journey, and call the intelligence contract in publicly-owned chain to pay each side's income of this resource service process by user node, pass through public affairs
There are chain and alliance's chain to realize the upload and access process of content resource, the copyright information of content resource and distribution of interests rule is made to exist
Transparence in publicly-owned chain, and realize the decentralization storage of content resource, the initiative of resource sharing is improved, resource loss is reduced
Risk.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, of the invention other
Feature, objects and advantages will become more apparent upon:
Figure 1A is the flow chart of the resource method for uploading in a kind of block chain that the embodiment of the present invention one provides;
The architecture principle figure of content distributing network in the method that Figure 1B provides for the embodiment of the present invention one;
For the architecture framework of publicly-owned chain and alliance's chain in the method that Fig. 1 C provides for the embodiment of the present invention one;
Fig. 2 is the flow chart of the resource method for uploading in a kind of block chain provided by Embodiment 2 of the present invention;
Fig. 3 is the flow chart of the resource request method in a kind of block chain that the embodiment of the present invention three provides;
Fig. 4 is the flow chart of the resource request method in a kind of block chain that the embodiment of the present invention four provides;
Fig. 5 is the flow chart of the resource request method in a kind of block chain that the embodiment of the present invention five provides;
Fig. 6 A is the money being applied in one of particular content distribution network block chain that the embodiment of the present invention six provides
The flow chart of source requesting method;
Fig. 6 B is the architecture principle figure of the particular content distribution network in the method that the embodiment of the present invention six provides.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Figure 1A is the flow chart of the resource method for uploading in a kind of block chain that the embodiment of the present invention one provides, and the present invention is real
Example is applied to be applicable in the content distributing network that any pair of content resource is handled.Specifically, as shown in Figure 1B, the present invention
In embodiment, in the corresponding network topology of content distributing network, each network node when can be distributed according to content resource
Logical place, which determines, provides the super node of content distribution and storage service, and super node has the function of centralization control, can
To be correspondingly connected with multiple and different memory node and user node, at this point, the corresponding different memory nodes of same super node or
User node constitutes a service-domain.Other corresponding nodes of super node meanwhile in content distribution procedure, in service-domain
Quantity can need to be updated at any time according to content distribution.Wherein, user node can be user's upload or request content money
Client selected by user when source can be not involved in the data common recognition of block chain in the present embodiment.Meanwhile except super in service-domain
Other nodes except grade node are uploaded in user by the node or when request content resource as user node, and super
As memory node when node stores variant content resource by the node.Therefore, user node and memory node can be with
It is node different in service-domain, and had both can store received each content resource in super node in a certain node, it can also be with
It is uploaded by user by the node or when request content resource, the node can also be simultaneously as user's section in service-domain at this time
Point and memory node.In addition, as shown in Figure 1 C, it is super in each service-domain in the content distributing network in the embodiment of the present invention
Node maintains alliance's chain jointly, framework management by synchronization module and Context resolution module two submodules in alliance's chain,
To record circulation information of the content resource in content distributing network and storage information;In each service-domain include super node,
Network node including user node, memory node and block common recognition node maintains a publicly-owned chain jointly, wherein block
Common recognition node can be only involved in the common recognition of the data in block chain, and and be not involved in the content distribution service in content distributing network,
And user node can be not involved in the common recognition of the data in block chain, framework content release module and payment management mould in publicly-owned chain
Two submodules of block, with record content resource copyright information and each resource service during each side's income.
Specifically, the present embodiment is applicable to how to solve content resource in any content distributing network in upload procedure
In storage and distribution of interests problem.Resource method for uploading in a kind of block chain provided in this embodiment can by publicly-owned chain and
The content release module configured on each network node in alliance's chain is executed by the data interaction between each network node.Tool
Body, with reference to Figure 1A, this method be may include steps of:
S110, the super node in service-domain receive the content resource that user node uploads.
Wherein, service-domain be in content distributing network one have a set of computers of security boundary, in the present embodiment in advance
Determine corresponding each super node in content distributing network, such as: CDN service quotient etc., each super node and its under not
Different service-domains is respectively constituted with memory node, and super node is only user's offer service in own services domain.It is super
Node is mainly used for managing the memory node in this service-domain, and safeguards alliance's chain jointly.User node is user at this
Client selected by user when uploading or request corresponding content resource in service-domain.For example, user is existed by mobile terminal
When corresponding Baidu's cloud website uploads a file resource, mobile terminal at this time is then the corresponding user node of the user.User
Node, which can according to need, to be added at any time in corresponding service-domain, can also be exited at any time.Content resource is content distributing network
All kinds of resource datas of middle transmission, for example, the popular information in microblogging and each video in playing platform etc..
Optionally, need the content resource of itself uploading to partial volume distribution network in user, allow other users into
When row accordingly accesses, it is necessary first to receive the content resource of user, be divided into content distributing network in the present embodiment multiple and different
Service-domain, therefore in reception content resource, it is first determined the service-domain where user node, user node will be locally stored
User upload content resource, the super node being uploaded in this service-domain, so that the super node in this service-domain be made to connect
The content resource that user node uploads is received, so that the super node can accordingly be deposited in the subsequent content resource to upload
Storage.Illustratively, when user uploads a local video by mobile phone, which can be by the local video as user node
It corresponds in the super node in this service-domain where uploading to the user node, receives the super node in this service-domain
The video that user node uploads.
S120, super node store memory node fragment of the content resource in this service-domain.
Wherein, memory node can be its that can correspond to storage content resource in this service-domain in addition to super node
His node, and other nodes in this service-domain in addition to super node need to upload or request by the node to visit in user
As user node when asking content resource, it is stored in this service-domain in various uploads in super node by node correspondence
As memory node when holding resource.
Specifically, receiving the user node in the super node where the user node for uploading content resource in service-domain
When the content resource of upload, in order to improve transmission rate when content distribution and guarantee the data high availability of content resource,
The content resource received can be carried out fragment by super node, carried out fragment on each memory node in this service-domain and deposited
Storage.Further, super node can determine the size of received content resource when carrying out fragment to content resource first,
And corresponding fragment is carried out according to resource size, reference numeral can be carried out to each fragment content resource at this time, each fragment is compiled
The corresponding storage of number corresponding fragment content resource determines that each fragment number is corresponding into the memory node in this service-domain
Fragment storage location realizes that fragment of the super node to content resource in each memory node stores in this service-domain.
S130, the resource characteristic value that super node generates content resource return to user node, and super node provides content
Resource characteristic value and fragment the storage information in source are stored to alliance's chain.
Wherein, resource characteristic value is to carry out corresponding Hash operation to the content resource of upload, and obtained unique expression should
The identification information of content resource.It, can be with specifically, handled by using content resource of the corresponding hash algorithm to upload
It is the binary value of regular length by the content resource correspondence mappings, obtains corresponding cryptographic Hash, which can uniquely mark
Know the resource characteristic value in the content resource, that is, the present embodiment.It optionally, can be by upload in the present embodiment
Hold resource and operation is carried out using informative abstract Encryption Algorithm, to obtain corresponding resource characteristic value.
Optionally, super node is after by memory node fragment storage of the content resource in this service-domain, in order to can be with
Every a content resource uploaded is distinguished, the money of the content resource can be generated by using corresponding hash algorithm
Source characteristic value to distinguish in content distributing network to the content resource of each upload, and the resource characteristic value is returned to
The user node of the content resource is uploaded, realizes corresponding income storage in publicly-owned chain so as to subsequent.And in order in content point
In hairnet network can to each network node upload all kinds of content resources carry out it is cross-platform request access to, on content resource
It, at this time can should if super node carries out fragment storage in this service and interior memory node to the content resource when biography
The resource characteristic value of content resource and the fragment storage information of determination pass through between the super node in each service-domain of alliance's chain
An affairs upload request is sent, node is generated by block current in alliance's chain, a series of things is carried out to the affairs upload request
Business processing operation, to the resource characteristic value for uploading content resource and fragment storage information be stored into alliance's chain, with after an action of the bowels
The continuous cross-platform access for carrying out corresponding resource.
In addition, in existing content distributing network in the network node of different distribution platforms when uploading content resource, by
The content resource respectively uploaded is not shared in real time between each network node of different platform, may be existed at this time same
The phenomenon that copyright repeated and redundant of one content resource, therefore the resource that the present embodiment stores corresponding content resource by alliance's chain is special
Value indicative and fragment store information, and the resource redundancy that can be uploaded with uploader in monitoring content distribution network avoids unnecessary money
Source waste.Meanwhile can guarantee the uniqueness of the content resource uploaded in alliance's chain, it also can protect the version of the content resource
Weigh information.
S140, user node call intelligent contract that the distribution of interests rule of resource characteristic value and content resource is uploaded to public affairs
There is chain.
Specifically, the tool that intelligent contract belongs to user and block chain interacts, will incite somebody to action after the completion of system building
Block chain is written in corresponding intelligence contract, in case follow-up business is called.User accesses corresponding in content distributing network
When content resource, since content resource may belong to payment resource, access user, which needs to pay certain expense, can be just somebody's turn to do
Content resource participates in the users such as uploader, the disseminator of the content resource of this content distribution at this time in content distributing network
Role should all collect certain interests.Optionally, distribution of interests rule is that content resource is pre-configured with when uploading by upload user
For participate in resource dissemination during each user role should distribute benefit ratio rule.
Optionally, when user node receives the resource characteristic value of the return of the super node in this service-domain, Yong Hujie
Point can be according to the resource characteristic value in the upload for locally directly configuring the content resource of the subsequent content resource in access when
Node, the benefit ratio for propagating each user roles such as node generate corresponding distribution of interests rule.In order to visit content resource
Interests circulation carries out corresponding distribution after the payment asked, user node can be by calling intelligent contract by the resource of the content resource
Characteristic value and corresponding distribution of interests rule generate corresponding transactions requests in each node in publicly-owned chain, by publicly-owned chain
Current block generate node respective handling carried out to the transactions requests, and be uploaded in publicly-owned chain, thus in subsequent access
Determine the corresponding benefit ratio of each user role.
In addition, publicly-owned chain stores the fragment of content resource as the main chain for being used for charging in content resource distribution procedure
Information and resource flow transfering the letter breath are stored in alliance's chain, are reduced the storage of publicly-owned chain and are calculated pressure, improve content resource
Retrieval rate, reduce the access pressure of publicly-owned chain.And the uniqueness for uploading content resource is carried out by super node
Audit, can protect corresponding copyright information to avoid piracy.
Technical solution provided in this embodiment, it is special by the resource for storing the content resource in this service-domain in alliance's chain
Value indicative and fragment store information, and the resource characteristic value and distribution of interests rule of content resource are uploaded in publicly-owned chain, in realization
Hold transparence of the distribution of interests rule of resource in publicly-owned chain, avoids information asymmetry caused by centralization platform, interests
The problems such as distribution is uneven, and realize the decentralization storage of content resource, reduce resource loss risk.
Specifically, technical solution provided in an embodiment of the present invention, can achieve following technical effect:
1, copyright information is really weighed
The present embodiment utilizes digital signature technology and publicly-owned chain characteristic, proves that content resource belongs to by mathematical computations mode
In the user node for uploading the content resource.Meanwhile the characteristic of account book being disclosed using publicly-owned chain, it is complete in content distributing network
Portion's node carries out publicity, avoids other users from repeating to state to the content resource right of attribution, obscures copyright information.
2, distribution of interests is transparent can verify that
After the user node of request content resource pays the content resource, associated rights interests will be according to intelligence
Distribution of interests rule in contract is automatically performed transfer operation, avoids information asymmetry caused by centralization platform, interests point
The problems such as with unevenness.After the completion of distribution of interests, all kinds of transfer accounts can be searched by publicly-owned chain, convenient for distribution of interests information
Audit and supervision.
3, decentralization stores
The embodiment of the present invention avoids content distribution platform exclusive resource, and forms monopolization, it can be achieved that interior to content resource
Hold cross-platform, across the service-domain calling of resource.Content distribution platform only provides the content resource displaying of this service-domain, commending contents
Deng displaying layer service, no longer content resource is stored.The uncertain factors such as content distribution platform operation situation no longer endanger
The availability of content resource, the content resource that user uploads can be by storage effective, can verify that, persistent and access.
4, efficient content distribution
The embodiment of the present invention proposes the concept of service-domain and super node, and super node is the user node in this service-domain
Content distribution service is provided, to guarantee content distribution efficiency.Content circulation carries out letter by the alliance's chain safeguarded between super node
Breath interaction.Content distribution is completed by super node, super node can guarantee service quality, and complete content resource examination, avoid
Circulation of the harmful content resource in content distributing network.
Embodiment two
Fig. 2 is the flow chart of the resource method for uploading in a kind of block chain provided by Embodiment 2 of the present invention.The present embodiment
It is to optimize on the basis of the above embodiments.Specifically, as shown in Fig. 2, this method may include steps of:
The copyright information of content resource is uploaded in publicly-owned chain by S210, user node.
Optionally, the copyright information of content resource indicates the uploader of content resource, in following resource access, passes through version
It weighs information and certain income is paid to corresponding uploader.Publicly-owned chain is mainly used for the payment problem of resource access process, in user
When needing to upload piece of content resource, user node receives the content resource of user upload, and is locally determining content resource
Copyright information, that is, the match information of the user node and the content resource of upload, and the copyright of the content resource is believed
Breath is uploaded in publicly-owned chain, when so as to subsequent access, can be corresponded to and be obtained certain payment income.Wherein, in the present embodiment
The copyright information for holding resource can be digitally signed determination to the content resource by user node.Specifically, user node
In the content resource for receiving upload, unique corresponding cryptographic Hash of the content resource is generated using hash algorithm in local,
It is signed using cryptographic Hash of the private key in unsymmetrical key to the content resource, content resource access is needed to test subsequent
When signed certificate name, it is necessary to which the public key corresponding with the private key provided using the user node is signed with verifying to prove content resource
The user node of ownership, and using the characteristic for disclosing account book in publicly-owned chain, publicity is carried out in whole nodes, avoids other sections
Point carries out the right of attribution of the content resource to repeat statement, obscures copyright information.
S220, the super node in service-domain receive the content resource that user node uploads.
S230, super node store memory node fragment of the content resource in this service-domain.
S240, super node, which generates, to be held the resource characteristic value of resource and returns to user node, and super node is by content resource
Resource characteristic value and fragment storage information storage to alliance's chain.
S250, user node call intelligent contract that the distribution of interests rule of resource characteristic value and content resource is uploaded to public affairs
There is chain.
Technical solution provided in this embodiment, it is special by the resource for storing the content resource in this service-domain in alliance's chain
Value indicative and fragment store information, and the resource characteristic value and distribution of interests rule of content resource are uploaded in publicly-owned chain, in realization
Hold the transparence of the copyright information and distribution of interests rule of resource in publicly-owned chain, avoids information caused by centralization platform not
Symmetrically, the problems such as distribution of interests is uneven, and realize the decentralization storage of content resource, reduce resource loss risk.
Embodiment three
Fig. 3 is the flow chart of the resource request method in a kind of block chain that the embodiment of the present invention three provides, the present embodiment
It is applicable to the resource downloading how solved in content distributing network content resource in access process and the payment of corresponding interests
Problem.Resource request method in a kind of block chain provided in this embodiment can be by each network section in publicly-owned chain and alliance's chain
Context resolution module, content synchronization module and the payment management module configured on point passes through the data interaction between each network node
To execute jointly.Specifically, this method may include steps of with reference to Fig. 3:
S310, the super node in service-domain receive the resource request of user node.
It wherein, include resource characteristic value in the resource request of user node.Optionally, it needs in user to content delivery network
When a certain content resource in network requests access to, since the fragment storage information of content resource stores in alliance's chain, and alliance
Chain includes the super node in each service-domain, therefore the user node (client) where first passing through the user determines that this is interior
Hold the resource request of resource, and the resource request is sent to the super node in the service-domain of user node place, this service-domain
In super node receive user node transmission include the resource characteristic value of content resource that needs access including resource
Request, so as to the subsequent storage information for searching corresponding content resource in alliance's chain.
S320, the fragment storage information that super node searches corresponding content resource according to resource characteristic value in alliance's chain are returned
Back to user node;Super node calls the corresponding intelligent contract of resource characteristic value in publicly-owned chain to state this resource service mistake
Journey.
Wherein, when this resource service process is that user accesses content resource, the content resource is in content distributing network
Specific resource flows through journey.Optionally, the super node in this service-domain is in the resource request for receiving user node
The content resource of corresponding access is obtained, which can look into alliance's chain according to the resource characteristic value in resource request
Super node of the content resource when resource uploads in corresponding with service domain is looked for, and searches the service-domain for being stored with the content resource
In the fragment of the corresponding storage of super node store information, fragment storage information may include the volume after content resource fragment
Number, the storage location in each memory node.Wherein, the data structure of the fragment storage information of acquisition can be fID:
[{ shard1:{ location1, hash1 } }, { shard2:{ location2, hash2 } } ... ..., shardn:
{locationn,hashn}}].Wherein, shard indicates fragment number, and location indicates storage location, and hash indicates this point
Piece content resource carries out the fragment cryptographic Hash that Hash operation obtains, and can uniquely indicate the fragment content resource.In this service-domain
Super node when the fragment for finding corresponding content resource stores information, fragment storage information is returned to and needs to request
The user node of the content resource, so that user node can store the corresponding money of the corresponding downloading of information subsequent according to the fragment
Source data.
Further, the super node in this service-domain is when returning to corresponding fragment storage information to user, Ke Yizuo
Content resource is transmitted for the message sender during this resource service, in the subsequent payment of user, is needed pair
The super node pays certain income, therefore the income in order to protect each user role during this resource service, super section
Point can provided for user node fragment storage information after, can also call in publicly-owned chain content resource upload when store with
The corresponding intelligent contract of the resource characteristic value, to state this resource service process, to indicate that super node participates in this resource
Service process, subsequent available certain income.
Optionally, also have in the prior art through bit stream (Bit Torrent) agreement and realize Distributed Storage
And downloading, p2p network is established using distributed hashtable (distributed hash table, DHT), under helping user to establish
Link is carried, content resource is divided into small segment from the equipment of different user and is downloaded end to end, centralization is avoided to deposit
The problems such as resource caused by storage is unavailable and speed of download is slow.But although Bit Torrent agreement is p2p mode to money
Source is downloaded, but Bit Torrent needs to parse corresponding resource characteristic value there are the server of centralization, and
The analysis mode of centralization may will become the bottleneck in system, if the server of centralization is attacked, system service may
Meeting can not normal use.Alternatively, using interspace file system (Inter Planetary File System, IPFS) and StorJ
Content resource is distributed, both helps user node more fully to utilize the memory space of itself, by memory space
Be leased to other users, both using by file division storage by the way of by the storage of entire file distribution in a network
Memory node in, difference is that IPFS chooses whether to carry out storage by memory node oneself and can be to more popular file
CDN service is stored and is provided, and StorJ itself has the mechanism for guaranteeing file availability, can be answered file fragmentation
System, and send whether heartbeat packet file fragmentation can be used, new section is copied to again when the reduction of fragment memory node will do it
Put the availability to guarantee resource.During this distributed storage, ordinary user's node is able to hire out their storage
Space, but service stability existing for ordinary user's node is insufficient (at any time may be offline), service quality and bandwidth cannot protect
The problems such as card, and the server for being also required to centralization parses corresponding resource characteristic value, there are each of centralization parsing
Kind problem.And super node determines the storage location of each fragment by searching for fragment storage information in the present embodiment, and right respectively
The corresponding fragment cryptographic Hash of each fragment is parsed, and downloads corresponding fragment data according to the storage location of each fragment so as to subsequent,
There is no the servers of centralization to resource resolution, improves the analyzing efficiency of system.
S330, user node store information according to fragment and download resource data;User node calls resource in publicly-owned chain special
The corresponding intelligent contract of value indicative pays each side's income of this resource service process.
Optionally, user node is when receiving the fragment that super node in this service-domain returns and storing information, can be with
The fragment number of each fragment content resource after acquisition of information carries out fragment when uploading to the content resource is stored according to fragment
And each fragment corresponds to storage location, at this time according to the correspondence storage location of fragment each in content resource, respectively to each fragment into
Row downloading, obtains the corresponding resource data of each fragment.Further, user node can also be numbered according to the fragment of each fragment,
The corresponding resource data of each fragment of downloading is assembled, the content resource is obtained and corresponds to complete resource data.
Further, it when user stores information according to fragment by the user node at place and downloads resource data, needs
Certain expense is paid to the content resource, and copyright information and interests point when pre-recorded content resource uploads in publicly-owned chain
Claim information with the super node during rule and this resource service, therefore user can pass through the user at place
Node calls the intelligent contract corresponding with the resource characteristic value stored in publicly-owned chain, obtains the corresponding copyright letter of the content resource
Breath, that is, the uploader and preconfigured distribution of interests rule of the content resource, according to the distribution of interests rule to this
The uploader of content resource and the corresponding each side's income of each message sender payment for stating this resource service process.Show
Example property, intelligent contract when user node calls content resource to upload pays copyright, and copyright revenue is passed through benefit
Beneficial allocation rule is transferred to automatically in content originator account corresponding with the super node of this resource service process is participated in.
Technical solution provided in this embodiment passes through fragment of the content resource of the search request in alliance's chain when uploading
Information is stored to download corresponding resource data, and calls the intelligence contract in publicly-owned chain to pay this resource by user node
Each side's income of service process realizes the resource request access of the content resource, makes the copyright information and interests point of content resource
With rule in publicly-owned chain transparence, improve the initiative of resource sharing, reduce the resource loss risk in resource access process.
Example IV
Fig. 4 is the flow chart of the resource request method in a kind of block chain that the embodiment of the present invention four provides.The present embodiment
It is on the basis of the above embodiments, corresponding content resource to be searched according to resource characteristic value in alliance's chain to super node and is divided
Explanation is further expalined in the step for piece storage information returns to user node.Specifically, as shown in figure 4, this method can
To include the following steps:
S401, super node judges content resource whether in this service-domain, if so, executing S402;If it is not, executing
S404;
Specifically, content resource when uploading, can pass through the user node in service-domains different in content distributing network
It is uploaded, therefore, when super node receives the resource request that user is sent by the user node at place, it is necessary first to
Judge the content resource of request whether in this service according to storage information of the resource characteristic value in resource request in alliance's chain
In domain, to execute different down operations.
S402, super node search resource characteristic value in alliance's chain, obtain fragment of the content resource in this service-domain
Store information.
Optionally, if super node determines the content resource according to the resource characteristic value of the content resource in alliance's chain
It is stored in this service-domain, then super node directly searches the resource characteristic value of the content resource in alliance's chain, and according to this
Resource characteristic value determines fragment storage information of the content resource in this service-domain.Specifically, obtaining the content resource in this clothes
The fragment cryptographic Hash of each fragment number, the storage location of each fragment and each fragment after corresponding to fragment in business domain.It is exemplary
, obtained fragment storage information can be fID:[{ shard1:{ location1, hash1 } }, shard2:
{ location2, hash2 } } ... ..., { shardn:{ locationn, hashn } }].
Fragment storage information in this service-domain is sent to user node by S403, super node.
Specifically, super node needs to be handed down to after obtaining fragment storage information of the content resource in this service-domain
The user node for requesting resource, make user node obtain each fragment number in the content resource corresponding fragment storage information,
The information such as the storage location and fragment cryptographic Hash of each fragment, so as to each fragment data in subsequent corresponding downloading content resource.
S404, super node inquire other super nodes for possessing content resource in alliance's chain.
Optionally, if super node determines in this service-domain in alliance's chain according to the resource characteristic value of the content resource
There is no the content resources, then super node can also be searched according to the resource characteristic value in alliance's chain possesses the content resource
Other super nodes in other service-domains.Wherein, the content resource is when uploading by where other super nodes
User node in service-domain is uploaded.
S405, super node search resource characteristic value in alliance's chain, obtain content resource where other super nodes
Service-domain in fragment store information.
Specifically, when inquiring other super nodes for possessing content resource in alliance's chain, it is super in this service-domain
Node can directly determine the content resource in other super node institutes by searching corresponding resource characteristic value in alliance's chain
Fragment in service-domain stores information, does not need corresponding fragment is inquired by other super nodes and parsed in alliance's chain and deposit
Information is stored up, the super node for needing to request the content resource is returned to, to reduce the access times of alliance's chain.
Meanwhile super node is deposited in fragment of the determining content resource requested in the service-domain where other super nodes
After storing up information, it is each in the fragment storage information where other super nodes in service-domain that the content resource can be directly determined
Fragment number, the storage location of each fragment and each fragment cryptographic Hash etc., that is, the content resource is in other super node institutes
Service-domain in each fragment where memory node, to need to request the super node of the content resource directly at other
Each fragment of the content resource is downloaded in the memory node in service-domain where super node.
S406, other super nodes call the corresponding intelligent contract of resource characteristic value in publicly-owned chain to state this resource service
Process.
In addition, other super nodes are determining the request content in order to pay income to other super nodes subsequent
After the super node of resource is downloaded each fragment of the content resource in the service-domain where other super nodes, also need
The intelligent contract corresponding with the resource characteristic value stored in publicly-owned chain is called to state during this resource service other
Super node sends the process of fragment storage information to the super node in this service-domain, and is recorded in publicly-owned chain, illustrates it
To request, the super node of the content resource provides a content storage to his super node and distribution services.
S407, super node store acquisition of information content resource according to the fragment in service-domain where other super nodes,
And content resource fragment is stored in the memory node in this service-domain.
Optionally, the super node in this service-domain is determining the content resource where other super nodes in service-domain
Fragment when storing information, each fragment number in fragment storage information, the storage location of each fragment and each fragment are breathed out
Uncommon value is parsed, thus the corresponding downloading content resource in each memory node where other super nodes in service-domain
Fragment data, and each fragment data of downloading is assembled to obtain the corresponding money of complete content resource according to each fragment number
Source data.In order to which when following resource is requested, the content resource that can be accessed nearby according to the logical reach of node is super
Memory node of the content resource in this service-domain can also be carried out fragment storage when getting content resource by node,
The content resource can be directly obtained out of this service-domain so as to subsequent, without being obtained from other super nodes.
It should be noted that the S406 and S407 in the present embodiment execute sequence without successive when being executed, may be performed simultaneously, herein
Without limitation.
Fragment storage information of the content resource in this service-domain is sent to user node by S408, super node;It is super
Node stores fragment storage information of the content resource in this service-domain to alliance's chain.
Specifically, super node is after carrying out fragment storage for memory node of the content resource in this service-domain, by this
Fragment storage information of the content resource in this service-domain is sent to user node, so that user node is according in this service-domain
Each fragment in the corresponding downloading content resource of storage location.At this point, can lead to make the super node in other service-domains also
It crosses alliance's chain and obtains the content resource in the super node in this service-domain, the super node in this service-domain can also be in root
Acquisition of information content resource is stored according to the fragment in service-domain where other super nodes, and content resource fragment is stored in this
After memory node in service-domain, fragment storage information of the content resource in this service-domain is stored to alliance's chain, so that with
Other super nodes similar in this service-domain can directly obtain the content resource in this service-domain, without to original
It is obtained in service-domain where storing other super nodes of the content resource, accelerates resource acquisition rate.At this point, request content provides
The super node in source stores fragment storage information of the content resource in this service-domain onto alliance's chain, also illustrates original storage
Other super nodes in the service-domain of the content resource also provide in primary for the super node of this request content resource
Hold distribution service.
Technical solution provided in this embodiment passes through fragment of the content resource of the search request in alliance's chain when uploading
Information is stored to download corresponding resource data, and calls the intelligence contract in publicly-owned chain to pay this resource by user node
Each side's income of service process realizes the resource request access of the content resource, makes the copyright information and interests point of content resource
With rule in publicly-owned chain transparence, improve the initiative of resource sharing, reduce the resource loss risk in resource access process.
Embodiment five
Fig. 5 is the flow chart of the resource request method in a kind of block chain that the embodiment of the present invention five provides, the present embodiment
It is to optimize on the basis of the above embodiments, specifically, as shown in figure 5, the present embodiment may include steps of:
S510, the super node in service-domain receive the resource request of user node, in the resource request of the user node
Including resource characteristic value.
S520, the fragment storage information that super node searches corresponding content resource according to resource characteristic value in alliance's chain are returned
Back to user node;Super node calls the corresponding intelligent contract of resource characteristic value in publicly-owned chain to state this resource service mistake
Journey.
S530, user node store information according to fragment and download resource data;User node calls resource in publicly-owned chain special
The corresponding intelligent contract of value indicative pays each side's income of this resource service process.
S540, user node store the payment record of each side's income during this resource service into publicly-owned chain.
Optionally, the corresponding intelligent contract of user node resource characteristic value in calling publicly-owned chain pays this resource service
After each side's income of process, in order to which each side's income is audited and supervised, the interests of each user role, Yong Hujie are ensured
Point can also will store into publicly-owned chain the payment record of each side's income during this resource service, can not using publicly-owned chain
The characteristic distorted avoids the problem of distribution of interests unevenness convenient for the audit to distribution of interests.
S550, user node store the integrality for the resource data that Information Authentication is downloaded according to fragment;If the money of downloading
Source data is imperfect, then super node of the user node into publicly-owned chain and this service-domain uploads corresponding service memory false alarm
It accuses.
Optionally, after storing the corresponding resource data of information downloading according to fragment in user node, since user node is
It is downloaded respectively by the storage location to fragment each in content resource, it is therefore desirable to verify the complete of the resource data of downloading
Property.By the way that the corresponding fragment cryptographic Hash of fragment each in fragment storage information is compared in the present embodiment, when judging with uploading
Fragment cryptographic Hash whether match, to verify the integrality of the resource data of downloading.Further, if verifying downloading
Resource data is imperfect, then user node determines that the fragment data of the memory node storage where the fragment is imperfect and publicly-owned
Super node in chain and this service-domain uploads corresponding service memory error reporting, to state that the resource data of this time downloading goes out
Mistake, and report the storage service of the content resource in corresponding with service domain there are mistakes.S540 and S550 in the present embodiment exist
It without sequencing when execution, may be performed simultaneously, and without limitation.
Technical solution provided in this embodiment passes through fragment of the content resource of the search request in alliance's chain when uploading
Information is stored to download corresponding resource data, and calls the intelligence contract in publicly-owned chain to pay this resource by user node
Each side's income of service process realizes the resource request access of the content resource, makes the copyright information and interests point of content resource
With rule in publicly-owned chain transparence, improve the initiative of resource sharing, reduce the resource loss risk in resource access process.
Embodiment six
Fig. 6 A is the money being applied in one of particular content distribution network block chain that the embodiment of the present invention six provides
The flow chart of source requesting method, the present embodiment are to provide specific application scenarios on the basis of the above embodiments.The present embodiment
In, include service-domain A and service-domain B in the content distributing network as shown in Figure 6B, includes super node 1 in service-domain A, uses
Family node 1 and memory node 1, memory node 2 include super node 2, user node 2 and memory node, storage in service-domain B
Node 4.One alliance's chain of maintenance, all nodes safeguard a publicly-owned chain jointly jointly for super node 1 and super node 2.Wherein,
User A uploads content resource A by the user node 1 in service-domain A, and super node 1 is servicing the content resource A of upload
Memory node 1 and memory node 2 in the A of domain carry out fragment storage, and generate the resource characteristic value of content resource A, and publicly-owned
The resource characteristic value of storage content resource A, copyright information and distribution of interests rule in chain;Super node 1 is by the money of content resource A
Source characteristic value and on memory node 1 and memory node 2 fragment storage information store into alliance's chain.At this point, user B passes through
User node 2 in service-domain B requests access to content resource A.
Specifically, as shown in Figure 6A, the present embodiment may include steps of:
User node 2 in S610, service-domain B is by the resource including the resource characteristic value comprising content resource A of user B
Request, is sent to super node 2, thus to 2 request content resource A of super node.
S620, super node 2 finds content resource A not in this service-domain according to resource characteristic value, then in alliance's chain
In can find out content resource A and be stored in service-domain A.
S630, super node 2 search content resource A according to resource characteristic value at 1 place of super node in alliance's chain
Fragment on memory node 1 and memory node 2 in service-domain A stores information, when super node 1 calls content resource A to upload
Intelligent contract, statement super node 1 is that super node 2 provides the service of first resource storage and distribution, and is uploaded to public affairs
Have in chain.
S640, super node 2 store information according to the fragment in the service-domain A where super node 1, obtain in corresponding
Hold resource A, and on the memory node 3 and memory node 4 in service-domain B to content resource A carry out fragment storage, determine in
Hold fragment of the resource A in service-domain B and store information, and fragment storage information of the content resource A in service-domain B is uploaded to
In alliance's chain.
Fragment storage information in service-domain B is sent to user node 2, passes through user B by S650, super node 2
User node 2 stores each fragment that information downloads corresponding content resource A according to the fragment, and is stored in information according to fragment
Fragment number is assembled to obtain complete content resource A.
S660, super node 2 after providing service for user node 2, close by intelligence when content resource A can be called to upload
About, statement super node 2 is that user node 2 provides the service of first resource storage and distribution, and is uploaded in publicly-owned chain.
S670, user node 2 can call intelligent contract when content resource A upload, to version when downloading content resource A
Power is paid, and copyright revenue will be transferred to automatically user node 1, super node 1 and super section by distribution of interests rule
In 2 corresponding accounts of point.
Technical solution provided in this embodiment passes through fragment of the content resource of the search request in alliance's chain when uploading
Information is stored to download corresponding resource data, and calls the intelligence contract in publicly-owned chain to pay this resource by user node
Each side's income of service process realizes the resource request access of the content resource, makes the copyright information and interests point of content resource
With rule in publicly-owned chain transparence, improve the initiative of resource sharing, reduce the resource loss risk in resource access process.
The above description is only a preferred embodiment of the present invention, is not intended to restrict the invention, for those skilled in the art
For, the invention can have various changes and changes.All any modifications made within the spirit and principles of the present invention are equal
Replacement, improvement etc., should all be included in the protection scope of the present invention.