Patent ID: 8055798

Claim:
A method for transmitting shared contents, comprising: by a content source peer, dividing original contents into blocks and constructing coefficient vectors corresponding to the original contents according to pre-configured rules for constructing the coefficient vectors, and combining original content blocks with the corresponding coefficient vectors linearly to obtain code blocks, wherein ID of each code block is the same as ID of the corresponding coefficient vector; and by a content receiving peer, determining to download code blocks from the content source peer, and downloading code blocks from the content source peer according to the IDs of code blocks stored by the content source peer but not stored by the content receiving peer; wherein the rules for constructing coefficient vectors are: the first n coefficient vectors form an n-dimensional unit matrix, the latter m-n coefficient vectors form a matrix in the Galois field (GF), and any n coefficient vector in the m coefficient vector are of linear independence, wherein n indicates the number of orginal content blocks, m indicates the number of code blocks, and the ID of each coefficient vector indicates the row number of the coefficient vector in the coefficient martix; and the method further comprises: by the content receiving peer, determining the number of downloaded code block is equal to n, and judging whether there are code blocks with IDs greater than n in the n code blocks; if not, determining that the n code blocks are the n orginal content blocks, and recovering the original content according to the n orginal content blocks; if so, constructing coefficient vectors corresponding to the code blocks according to the IDs of code blocks and configured rules for constructing coefficient vectors, constructing a linear equation with n unknowns according to the code blocks and the corresponding coefficient vectors, determining that the code blocks with IDs equal to or smaller than n are original content blocks, computing the equation to obtain the original content blocks corresponding to the code blocks with IDs greater than n, and recovering the orginal content according to the n original content blocks, wherein n indicates the total number of original content blocks.