CN109660496B - Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment - Google Patents

Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment Download PDF

Info

Publication number
CN109660496B
CN109660496B CN201710947291.9A CN201710947291A CN109660496B CN 109660496 B CN109660496 B CN 109660496B CN 201710947291 A CN201710947291 A CN 201710947291A CN 109660496 B CN109660496 B CN 109660496B
Authority
CN
China
Prior art keywords
resource
information
check
block
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
CN201710947291.9A
Other languages
Chinese (zh)
Other versions
CN109660496A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710947291.9A priority Critical patent/CN109660496B/en
Publication of CN109660496A publication Critical patent/CN109660496A/en
Application granted granted Critical
Publication of CN109660496B publication Critical patent/CN109660496B/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
    • 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/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a method, a device and electronic equipment for acquiring verification information, verifying resources and issuing, wherein the method for verifying resources comprises the following steps: receiving a resource downloading request sent by a request node, comparing first interval information in the request with the interval range of each partitioned resource contained in the resource to be downloaded searched in the local storage unit, and determining a first partitioned resource with a coincidence interval with the first interval information; respectively carrying out check calculation on each first partitioned resource by adopting a preset check algorithm to obtain a third check value; and comparing each third check value with the check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same, sending the resource part corresponding to the first interval information in the corresponding block resource to the request node. The scheme of the embodiment of the invention can carry out block verification on the resources shared in the P2P network, thereby improving the sharing rate of the resource files.

Description

Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for acquiring verification information, verifying a resource, and issuing a resource, and an electronic device.
Background
A Peer-to-Peer computer network (Peer to Peer, P2P) system is composed of a plurality of P2P nodes, each node can download resources through the P2P network, and can also publish the resources to a resource server after downloading the complete resources, so as to provide uploading service for other nodes.
In the P2P network system, because of various problems such as network data hijacking tampering, redirection by a small operator, local data damage caused by a bad disk card, and the like, error data may occur in the data transmission process. If the video resources have wrong data, various playing abnormalities such as blocking, screen splash and the like can be caused in the process of playing the video, and the user experience is greatly influenced.
In addition, the P2P network is a divergent network, and once a P2P node has wrong data, it will quickly spread over the entire network in a short time, resulting in the breakdown of the entire P2P network system.
In order to ensure the correctness of resource data, a general solution is to perform MD5 check once on the whole file after the resource download is completed, and determine whether there is error data, and the specific process of the solution is as follows:
before starting downloading the resource, the resource server is requested to obtain the MD5 value A of the resource, and after the downloading is completed, an MD5 value B is calculated for the whole resource file. And judging whether the A and the B are equal, if not, indicating that the current file and the original file are different, and possibly having error data inside. In this case, the resource cannot be provided to the player for use, or uploaded to another node, and at this time, the whole resource needs to be deleted and then downloaded again. If the check result shows that the two MD5 values are consistent, the file is indicated to have no error data inside, and the file can be normally used.
However, in the existing solution, once the error data occurs, the whole resource needs to be deleted completely. For a large resource file (e.g., video, generally ranging from several MB to several GB), a huge waste of resources is caused by deleting the whole file and re-downloading the file due to local error data.
In addition, existing solutions fail to address situations where local data is corrupted. For example, after downloading is completed, MD5 is used to check that file data is passed, but file data is damaged in the process of local storage, and when resources are uploaded, data is provided directly to the other party, or error data is introduced into the network.
Disclosure of Invention
The invention provides a method, a device and electronic equipment for acquiring verification information, verifying resources and issuing, which can perform block verification on resources shared in a P2P network, thereby improving the sharing rate of resource files.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a method for acquiring resource check information is provided, including:
sending a resource information request to a server to acquire resource information of resources to be downloaded;
receiving resource information returned by the server, wherein the resource information comprises: block checking information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded, and the resource node information indicates the position of the node where the resources to be downloaded are located.
In a second aspect, another method for acquiring resource check information is provided, including:
sending a resource information request to a server, and acquiring resource information of a resource to be downloaded, wherein the resource information comprises: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
according to the resource node information, sending a block check information request to the resource node to acquire the block check information of the resource to be downloaded, wherein the block check information request comprises the first check value,
and the block checking information is obtained by searching the resource node in a local information base and is sent out after the checking is passed by adopting the first checking value.
In a third aspect, a checking method for partitioned resources is provided, including:
receiving a resource downloading request sent by a request node, wherein the resource downloading request comprises first interval information of resources to be downloaded;
comparing the first interval information with the interval range of each partitioned resource contained in the resource to be downloaded searched in a local storage unit, and determining a first partitioned resource having a coincidence interval with the first interval information;
performing check calculation on each first partitioned resource by adopting a preset check algorithm to obtain a third check value;
and comparing each third check value with a check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same, sending the resource part corresponding to the first interval information in the corresponding block resource to the request node.
In a fourth aspect, another method for checking a partitioned resource is provided, including:
sending a resource downloading request to a resource node, and acquiring resource data in the first interval information in the resource to be downloaded;
splicing all the received first interval information of the resources to be downloaded to form second interval information, comparing the second interval information with an interval range corresponding to each block resource contained in the resources to be downloaded, and determining a first block resource with a superposition interval with the second interval information;
respectively carrying out check calculation on resource parts positioned in the first block resources in the received resources to be downloaded by adopting a preset check algorithm to obtain a fourth check value;
and comparing each fourth check value with a check value corresponding to the same block resource in the block check information of the locally stored resource to be downloaded, and if the fourth check values are the same, storing a resource part with a superposition interval with the second interval information in the corresponding block resource to the local.
In a fifth aspect, a method for publishing a resource is provided, including:
sending a resource publishing request to a server, wherein the resource publishing request comprises block verification information of a resource to be published;
receiving resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the block check information corresponding to the same release resource and existing locally in the server, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have the block check information corresponding to the same resource as the release resource.
In a sixth aspect, another method for publishing resources is provided, including:
sending a resource publishing request to a server, wherein the resource publishing request comprises a first check value of block check information of a resource to be published;
receiving resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the first check value of the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have a first check value of the block check information corresponding to the same resource as the release resource.
A seventh aspect provides an apparatus for acquiring resource check information, including:
the first resource information request module is used for sending a resource information request to the server so as to acquire resource information of resources to be downloaded;
a first resource information receiving module, configured to receive resource information returned by the server, where the resource information includes: block checking information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded, and the resource node information indicates the position of the node where the resources to be downloaded are located.
In an eighth aspect, another apparatus for acquiring resource check information is provided, including:
a second resource information request module, configured to send a resource information request to a server, and acquire resource information of a resource to be downloaded, where the resource information includes: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
a check information request module, configured to send a block check information request to the resource node according to the resource node information, to obtain block check information of the resource to be downloaded, where the block check information request includes the first check value,
and the block checking information is obtained by searching the resource node in a local information base and is sent out after the checking is passed by adopting the first checking value.
In a ninth aspect, a checking apparatus for partitioned resources is provided, which includes:
the downloading request receiving module is used for receiving a resource downloading request sent by a request node, wherein the resource downloading request comprises first interval information of resources to be downloaded;
the first resource comparison module is used for comparing the first interval information with the interval range of each partitioned resource contained in the resource to be downloaded found in the local storage unit, and determining a first partitioned resource with a coincidence interval with the first interval information;
the first check calculation module is used for performing check calculation on each first block resource by adopting a preset check algorithm to obtain a third check value;
and the resource sending module is used for comparing each third check value with a check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same, sending the resource part corresponding to the first interval information in the corresponding block resource to the request node.
In a tenth aspect, there is provided another apparatus for checking a partitioned resource, including:
the downloading request module is used for sending a resource downloading request to the resource node and acquiring resource data positioned in the first interval information in the resource to be downloaded;
the second resource comparison module is used for splicing all the received first interval information of the resources to be downloaded to form second interval information, comparing the second interval information with an interval range corresponding to each blocked resource contained in the resources to be downloaded, and determining a first blocked resource with a superposition interval with the second interval information;
the second check calculation module is used for respectively performing check calculation on resource parts positioned in the first block resources in the received resources to be downloaded by adopting a preset check algorithm to obtain a fourth check value;
and the resource processing module is used for comparing each fourth check value with a check value corresponding to the same block resource in the locally stored block check information of the resource to be downloaded, and if the fourth check values are the same, storing a resource part with a superposition interval with the second interval information in the corresponding block resource to the local.
In an eleventh aspect, an apparatus for publishing a resource is provided, including:
the system comprises a first issuing request sending module, a first issuing request sending module and a first issuing module, wherein the first issuing request sending module is used for sending a resource issuing request to a server, and the resource issuing request comprises block verification information of a resource to be issued;
a first publishing result receiving module, configured to receive resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the block check information corresponding to the same release resource and existing locally in the server, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have the block check information corresponding to the same resource as the release resource.
In a twelfth aspect, there is provided another apparatus for publishing resources, including:
the second issuing request sending module is used for sending a resource issuing request to the server, wherein the resource issuing request comprises a first check value of the block check information of the resource to be issued;
a second publishing result receiving module, configured to receive resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the first check value of the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have a first check value of the block check information corresponding to the same resource as the release resource.
In a thirteenth aspect, an electronic device is provided, comprising:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
sending a resource information request to a server to acquire resource information of resources to be downloaded;
receiving resource information returned by the server, wherein the resource information comprises: block checking information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded, and the resource node information indicates the position of the node where the resources to be downloaded are located.
In a fourteenth aspect, another electronic device is provided, including:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
sending a resource information request to a server, and acquiring resource information of a resource to be downloaded, wherein the resource information comprises: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
according to the resource node information, sending a block check information request to the resource node to acquire the block check information of the resource to be downloaded, wherein the block check information request comprises the first check value,
and the block checking information is obtained by searching the resource node in a local information base and is sent out after the checking is passed by adopting the first checking value.
In a fifteenth aspect, another electronic device is provided, including:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
receiving a resource downloading request sent by a request node, wherein the resource downloading request comprises first interval information of resources to be downloaded;
comparing the first interval information with the interval range of each partitioned resource contained in the resource to be downloaded searched in a local storage unit, and determining a first partitioned resource having a coincidence interval with the first interval information;
performing check calculation on each first partitioned resource by adopting a preset check algorithm to obtain a third check value;
and comparing each third check value with a check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same, sending the resource part corresponding to the first interval information in the corresponding block resource to the request node.
In a sixteenth aspect, there is provided another electronic device, comprising:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
sending a resource downloading request to a resource node, and acquiring resource data in the first interval information in the resource to be downloaded;
splicing all the received first interval information of the resources to be downloaded to form second interval information, comparing the second interval information with an interval range corresponding to each block resource contained in the resources to be downloaded, and determining a first block resource with a superposition interval with the second interval information;
respectively carrying out check calculation on resource parts positioned in the first block resources in the received resources to be downloaded by adopting a preset check algorithm to obtain a fourth check value;
and comparing each fourth check value with a check value corresponding to the same block resource in the block check information of the locally stored resource to be downloaded, and if the fourth check values are the same, storing a resource part with a superposition interval with the second interval information in the corresponding block resource to the local.
In a seventeenth aspect, another electronic device is provided, including:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
sending a resource publishing request to a server, wherein the resource publishing request comprises block verification information of a resource to be published;
receiving resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the block check information corresponding to the same release resource and existing locally in the server, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have the block check information corresponding to the same resource as the release resource.
In an eighteenth aspect, there is provided another electronic device, including:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
sending a resource publishing request to a server, wherein the resource publishing request comprises a first check value of block check information of a resource to be published;
receiving resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the first check value of the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have a first check value of the block check information corresponding to the same resource as the release resource.
According to the method, the device and the electronic equipment for acquiring the verification information and verifying and releasing the resource, provided by the invention, when the resource file is shared (such as resource downloading and resource releasing) in the P2P network, the shared resource is verified in a form of blocked resource, and after the downloaded blocked resource is verified and successfully released by the downloading node, the downloading node can store the blocked resource, so that the sharing rate of the resource is improved.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a diagram of the logical architecture of a conventional resource sharing scheme;
FIG. 2 is a diagram of the logical architecture of a resource sharing scheme according to an embodiment of the present invention;
fig. 3 is a first flowchart of a method for acquiring resource check information according to an embodiment of the present invention;
fig. 4 is a flowchart of a method for acquiring resource check information according to an embodiment of the present invention;
FIG. 5 is a flowchart of a block resource checking method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a checking method for partitioned resources according to an embodiment of the present invention;
FIG. 7 is a first flowchart of a resource publishing method according to an embodiment of the present invention;
FIG. 8 is a flowchart of a resource publishing method according to an embodiment of the present invention;
fig. 9 is a first structural diagram of an apparatus for acquiring resource check information according to an embodiment of the present invention;
fig. 10 is a second structural diagram of an apparatus for acquiring resource check information according to an embodiment of the present invention;
FIG. 11 is a first block diagram of an apparatus for checking partitioned resources according to an embodiment of the present invention;
fig. 12 is a second block diagram of a checking apparatus for partitioned resources according to an embodiment of the present invention;
FIG. 13 is a first diagram of a resource distribution device according to an embodiment of the present invention;
FIG. 14 is a second diagram of a resource distribution device according to an embodiment of the present invention;
FIG. 15 is a first schematic structural diagram of an electronic device according to an embodiment of the invention;
FIG. 16 is a second schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 17 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 18 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 19 is a schematic structural diagram of an electronic device according to an embodiment of the invention;
fig. 20 is a sixth schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In a conventional resource sharing scheme, a complete resource file is mainly used as a shared resource object, and resource downloading or resource publishing is performed in a P2P network. As shown in fig. 1, is a logical architecture diagram of a conventional resource sharing scheme. As shown in fig. 1, the subject in a conventional P2P network mainly includes a server 110, a CDN (content delivery network) 120, and a P2P node 130, where:
the server 110 is configured to store resource information issued by each P2P node 130 in the P2P network, and it should be noted that only a P2P node having complete content of a certain resource may issue the resource information to the server; the issued resource information includes: a resource node list consisting of the resource ID, the resource size information, the MD5 value and the resource node information of the issued resource;
the CDN120 is a network storage unit configured to store complete content of a certain resource, and uniquely specifies a storage location of the CDN120 by a resource URL;
the P2P node, which may be referred to as a terminal device(s) logging in the P2P network in a broad sense, may share resources among P2P nodes, where the P2P node requesting downloading of resources may be referred to as a requesting node, the P2P node providing downloading resources may be referred to as a resource node, and the P2P node publishing resource information to the server 110 may be referred to as a publishing node, and each P2P node may switch roles according to behaviors in the resource sharing process. Each P2P node may comprise two parts, a client App and an accelerator, the client App is mainly used to respond to the resource play request of the user and download the requested resource in the play request from the P2P network through the accelerator, so that the accelerator on each terminal device can be illustrated as a P2P node from a narrow perspective.
Specifically, when a requesting node wants to download a resource, it first generates a resource ID corresponding to the resource (each resource corresponds to a unique resource ID) according to a uniform resource ID generation rule and a resource URL of the requested resource. Then, the resource ID is sent to the server 110 to inquire whether the information of the resource containing the resource ID is stored on the server; if not, downloading the resource from the CDN120 according to the resource URL of the requested resource (if the requesting node wants to deliver the resource, it needs to download the complete resource from the CDN 120), and if so, obtaining resource information corresponding to the requested resource; and extracting the resource node which issues the resource from the acquired resource information, and sending a resource downloading request to the resource node, wherein the request comprises a resource ID and an MD5 value of the resource, so as to download the resource from the resource node.
After receiving a resource downloading request of a requesting node, a resource node finds a corresponding resource information entry from a local information base according to a resource ID, compares an MD5 value of the resource with an MD5 value carried in the request, extracts the requested resource from a local storage unit if the resource information entry is the same as the MD5 value of the resource, performs verification calculation on the resource to obtain a verification value, compares an MD5 value of the resource with the verification value again to verify the integrity of the resource, and determines that the verification is successful and sends the resource to the requesting node if the two values are the same.
After the requesting node finishes downloading a certain resource, in order to guarantee the integrity of the resource, the resource may be checked and calculated to obtain a check value, and the MD5 value of the resource is compared with the check value again to check the integrity of the resource, if the two values are the same, it is determined that the check is successful, and the resource is reserved to the local storage unit.
When the requesting node changes roles as a publishing node and wants to publish the information of the resource to the server 110, the resource is checked and calculated to obtain a check value, the MD5 value of the resource is compared with the check value again to check the integrity of the resource, if the two values are the same, the check is determined to be successful, and a resource publishing message is sent to the server 110 to complete the publishing of the resource; if the check fails, no resource publication message is sent to the server 110 for the current resource.
As can be understood from fig. 1, the behavior of sharing resources among the P2P nodes 130 and the behavior of acquiring resource information from the server 110 by the P2P node 130 are both based on the fact that the resources published by the publishing node are complete resources. In the process of downloading the resource by the request node, providing the resource by the resource node and publishing the resource information by the publishing node, the integrity of the corresponding resource needs to be checked by using the MD5 value of the resource, so as to ensure the integrity of the resource propagated in the P2P network. However, it is difficult for the requesting node to download the complete resource, especially the complete resource with a large file, from the resource node, because the resource requested by the downloading node each time may not be the complete resource itself, or the error data may occur during the process of downloading and storing the resource, and these situations may cause the resource not to be passed during the integrity check, and once the check is not passed, the requesting node cannot judge the correctness of the resource data, and even if only a very small part of the data content has an error, the whole resource is deleted and downloaded from the new time, thereby reducing the P2P sharing efficiency of the resource, especially the large file resource.
The scheme is based on the logic architecture of the sharing scheme in the traditional P2P network, and introduces a new verification scheme for the resource files. As shown in fig. 2, based on a logic architecture of a sharing scheme in a conventional P2P network, in the scheme, a uniform resource splitting rule is added in each P2P node, so that the content of partitioned resources after splitting the same resource file on each P2P node is the same. Meanwhile, the same checking algorithm of the block resources is built in, and the same checking value corresponding to the same block resources is ensured, so that the same block checking information corresponding to the same resource is ensured. The block check information is a character string formed by dividing resources, calculating each formed block resource according to a preset check algorithm to obtain check values, and splicing the check values.
When the scheme is used for verifying the resource file, a blocking resource verification mode is adopted. In the process of providing resources by the resource nodes and the process of downloading the resources by the request nodes, the corresponding block resources can be shared or stored as long as the shared block resources pass the verification. However, when publishing a resource message to the server 110, the publishing node still needs to assume that the publishing node locally stores the complete resource. The resource information issued by the issuing node includes a resource ID, block check information (or an MD5 value of the block check information, at this time, the block check information is stored on the resource node, and the requesting node needs to acquire the block check information from the resource node through the MD5 value of the block check information), a resource node list, and other resource information such as: resource size, MD5 value of the resource, etc.
When the scheme is used for checking the resource file, the method for checking the partitioned resources can involve the following problems: the method comprises the steps of acquiring block check information, checking resources to be shared by resource nodes, checking downloaded resources by request nodes, and releasing resource information by release nodes.
Firstly, the problem of obtaining the block check information refers to how the request node obtains the block check information of the resource to be downloaded (when the resource node issues the resource information, the block check information of the resource is already stored locally, so the problem relates to that the main body is the request node).
In the scheme, the request node can acquire the block check information of the resource to be downloaded through two ways, one way is to acquire the block check information from the server, and the other way is to acquire the block check information from the resource node providing the resource. And when the resource information is acquired from the server and needs to be released by the resource node, the block verification information of the resource is sent to the server for storage. When the resource information is required to be issued by the resource node, the check value corresponding to the block check information of the resource is sent to the server for storage, so that the resource node can acquire the block check information from the resource node through the check value.
Secondly, the problem that the resource node checks the resource to be shared refers to how the resource node checks the resource part provided for the request node.
In the scheme, the resource nodes can segment the complete resource file to be shared into a plurality of block resources through a unified resource segmentation rule, then the resource part requested by the request node is mapped into the block resources, and the block resources which are overlapped with the requested resource part are verified by adopting block verification information. And if the check is passed, sending the corresponding resource to the requesting node.
Thirdly, the problem that the requesting node checks the downloaded resource refers to how the requesting node checks the part of the resource downloaded from the resource node.
In the scheme, the request node can segment the complete resource file to be downloaded into a plurality of block resources through a unified resource segmentation rule, then map the resource part actually requested to be downloaded into the block resources, and verify the resource part of the request which is coincident with the block resources by adopting block verification information. And if the verification is passed, saving the corresponding resource to the local.
Finally, the issue of delivering the resource information by the delivery node means that after the download node downloads the complete resource file from the resource node or from the CDN, the resource information of the resources is delivered to the server.
In the scheme, the publishing node can segment the local complete resource file to form a plurality of block resources through a unified resource segmentation rule, then the check values of the block resources are respectively calculated by adopting a preset check algorithm, and then the check values are spliced to form block check information of the resources. When the publishing node publishes the resource information to the server, the blocking verification information can be directly published to the server, so that a requesting node requesting to download the resource can directly obtain the blocking verification information from the server side; the block check information can also be checked and calculated to obtain a check value, and then the check value is issued to the server, so that a request node requesting to download the resource can acquire the block check information from the resource node side through the check value.
The technical solution of the present application is further illustrated by the following examples.
Example one
Based on the logical idea of the resource sharing scheme shown in fig. 2, as shown in fig. 3, it is a flowchart of a method for acquiring resource check information, shown in the embodiment of the present invention, that is, the method is mainly executed as a request node in the P2P nodes shown in fig. 2. As shown in fig. 3, the method for acquiring resource check information includes the following steps:
s310, sending a resource information request to a server to acquire resource information of the resource to be downloaded;
for example, when a user clicks on the client App to play a video file (resource to be downloaded), the client App sends a file play request to the accelerator, where the file play request may be in the form of a hypertext Transfer Protocol (HTTP) request, such as HTTP://127.0.0.1:7878/www.youku.com/xxxxxx. In the header of HTTP, the section information corresponding to the resource part requested at the time, such as [15MB, 25MB ], is carried, that is, data between 15MB and 25MB in the requested resource is requested.
The HTTP request is a resource URL for downloading the requested resource, and each resource URL has key field information uniquely identifying one resource, such as "xxxxxx. After receiving a resource URL which is sent by the client App and used for downloading the requested resource, the requesting node extracts key field information contained in the resource URL.
The accelerator performs MD5 operation on key field information extracted from a resource URL analyzed from an HTPP request sent by a client App to generate an MD5 value. On the basis of the MD5 value, some auxiliary information, such as description information of the resource to be downloaded (which refers to the specific content of the resource, such as the type of media content, the name of media content, etc.), and customer information providing the resource to be downloaded (such as the identity of the resource is "you", and then you can identify the name or specified character string as customer information) are added for splicing, and finally a character string with 40 bytes is formed as the resource ID of the resource to be downloaded, and the form can be as follows:
20010211AAAAAAAAAAAAAAAAAAAAAAAAAAAA。
the request node sends a resource information request containing the resource ID of the resource to be downloaded to the server so as to acquire the resource information of the resource to be downloaded from the server, wherein the acquired resource information mainly refers to the block verification information of the resource to be downloaded and the resource node information providing the resource to be downloaded.
S320, receiving resource information returned by the server, wherein the resource information comprises: checking information of the blocks of the resources to be downloaded and resource node information;
the blocking check information is a character string formed by dividing resources to be downloaded, calculating each formed blocking resource according to a preset check algorithm to obtain check values, and splicing the check values; the block verification information is obtained by the server through searching in the local information base according to the resource ID and is used for verifying each block resource contained in the resource to be downloaded; the resource node information indicates the location of the node where the resource to be downloaded is located, and may be, for example, a list of IP addresses of resource nodes that provide the resource to be downloaded.
The segmentation rules adopted for segmenting the same resource file on each P2P node are the same, for example, when video resources are segmented, the resources can be segmented according to dimensions such as playing time and data stream length, so that a plurality of segmented resources are formed. It should be noted here that the resource to be split must be an entire resource file, and the size of each partitioned resource formed by splitting the entire resource may be the same or different, but when the same resource file is split by using the splitting rule, the size of each partitioned resource formed each time is correspondingly the same.
For example, when the resource file is partitioned in a fixed-length data stream manner, the length of each partitioned resource is the same, and the partitioning step is 10MB, the length of each partitioned resource obtained by partitioning a certain resource file is 10MB, and the length sections corresponding to each partitioned resource are [0MB, 10MB ], (10MB, 20MB ], (20MB, 30MB ], and … …, respectively.
The resource information of the complete resource issued to the server by the issuing node may include the resource ID of the issued resource, the block verification information, and the information of the resource node (e.g., the public network address of the resource node, the public network port of the node, the Relay address of the node, the Relay port of the node, the address type of the node, etc.). Therefore, the request node can acquire the block check information of the resource to be downloaded from the server side.
Of course, if the resource to be downloaded currently requested by the requesting node is not published on the server, the resource information returned to the resource node by the server is null. At this time, the requesting node may download the corresponding resource content from the CDN that provides the resource according to the resource URL of the resource to be downloaded.
Further, the resource information may further include whole verification information of the resource to be downloaded, which is used to perform whole verification on the resource to be downloaded.
In order to facilitate the request node to perform overall verification on the downloaded resource, or when the request node requests the resource from the resource node, the resource node performs verification on the resource requested by the request node, when the resource node serves as a publishing node to publish resource information, overall verification information of the currently published resource is added in the published resource information, and the overall verification information is used for performing overall verification on the published resource.
According to the method for acquiring the resource check information, the request node sends the resource information request to the server to acquire the block check information of the resource to be downloaded, and then the block check information is used for checking the resource which is downloaded to the local according to each block resource, so that the sharing rate of the resource is improved.
Example two
Based on the logical idea of the resource sharing scheme shown in fig. 2, as shown in fig. 4, it is a flowchart of a method for acquiring resource check information shown in the embodiment of the present invention, and the method is mainly executed as a request node in the P2P nodes shown in fig. 2. As shown in fig. 4, the method for acquiring resource check information includes the following steps:
s410, sending a resource information request to a server, and acquiring resource information of resources to be downloaded, wherein the resource information comprises: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates that the resource ID of the resource to be downloaded can also be included in the resource information request of the position of the node where the resource to be downloaded is located;
the generation process of the resource ID of the resource to be downloaded can refer to the corresponding content in step S310.
The request node sends a resource information request containing the resource ID of the resource to be downloaded to the server so as to acquire the resource information of the resource to be downloaded from the server, wherein the acquired resource information mainly refers to a first check value of block check information of the resource to be downloaded and resource node information providing the resource to be downloaded.
The received resource information returned by the server comprises: the method comprises the steps of checking a first check value of block check information of a resource to be downloaded and providing resource node information of the resource to be downloaded;
the blocking check information is a character string formed by dividing resources to be downloaded, calculating each formed blocking resource according to a preset check algorithm to obtain check values, and splicing the check values; the first check value is calculated by the character string according to a preset check algorithm, the first check value can be obtained by the server by searching in the local information base according to the resource ID, and the block check information is used for checking each block resource contained in the resource to be downloaded.
The process of segmenting a complete resource to form a plurality of partitioned resources and the segmentation rule adopted in the segmentation process are detailed in the corresponding contents in step S320.
The publishing node may include, in the resource information of the complete resource published to the server, a resource ID of the published resource, a first check value (e.g., MD5 value) of the block check information, and information of the resource node (e.g., a public network address of the resource node, a public network port of the node, a Relay address of the node, a Relay port of the node, an address type of the node, etc.). Therefore, the request node can acquire the first check value of the block check information of the resource to be downloaded from the server side.
Of course, if the resource to be downloaded currently requested by the requesting node is not published on the server, the resource information returned to the resource node by the server is null. At this time, the requesting node may download the corresponding resource content from the CDN that provides the resource according to the resource URL of the resource to be downloaded.
S420, according to the resource node information, sending a block check information request to the resource node to obtain block check information of the resource to be downloaded, wherein the block check information request comprises: a first check value;
the request node extracts the resource node information from the received resource information sent by the server, and initiates a connection request to the resource node to establish network connection. The request node sends a block check information request to the resource node which has established connection, wherein the request comprises a first check value which is obtained from the server before and can also comprise a resource ID of the resource to be downloaded.
And then, the request node receives the blocking check information of the resource to be downloaded, which is returned by the resource node, wherein the blocking check information can be sent out after the resource node is searched in the local information base according to the resource ID and passes the verification by adopting the first check value.
After receiving the block check information request sent by the request node, the resource node can locally find a second check value of the block check information corresponding to the corresponding resource, compare the second check value with the first check value, and if the first check value is the same as the second check value, indicate that the block resource check information locally stored by the resource node is the block check information requested by the resource node. At this time, the resource node sends the locally stored block check information to the requesting node.
And after the second check value is that the resource node divides the locally stored complete resource, each formed partitioned resource is respectively calculated according to the preset check algorithm to obtain a check value, and the check values are spliced to form a character string.
Specifically, the step of searching the resource node in the local information base and verifying the block verification information by using the first verification value may specifically include the following steps:
the resource node can search whether a resource information item containing the resource ID exists in a local resource information base according to the resource ID, and each resource information item can comprise the resource ID of the resource issued by the resource node, a second check value of the block check information and a storage path of the block check information;
and if the resource information item containing the resource ID exists, the resource node compares the first check value with the second check value in the resource information item, and if the first check value is the same as the second check value, the resource node determines to send out the block check information under the storage path.
For example, the resource node parses the resource ID from the block check information request sent by the request node, and after the first check value of the block check information, searches whether a resource information entry including the resource ID exists in the local information base. When the resource node serves as a publishing node to publish the resource information value server, the published resource information is stored in a local information base as a resource information entry, that is, a plurality of resource information entries similar to the resource information entry are stored in the local information base of the resource node. Each resource information entry comprises the resource ID of the published resource, the second check value of the block check information and the storage path of the block check information.
And if the resource node does not find the resource information item containing the resource ID from the local information base according to the resource ID, returning the feedback information that the requested content does not exist locally to the request node.
If the resource node finds a resource information item containing the resource ID from a local information base according to the resource ID, the resource node further extracts a second check value in the resource information item, then compares the first check value and the second check value in the block check information request, and if the two values are the same, reads corresponding block check information according to a storage path of the block check information recorded in the resource information item and sends the block check information to the request node; and if the two values are not the same, returning feedback information that the requested content does not exist locally to the requesting node.
After the request node receives the block verification information of the resource to be downloaded returned by the resource node, the block resource verification can be carried out on the resource subsequently downloaded to the local.
Further, the resource information further includes whole verification information of the resource to be downloaded, which is used for performing whole verification on the resource to be downloaded.
In order to facilitate the request node to perform overall verification on the downloaded resource, or when the request node requests the resource from the resource node, the resource node performs verification on the resource requested by the request node, when the resource node serves as a publishing node to publish resource information, overall verification information of the currently published resource is also added in the published resource information, and the verification information is used for performing overall verification on the published resource.
According to the method for acquiring the resource check information, the request node firstly sends the resource information request to the server to acquire the first check value of the block check information of the resource to be downloaded, then the first check value is utilized to send the block check information request to the resource node providing the resource to acquire the block check information corresponding to the resource to be downloaded from the resource node, and then the block check information is utilized to check the resource downloaded to the local according to each block resource, so that the sharing rate of the resource is improved.
EXAMPLE III
Based on the logical idea of the resource sharing scheme shown in fig. 2, as shown in fig. 5, it is a flowchart of a checking method for partitioned resources shown in the embodiment of the present invention, and the method is mainly executed as a resource node in the P2P node shown in fig. 2. As shown in fig. 5, the checking method for partitioned resources includes the following steps:
s510, receiving a resource downloading request sent by a request node, wherein the resource downloading request comprises first interval information of resources to be downloaded;
the first interval information is range information corresponding to the whole resource to be downloaded of part of the resource to be downloaded requested by the request node each time.
The requesting node divides all the requested resources into a plurality of P2P tasks, and then starts a request for downloading the resources to the resource node by taking the P2P task as a unit, wherein each P2P task comprises a resource ID of the resource to be downloaded by the task and first interval information corresponding to the part of the resource required to be downloaded. For example, the client APP will carry the interval information corresponding to the resource part requested at the time, such as [15MB, 25MB ], in the header of the HTTP sent to the accelerator, that is, request data located between 15MB and 25MB in the requested resource. The accelerator further decomposes the resource downloading task corresponding to the interval information [15MB, 25MB) to generate a plurality of P2P tasks, and forms a P2P task pool, which is stored in the local memory. The content information of each P2P task may include: the resource ID of the resource to be downloaded, the initial position of the data block of the request, the size of the data block and the like.
The accelerator extracts a P2P task from the task pool in sequence, and sends a resource downloading request to the resource node according to the task content, wherein the resource downloading request comprises a resource ID of the resource to be downloaded and first interval information. The first interval information corresponds to the starting position of the data block of the current request and the size of the data block. For example, if the starting position of the currently requested data block is 8KB and the size of the data block is 9KB, the corresponding first interval is [8KB, 17KB ].
S520, comparing the first interval information with the interval range corresponding to each partitioned resource contained in the resource to be downloaded and searched in the local storage unit, and determining the first partitioned resource with the overlapping interval with the first interval information;
for example, when the first interval information in the resource download request received by the resource node is 8KB in starting position and 9KB in data block size, the corresponding first interval is [8KB, 17KB ]. If the segmentation rule corresponding to the block resources is that after the complete resource file is sequentially segmented, the size of each block resource is 10KB, the data block requested this time falls into two block resources of [0KB, 10KB) and [10KB, 20 KB). Wherein, the block resources corresponding to [0KB, 10KB) and [10KB, 20KB) are the first block resources.
S530, respectively carrying out check calculation on each first partitioned resource by adopting a preset check algorithm to obtain a third check value;
for example, the resource portions corresponding to [0KB, 10KB), [10KB, 20KB) are calculated by a preset check algorithm (e.g., MD5 algorithm) to obtain two third check values (MD5 values).
S540, comparing each third check value with the check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same, sending the resource part corresponding to the first interval information in the corresponding block resource to the request node;
the blocking check information is a character string formed by dividing resources to be downloaded, calculating each formed blocking resource according to the preset check algorithm to obtain check values, and splicing the check values.
The distributed block check information corresponding to each resource stored in the resource node local information base includes check values corresponding to all block resources corresponding to the resource, and the check values are generated after the calculation of each block resource by adopting the preset check algorithm.
After the third check values corresponding to the first block resources are obtained through calculation, the third check values may be compared with check values corresponding to the same block resources in block check information corresponding to the same resource stored in the resource node local information base, if the third check values are the same as the check values of the same block resources belonging to the block check information, it is indicated that the content of the first block resources is complete, and at this time, the resource node may send the resource part corresponding to the first interval information in the corresponding block resources to the request node. For example, after the check of the block resources corresponding to the resource node pair [0KB, 10KB), [10KB, 20KB) is successful, the resource portions of [8KB, 10B ] of the block resources of [0KB, 10KB) and [10, 17KB) of the block resources of [10KB, 20KB) may be respectively sent to the requesting node.
Further, the resource downloading request sent by the request node to the resource node may further include integral verification information of the resource to be downloaded, where the integral verification information is used to perform integral verification on the resource to be downloaded;
correspondingly, the method can also comprise the following steps:
searching whether integral verification information of resources to be downloaded exists in a local resource information base;
and if the overall verification information of the resource to be downloaded exists, comparing the overall verification information with the overall verification information in the resource downloading request, and if the overall verification information is the same as the overall verification information in the resource downloading request, determining to execute the operation of the step S520.
Specifically, the resource node may first search, according to the resource ID in the received resource download request, whether a resource information entry including the resource ID exists in the local information base. Each resource information entry comprises a resource ID of a resource issued by a resource node and overall verification information of the resource. If the resource information exists, the resource node analyzes the whole check information of the resource in the resource downloading request (for example, a check value generated by the preset check algorithm for the whole resource, such as an MD5 value) and compares the whole check information of the resource with the check information of the whole resource in the searched resource information entry, and if the whole check information of the resource is the same, the resource node determines to execute step S520 again. And if the resource information item containing the resource ID does not exist in the local information base, or the resource node compares the complete verification information of the resource in the resource downloading request with the complete verification information of the resource in the searched resource information item, and the two values are not equal, the resource node returns the message of the resource requested by the locally nonexistent resource node to the request node.
According to the checking method for the block resources, disclosed by the embodiment of the invention, the resource data requested by the request node is mapped into each pre-segmented block resource by the resource node, then the block resources hit by mapping are checked by adopting the corresponding check value in the block check information, if the check is successful, the resource data requested by the request node in the corresponding block resources is partially transmitted to the request node, so that the check and sharing of each block resource can be realized under the condition that the integrity check of the whole resource is not needed, and the sharing rate of the resource is improved.
Example four
Based on the logical idea of the resource sharing scheme shown in fig. 2, as shown in fig. 6, it is a flowchart of a checking method for partitioned resources shown in the embodiment of the present invention, and the method is mainly executed as a requesting node in the P2P nodes shown in fig. 2. As shown in fig. 6, the checking method for partitioned resources includes the following steps:
s610, sending a resource downloading request to the resource node, and acquiring resource data located in the first interval information in the resource to be downloaded.
The resource downloading request comprises first interval information and also comprises a resource ID of a resource to be downloaded; the content of this step can be referred to the content of step S510.
S620, splicing all the received first interval information of the resources to be downloaded to form second interval information, comparing the second interval information with the interval range corresponding to each block resource contained in the resources to be downloaded, and determining the first block resource with the second interval information having a superposition interval;
when the requesting node obtains the resource from the P2P network according to the play request sent by the client App, the whole download task is usually divided into a plurality of P2P tasks to complete the download of the resource data. The data range downloaded each time corresponds to the resource data in the one first interval information. And the requesting node splices the resource data of the first interval information downloaded by each P2P task, so that the resource content to be played by the client App is completed. The requesting node splices the resource data in the first interval information received each time, so that resource data corresponding to second interval information with a larger range is formed. And the requesting node compares the second interval information with the interval range corresponding to each block resource contained in the resource to be downloaded, and determines the first block resource with the overlapping interval with the second interval information from each block resource.
For example, the second interval information is [8KB, 25KB), and the size of each partition resource is 10K, then [8KB, 25KB) falls into the partition resources corresponding to the three interval ranges [0KB, 10KB), [10KB, 20KB), [20KB, 30 KB). These three partitioned resources are denoted as first partitioned resources.
S630, performing check calculation on resource parts in the first block resources in the received resources to be downloaded by adopting a preset check algorithm to obtain a fourth check value;
the resource portions in each first block resource of the resource data corresponding to the second section information are extracted, for example, the resource data corresponding to the three portions [8KB, 10KB), [10KB, 20KB), [20KB, 25KB ] in the above example. And respectively carrying out check calculation on the three parts of resource data by adopting a preset check algorithm to obtain three check values, and recording each check value as a fourth check value.
And S640, comparing each fourth check value with the check value corresponding to the same block resource in the block check information of the locally stored resource to be downloaded, and if the fourth check values are the same, storing the resource part of the corresponding block resource, which has a superposition interval with the second interval information, to the local.
And the blocking check information is a character string formed by dividing the resource to be downloaded, calculating each formed blocking resource according to the preset check algorithm to obtain check values and splicing the check values.
The process of segmenting a complete resource to form a plurality of partitioned resources, and the segmentation rule adopted in the segmentation process are detailed in the corresponding content in step S320, which is not described herein again.
Comparing each obtained fourth check value with a check value corresponding to the same block resource in the locally stored block check information of the resource to be downloaded, for example, comparing the fourth check value corresponding to [8KB, 10KB) with the check value of the block resource of [0KB, 10KB) in the block check information; comparing the fourth check value corresponding to [10KB, 20KB) with the check value of the blocked resource of [10KB, 20KB) in the blocked check information; the fourth check value corresponding to [20KB, 25KB) is compared with the check value of the [20KB, 30KB) chunked resource in the chunked check information. And if the two compared values are the same, the currently downloaded resource data is considered to be complete, and the resource part with the overlapped interval with the second interval information in the corresponding block resource is stored to the local. And if the two compared values are different, the currently downloaded resource data is considered to be incomplete, and the resource part which has the overlapped interval with the second interval information in the corresponding block resource is discarded.
In an actual application scenario, the resource data requested to be played by the request node is usually continuous, but the data start position and the data end position do not necessarily fall exactly on the boundary of one block resource, so when checking the resource data in the second interval information range, the resource data at the head and tail portions may not pass the check of the block check information. Therefore, the resource data of the head part and the tail part can not be checked. The corresponding resource data for which the fourth check value is calculated may begin at a starting data point located at the end of the first full block resource range and end at a data point located at the end of the last full block resource range in the requested play resource data. For example, for the resource data in the above [8KB, 25KB) range, only the fourth check value of the resource data in the [10KB, 20KB) range is calculated, and the checking of the block check information is not performed for the resource data in the [8KB, 10KB) and [20KB, 25KB) range.
In addition, when the request node downloads the resource data, the resource data can be sequentially downloaded from front to back according to the data stream flow direction, so that after the complete data contained in one block resource is downloaded, the block verification information can be adopted to verify the part of the resource data.
According to the checking method for the partitioned resources, the request node maps all downloaded resource data of the same resource to each partitioned resource which is segmented in advance, then the partitioned resource which is hit by mapping is extracted to serve as the first partitioned resource, the resource part, located in each first partitioned resource, in the downloaded resource data is checked and calculated by adopting a preset checking algorithm, checking values corresponding to the same partitioned resource in the partitioned checking information are used for checking, if checking is successful, the corresponding downloaded resource is stored locally, therefore, checking and downloading storage can be carried out on each partitioned resource under the condition that integrity checking is not needed to be carried out on the whole resource, and the sharing rate of the resource is improved.
EXAMPLE five
Based on the logical idea of the resource sharing scheme shown in fig. 2, as shown in fig. 7, it is a flowchart of a resource publishing method shown in the embodiment of the present invention, and the method is mainly executed as a publishing node in the P2P node shown in fig. 2. As shown in fig. 7, the method for publishing resources includes the following steps:
s710, sending a resource publishing request to a server, wherein the resource publishing request comprises block verification information of a resource to be published;
the blocking check information is a character string formed by dividing the resources to be issued, calculating each formed blocking resource according to a preset check algorithm to obtain check values, and splicing the check values. The process of segmenting a complete resource to form a plurality of partitioned resources, and the segmentation rule adopted in the segmentation process are detailed in the corresponding content in step S320, which is not described herein again.
The resource delivered by the delivery node must be a complete resource, which may be downloaded from other resource nodes that provide the resource or obtained from a CDN that stores the resource.
Before the resource node issues the resource information, the resource node needs to perform check calculation on the complete resource to be issued, so as to obtain the block check information corresponding to the resource.
S720, receiving resource release result information sent by the server;
the release result information is a release success message sent when the comparison result is the same after comparing the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have the block check information corresponding to the same resource as the release resource.
Further, the resource issuing request may further include whole verification information of the resource to be issued, which is used to perform whole verification on the resource to be issued.
According to the resource publishing method provided by the embodiment of the invention, when the publishing node publishes the resource information, the blocking verification information for verifying each blocking resource contained in the publishing resource can be published to the server together, so that each P2P node in the network can verify and share each blocking resource contained in the publishing resource through the blocking verification information, and the resource sharing rate is improved.
EXAMPLE six
Based on the logical idea of the resource sharing scheme shown in fig. 2, as shown in fig. 8, it is a flowchart of a resource publishing method shown in the embodiment of the present invention, and the method is mainly executed as a publishing node in the P2P node shown in fig. 2. As shown in fig. 8, the method for publishing resources includes the following steps:
s810, sending a resource publishing request to a server, wherein the resource publishing request comprises a first check value of the block check information of the resource to be published;
the blocking check information is a character string formed by dividing resources to be issued, calculating each formed blocking resource according to a preset check algorithm to obtain check values, and splicing the check values, wherein the first check value is a check value calculated according to the preset check algorithm on the character string;
the resource delivered by the delivery node must be a complete resource, which may be downloaded from other resource nodes that provide the resource or obtained from a CDN that stores the resource.
Before the resource node issues the resource information, the resource node needs to perform check calculation on the complete resource to be issued to obtain the block check information corresponding to the resource, and then perform check calculation on the block check information again to obtain a first check value of the block check information.
S820, receiving resource release result information sent by a server;
the issuing result information is an issuing success message sent when the comparison result is the same after comparing the first check value of the block check information which is locally existed in the server and corresponds to the same issuing resource, or an issuing failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have a first check value of the block check information corresponding to the same resource as the release resource.
Further, the resource issuing request may further include whole verification information of the resource to be issued, which is used to perform whole verification on the resource to be issued.
According to the resource publishing method provided by the embodiment of the invention, when the publishing node publishes the resource information, the publishing node can publish the first check value of the block check information for checking each block resource contained in the publishing resource to the server together, so that each P2P node in the network can acquire the corresponding block check information from the publishing node through the first check value of the block check information, and each block resource contained in the published resource is checked and shared respectively, thereby improving the sharing rate of the resource.
In addition, in all the embodiments described above, the resource information of each resource may include, in addition to the first check value of the block check information/the block check information, resource description information such as a resource ID of the resource, overall check information (for example, MD5 value), a size of the resource, a storage path of the resource, and a storage path of the block check information.
EXAMPLE seven
As shown in fig. 9, a first structure of an apparatus for acquiring resource check information according to an embodiment of the present invention is shown, where the apparatus for acquiring resource check information can be used to execute the method steps shown in fig. 3, and includes:
a first resource information request module 910, configured to send a resource information request to a server, so as to obtain resource information of a resource to be downloaded;
a first resource information receiving module 920, configured to receive resource information returned by the server, where the resource information includes: block checking information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded, and the resource node information indicates the position of the node where the resources to be downloaded are located.
Further, the resource information further includes complete verification information of the resource to be downloaded, which is used for performing overall verification on the resource to be downloaded.
The resource check information acquisition device of the embodiment of the invention acquires the block check information of the resource to be downloaded by sending the resource information request to the server, and then checks the resource downloaded to the local by using the block check information according to each block resource, so as to improve the sharing rate of the resource.
Example eight
As shown in fig. 10, a second structure of the apparatus for acquiring resource check information according to the embodiment of the present invention is shown, where the apparatus for acquiring resource check information can be used to execute the method steps shown in fig. 4, and includes:
a second resource information request module 101, configured to send a resource information request to a server, and acquire resource information of a resource to be downloaded, where the resource information includes: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
the check information request module 102 is configured to send a block check information request to the resource node according to the resource node information, and acquire block check information of the resource to be downloaded, where the block check information request includes a first check value, and the block check information is obtained by searching the resource node in the local information base and is sent after passing the check by using the first check value.
Further, the resource information further includes complete verification information of the resource to be downloaded, which is used for performing overall verification on the resource to be downloaded.
Further, the searching of the resource node in the local information base and the checking of the block checking information by using the first check value includes:
the resource node searches whether a resource information item of the resource to be downloaded exists in a local information base, wherein each resource information item comprises a second check value of the block check information of the resource released by the resource node and a storage path of the block check information;
if the resource information item of the resource to be downloaded exists, the resource node compares the first check value with the second check value in the resource information item, and if the first check value is the same as the second check value, the resource node determines to send out the block check information under the storage path.
The resource check information acquisition device of the embodiment of the invention firstly sends a resource information request to a server to acquire a first check value of block check information of a resource to be downloaded, then sends the block check information request to a resource node providing the resource by using the first check value to acquire the block check information corresponding to the resource to be downloaded from the resource node, and then checks the resource downloaded to the local by using the block check information according to each block resource, so as to improve the sharing rate of the resource.
Example nine
As shown in fig. 11, a first block of structure of a checking apparatus for partitioned resources according to an embodiment of the present invention is a structure of the checking apparatus for partitioned resources, where the checking apparatus for partitioned resources may be configured to perform the method steps shown in fig. 5, and the method includes:
a download request receiving module 111, configured to receive a resource download request sent by a requesting node, where the resource download request includes first interval information of a resource to be downloaded;
a first resource comparison module 112, configured to compare the first interval information with the interval range of each blocked resource included in the resource to be downloaded found in the local storage unit, and determine a first blocked resource having a coinciding interval with the first interval information;
the first check calculation module 113 is configured to perform check calculation on each first partition resource by using a preset check algorithm, so as to obtain a third check value;
and the resource sending module 114 is configured to compare each third check value with a check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same as the check values corresponding to the same block resource, send a resource part corresponding to the first interval information in the corresponding block resource to the requesting node.
Further, the resource downloading request further includes whole verification information of the resource to be downloaded, which is used for carrying out whole verification on the resource to be downloaded;
on this basis, the apparatus shown in fig. 11 may further include:
the information searching module is used for searching whether the overall verification information of the resource to be downloaded exists in the local information base;
and the information processing module is used for comparing the overall verification information with the overall verification information in the resource downloading request if the overall verification information of the resource to be downloaded exists, and triggering the operation of comparing the first interval information with the interval range of each partitioned resource contained in the resource to be downloaded searched in the local storage unit and determining the first partitioned resource with the overlapping interval with the first interval information if the overall verification information of the resource to be downloaded is the same as the overall verification information in the resource downloading request.
According to the checking device for the block resources, disclosed by the embodiment of the invention, the resource data requested by the request node is mapped into each block resource which is segmented in advance, then the corresponding check value in the block check information is adopted for checking the block resources hit by mapping, and if the check is successful, the resource data requested by the request node in the corresponding block resources is partially transmitted to the request node, so that the check and sharing of each block resource can be realized under the condition that the integrity check of the whole resource is not needed, and the sharing rate of the resource is improved.
Example ten
As shown in fig. 12, a second block resource verifying apparatus according to an embodiment of the present invention is a block resource verifying apparatus, which can be used to execute the method steps shown in fig. 6, and includes:
a download request module 121, configured to send a resource download request to a resource node, and obtain resource data located in the first interval information in the resource to be downloaded;
the second resource comparing module 122 is configured to splice all the first interval information of the received resources to be downloaded to form second interval information, compare the second interval information with an interval range corresponding to each blocked resource included in the resources to be downloaded, and determine a first blocked resource having a coinciding interval with the second interval information;
the second check calculation module 123 is configured to perform check calculation on resource portions, located in each first partitioned resource, in the received resources to be downloaded by using a preset check algorithm, respectively, so as to obtain a fourth check value;
and the resource processing module 124 is configured to compare each fourth check value with a check value corresponding to the same block resource in the locally stored block check information of the resource to be downloaded, and if the fourth check values are the same as the check values corresponding to the same block resource, store a resource part having a coincidence interval with the second interval information in the corresponding block resource to the local.
According to the checking device for the partitioned resources, all downloaded resource data of the same resource are mapped into each partitioned resource which is segmented in advance, then the partitioned resource which is hit by mapping is extracted to be used as the first partitioned resource, the resource part, located in each first partitioned resource, in the downloaded resource data is checked and calculated by adopting the preset checking algorithm, the checking value corresponding to the same partitioned resource in the partitioned checking information is used for checking, and if the checking is successful, the corresponding downloaded resource is stored locally, so that the partitioned resource can be checked, downloaded and stored under the condition that the integrity of the whole resource is not required to be checked, and the sharing rate of the resource is improved.
EXAMPLE eleven
As shown in fig. 13, a first structure of a resource publishing device according to an embodiment of the present invention is a resource publishing device, which can be used to execute the method steps shown in fig. 7, and includes:
a first publishing request sending module 131, configured to send a resource publishing request to a server, where the resource publishing request includes block verification information of a resource to be published;
a first publishing result receiving module 132, configured to receive resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have the block check information corresponding to the same resource as the release resource.
Further, the resource issuing request may further include whole verification information of the resource to be issued, which is used to perform whole verification on the resource to be issued.
The resource publishing device of the embodiment of the invention can publish the block verification information for verifying each block resource contained in the published resource to the server when publishing the resource information, so that each P2P node in the network can verify and share each block resource contained in the published resource through the block verification information, thereby improving the sharing rate of the resource.
Example twelve
As shown in fig. 14, a second structure of a resource publishing device according to an embodiment of the present invention is a resource publishing device, which can be used to execute the method steps shown in fig. 8, and includes:
the second publishing request sending module 141 is configured to send a resource publishing request to the server, where the resource publishing request includes a first check value of the block check information of the resource to be published;
a second publishing result receiving module 142, configured to receive the resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the first check value of the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
and the release result information is a release success message sent when the server does not locally have a first check value of the block check information corresponding to the same resource as the release resource.
Further, the resource issuing request further includes whole verification information of the resource to be issued, which is used for performing whole verification on the resource to be issued.
According to the resource publishing device provided by the embodiment of the invention, when the resource information is published, the first check value of the block check information for checking each block resource contained in the published resource can be published to the server together, so that each P2P node in the network can acquire the corresponding block check information from the publishing node through the first check value of the block check information, and each block resource contained in the published resource is checked and shared respectively, thereby improving the sharing rate of the resource.
EXAMPLE thirteen
The foregoing describes an overall architecture of an apparatus for acquiring resource check information, where the function of the apparatus can be implemented by an electronic device, as shown in fig. 15, which is a schematic structural diagram of the electronic device according to an embodiment of the present invention, and specifically includes: a memory 151 and a processor 152.
And a memory 151 for storing a program.
In addition to the above-described programs, the memory 151 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 151 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 152, coupled to the memory 151, for executing programs in the memory 151 for:
sending a resource information request to a server to acquire resource information of resources to be downloaded;
receiving resource information returned by the server, wherein the resource information comprises: block checking information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded, and the resource node information indicates the position of the node where the resources to be downloaded are located.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 15, the electronic device may further include: communication components 153, power components 154, audio components 155, a display 156, and other components. Only some of the components are schematically shown in fig. 15, and it is not meant that the electronic device includes only the components shown in fig. 15.
The communication component 153 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 153 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 153 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 154 provides power to the various components of the electronic device. The power components 154 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for an electronic device.
Audio component 155 is configured to output and/or input audio signals. For example, audio component 155 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 151 or transmitted via the communication component 153. In some embodiments, audio component 155 also includes a speaker for outputting audio signals.
The display 156 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Example fourteen
The foregoing describes an overall architecture of an apparatus for acquiring resource check information, where the function of the apparatus can be implemented by an electronic device, as shown in fig. 16, which is a schematic structural diagram of the electronic device according to an embodiment of the present invention, and specifically includes: a memory 161 and a processor 162.
The memory 161 stores programs.
In addition to the above-described programs, the memory 161 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 161 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 162, coupled to the memory 161, for executing programs in the memory 161 to:
sending a resource information request to a server, and acquiring resource information of resources to be downloaded, wherein the resource information comprises: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
according to the resource node information, sending a block check information request to the resource node to acquire block check information of the resource to be downloaded, wherein the block check information request comprises a first check value,
the block check information is obtained by searching the resource node in the local information base and is sent out after the check is passed by adopting the first check value.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 16, the electronic device may further include: communication components 163, power components 164, audio components 165, display 166, and other components. Only some of the components are schematically shown in fig. 16, and it is not meant that the electronic device includes only the components shown in fig. 16.
The communication component 163 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 163 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 163 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
And a power supply component 164 that provides power to the various components of the electronic device. The power components 164 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for an electronic device.
Audio component 165 is configured to output and/or input audio signals. For example, audio component 165 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 161 or transmitted via the communication component 163. In some embodiments, audio component 165 further comprises a speaker for outputting audio signals.
The display 166 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Example fifteen
The foregoing describes an overall architecture of a resource downloading apparatus, and functions of the apparatus can be implemented by an electronic device, as shown in fig. 17, which is a schematic structural diagram of the electronic device according to an embodiment of the present invention, and specifically includes: a memory 171 and a processor 172.
The memory 171 stores a program.
In addition to the above programs, the memory 171 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 171 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 172, coupled to the memory 171, for executing programs in the memory 171 to:
receiving a resource downloading request sent by a request node, wherein the resource downloading request comprises first interval information of resources to be downloaded;
comparing the first interval information with the interval range of each partitioned resource contained in the resource to be downloaded searched in the local storage unit, and determining a first partitioned resource having a superposition interval with the first interval information;
respectively carrying out check calculation on each first partitioned resource by adopting a preset check algorithm to obtain a third check value;
and comparing each third check value with the check value corresponding to the same block resource in the block check information stored in the local information base, and if the third check values are the same, sending the resource part corresponding to the first interval information in the corresponding block resource to the request node.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 17, the electronic device may further include: communication components 173, power components 174, audio components 175, display 176, and the like. Only some of the components are schematically shown in fig. 17, and it is not meant that the electronic device includes only the components shown in fig. 17.
The communication component 173 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 173 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 173 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 174 provides power to the various components of the electronic device. The power components 174 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for an electronic device.
Audio component 175 is configured to output and/or input audio signals. For example, audio component 175 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 171 or transmitted via the communication component 173. In some embodiments, audio component 175 also includes a speaker for outputting audio signals.
The display 176 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Example sixteen
The foregoing describes an overall architecture of a resource downloading apparatus, and functions of the apparatus can be implemented by an electronic device, as shown in fig. 18, which is a schematic structural diagram of the electronic device according to an embodiment of the present invention, and specifically includes: a memory 181 and a processor 182.
And a memory 181 for storing programs.
In addition to the above programs, the memory 181 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 181 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 182 coupled to the memory 181 for executing programs in the memory 181 for:
sending a resource downloading request to a resource node, and acquiring resource data in the first interval information in the resource to be downloaded;
splicing all the received first interval information of the resources to be downloaded to form second interval information, comparing the second interval information with the interval range corresponding to each block resource contained in the resources to be downloaded, and determining the first block resource with a superposition interval with the second interval information;
respectively carrying out check calculation on resource parts positioned in each first partitioned resource in the received resources to be downloaded by adopting a preset check algorithm to obtain a fourth check value;
and comparing each fourth check value with the check value corresponding to the same block resource in the block check information of the locally stored resource to be downloaded, and if the fourth check values are the same, storing the resource part of the corresponding block resource, which has the overlapped interval with the second interval information, to the local.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 18, the electronic device may further include: communication components 183, power components 184, audio components 185, a display 186, and other components. Only some of the components are schematically shown in fig. 18, and it is not meant that the electronic device includes only the components shown in fig. 18.
The communication component 183 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 183 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 183 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
A power supply component 184 provides power to the various components of the electronic device. The power components 184 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for an electronic device.
The audio component 185 is configured to output and/or input audio signals. For example, the audio component 185 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 181 or transmitted via the communication component 183. In some embodiments, the audio component 185 also includes a speaker for outputting audio signals.
The display 186 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Example seventeen
The foregoing describes an overall architecture of a resource publishing apparatus, and functions of the apparatus can be implemented by an electronic device, as shown in fig. 19, which is a schematic structural diagram of the electronic device according to an embodiment of the present invention, and specifically includes: a memory 191 and a processor 192.
The memory 191 stores programs.
In addition to the above-described programs, the memory 191 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 191 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 192 coupled to the memory 191 for executing programs in the memory 191 for:
sending a resource publishing request to a server, wherein the resource publishing request comprises block verification information of a resource to be published;
receiving resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have the block check information corresponding to the same resource as the release resource.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 19, the electronic device may further include: communication components 193, power components 194, audio components 195, a display 196, and the like. Only some of the components are schematically shown in fig. 19, and it is not meant that the electronic device includes only the components shown in fig. 19.
The communication component 193 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 193 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 193 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The power supply unit 194 supplies power to various components of the electronic device. The power components 194 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for an electronic device.
Audio component 195 is configured to output and/or input audio signals. For example, the audio component 195 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 191 or transmitted via the communication component 193. In some embodiments, audio component 195 further comprises a speaker for outputting audio signals.
The display 196 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
EXAMPLE eighteen
The foregoing describes an overall architecture of a resource publishing apparatus, and functions of the apparatus can be implemented by an electronic device, as shown in fig. 20, which is a schematic structural diagram of the electronic device according to an embodiment of the present invention, and specifically includes: a memory 201 and a processor 202.
A memory 201 for storing programs.
In addition to the above-described programs, the memory 201 may also be configured to store other various data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phonebook data, messages, pictures, videos, and so forth.
The memory 201 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
A processor 202, coupled to the memory 201, for executing the program in the memory 201 to:
sending a resource publishing request to a server, wherein the resource publishing request comprises a first check value of the block check information of the resource to be published;
receiving resource publishing result information sent by the server,
the release result information is a release success message sent when the comparison result is the same after comparing the first check value of the block check information which is locally existed in the server and corresponds to the same release resource, or a release failure message sent when the comparison result is different;
alternatively, the first and second electrodes may be,
the release result information is a release success message sent when the server does not locally have a first check value of the block check information corresponding to the same resource as the release resource.
The above specific processing operations have been described in detail in the foregoing embodiments, and are not described again here.
Further, as shown in fig. 20, the electronic device may further include: communication components 203, power components 204, audio components 205, display 206, and other components. Only some of the components are schematically shown in fig. 20, and it is not meant that the electronic device includes only the components shown in fig. 20.
The communication component 203 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 203 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 203 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
The power supply component 204 provides power to the various components of the electronic device. The power components 204 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for an electronic device.
The audio component 205 is configured to output and/or input audio signals. For example, the audio component 205 includes a Microphone (MIC) configured to receive external audio signals when the electronic device is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 201 or transmitted via the communication component 203. In some embodiments, the audio component 205 further comprises a speaker for outputting audio signals.
The display 206 includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (7)

1. A method for acquiring resource check information is characterized by comprising the following steps:
sending a resource information request to a server, and acquiring resource information of a resource to be downloaded, wherein the resource information comprises: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
according to the resource node information, sending a block check information request to the resource node to obtain block check information of the resource to be downloaded, wherein the block check information request comprises the first check value, the block check information is a character string formed by splitting the check values and calculating the character string according to a preset check algorithm, the block check information is the block check information of the resource to be downloaded, each formed block resource is calculated according to the preset check algorithm to obtain the check value, and the check values are spliced to form the character string, the first check value is the check value calculated according to the preset check algorithm to the character string,
and the block checking information is obtained by searching the resource node in a local information base and is sent out after the checking is passed by adopting the first checking value.
2. The method according to claim 1, wherein the resource information further includes whole verification information of the resource to be downloaded, which is used for performing whole verification on the resource to be downloaded.
3. The method of claim 1, wherein the resource node looking up in a local information base and verifying the block check information using the first check value comprises:
the resource node searches whether a resource information item of the resource to be downloaded exists in a local information base, wherein each resource information item comprises a second check value of the block check information of the resource released by the resource node and a storage path of the block check information;
if the resource information item of the resource to be downloaded exists, the resource node compares the first check value with the second check value in the resource information item, and if the first check value and the second check value are the same, the block check information under the storage path is determined to be sent out.
4. An apparatus for acquiring resource check information, comprising:
a second resource information request module, configured to send a resource information request to a server, and acquire resource information of a resource to be downloaded, where the resource information includes: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
a check information request module, configured to send a block check information request to the resource node according to the resource node information, to obtain block check information of the resource to be downloaded, where the block check information request includes the first check value, where the block check information is a character string formed by splitting the resource to be downloaded, calculating check values for each formed block resource according to a preset check algorithm, and splicing the check values, where the first check value is a check value calculated for the character string according to the preset check algorithm,
and the block checking information is obtained by searching the resource node in a local information base and is sent out after the checking is passed by adopting the first checking value.
5. The apparatus according to claim 4, wherein the resource information further includes whole verification information of the resource to be downloaded, which is used to perform whole verification on the resource to be downloaded.
6. The apparatus of claim 4, wherein the resource node looking up in a local information base and verifying the block check information using the first check value comprises:
the resource node searches whether a resource information item of the resource to be downloaded exists in a local information base, wherein each resource information item comprises a second check value of the block check information of the resource released by the resource node and a storage path of the block check information;
if the resource information item of the resource to be downloaded exists, the resource node compares the first check value with the second check value in the resource information item, and if the first check value and the second check value are the same, the block check information under the storage path is determined to be sent out.
7. An electronic device, comprising:
a memory for storing a program;
a processor, coupled to the memory, for executing the program for:
sending a resource information request to a server, and acquiring resource information of a resource to be downloaded, wherein the resource information comprises: a first check value of the block check information and resource node information; the block checking information is used for checking a plurality of block resources of the resources to be downloaded; the first check value is used for checking the block check information, and the resource node information indicates the position of the node where the resource to be downloaded is located;
according to the resource node information, sending a block check information request to the resource node to obtain block check information of the resource to be downloaded, wherein the block check information request comprises the first check value, the block check information is a character string formed by splitting the check values and calculating the character string according to a preset check algorithm, the block check information is the block check information of the resource to be downloaded, each formed block resource is calculated according to the preset check algorithm to obtain the check value, and the check values are spliced to form the character string, the first check value is the check value calculated according to the preset check algorithm to the character string,
and the block checking information is obtained by searching the resource node in a local information base and is sent out after the checking is passed by adopting the first checking value.
CN201710947291.9A 2017-10-12 2017-10-12 Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment Active CN109660496B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710947291.9A CN109660496B (en) 2017-10-12 2017-10-12 Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710947291.9A CN109660496B (en) 2017-10-12 2017-10-12 Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment

Publications (2)

Publication Number Publication Date
CN109660496A CN109660496A (en) 2019-04-19
CN109660496B true CN109660496B (en) 2021-09-03

Family

ID=66109244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710947291.9A Active CN109660496B (en) 2017-10-12 2017-10-12 Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment

Country Status (1)

Country Link
CN (1) CN109660496B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764815A (en) * 2019-09-26 2020-02-07 北京网聘咨询有限公司 Web API project issuing method and device
CN111093110B (en) * 2019-12-03 2021-02-12 华为技术有限公司 HTTP request transmission method and equipment
SE2150527A1 (en) * 2021-04-26 2022-10-27 Hive Streaming Ab Cipher text validation
CN114398659A (en) * 2021-10-28 2022-04-26 上海哔哩哔哩科技有限公司 Resource checking method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710857A (en) * 2004-06-18 2005-12-21 千橡寰宇科技发展(北京)有限公司 Method and method for realizing document accelerated download
CN101848188A (en) * 2009-03-25 2010-09-29 上海聚力传媒技术有限公司 Method and device for updating data block checking information
CN102025444A (en) * 2009-09-09 2011-04-20 腾讯科技(深圳)有限公司 Resource publishing method, resource downloading method and data verification system
CN102546731A (en) * 2010-12-30 2012-07-04 中国移动通信集团公司 Subchunk integrity checking method and system of peer-to-peer streaming media system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7617178B2 (en) * 2006-12-05 2009-11-10 International Business Machines Corporation Moving file fragments from background file sharing to foreground file sharing and preventing duplicate downloads

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1710857A (en) * 2004-06-18 2005-12-21 千橡寰宇科技发展(北京)有限公司 Method and method for realizing document accelerated download
CN101848188A (en) * 2009-03-25 2010-09-29 上海聚力传媒技术有限公司 Method and device for updating data block checking information
CN102025444A (en) * 2009-09-09 2011-04-20 腾讯科技(深圳)有限公司 Resource publishing method, resource downloading method and data verification system
CN102546731A (en) * 2010-12-30 2012-07-04 中国移动通信集团公司 Subchunk integrity checking method and system of peer-to-peer streaming media system

Also Published As

Publication number Publication date
CN109660496A (en) 2019-04-19

Similar Documents

Publication Publication Date Title
CN109660496B (en) Method and device for acquiring verification information, method and device for verifying and releasing resources and electronic equipment
US11669872B2 (en) Smart broadcasting device
US9774642B2 (en) Method and device for pushing multimedia resource and display terminal
WO2017107542A1 (en) Video program obtaining method, device and system
CN106302337B (en) Vulnerability detection method and device
US20130231194A1 (en) Offline game storing system and method thereof
CN103428261B (en) Pass through the method for hardware aid in treatment http header
CN108702369B (en) Interaction method and device for mobile terminal and cloud platform of unmanned aerial vehicle
CN104093064B (en) The method, system and device of video interactive are carried out between terminal devices
US20130238740A1 (en) Caching of Fragmented Streaming Media
CN109525622B (en) Fragment resource ID generation method, resource sharing method, device and electronic equipment
CN107707584B (en) Application loading method, terminal and platform server
US8824676B2 (en) Streaming video to cellular phones
EP3902266A1 (en) Processing method for dragging video data and proxy server
US20140359066A1 (en) System, method and device for offline downloading resource and computer storage medium
CN109379742A (en) A kind of cut-in method of WLAN, device and storage medium
CN104010035A (en) Method and system for application program distribution
CN112839003A (en) Data verification method and system
CN111405018B (en) File transmission method and device, electronic equipment and storage medium
CN109286684B (en) Communication connection processing method and device, proxy server and storage medium
CN108833961B (en) Method, server and system for acquiring flight record data
WO2018032705A1 (en) Method and device for providing wireless access point information packet
CN111835801B (en) File downloading method, device, server, edge equipment, terminal and medium
CN109194729B (en) Information communication system and method
WO2019242279A1 (en) Message processing method and device

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