Summary of the invention
Technical problem to be solved by this invention provides a kind of method and system of resource-sharing, and the resource in the P2P network can balancedly be shared, and improves the speed of user's download documentation, and the P2P Internet resources are fully utilized.
The present invention also provides a kind of server, is used for the configuration of P2P Resource sharing in networks.
The present invention also provides a kind of client, is used for the configuration of P2P Resource sharing in networks.
For solving the problems of the technologies described above, the invention provides a kind of method of resource-sharing, comprising:
Server receives the sharing request information that client sends, and this sharing request information comprises the shareable resource information of described client;
Described server obtains the frequency of occurrences of each resource in the shareable resource information of its preservation in the described shareable resource information;
When the frequency of occurrences of certain resource was hanged down predetermined value, described server notification client provided described resource.
Preferably, also comprise: described server obtains described resource and be downloaded number of times in the shared resource download message of its preservation;
With the frequency of occurrences of described resource be downloaded number of times and compare;
When comparing result was lower than predetermined value, the described client of described server notification provided described resource.
Preferably, also comprise: other client of described server notification provides described resource.
Preferably, also comprise: described server receives the shared resource download message that client sends, and this shared resource download message comprises the number of times that is downloaded of resource.
Preferably, also comprise: server receives the hardware information that client sends, and determines the quantity of described client shared resource according to described hardware information.
The invention provides a kind of system of resource-sharing, comprising:
Client is used to send sharing request information to server, and described sharing request information comprises shareable resource information;
Server is used for obtaining resource frequency of occurrences in the shareable resource information of its preservation of described shareable resource information, when the frequency of occurrences is lower than predetermined value, notifies described client that described resource is provided.
Preferably, described server also is used to receive the shared resource download message that client sends, and this shared resource download message comprises the number of times that is downloaded of resource;
Obtain described resource and in the shared resource download message of its preservation, be downloaded number of times, and with described resource be downloaded number of times and the described frequency of occurrences compares; When comparing result is lower than predetermined value, notify described client that described resource is provided.
Preferably, also comprise: other client of described server notification is shared described resource.
Preferably, described server also is used to receive the hardware information that described client sends, and determines the quantity of described client shared resource according to described hardware information.
The invention provides a kind of server, comprise shareable resource information process unit and notification unit:
Described shareable resource information process unit is used to receive the shareable resource information that client sends, and obtains the resource frequency of occurrences in the shareable resource tabulation of its preservation in the described shareable resource information; When the frequency of occurrences is lower than predetermined value, trigger described notification unit;
Described notification unit is used to notify client that described resource is provided.
Preferably, also comprise: shared resource download message processing unit, be used to receive the shared resource download message that client sends, this shared resource download message comprises the number of times that is downloaded of resource; Obtain described resource and in the shared resource download message of its preservation, be downloaded number of times; With the described frequency of occurrences of described resource be downloaded number of times and compare; When comparing result is lower than predetermined value, trigger described notification unit.
Preferably, also comprise: the hardware information processing unit is used to receive the hardware information that client sends, and determines the quantity of described client shared resource according to described hardware information.
The present invention also provides a kind of client, comprising: share information retrieval unit, be used to obtain described client shareable resource information, and shareable resource information is sent to server;
The resource-sharing unit is used for the shared resource information returned according to server, and corresponding resource is provided.
Preferably, also comprise: shared resource download message transmitting element, the shared resource download message that is used for comprising the number of times of client downloads shared resource sends to described server.
Preferably, also comprise: the hardware information retrieval unit is used to retrieve the hardware information of client and sends to described server.
Server of the present invention is according to the frequency of occurrences of shared resource in described shareable resource tabulation, and shared resource is allocated in equilibrium, and when the frequency of occurrences was lower than certain numerical value, the server notification client provided described resource, avoided the part resource excessively shared in the P2P network.
Preferably, server of the present invention obtains shared resource and be downloaded number of times in the shared resource download message of its preservation, server is downloaded number of times with the shared resource frequency of occurrences and compares with it, when comparing result was lower than certain numerical value, the server notification client provided described shared resource.Shared resource is downloaded often, shows this shared resource temperature height, and shared resource is shared by the client of fair amount in the P2P network according to its temperature, satisfies shared resource balanced distribution in the P2P network.
Preferably, server of the present invention determines the quantity that this client can shared resource according to the hardware configuration of client, the client that hardware configuration is high can be shared more resource, the client that hardware configuration is low can only be shared less resource, the higher client of configuration in the P2P network is fully utilized, and the raising user visits in P2 P network, the speed of file in download data; Make that also bandwidth is well utilized in the P2P network, alleviate the pressure of server.
Embodiment
The present invention is mainly used in the P2P network, and a plurality of clients link to each other with server in the P2P network, can download resources shared mutually between the client, and server centered is managed each client, and exchanges the information of each client.
Core concept of the present invention is: server is according to the frequency of occurrences of shared resource in described shareable resource tabulation, balanced allotment shared resource, when the frequency of occurrences is lower than certain numerical value, the server notification client provides described resource, avoid the part resource excessively shared in the P2P network, improve the sharing degree of some other resource;
Server obtains shared resource and be downloaded number of times in the shared resource download message of its preservation, server is downloaded number of times with the shared resource frequency of occurrences and compares with it, when comparing result was lower than certain numerical value, the server notification client provided described shared resource; Shared resource is downloaded often, shows this shared resource temperature height, and shared resource is shared by the client of fair amount in the P2P network according to its temperature, satisfies shared resource balanced distribution in the P2P network;
Server determines the quantity that this client can shared resource according to the hardware configuration of subscription client, the client that hardware configuration is high can be shared more resource, the client that hardware configuration is low can only be shared less resource, the higher client of configuration in the P2P network is fully utilized, and the raising user visits in the P2P network, the speed of file in download data; Make that bandwidth is well utilized in the P2P network, alleviate the pressure of server.
See also Fig. 1, show a kind of resource sharing system schematic diagram of the present invention, a plurality of clients 11 interconnect, and all are connected to server 12.
Resource sharing system of the present invention realizes that the mode of resource-sharing is: client 11 sends sharing request information to server 12, sharing request information comprises the shareable resource tabulation, server 12 is according to the resource in the shareable resource tabulation, in the shareable resource information of its preservation, search and calculate the frequency of occurrences of this resource, when the frequency of occurrences was lower than certain numerical value, server 12 returned in the shared resource tabulation of client 11 and includes this resource; When the frequency of occurrences was higher than certain numerical value, server 12 returned in the shared resource tabulation of client 11 and does not include this resource.Client 11 provides corresponding resource according to the information in the shared resource that the returns tabulation of server 12.
Resource sharing system of the present invention realizes that the mode of resource-sharing also can be: client 11 sends information sharing resource downloading information to server 12, this shared resource download message comprises the title of resource and is downloaded number of times, server 12 is searched, is calculated described resource and be downloaded number of times in the shared resource download message of its preservation, and with described resource be downloaded number of times and its in the shareable resource that server is preserved in the table frequency of occurrences compare, obtain comparing result; When comparing result was lower than certain numerical value, server 12 returned in the shared resource tabulation of client 11 and does not include described resource; Comparing result is higher than certain numerical value, and server 12 returns in the shared resource tabulation of client 11 and includes described resource, and server 12 also notifies other client 11 to share described resources; Client 11 provides corresponding resource according to the information in the shared resource that the returns tabulation of server 12.
Resource sharing system of the present invention realizes that the mode of resource-sharing also can be: server 12 receives the hardware information that described client 11 sends, and determines the quantity of client 11 shared resources according to described hardware information; Server 12 determines according to the frequency of occurrences of resource whether it is shared by client 11, also can determine whether it is shared by client 11 according to the comparing result that is downloaded number of times and its frequency of occurrences of resource; Server 11 sends shared resources and tabulates to client 12, and the resource that is comprised in this shared resource tabulation does not exceed client 12 can the resources shared size, and client 12 is according to the shared corresponding resource of shared resource tabulation.
See also Fig. 2, be the schematic diagram of a kind of server of the present invention, server 20 comprises shareable resource information process unit 21, shared resource download message processing unit 22, hardware information processing unit 23 and notification unit 24.
Shareable resource information process unit 21 obtains the resource frequency of occurrences in the shareable resource tabulation of its preservation in the shareable resource tabulation; When the frequency of occurrences is lower than certain numerical value, trigger notice unit 24, notification unit 24 notice clients provide described resource;
Shared resource download message processing unit 22 receives the shared resource download message that client sends, and this shared resource download message comprises the title of resource and is downloaded number of times; Also can obtain resource and in the shared resource download message of its preservation, be downloaded number of times; Also can with the frequency of occurrences of described resource be downloaded number of times and compare, obtain comparing result; When comparing result is lower than certain numerical value, trigger notice unit 24, notification unit 24 notice clients provide described resource.
Hardware information processing unit 23 receives the hardware information that client sends, and determines the quantity of described client shared resource according to described hardware information.
See also Fig. 3, be the schematic diagram of a kind of client of the present invention, client 30 comprises shares information retrieval unit 31, shared resource download message transmitting element 32, hardware information retrieval unit 33 and resource-sharing unit 34.
Share information retrieval unit 31 and obtain the tabulation of client shareable resource, and the shareable resource tabulation is sent to server; Server is according to the frequency of occurrences of resource in the shareable resource tabulation, and whether notice client 30 shares this resource;
Shared resource download message transmitting element 32 sends to server with client 30 shared resource download messages, and this shared resource download message comprises the title of resource and is downloaded number of times; This shared resource download message is used for determining the number of times that is downloaded of resource, with resource be downloaded number of times and the frequency of occurrences compares, when comparing result was lower than certain numerical value, server notification client 30 provided described resource.
The hardware information of hardware information retrieval unit 33 retrieval clients also sends to server; Hardware information is used for determining the quantity of client 30 shared resources;
Resource-sharing unit 34 is used for the shared resource information that comprises according to the server return information, and corresponding resource is provided.
See also Fig. 4, show resource share method one embodiment flow chart of the present invention, detailed process is as follows;
41, user end to server sends sharing request information to server, and this sharing request information comprises the shareable resource tabulation.
Client functionality unit retrieval user resources shared information, and make shareable resource by certain form and tabulate.Shared resource be audiovisual materials, learning materials, application software data etc. all can be used for the documentation of Network Transmission.Comprise information such as that the client user has, as to be ready the documentation shared title, size in the shareable resource tabulation.
42, server receives this solicited message, and obtains the frequency of occurrences of resource in the shareable resource tabulation.
Collation server is also preserved client and is transmitted the shareable resource tabulation, determines the number of times that this document data is shared according to the frequency that documentation occurs in the shareable resource tabulation of preserving in whole P2P network.As, the frequency of motion picture data appearance in the shareable resource tabulation that 500,000 clients transmit is 10%, shows that this motion picture data has 50,000 clients to provide shared at the P2P network this moment.
43, server determines that whether this resource shared by client, and generates corresponding shared resource tabulation and send to described client.
Server is according to the unified equilibrium allotment of configuration rule shared resource, and this configuration rule is that the frequency of occurrences is shared for excessive above the shared resource of certain numerical value in the shareable resource tabulation, needs its number of times that is shared of minimizing.Concrete numerical value is obtained by the actual conditions test of server according to whole P2P network.
Excessive resources shared, server notification client do not provide sharing of this resource, are not excessive resources shared, and the server notification client provides sharing of this resource.Server is with the form notice client of shared resource tabulation.
44, client is shared corresponding resource according to the shared resource tabulation that receives.
Shared resource can be shared by the client of fair amount in the P2P network according to its temperature in the P2P network in order to make, allow shared resource obtain more reasonable balanced distribution in the P2P network, documentation is by the number of times of client downloads in the server statistics shared resource of the present invention; Server compares the number of times that is downloaded of the shared resource frequency of occurrences and this shared resource, determines the number of times that this shared resource is shared according to comparing result by certain rule.
See also Fig. 5, show the flow chart of another embodiment of resource share method of the present invention, detailed process is as follows.
51, server receives client and sends the shared resource solicited message, and this shared resource solicited message comprises the tabulation of client shareable resource.
Server obtains the frequency of occurrences of each resource in the shareable resource tabulation of preserving in the shareable resource tabulation.
52, server statistics shared resource in the P2P network by the client downloads number of times.
When client file in download data on network, this client sends a download information to server, and this download message comprises information such as the title, time of client institute file in download data.The built-in functional unit of server is provided with a dynamic shared resource Thermometer, show number of times that each documentation is downloaded on the P2P network and the time that at every turn is downloaded in this shared resource Thermometer, and according to the download message real-time update that each client is transmitted.The number of times that server is downloaded within a certain period of time according to each documentation determines its temperature.
Because the client user likes the very big homoplasy of existence, the application software that the practicality of some new releases is very strong, star's popular song, or the documentations such as film of a large amount of propagandas of certain body often are subjected to most of user and like, its number of times that is downloaded is quite a lot of, the documentation that has even within one hour, just be downloaded up to ten thousand time, and the temperature of the documentation that has changed very greatly in the regular period, such as the film of newly showing, through after long period of time, its temperature more greatly reduces, therefore, the temperature of each documentation all is dynamically, the need real-time update.
53, server compares number of times and its frequency of occurrences in the shareable resource tabulation of preserving that is downloaded of resource, according to result relatively, carries out the equilibrium distribution.
Server compares temperature and its frequency of occurrences in the shareable resource tabulation of documentation, as, in client terminal quantity is 100 ten thousand P2P network, a documentation frequency of occurrences in the shareable resource tabulation that client transmits is 5%, promptly 50,000 clients provide this document data to share, and this document data is 1,000 times in the nearest quantity that was downloaded in one hour, then server thinks that this document data is excessively shared, according to configuration rule, this document data only needs 10,000 clients to share to get final product, therefore, the server notification client is not shared this document data, and the client of sharing this document data is reduced gradually.
As, one documentation is shared by 50,000 client in whole P2P network, and this document data reaches several ten thousand times in the nearest quantity that was downloaded in one hour, then server thinks that this document data shared low, according to allocation rule, this document data also need 50,000 clients be shared the needs that could satisfy other client user's download, and server is selected the shared this document data of having the ability in the P2P network 50,000 clients bring in shared this documentation.Share this document data by ability and be meant that mainly the hardware configuration of client can satisfy shared this document data, and according to showing that this client has this documentation in former shareable resource tabulation that sends of this client or the download message.
The configuration rule of present embodiment is that server is formulated according to test and statistics, be the documentation numerical value that can be shared and the relativity of its temperature, and according to the actual conditions dynamic change of P2P network, quantity and its temperature of using this rule that documentation is shared adapt, promptly satisfy the requirement of user's download this document, be unlikely to this document data again and excessively shared.
54, after server is finished the equilibrium allotment of shared resource according to configuration rule, generate corresponding shared resource tabulation and send to described client, client is shared corresponding resource.
Visit in the P2P network for improving the user, the speed of file in download data, bandwidth is well utilized, and is alleviated the pressure of server to a certain extent.Server of the present invention determines the quantity that this client can shared resource according to the hardware configuration of subscription client, the client that hardware configuration is high can be shared more resource, the client that hardware configuration is low can only be shared less resource, and the higher client of configuration in the P2P network is fully utilized.
See also Fig. 6, the another embodiment flow chart of resource share method of the present invention is shown, detailed process is as follows:
61, user end to server sends sharing request information, and this information comprises client hardware information;
The hardware configuration information of this client of client retrieves, be mainly the center processor (CPU of client, Center Processing Unit), hardware configuration such as bandwidth, internal memory, networked devices, CUP determines the speed of the deal with data of client to a great extent, bandwidth determines the speed of miscellaneous equipment transfer of data on client and the P2P network to a certain extent, according to hardware configuration such as the CPU of client, bandwidth, can roughly judge the speed of on network, carrying out data interaction substantially with this client.
62, server is determined the size of client shared resource according to the hardware information in the solicited message.
Hardware information comprises hardware configuration informations such as the CPU, bandwidth of client, server is by testing the relativity between client hardware configuration as can be known and this client process, the transmission data speed to the data transmission bauds of P2P network, this relativity is not what fix, need constantly adjust according to the result of server test.Server is according to the size of relativity decision client shareable resource.
If the relatively low client of hardware configuration has been shared a large amount of documentations, other client will this client of central access or in this client downloads documentation, the CUP of this client need handle a large amount of related datas, because of its processing speed lower, the time of handling increases a lot relatively, again because its bandwidth deficiency, transfer of data is slower, cause the client user who visits its client or download its shared file data to wait for for a long time, like this, quick and the convenience of the not only imperceptible P2P of the user of client networking file in download data is also abandoned downloading because of waits for too long probably, wastes the unnecessary time.
On the contrary,, its hardware resource can not be fully utilized, cause the relative waste of network hardware resource if the very high client of hardware configuration has only been shared the documentation of negligible amounts.
Therefore, determine the quantity that this client can shared resource according to the hardware configuration of subscription client, the client that hardware configuration is high can be shared more resource, the client that hardware configuration is low can only be shared less resource, can allow the higher client of configuration in the P2P network be fully utilized, improve that the user visits, the speed of file in download data in the P2P network; Make that also bandwidth is well utilized in the P2P network, alleviate the pressure of server.
63, server is downloaded the number of times and the frequency of occurrences according to what client provided shared resource in the shareable resource information list, determines that this client could resources shared.
Server can determine whether it is shared by client according to the temperature of shared resource, also can determine whether it is shared by client according to the temperature of shared resource and the comparing result of its frequency of occurrences.
64, server transmission shared resource is tabulated to client, and the resource that is comprised in this shared resource tabulation does not exceed client can the resources shared size.Client is according to the shared corresponding resource of shared resource tabulation.
See also Fig. 7, show the sharing degree curve synoptic diagram of the shared resource of handling through the present invention program, wherein abscissa is the documentation sequence, ordinate is the documentation sharing degree, dotted line represents not handle through the present invention program the sharing degree curve of documentation, the shared file data sharing degree curve of solid line for handling through the present invention program.
The dotted line curvature is excessive among the figure, show the documentation of not handling through the present invention program, its sharing degree is obviously unbalanced, and a part of documentation is obviously too high, through then level and smooth many of the solid line after the unified balanced allotment of the present invention program, the documentation that expression is shared is shared by equilibrium.
More than to the method and system of a kind of resource-sharing provided by the present invention, be described in detail, used specific case herein principle of the present invention and execution mode are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.