CN102064906A - Method and device for checking data blocks - Google Patents
Method and device for checking data blocks Download PDFInfo
- Publication number
- CN102064906A CN102064906A CN2009101989829A CN200910198982A CN102064906A CN 102064906 A CN102064906 A CN 102064906A CN 2009101989829 A CN2009101989829 A CN 2009101989829A CN 200910198982 A CN200910198982 A CN 200910198982A CN 102064906 A CN102064906 A CN 102064906A
- Authority
- CN
- China
- Prior art keywords
- data block
- check information
- described data
- information
- burst
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention aims to provides a method for checking data blocks, and relates to a method of generating check information of data blocks from a third party at a server and judging the correctness of downloaded data blocks according to the check information to prevent errors from diffusing. The method mainly comprises the following steps that: user equipment directly generates the check information of the data blocks and sends the check information serving as server check information of the data blocks to the data blocks; and request user equipment only needs to acquire the server check information of the data blocks to compare with the generated check information so as to judge the correctness of the downloaded data blocks. Through the technical scheme, the server does not need to store the data blocks, the storage resources are greatly saved and the network transmission efficiency is improved.
Description
Technical field
The present invention relates to data block transmitted in the distributed network is carried out the method and apparatus of verification, relate in particular to the method for calibration and the device of data block transmitted in based on the point-to-point protocol network.
Background technology
Along with developing rapidly of Internet technology, people carry out propagation, the exchange of data by the Internet more and more and share.Yet, because the data of transmitting in network may be subjected to the influence of various interference.Fact proved, in the data of transmission over networks invalidated or only have very excessive risk through the data of simple authentication.For example, data block transmitted is easy to be subjected to the influence of non-artificial factors such as noise jamming, media error and hardware error and mistake occurs between the subscriber equipment, also be easy to be intercepted, distorted, inject a series of destructions such as virus thereby cause data by the third party.Particularly in video on-demand system,, when the data of mistake are diffused in the whole system, a large amount of misdatas can occur in the system, influence normally watching of user, and reduce the validity of transfer of data because data are to disperse to propagate based on the P2P agreement.
In existing video on-demand system based on point-to-point (P2P) agreement, server end at first generates the check information of this data block at server end based on definite algorithm to data block.When user equipment requests and after successfully obtaining this data block, generate the check information of this data block based on same definite algorithm at the subscriber equipment end, and the check information of this data block subscriber equipment end is compared with the check information of server end.It will be understood by those skilled in the art that if server end is identical with the check information of subscriber equipment end, think that then the data block that subscriber equipment obtains is correct, otherwise, then think this data block error.This verification scheme effectively raises discriminating wrong in the transmission of data blocks, has ensured the fail safe of Network Transmission.
Further, it will be understood by those skilled in the art that and use the prerequisite of above-mentioned mechanism to be that this data block need at first be stored in the server end of distributed network.Based on above-mentioned condition, server just can further generate the enciphered message of data block.But,, can take a lot of hardware resources undoubtedly at server end storage lot of data piece.Especially for the mechanism that Video service is provided, the film and television play all needs to take a large amount of memory spaces.In addition, will transfer to network server end from third-party mass data piece and also need to take Internet resources, for example bandwidth.For how addressing the above problem, need not data block is downloaded to the check information that effectively generates data block under the situation of server, still there is not the scheme of mature and feasible at present.
Summary of the invention
In order to solve the problems referred to above that prior art exists, special proposition the present invention.
According to a first aspect of the invention, provide the server end of a kind of subscriber equipment in distributed network that the method for the check information of data block is provided, this method comprises: obtain described data block from the third party who is independent of described distributed network; Generate the check information of described data block based on pre-defined algorithm; The check information of described data block is sent to described server end, and the check information of described data block is used for the server end check information as described data block.
According to a second aspect of the invention, a kind of method of carrying out auxiliary examination at the server end of distributed network by the data block check information is provided, this method comprises: receive the user side check information from the data block of subscriber equipment, the corresponding third party's download address determined of described data block, described user side check information is generated based on pre-defined algorithm by subscriber equipment, and described third party is independent of described distributed network; Set up the index information of described data block, with the described user side check information of the described data block server end check information as described data block, described index information comprises the described third party's download address and the described server end check information of described data block correspondence.
According to a third aspect of the invention we, provide the server end of a kind of subscriber equipment in distributed network that the generator of the check information of data block is provided, this generator comprises deriving means, generating apparatus and first dispensing device, wherein, described deriving means is used for obtaining described data block from the third party who is independent of described distributed network; Described generating apparatus is used for generating based on pre-defined algorithm the check information of described data block; Described first dispensing device is used for the check information of described data block is sent to described server end, and the check information of described data block is used for the server end check information as described data block.
According to a forth aspect of the invention, provide the server end of a kind of subscriber equipment in distributed network that the generator of the check information of data block is provided, this generator comprises deriving means, generating apparatus and first dispensing device, and described deriving means is used for obtaining described data block from the third party who is independent of described distributed network; Described generating apparatus is used for generating based on pre-defined algorithm the check information of described data block; Described first dispensing device is used for the check information of described data block is sent to described server end, and the check information of described data block is used for the server end check information as described data block.
In sum, in technical scheme of the present invention, be responsible for the data block that downloads to is carried out verification, generate check information, again this check information is uploaded to the check information of server as server end from the subscriber equipment of third party's downloading data block.Those skilled in the art understand, in technical scheme of the present invention, server end only need be stored the relevant information of the data block that downloads to from the third party, stores this data block and need not reserve a large amount of memory spaces, can be so that this data block normal transmission in distributed network.Therefore, the method and apparatus that the application of the invention provides can be saved memory space effectively, and conserve network resources improves system effectiveness simultaneously.
Description of drawings
By reading the detailed description of doing with reference to the following drawings that non-limiting example is done, it is more obvious that other features, objects and advantages of the present invention will become:
Fig. 1 is according to distributed network of a specific embodiment of the present invention and third-party structural representation;
Fig. 2 is the method flow diagram that the data block check information is provided according to a specific embodiment of the present invention;
Fig. 3 is the method flow diagram according to the check information of the generation data block of a specific embodiment of the present invention;
Fig. 4 is the block diagram according to the generator that the data block check information is provided of a specific embodiment of the present invention;
Fig. 5 is the block diagram that the data block check information carries out the servicing unit of auxiliary examination that passes through according to a specific embodiment of the present invention.
Embodiment
Followingly the present invention is described in further detail with reference to accompanying drawing.Should be appreciated that to the invention provides a kind ofly that this mechanism is particularly useful for the network based on point-to-point protocol (P2P) agreement to mechanism in network to carrying out verification from third-party data block.In addition, the data block among the present invention can be audio/video file, text, picture etc., also can be file or file fragmentation.Need to prove that in addition the subscriber equipment of mentioning can be various portable terminals (for example mobile phone, PDA(Personal Digital Assistant), notebook computer etc.) or fixed terminal (for example desktop computer etc.) herein.
Below in conjunction with accompanying drawing specific embodiments of the invention are described.
At first, in conjunction with the embodiment of first aspect present invention and second aspect, the method for technical solution of the present invention partly is described in detail.
Fig. 1 is the schematic network structure according to a specific embodiment of the present invention.As shown in Figure 1, the server sv1 and the first subscriber equipment p1, the second subscriber equipment p2, the 3rd subscriber equipment p3 and four-function family equipment p4 have constituted the P2P network of a simplification.Wherein, each subscriber equipment links to each other with server sv1 respectively, also links to each other with other subscriber equipment in this network.In addition, the first subscriber equipment p1 also links to each other with third party's loading source t1.The third party refers to and is positioned at outside this P2P network, independently loading source.In other words, the first subscriber equipment p1 can server sv1 or other subscriber equipment from network obtain data block, perhaps carries out information interaction, also can obtain data block from third party's loading source t1, and t1 carries out information interaction with third party's loading source.
Fig. 2 is the method flow diagram that the data block check information is provided according to a specific embodiment of the present invention.Followingly provide the method for the check information of data block to the first subscriber equipment p1 to server end, and server end is elaborated by the method that the data block check information carries out auxiliary examination according to Fig. 2 and in conjunction with Fig. 1.
The first subscriber equipment p1 among Fig. 1 needs downloading data block A, and the download of data block A is not provided in the P2P at its place network.
At first, in step S1, the first subscriber equipment p1 obtains data block A from the third party t1 that is independent of the P2P network.Wherein, third party's loading source t1 is not in the P2P network of the first subscriber equipment p1, the second subscriber equipment p2, the 3rd subscriber equipment p3 and four-function family equipment p4 and server sv1 formation, and third party's loading source t1 links to each other with the first subscriber equipment p1.
Then, in step S2, the first subscriber equipment p1 generates the check information of data block A based on pre-defined algorithm.
Typically, the first subscriber equipment p1 can use cryptographic algorithm to generate check information as pre-defined algorithm.Typically, this pre-defined algorithm includes but not limited to MD5 algorithm (Message-Digest Algorithm 5, md5-challenge), CRC (Cyclical Redundancy Check, CRC), SHA (Secure Hash Algorithm, SHA) and Hash (hash algorithm).In the present embodiment, adopt the MD5 algorithm with being without loss of generality, the core of MD5 algorithm is can be with a series of calculations of character string process of random length, thereby make it be transformed into the lint-long integer of one 128 bit, even it can realize knowing source program and arthmetic statement, also a MD5 value can't be reduced into original character string.
Preferably, the rule of this pre-defined algorithm can be that the server end of P2P network is notified the first subscriber equipment p1.Simultaneously, server end also notifies other to need the subscriber equipment of downloading data block A this pre-defined algorithm.Only be appreciated that based on same pre-defined algorithm to generate check information whether the download that could guarantee to compare by the check information of subscriber equipment end and server end judgment data piece A is correct at the subscriber equipment end.
Need to prove that further the check information of the data block A that the first subscriber equipment p1 generates can comprise the check information of each data block file fragmentation of data block A.Fig. 3 is the method flow diagram according to the check information of the generation data block of a specific embodiment of the present invention.Below in conjunction with Fig. 3 the flow process of the check information of generation data block burst is described in detail.
In step S21, the first subscriber equipment p1 is divided into a plurality of data block bursts with the data block A that downloads among the step S1, i.e. burst s0, and s1, s2 ..., sN.Those skilled in the art can understand, the thinking of this burst is to use the prerequisite of P2P technology, by each data block burst being offered each node in the P2P network, quickened the speed of subscriber equipment download film, alleviated the burden of the webserver simultaneously greatly.As for the actual size of each fragment, can determine according to the actual conditions of network and film.Its concrete burst means are the mature technology means in this area, repeat no more herein.
In step S22, the first subscriber equipment p1 is to burst s0, s1, and s2 ..., sN generates check value respectively.Preferably, wherein the check value of each data block burst is unique.
Be example with the check information that uses the MD5 algorithm to obtain burst s0, at first, burst s0 carried out initial packet handle that each grouping is generally 512, then again each grouping further is divided into 16 32 grouping respectively.
Then, son after grouping grouping variable is carried out " filling ", making its byte length equal 448 to the result of 512 complementations (is N*512+448, N is a positive integer), particularly, fill one " 1 " and a plurality of " 0 " until satisfying above-mentioned condition at the last position of this packet data block afterbody, afterwards this as a result the back add one with the filling of 64 binary representations before message length, the byte length of sub-packet data block at this moment equals N*512+448+64=(N+1) * 512.
At last, set four 32 numeric parameter A, the B, C, the D that are called as link variable (Chaining Variable), and the grouping of the son after " filling " variable is carried out four-wheel cycle calculations (totally 64 steps).
Particularly, at first four link variables are copied in other four variablees: a=A, b=B, c=C, d=D.
Then, any three variablees in four variablees are done once non-line shape function computing (suppose that described non-line shape function is respectively F (x, y, z), G (x, y, z), H (x, y, z) and I (x, y, z)), then the gained result is added the 4th variable, (suppose that Mj represents j son grouping, j=0 1......15) (supposes that described arbitrary constant is ti with an arbitrary constant in a son grouping, wherein, the value difference of ti in per step computing, the ground that is without loss of generality is in i goes on foot, ti is the integer part of 4294967296 * abs (sin (i))), delocalization (suppose that described delocalization is s, wherein, the value difference of s in per step computing) again moves right the gained superposition value, and add above-mentioned four variablees one of them, with the gained scaled value cover described four variablees one of them.Suppose FF (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (F (b, c, d)+Mj+ti)<<s, GG (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (G (b, c, d)+Mj+ti)<<s, HH (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (H (b, c, d)+Mj+ti)<<s, II (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (I (b, c, d)+Mj+ti)<<s, then the four-wheel cycle calculations is specific as follows:
The first round: FF (a, b, c, d, M0, s, ti); FF (d, a, b, c, M1, s, ti); FF (c, d, a, b, M2, s, ti); FF (b, c, d, a, M3, s, ti); FF (a, b, c, d, M4, s, ti); FF (d, a, b, c, M5, s, ti); FF (c, d, a, b, M6, s, ti); FF (b, c, d, a, M7, s, ti); FF (a, b, c, d, M8, s, ti); FF (d, a, b, c, M9, s, ti); FF (c, d, a, b, M10, s, ti); FF (b, c, d, a, M11, s, ti); FF (a, b, c, d, M12, s, ti); FF (d, a, b, c, M13, s, ti); FF (c, d, a, b, M14, s, ti); FF (b, c, d, a, M15, s, ti).
Second takes turns: and GG (a, b, c, d, M1, s, ti); GG (d, a, b, c, M6, s, ti); GG (c, d, a, b, M11, s, ti); GG (b, c, d, a, M0, s, ti); GG (a, b, c, d, M5, s, ti); GG (d, a, b, c, M10, s, ti); GG (c, d, a, b, M15, s, ti); GG (b, c, d, a, M4, s, ti); GG (a, b, c, d, M9, s, ti); GG (d, a, b, c, M14, s, ti); GG (c, d, a, b, M3, s, ti); GG (b, c, d, a, M8, s, ti); GG (a, b, c, d, M13, s, ti); GG (d, a, b, c, M2, s, ti); GG (c, d, a, b, M7, s, ti); GG (b, c, d, a, M12, s, ti).
Third round: HH (a, b, c, d, M5, s, ti); HH (d, a, b, c, M8, s, ti); HH (c, d, a, b, M11, s, ti); HH (b, c, d, a, M14, s, ti); HH (a, b, c, d, M1, s, ti); HH (d, a, b, c, M4, s, ti); HH (c, d, a, b, M7, s, ti); HH (b, c, d, a, M10, s, ti); HH (a, b, c, d, M13, s, ti); HH (d, a, b, c, M0, s, ti); HH (c, d, a, b, M3, s, ti); HH (b, c, d, a, M6, s, ti 5); HH (a, b, c, d, M9, s, ti); HH (d, a, b, c, M12, s, ti); HH (c, d, a, b, M15, s, ti); HH (b, c, d, a, M2, s, ti).
Four-wheel: II (a, b, c, d, M0, s, ti); II (d, a, b, c, M7, s, ti); II (c, d, a, b, M14, s, ti); II (b, c, d, a, M5, s, ti); II (a, b, c, d, M12, s, ti); II (d, a, b, c, M3, s, ti); II (c, d, a, b, M10, s, ti); II (b, c, d, a, M1, s, ti); II (a, b, c, d, M8, s, ti); II (d, a, b, c, M15, s, ti); II (c, d, a, b, M6, s, ti); II (b, c, d, a, M13, s, ti); II (a, b, c, d, M4, s, ti); II (d, a, b, c, M11, s, ti); II (c, d, a, b, M2, s, ti); II (b, c, d, a, M9, s, ti).
At last, described four link variable A, B, C, D are added four variable a, b, c, d respectively, and continue to proceed above-mentioned cycle calculations that the cascade of Shu Chu four link variables at last is the MD5 value key of burst s0 with next packet data block
C0
Need to prove that the MD5 algorithm that is adopted in the present embodiment can be adopted any known algorithmic rule to replace by those skilled in the art, it can not be used to limit protection scope of the present invention.
Finished burst s0 carried out encryption after, repeat above-mentioned MD5 algorithm steps 3, so that all the other burst s1-sN are carried out encryption respectively, thereby obtain the MD5 value of each data block burst, i.e. the check information key of each data block burst
C1To key
CN
Replacedly, also can adopt CRC algorithm or SHA algorithm or hash algorithm that described each data block burst is carried out encryption, crc value that obtains like this or SHA value or hash value also can be used as the check information of described each data block burst.
More than the check information of data block is comprised that the situation of the check information of each data block burst describes in detail.Those skilled in the art should know, often be that unit downloads in the P2P Network Transmission with the file fragmentation, with the data block burst is that the advantage that unit generates check information is, can after obtaining each burst, carry out verification, if mistake, only need handle, for example download correct burst again, and can not influence the normal download use of whole data block this data block burst.
Preferably, among the step S22, also generated the relevant information of data block A, affiliated relevant information comprises the length of data block A, the number of data block burst, at least one item in the length of each data block burst.It will be appreciated by those skilled in the art that above-mentioned example does not constitute qualification to relevant information.Above-mentioned relevant information should be to generate to extract from data block A, can play the information of basic verification effect in transmission.
Those skilled in the art also should be appreciated that simultaneously, optionally, in step S2, can also encrypt data block A integral body based on pre-defined algorithm, generate the integrity checking information key of data block A
CtotalPreferably, generate the key of integrity checking information
CtotalPre-defined algorithm can be identical with the algorithm of the check information that generates the data block burst, repeat no more herein.Optionally, generate the key of integrity checking information
CtotalPre-defined algorithm also can be identical different with the algorithm of the check information that generates the data block burst.It should be noted that the pre-defined algorithm that in other request subscriber equipment, generates check information, should with the corresponding purpose that just can play the verification downloading data block of the pre-defined algorithm among the first subscriber equipment p1.For instance, the integrity checking information key that in the first subscriber equipment p1, generates of data block A
CtotalThe generation pre-defined algorithm must with the request subscriber equipment in integrity checking information key
RtotalThe generation pre-defined algorithm identical.
Optionally, the check information of data block A can comprise integrity checking information key simultaneously
CtotalCheck information key with each data block burst
C0To key
CN
In step S3, the first subscriber equipment p1 is sent to server end with the check information of data block A.Wherein, the check information of data block A is used for the server end check information as data block A.If generated other relevant informations of data block among the step b, then above-mentioned relevant information also be sent to server end.
Preferably, the first subscriber equipment p1 sends the address of third party's loading source t1 of data block A to server end.It will be appreciated by those skilled in the art that, if the download of data block A is not provided in the P2P network originally, then can the address of this third party's loading source t1 be sent to and need the request of downloading data block A subscriber equipment by server sv1, thereby the subscriber equipment of realizing making subscriber equipment in the P2P network to preserve data block A from third party's loading source t1 and network obtains this data block, and need not self to store this data block at server sv1.
In step S4, server sv1 receives the check information from the data block A of the first subscriber equipment p1, and the address of third party's loading source t1 of data block A correspondence.According to the difference of concrete performance, the check information key of data block A
cCan comprise integrity checking information key
CtotalAnd/or the check information key of each data block burst
C0To key
CNIf generated the relevant information of data block A among the step S2 simultaneously, then server sv1 also receives the relevant information from the first subscriber equipment p1.This relevant information comprises the length of data block A, at least one item in the length of the number of data block burst and each data block burst.
In step S5, server sv1 sets up the index information of data block A, with the user side check information key of data block A
cCheck information key as server end
r, this index information comprises the address of third party's loading source t1 of data block A correspondence and the check information key of server end
rBe to be understood that, the purpose of setting up the index information of data block A at server sv1 is, request user equipment requests in the P2P network is carried out the associative operation of data block A, for example during downloading data block A, server sv1 can ask subscriber equipment to provide this to operate necessary check information to this, in time detect document lending in the downloading process, avoid error diffusion.Preferably, when in the network as seed store the subscriber equipment lazy weight of data block A the time, server sv1 also can provide the address of third party's loading source t1 of data block A, so that the request subscriber equipment improves download efficiency directly from third party's loading source t1 downloading data block A.
Therefore, the specific embodiment of corresponding requests user equipment requests downloading data block A, further S6 in steps also behind the step S5.
In step S6, server sv1 is sent to the request subscriber equipment with the index information of data block A.The transmission of index information may based on the request subscriber equipment request message (for example, user equipment requests is watched certain TV play), also may be by server sv1 active push (server push advertisement).The request subscriber equipment obtains the check information of data block A by index information.After download obtained data block A ', the request subscriber equipment can calculate the check information key that self downloads the data block A ' that obtains based on the identical algorithms corresponding with the first subscriber equipment p1
pIf, user side check information key
pCheck information key with server end
rIdentical, think that then the data block A ' that downloads to is identical with data block A, download correctly, otherwise, then think different, enter next step subsequent treatment.
Below in conjunction with the embodiment of third aspect present invention and fourth aspect, the device of technical solution of the present invention partly is described in detail.
Fig. 1 is the schematic network structure according to a specific embodiment of the present invention.It is concrete constitute with embodiment above in identical, repeat no more herein.
Fig. 4 is the block diagram according to the generator that the data block check information is provided of a specific embodiment of the present invention.Fig. 5 is the block diagram that the data block check information carries out the servicing unit of auxiliary examination that passes through according to a specific embodiment of the present invention.Followingly provide the generator of the check information of data block to the first subscriber equipment p1 to server end, and server end is elaborated by the servicing unit that the data block check information carries out auxiliary examination according to Fig. 4 and Fig. 5 and in conjunction with Fig. 1.Wherein, generator 1 is arranged in the first subscriber equipment p 1, comprises deriving means 10, generating apparatus 11 and first dispensing device 12.Servicing unit 2 is positioned at the server end of network, and it comprises receiving system 20 and information apparatus for establishing 21.
The first subscriber equipment p1 among Fig. 1 needs downloading data block A, and the download of data block A is not provided in the P2P at its place network.
At first, the deriving means 10 among the first subscriber equipment p 1 obtains data block A from the third party's loading source t1 that is independent of the P2P network.Wherein, third party's loading source t1 is not in the P2P network of first subscriber equipment p1 to the four-function family equipment and server sv1 formation, and third party's loading source t1 links to each other with the first subscriber equipment p1.
Then, the first subscriber equipment p1 generates the check information of data block A based on pre-defined algorithm by generating apparatus 11.
Typically, generating apparatus 11 can use cryptographic algorithm to generate check information as pre-defined algorithm.Typically, this pre-defined algorithm includes but not limited to MD5 algorithm (Message-Digest Algorithm 5, md5-challenge), CRC (Cyclical Redundancy Check, CRC), SHA (Secure Hash Algorithm, SHA) and Hash (hash algorithm).In the present embodiment, adopt the MD5 algorithm with being without loss of generality, the core of MD5 algorithm is can be with a series of calculations of character string process of random length, thereby make it be transformed into the lint-long integer of one 128 bit, even it can realize knowing source program and arthmetic statement, also a MD5 value can't be reduced into original character string.
Preferably, the rule of this pre-defined algorithm can be that the server end of P2P network is notified the first subscriber equipment p1.Simultaneously, server end also notifies other to need the subscriber equipment of downloading data block A this pre-defined algorithm.Only be appreciated that based on same pre-defined algorithm to generate check information whether the download that could guarantee to compare by the check information of subscriber equipment end and server end judgment data piece A is correct at the subscriber equipment end.
Need to prove that further the check information of the data block A that generating apparatus 11 generates can comprise the check information of each data block file fragmentation of data block A.Preferably, generating apparatus 11 also comprises slicing apparatus 110 and burst calibration equipment 111.
Slicing apparatus 110 is divided into a plurality of data block bursts with the data block A that downloads to, i.e. burst s0, and s1, s2 ..., sN.Those skilled in the art can understand, the thinking of this burst is to use the prerequisite of P2P technology, by each data block burst being offered each node in the P2P network, quickened the speed of subscriber equipment download film, alleviated the burden of the webserver simultaneously greatly.As for the actual size of each fragment, can determine according to the actual conditions of network and film.Its concrete burst means are the mature technology means in this area, repeat no more herein.
111 couples of burst s0 of burst calibration equipment, s1, s2 ...., sN generates check value respectively.Preferably, wherein the check value of each data block burst is unique.
Be example with the check information that uses the MD5 algorithm to obtain burst s0, at first, burst s0 carried out initial packet handle that each grouping is generally 512, then again each grouping further is divided into 16 32 grouping respectively.
Then, son after grouping grouping variable is carried out " filling ", making its byte length equal 448 to the result of 512 complementations (is N*512+448, N is a positive integer), particularly, fill one " 1 " and a plurality of " 0 " until satisfying above-mentioned condition at the last position of this packet data block afterbody, afterwards this as a result the back add one with the filling of 64 binary representations before message length, the byte length of sub-packet data block at this moment equals N*512+448+64=(N+1) * 512.
At last, set four 32 numeric parameter A, the B, C, the D that are called as link variable (Chaining Variable), and the grouping of the son after " filling " variable is carried out four-wheel cycle calculations (totally 64 steps).
Particularly, at first four link variables are copied in other four variablees: a=A, b=B, c=C, d=D.
Then, any three variablees in four variablees are done once non-line shape function computing (suppose that described non-line shape function is respectively F (x, y, z), G (x, y, z), H (x, y, z) and I (x, y, z)), then the gained result is added the 4th variable, (suppose that Mj represents j son grouping, j=0 1......15) (supposes that described arbitrary constant is ti with an arbitrary constant in a son grouping, wherein, the value difference of ti in per step computing, the ground that is without loss of generality is in i goes on foot, ti is the integer part of 4294967296 * abs (sin (i))), delocalization (suppose that described delocalization is s, wherein, the value difference of s in per step computing) again moves right the gained superposition value, and add above-mentioned four variablees one of them, with the gained scaled value cover described four variablees one of them.Suppose FF (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (F (b, c, d)+Mj+ti)<<s, GG (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (G (b, c, d)+Mj+ti)<<s, HH (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (H (b, c, d)+Mj+ti)<<s, II (a, b, c, d, Mj, s, ti) expression a=b+ ((a+ (I (b, c, d)+Mj+ti)<<s, then the four-wheel cycle calculations is specific as follows:
The first round: FF (a, b, c, d, M0, s, ti); FF (d, a, b, c, M1, s, ti); FF (c, d, a, b, M2, s, ti); FF (b, c, d, a, M3, s, ti); FF (a, b, c, d, M4, s, ti); FF (d, a, b, c, M5, s, ti); FF (c, d, a, b, M6, s, ti); FF (b, c, d, a, M7, s, ti); FF (a, b, c, d, M8, s, ti); FF (d, a, b, c, M9, s, ti); FF (c, d, a, b, M10, s, ti); FF (b, c, d, a, M11, s, ti); FF (a, b, c, d, M12, s, ti); FF (d, a, b, c, M13, s, ti); FF (c, d, a, b, M14, s, ti); FF (b, c, d, a, M15, s, ti).
Second takes turns: and GG (a, b, c, d, M1, s, ti); GG (d, a, b, c, M6, s, ti); GG (c, d, a, b, M11, s, ti); GG (b, c, d, a, M0, s, ti); GG (a, b, c, d, M5, s, ti); GG (d, a, b, c, M10, s, ti); GG (c, d, a, b, M15, s, ti); GG (b, c, d, a, M4, s, ti); GG (a, b, c, d, M9, s, ti); GG (d, a, b, c, M14, s, ti); GG (c, d, a, b, M3, s, ti); GG (b, c, d, a, M8, s, ti); GG (a, b, c, d, M13, s, ti); GG (d, a, b, c, M2, s, ti); GG (c, d, a, b, M7, s, ti); GG (b, c, d, a, M12, s, ti).
Third round: HH (a, b, c, d, M5, s, ti); HH (d, a, b, c, M8, s, ti); HH (c, d, a, b, M11, s, ti); HH (b, c, d, a, M14, s, ti); HH (a, b, c, d, M1, s, ti); HH (d, a, b, c, M4, s, ti); HH (c, d, a, b, M7, s, ti); HH (b, c, d, a, M10, s, ti); HH (a, b, c, d, M13, s, ti); HH (d, a, b, c, M0, s, ti); HH (c, d, a, b, M3, s, ti); HH (b, c, d, a, M6, s, ti 5); HH (a, b, c, d, M9, s, ti); HH (d, a, b, c, M12, s, ti); HH (c, d, a, b, M15, s, ti); HH (b, c, d, a, M2, s, ti).
Four-wheel: II (a, b, c, d, M0, s, ti); II (d, a, b, c, M7, s, ti); II (c, d, a, b, M14, s, ti); II (b, c, d, a, M5, s, ti); II (a, b, c, d, M12, s, ti); II (d, a, b, c, M3, s, ti); II (c, d, a, b, M10, s, ti); II (b, c, d, a, M1, s, ti); II (a, b, c, d, M8, s, ti); II (d, a, b, c, M15, s, ti); II (c, d, a, b, M6, s, ti); II (b, c, d, a, M13, s, ti); II (a, b, c, d, M4, s, ti); II (d, a, b, c, M11, s, ti); II (c, d, a, b, M2, s, ti); II (b, c, d, a, M9, s, ti).
At last, described four link variable A, B, C, D are added four variable a, b, c, d respectively, and continue to proceed above-mentioned cycle calculations that the cascade of Shu Chu four link variables at last is the MD5 value key of burst s0 with next packet data block
C0
Need to prove that the MD5 algorithm that is adopted in the present embodiment can be adopted any known algorithmic rule to replace by those skilled in the art, it can not be used to limit protection scope of the present invention.
Burst calibration equipment 111 finished burst s0 carried out encryption after, repeat above-mentioned MD5 algorithm steps 3, so that all the other burst s1-sN are carried out encryption respectively, thereby obtain the MD5 value of each data block burst, i.e. the check information key of each data block burst
C1To key
CN
Replacedly, also can adopt CRC algorithm or SHA algorithm or hash algorithm that described each data block burst is carried out encryption, crc value that obtains like this or SHA value or hash value also can be used as the check information of described each data block burst.
More than the check information of data block is comprised that the situation of the check information of each data block burst describes in detail.Those skilled in the art should know, often be that unit downloads in the P2P Network Transmission with the file fragmentation, with the data block burst is that the advantage that unit generates check information is, can after obtaining each burst, carry out verification, if mistake, only need handle, for example download correct burst again, and can not influence the normal download use of whole data block this data block burst.
Preferably, generating apparatus 11 has also generated the relevant information of data block A, and affiliated relevant information comprises the length of data block A, the number of data block burst, at least one item in the length of each data block burst.It will be appreciated by those skilled in the art that above-mentioned example does not constitute qualification to relevant information.Above-mentioned relevant information should be to generate to extract from data block A, can play the information of basic verification effect in transmission.
Those skilled in the art also should be appreciated that optionally, burst calibration equipment 111 can also be encrypted data block A integral body based on pre-defined algorithm simultaneously, generate the integrity checking information key of data block A
CtotalPreferably, generate the key of integrity checking information
CtotalPre-defined algorithm can be identical with the algorithm of the check information that generates the data block burst, repeat no more herein.Optionally, generate the key of integrity checking information
CtotalPre-defined algorithm also can be identical different with the algorithm of the check information that generates the data block burst.It should be noted that the pre-defined algorithm that in other request subscriber equipment, generates check information, should with the corresponding purpose that just can play the verification downloading data block of the pre-defined algorithm among the first subscriber equipment p1.For instance, the integrity checking information key that in the first subscriber equipment p1, generates of data block A
CtotalThe generation pre-defined algorithm must with the request subscriber equipment in integrity checking information key
RtotalThe generation pre-defined algorithm identical.
Optionally, the check information of data block A can comprise integrity checking information key simultaneously
CtotalCheck information key with each data block burst
C0To key
CN
First dispensing device 12 is sent to server sv1 with the check information of data block A.Wherein, the check information of data block A is used for the server end check information as data block A.If generating apparatus 11 has generated other relevant informations of data block, then above-mentioned relevant information also is sent to server sv1.
Preferably, the first subscriber equipment p1 sends the address that the third party of data block A downloads t1 to server sv1.It will be appreciated by those skilled in the art that, if the download of data block A is not provided in the P2P network originally, then can the address of this third party's loading source t1 be sent to and need the request of downloading data block A subscriber equipment by server sv1, thereby the subscriber equipment of realizing making subscriber equipment in the P2P network to preserve data block A from third party's loading source t1 and network obtains this data block, and need not self to store this data block at server sv1.
The check information that the receiving system 20 of server sv1 receives from the data block A of the first subscriber equipment p1, and the address of third party's loading source t1 of data block A correspondence.According to the difference of concrete performance, the check information key of data block A
cCan comprise integrity checking information key
CtotalAnd/or the check information key of each data block burst
C0To key
CNIf generating apparatus 11 has generated the relevant information of data block A simultaneously, then server sv1 also receives the relevant information from the first subscriber equipment p1.This relevant information comprises the length of data block A, at least one item in the length of the number of data block burst and each data block burst.
Then, the information apparatus for establishing 21 of server sv1 is set up the index information of data block A, with the user side check information key of data block A
cCheck information key as server end
r, this index information comprises the address of third party's loading source t1 of data block A correspondence and the check information key of server end
rBe to be understood that, the purpose of setting up the index information of data block A at server sv1 is, request user equipment requests in the P2P network is carried out the associative operation of data block A, for example during downloading data block A, server sv1 can ask subscriber equipment to provide this to operate necessary check information to this, in time detect document lending in the downloading process, avoid error diffusion.Preferably, when in the network as seed store the subscriber equipment lazy weight of data block A the time, server sv1 also can provide the address of third party's loading source t1 of data block A, so that the request subscriber equipment improves download efficiency directly from third party's loading source t1 downloading data block A.
Therefore, the specific embodiment of corresponding requests user equipment requests downloading data block A, servicing unit 2 also comprises second dispensing device 22.
More than specific embodiments of the invention are described.It will be appreciated that the present invention is not limited to above-mentioned specific implementations, those skilled in the art can make various distortion or modification within the scope of the appended claims.
Claims (28)
1. the server end of a subscriber equipment in distributed network provides the method for the check information of data block, it is characterized in that this method may further comprise the steps:
A. obtain described data block from the third party who is independent of described distributed network;
B. generate the check information of described data block based on pre-defined algorithm;
C. the check information with described data block is sent to described server end, and the check information of described data block is used for the server end check information as described data block.
2. method according to claim 1 is characterized in that, described step b also comprises:
B1. described data block is divided into a plurality of data block bursts;
B2. generate the check information of each described data block burst of described data block respectively based on described pre-defined algorithm, wherein, the check information of each described data block burst is unique;
Described step c also comprises:
--the check information of each described data block burst is sent to described server end, and the check information of described data block burst is used for the server end check information as described data block burst.
3. method according to claim 2 is characterized in that, the check information of described data block comprises the check information of each described data block burst and the integrity checking information of described data block, and described step b also comprises:
-based on described pre-defined algorithm data block integral body is encrypted, generate the integrity checking information of described data block.
4. method according to claim 2 is characterized in that, described step b2 also comprises:
-generating the relevant information of described data block, described relevant information comprises the length of described data block, the number of described data block burst, at least one item in the length of each described data block burst;
Described step c also comprises:
-send described relevant information to described server end.
5. method according to claim 1 is characterized in that, described step c also comprises:
-report third party's download address of described data block to described server end.
6. according to each described method in the claim 1 to 5, it is characterized in that described pre-defined algorithm is MD5 or SHA1 cryptographic algorithm.
7. according to each described method in the claim 1 to 5, it is characterized in that described data block is the burst of multimedia file or multimedia file.
8. one kind is carried out the method for auxiliary examination at the server end of distributed network by the data block check information, it is characterized in that this method may further comprise the steps:
A. receive user side check information from the data block of subscriber equipment, the corresponding third party's download address determined of described data block, described user side check information is generated based on pre-defined algorithm by subscriber equipment, and described third party is independent of described distributed network;
B. set up the index information of described data block, with the described user side check information of the described data block server end check information as described data block, described index information comprises the described third party's download address and the described server end check information of described data block correspondence.
9. method according to claim 8, it is characterized in that, described data block comprises a plurality of data block bursts, and described user side check information comprises the user side check information of each data block burst and encrypted the integrity checking information of the described data block that generates by subscriber equipment.
10. method according to claim 9 is characterized in that, described steps A also comprises:
-reception is from the relevant information of the described data block of subscriber equipment;
Described step B also comprises:
-in index information, set up the corresponding relation between described data block and its relevant information.
11. method according to claim 10 is characterized in that, described relevant information comprises the length of described data block, the number of described data block burst, at least one item in the length of each described data block.
12. method according to claim 8 is characterized in that, and is further comprising the steps of after the described step B:
C. the index information with described data block is sent to the described request subscriber equipment, and whether the data block check information that described server end check information is used for generating with the described request subscriber equipment compares, correct to judge subscriber equipment data downloaded piece.
13. each described method in 12 is characterized in that described pre-defined algorithm is MD5 or SHA1 cryptographic algorithm according to Claim 8.
14. each described method in 12 is characterized in that described data block is the burst of multimedia file or multimedia file according to Claim 8.
15. the server end of a subscriber equipment in distributed network provides the generator of the check information of data block, it is characterized in that, described generator comprises deriving means, generating apparatus and first dispensing device,
Described deriving means is used for obtaining described data block from the third party who is independent of described distributed network;
Described generating apparatus is used for generating based on pre-defined algorithm the check information of described data block;
Described first dispensing device is used for the check information of described data block is sent to described server end, and the check information of described data block is used for the server end check information as described data block.
16. generator according to claim 15 is characterized in that, described generating apparatus also comprises slicing apparatus and burst calibration equipment:
Described slicing apparatus is used for described data block is divided into a plurality of data block bursts;
Described burst calibration equipment is used for generating respectively based on described pre-defined algorithm the check information of each described data block burst of described data block, and wherein, the check information of each described data block burst is unique;
Described first dispensing device also is used for the check information of each described data block burst is sent to described server end, and the check information of described data block burst is used for the server end check information as described data block burst.
17. generator according to claim 16, it is characterized in that, the check information of described data block comprises the check information of each described data block burst and the integrity checking information of described data block, described generating apparatus also is used for based on described pre-defined algorithm data block integral body being encrypted, and generates the integrity checking information of described data block.
18. generator according to claim 16, it is characterized in that described generating apparatus also is used to generate the relevant information of described data block, described relevant information comprises the length of described data block, the number of described data block burst, at least one item in the length of each described data block burst;
Described first dispensing device also is used to send described relevant information to described server end.
19. generator according to claim 15 is characterized in that, described first dispensing device also is used for reporting to described server end third party's download address of described data block.
20., it is characterized in that described pre-defined algorithm is MD5 or SHA1 cryptographic algorithm according to each described generator in the claim 15 to 19.
21., it is characterized in that described data block is the burst of multimedia file or multimedia file according to each described generator in the claim 15 to 19.
22. one kind is carried out the servicing unit of auxiliary examination at the server end of distributed network by the data block check information, it is characterized in that described servicing unit comprises receiving system and information apparatus for establishing,
Described receiving system is used to receive the user side check information from the data block of subscriber equipment, the corresponding third party's download address determined of described data block, described user side check information is generated based on pre-defined algorithm by subscriber equipment, and described third party is independent of described distributed network;
Described information apparatus for establishing is used to set up the index information of described data block, with the described user side check information of the described data block server end check information as described data block, described index information comprises the described third party's download address and the described server end check information of described data block correspondence.
23. servicing unit according to claim 22, it is characterized in that, described data block comprises a plurality of data block bursts, and described user side check information comprises the user side check information of each data block burst and encrypted the integrity checking information of the described data block that generates by subscriber equipment.
24. servicing unit according to claim 23 is characterized in that, described receiving system also is used to receive the relevant information from the described data block of subscriber equipment;
Described information apparatus for establishing also is used for setting up corresponding relation between described data block and its relevant information at index information.
25. servicing unit according to claim 24 is characterized in that, described relevant information comprises the length of described data block, the number of described data block burst, at least one item in the length of each described data block burst.
26. servicing unit according to claim 22 is characterized in that, described servicing unit also comprises second dispensing device,
Described second dispensing device is used for the index information of described data block is sent to the described request subscriber equipment, whether the data block check information that described server end check information is used for generating with the described request subscriber equipment compares, correct to judge subscriber equipment data downloaded piece.
27., it is characterized in that described pre-defined algorithm is MD5 or SHA1 cryptographic algorithm according to each described servicing unit in the claim 22 to 26.
28. each described servicing unit in 12 is characterized in that described data block is the burst of multimedia file or multimedia file according to Claim 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101989829A CN102064906A (en) | 2009-11-18 | 2009-11-18 | Method and device for checking data blocks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2009101989829A CN102064906A (en) | 2009-11-18 | 2009-11-18 | Method and device for checking data blocks |
Publications (1)
Publication Number | Publication Date |
---|---|
CN102064906A true CN102064906A (en) | 2011-05-18 |
Family
ID=44000025
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2009101989829A Pending CN102064906A (en) | 2009-11-18 | 2009-11-18 | Method and device for checking data blocks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102064906A (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102739650A (en) * | 2012-05-28 | 2012-10-17 | 无锡力合数字电视技术有限公司 | File transmission system combining broadcast and television net and internet |
CN103795765A (en) * | 2012-11-02 | 2014-05-14 | 腾讯科技(深圳)有限公司 | File uploading verification method and system |
WO2018171550A1 (en) * | 2017-03-21 | 2018-09-27 | 腾讯科技(深圳)有限公司 | Data verification method, data transmission method, related devices, system and storage medium |
CN110809189A (en) * | 2019-12-03 | 2020-02-18 | 北京字节跳动网络技术有限公司 | Video playing method and device, electronic equipment and computer readable medium |
CN110855761A (en) * | 2019-10-29 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Data processing method and device based on block chain system |
CN111031536A (en) * | 2019-12-26 | 2020-04-17 | 大连市共进科技有限公司 | Method and device for transmitting burning file and 5G small base station burning equipment |
CN111107143A (en) * | 2019-12-16 | 2020-05-05 | 深圳市永达电子信息股份有限公司 | Network file transmission detection method, device and system |
CN112398655A (en) * | 2019-08-19 | 2021-02-23 | 中移(苏州)软件技术有限公司 | File transmission method, server and computer storage medium |
CN113961149A (en) * | 2021-10-29 | 2022-01-21 | 国网江苏省电力有限公司营销服务中心 | Multi-state data storage system and storage method for power information system |
DE102021117324A1 (en) | 2021-07-05 | 2023-01-05 | Bayerische Motoren Werke Aktiengesellschaft | Sending unit and receiving unit for sending and receiving data packets |
-
2009
- 2009-11-18 CN CN2009101989829A patent/CN102064906A/en active Pending
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102739650A (en) * | 2012-05-28 | 2012-10-17 | 无锡力合数字电视技术有限公司 | File transmission system combining broadcast and television net and internet |
CN102739650B (en) * | 2012-05-28 | 2015-04-22 | 无锡力合数字电视技术有限公司 | File transmission system combining broadcast and television net and internet |
CN103795765A (en) * | 2012-11-02 | 2014-05-14 | 腾讯科技(深圳)有限公司 | File uploading verification method and system |
US10949645B2 (en) | 2017-03-21 | 2021-03-16 | Tencent Technology (Shenzhen) Company Limited | Method, apparatus, and storage medium for data verification |
WO2018171550A1 (en) * | 2017-03-21 | 2018-09-27 | 腾讯科技(深圳)有限公司 | Data verification method, data transmission method, related devices, system and storage medium |
CN112398655A (en) * | 2019-08-19 | 2021-02-23 | 中移(苏州)软件技术有限公司 | File transmission method, server and computer storage medium |
CN112398655B (en) * | 2019-08-19 | 2022-06-03 | 中移(苏州)软件技术有限公司 | File transmission method, server and computer storage medium |
CN110855761A (en) * | 2019-10-29 | 2020-02-28 | 深圳前海微众银行股份有限公司 | Data processing method and device based on block chain system |
CN110809189A (en) * | 2019-12-03 | 2020-02-18 | 北京字节跳动网络技术有限公司 | Video playing method and device, electronic equipment and computer readable medium |
CN111107143A (en) * | 2019-12-16 | 2020-05-05 | 深圳市永达电子信息股份有限公司 | Network file transmission detection method, device and system |
CN111107143B (en) * | 2019-12-16 | 2022-05-10 | 深圳市永达电子信息股份有限公司 | Network file transmission detection method, device and system |
CN111031536A (en) * | 2019-12-26 | 2020-04-17 | 大连市共进科技有限公司 | Method and device for transmitting burning file and 5G small base station burning equipment |
DE102021117324A1 (en) | 2021-07-05 | 2023-01-05 | Bayerische Motoren Werke Aktiengesellschaft | Sending unit and receiving unit for sending and receiving data packets |
CN113961149A (en) * | 2021-10-29 | 2022-01-21 | 国网江苏省电力有限公司营销服务中心 | Multi-state data storage system and storage method for power information system |
CN113961149B (en) * | 2021-10-29 | 2024-01-26 | 国网江苏省电力有限公司营销服务中心 | Polymorphic data storage system and method for electric power information system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102064906A (en) | Method and device for checking data blocks | |
CN108494775B (en) | Method for preventing network attack by using legal data or tampering legal data | |
US10833871B2 (en) | System and method for deterministic signing of a message using a multi-party computation (MPC) process | |
CN101854241A (en) | Method and device for verifying data block transmitted in network | |
CN110708171B (en) | Block chain consensus voting method, device, equipment and storage medium | |
US9348993B2 (en) | Segment authentication for dynamic adaptive streaming | |
CN104255009B (en) | System and method for the fragment integrity and authenticity of adaptive stream media | |
US8379857B1 (en) | Secure key distribution for private communication in an unsecured communication channel | |
US7167984B2 (en) | Method and device for generating approximate message authentication codes | |
CN113055188B (en) | Data processing method, device, equipment and storage medium | |
US10938575B2 (en) | Signature compression for hash-based signature schemes | |
CN110224976B (en) | Encrypted communication method, device and computer readable storage medium | |
CN112035827B (en) | Cipher data processing method, device, equipment and readable storage medium | |
CN110944012B (en) | Anti-protocol analysis data secure transmission method, system and information data processing terminal | |
CN110096894B (en) | Data anonymous sharing system and method based on block chain | |
US20110271109A1 (en) | Systems and methods of remote device authentication | |
CN107147659A (en) | A kind of method and system for preventing to repeat | |
CN113507483B (en) | Instant messaging method, device, server and storage medium | |
WO2019214714A1 (en) | Method, system, node, and computer storage medium for controlling video playback | |
CN111367923A (en) | Data processing method, data processing device, node equipment and storage medium | |
CN111339201A (en) | Evaluation method and system based on block chain | |
Zhang et al. | Efficient secret image sharing scheme with authentication and cheating prevention | |
CN113243093B (en) | System and method for message transmission and retrieval using blockchain | |
US10608822B2 (en) | Efficient calculation of message authentication codes for related data | |
US20120331040A1 (en) | Validating download success |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20110518 |