WO2014075426A1 - 一种数据更新方法及web服务器 - Google Patents

一种数据更新方法及web服务器 Download PDF

Info

Publication number
WO2014075426A1
WO2014075426A1 PCT/CN2013/074580 CN2013074580W WO2014075426A1 WO 2014075426 A1 WO2014075426 A1 WO 2014075426A1 CN 2013074580 W CN2013074580 W CN 2013074580W WO 2014075426 A1 WO2014075426 A1 WO 2014075426A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
data
group
update
cache
Prior art date
Application number
PCT/CN2013/074580
Other languages
English (en)
French (fr)
Inventor
李华飞
何秀强
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2014075426A1 publication Critical patent/WO2014075426A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data update method and a web server.
  • the web server sends a query (query) message to the database server where the user's friend is located after receiving the request;
  • the web server obtains the content update queried by the database server and returns it to the user terminal, so that the user can browse the content update of the friend on the website page. Since the user's data is stored in the database, as the amount of data increases and the access is concentrated, there is a problem that the database load is aggravated and the response is deteriorated, and thus the user experience such as content display delay is poor. Therefore, in actual deployment, caching technology is often used to solve user database bottlenecks. Cache service The server caches the contents of the database in memory. In most cases, the web server only needs to access the cache server to obtain the query result. Only when the content of the query is not cached, will the database server be queried.
  • the cache scheme can reduce the number of database accesses and improve the response speed of the query. Users bring a better user experience.
  • Memcached is a high-performance distributed memory object caching system for dynamic web applications to reduce database load. It reduces the number of times the database is read by caching data and objects in memory, providing the speed of a dynamic, database-driven website.
  • the "pull-on-demand" mechanism based on memcached is to send a request to the web server when the user queries the friend content update, and the web server first obtains the friend information of the user from the user social relationship cache, and then all the friends to the user.
  • the cache server is sent a query message.
  • the web server may send N query messages.
  • the N value When the amount of data of the friend is large and the content is updated frequently, the N value will be Very large, resulting in a large query overhead, consuming a lot of system resources; wherein, based on the memcached "push-on-change" mechanism is that once a user has updated the content, the user will actively update the content to all friends Content cache, however, if the user has N friends, it will be pushed N times. When the number of friends of the user is large, it will occupy a large amount of system resources, which will bring a great load to the back-end server.
  • the embodiment of the invention provides a data update method and a web server.
  • the web server After receiving the data update request of the user or the current upload data of the user, the web server caches the cache group corresponding to the cache corresponding to the maximal group to which the user belongs.
  • the server sends a data query message or a current upload data of the user to implement data update or data upload, so that N friends in the maximal group to which the user belongs need only send a data query message or perform data transfer, which can be effective. Reduce the resources occupied by the web server in data update or data upload, and effectively save system resources.
  • An aspect of the present invention provides a data update method, including:
  • the web server receives the data update request of the user, determining the maximum group to which the user belongs, The users in the maximal group are friends with each other;
  • the web server receives update data sent by the maximal group cache server for implementing data update of the user requesting data update.
  • the update data includes a version number of the last time the user's friend uploaded the data.
  • the method further includes:
  • the friend of the user in the update data includes at least two pieces of update data, selecting and saving a latest update data of the version number from the at least two pieces of update data, and discarding the update data of the other version number.
  • the data update method further includes:
  • Determining, according to the maximal group to which the user belongs and the set of friends of the user, the non-extreme group of friends of the user, the non-extreme group of friends is included in the set of friends of the user and not in the user a collection of friends in the affiliated group;
  • non-extreme group buddy set is not an empty set, sending a data query message to a user cache server where the user cache corresponding to the buddy in the non-extreme group buddy set is located;
  • the data query message includes a time when the user last requested the update, so that the maximal group cache server and/or the user that receives the data query message
  • the cache server sends update data to the web server based on when the user last requested the update.
  • a second aspect of the present invention provides a data uploading method, including:
  • the web server receives the data currently uploaded by the user, and determines the maximal group to which the user belongs, the users in the maximal group are friends of each other;
  • the data uploading method further includes: sending data currently uploaded by the user to a user cache server where the user cache of the user is located, so that the user cache server The data currently uploaded by the user is saved in the user cache of the user.
  • the data currently uploaded by the user includes a version number, so that the data of the currently uploaded data of the user is received.
  • the large group cache server determines whether to save the data currently uploaded by the user according to the version number.
  • a third aspect of the present invention provides a web server, including:
  • a determining unit configured to: if a data update request of the user is received, determine a maximum group to which the user belongs, and the users in the maximal group are mutually friends;
  • a sending unit configured to send, after the determining unit determines the maximal group to which the user belongs, to send a data query message to the maximal group cache server where the cache corresponding to the maximal group is located;
  • a receiving unit configured to receive, after the sending unit sends the data query message, update data sent by the maximal group cache server, to implement data update of the user.
  • the update data includes a version number of the last time the friend of the user uploads data; and the web server further includes:
  • An optimization unit configured to: after the receiving unit receives the update data, if the friend of the user in the update data includes at least two pieces of update data, select and save a version number from the at least two pieces of update data Update data, discard update data of other version numbers.
  • the web server further includes:
  • a set determining unit configured to determine, according to the maximal group to which the user belongs and the friend set of the user, the non-extreme group of friends, after the obtaining unit determines to acquire the friend set of the user,
  • the non-extreme group of friends is included in the set of friends of the user and is not used a collection of friends in the collection of maximal groups to which the user belongs;
  • a message sending unit configured to send, when the non-extreme group buddy set is not an empty set, a data query message to a user cache server where the user cache corresponding to the friend in the non-extreme group of friends is located;
  • the data receiving unit receives the update data sent by the user cache server after the message sending unit sends the data query message.
  • a fourth aspect of the present invention provides a web server, including:
  • the maximal group determining unit is configured to: if the data currently uploaded by the user is received, determine the maximal group to which the user belongs, and the users in the maximal group are friends of each other;
  • a first sending unit configured to send, after the maximal group determining unit determines the maximal group, data currently uploaded by the user to a maximal group cache server where the cache corresponding to the maximal group is located, so that The maximal group cache server saves the data currently uploaded by the user to the cache corresponding to the maximal group.
  • the web server further includes: a user cache server where the user is located, so that the user cache server saves data currently uploaded by the user to the user cache of the user. .
  • the embodiments of the present invention have the following advantages:
  • the web server receives the data update request sent by the user, it determines the maximal group to which the user belongs, and sends a data query message to the maximal group cache server where the cache corresponding to the maximal group to which the user belongs, and receives the maximal group cache server.
  • the updated data is sent to implement the user's data update, or the web server can send the currently uploaded data of the received user to the cache server where the cache corresponding to the maximal group to which the user belongs, to implement data uploading,
  • the users in the group are all friends of the user, so that when a data query message or data currently uploaded by the user is sent to the maximal group cache server corresponding to the maximal group to which the user belongs, an update to multiple friends in a maximal group is performed.
  • the data query only needs to send a data query message, and only one data upload is needed for data uploading of multiple friends in a maximal group, which can effectively reduce the resources occupied by the web server in data update or data upload, and effectively Save system resources.
  • FIG. 1 is a schematic diagram of a data update method according to an embodiment of the present invention
  • FIG. 2 is a schematic view of a macro group in an embodiment of the present invention.
  • FIG. 3 is another schematic diagram of a data update method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a data uploading method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a structure of a web server according to an embodiment of the present invention.
  • FIG. 6 is another schematic diagram of a structure of a web server according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram showing the structure of a web server according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram showing the structure of a web server according to an embodiment of the present invention.
  • the embodiment of the present invention provides a data update method and a web server, which are used to implement user data update, which can effectively reduce the number of data query messages sent by the web server and save system resources.
  • an embodiment of a data update method includes: 101. If a web server receives a data update request of a user, determining a maximum group to which the user belongs, and a user in the maximal group Two and two are friends with each other;
  • the user when the user uses the social network, the user may manually click to send a data update request, or after the user logs in to the social network, the system automatically generates a data update request, where the data update request is used to request to update the content of all friends of the user.
  • the web server After receiving the data update request, the web server determines a set of maximal groups to which the user belongs, wherein the users in the maximal group are friends of each other.
  • the backend server periodically calculates the maximal group existing in the social network, and sends the calculated maximal group to the plurality of maximal group cache servers, and the plurality of maximal group cache servers
  • the cache will be allocated for the maximal group.
  • the size of the cache for the maximal group cache server can be determined according to the specific situation. It is not limited here.
  • the background server calculates 9 maximal groups, the numbers are respectively 1 to 9, there are 2 maximal group cache servers respectively A, B, then the cache can be allocated to the maximal group 1 to 4 by the maximal group cache server A, and the maximal map cache server B is the maximal group 5 to 9 allocates the cache, or, by the maximal group cache server A, allocates a cache for the maximal groups 1 and 9, and the maximal group cache server B allocates a cache for the maximal groups 2 to 8.
  • the back-end server will also establish a correspondence between the maximal group cache server and the maximal group, and the correspondence between the user and its maximal group, among which the maximal group cache server and the maximal group
  • the correspondence between the two can be saved in the database or in the cache server.
  • the correspondence between the user and its associated group can also be saved in the database or in the cache server.
  • the web server can determine the user belongs from the database or through the cache server.
  • the maximal group, and the maximal group cache server where the cache of the maximal group to which the user belongs is located.
  • 14 ⁇ is a collection of nodes in the graph
  • E is the edge set of the graph
  • the cluster in the graph refers to a set of nodes connected between two and two. If a cluster is not a true subset of any other group, the group is called For the maximal group, in Figure 2, nodes 1, 2, 3, 4 form a maximal group, nodes 7, 8, 9 form a maximal group, nodes 1, 10, 11 form a maximal group, node 8 13, 13 and 14 constitute a great group.
  • the background server uses the principle of the maximal group to divide the maximal group according to the friend relationship between the users, and establishes the correspondence relationship between the user and the maximal group to which the user belongs, and the user and the corresponding group are extremely
  • the correspondence between the groups is stored in the cache server.
  • the background server can also store the correspondence between the user and the maximal group to which it belongs.
  • the web server may determine, according to the identity identifier (ID, Identity) of the user, the correspondence between the saved user in the database and the maximal group to which the user belongs.
  • ID identity identifier
  • the maximal group to which the user belongs for example, taking the example of FIG. 2, if the web server receives the data update request sent by the user, and the user is the node 8, the correspondence between the user in the database and the maximal group to which it belongs can be obtained.
  • the set of maximal groups to which the node 8 belongs includes two maximal groups, that is, the maximal group formed by the nodes 7, 8, and the maximal group formed by the nodes 8, 13, 14
  • the collection of groups includes: ⁇ ( 7, 8, 9 ), ( 8, 13 , 14 ) ⁇ .
  • the web server may also send a query request to the cache server that stores the correspondence between the user and the maximal group to which the user belongs, and carry the ID of the user in the request, so that after the cache server receives the query request sent by the web server, Searching for the maximal group corresponding to the ID of the user in the corresponding relationship between the saved user and the maximal group to which the user belongs, and sending the set of the maximal group to which the found user belongs to the web server, where the user belongs
  • the maximal group refers to all the maximal groups that contain the user, and the maximal group contains the IDs of all the users that make up the maximal group.
  • the correspondence between the user and the friend is saved in the database or in the cache server, and the web server can search the database for the friend set according to the ID of the user.
  • the user's friend collection can also be obtained by sending a query request to the cache server.
  • the web server After determining the maximum map to which the user belongs, the web server will correspond to the maximal group to which the user belongs.
  • the maximal group cache server where the cache is located sends a data query message, and the data query message includes at least the number of the maximal group requesting the query, for example: if the maximal group to which the user belongs is the maximal group A and the maximal group B And the maximal group cache server where the maximal group A is located is C, and the maximal group cache server where the maximal group B is located is D, then the web server sends the data containing the number of the maximal group A to the maximal group cache server C.
  • the query message is sent to the Maximal Cache Server D to send a data query message containing the number of the Max B group to obtain the update data of the users in the Maximal Group A and the Maximal B.
  • the maximal group cache server After receiving the data query message, the maximal group cache server searches for the corresponding cache according to the number of the maximal group included in the data query message, and obtains the update data in the maximal group, and The update data is sent to the web server, so the web server can receive the update data sent by the maximal group cache server for implementing the user's data update.
  • the web server obtains the update data of the user by sending a data query message to the maximal group cache server to which the user belongs, because the users in the maximal group to which the user belongs are friends of the user,
  • the data update of the plurality of friends in the maximal group only needs to send a data query message, and the update data of the plurality of friends in the maximal group can be obtained, thereby effectively reducing the data query message sent by the web server.
  • Quantity avoiding user data update taking up too much resources and saving system resources.
  • FIG. 3 is an embodiment of the data update method in the embodiment of the present invention, including:
  • step 301 if the web server receives the user's data update request, the user is determined to belong to the maximal group, the users in the maximal group are friends, and step 302 and step 303 are performed respectively;
  • step 301 the content described in step 301 is similar to the content described in step 101 in the embodiment shown in FIG. 1, and details are not described herein again.
  • step 302 Send a data query message to the maximal group cache server where the cache corresponding to the maximal group to which the user belongs, and continue to step 306;
  • the content described in step 302 is similar to the content described in step 102 in the embodiment shown in FIG. 1, and details are not described herein again.
  • the web server after determining the maximal group to which the user belongs, the web server also acquires the user's friend set, wherein the web server can obtain the cache server or database that stores the correspondence between the user and the friend.
  • the user's friend collection specifically, the web server may send a friend query message to the cache server that stores the correspondence between the user and the friend, and the cache server uses the user ID in the received friend query message to query the corresponding friend set, and The queried buddy collection is sent to the web server, or the web server can query the database according to the user ID to obtain a buddy collection corresponding to the user.
  • the web server may determine the non-extreme group of friends according to the maximal group to which the user belongs and the set of friends of the user, where A large group of friends includes a collection of friends in the user's friend collection that are not in the maximal group to which the user belongs.
  • the non-maximum group buddy set is not an empty set, send a data query message to the user cache server where the user cache corresponding to the buddy in the non-extreme group buddy set, and continue to perform step 308.
  • the user's non-extreme group of friends is not an empty set, and the web server also sends a data query message to the user cache server where the user corresponding to the friend in the non-extreme group of friends is located, and the data query message includes at least The ID of the friend requesting the query, so that the user cache server that receives the data query message can query the corresponding user cache according to the ID of the friend, and obtain the update data of the friend.
  • the non-extreme group of friends of the user is an empty set, all the friends of the user are in the maximal group to which the user belongs, by using the pole to which the user belongs. Big The group sends a data query message to obtain updated data of all the friends of the user.
  • the maximal group cache server will obtain the update data and send the obtained update data to the web server. Therefore, the web server can receive the update data sent by the maximal group cache server.
  • the data query message further includes the time when the user last requested the update, so that the maximal group cache server that receives the data query message can obtain the maximal group corresponding to the request query according to the time when the user last requested the update.
  • the updated data in the cache, and the obtained data is sent to the web server, specifically: the maximal group cache server calculates the time difference between the time when the user last requested the update and the current time, if the time difference is less than or equal to the pre- If the set time is long, the maximal group cache server sends the update data uploaded after the time point when the user last requested the update to the web server from the cache corresponding to the number of the maximal group included in the data query message, if If the time difference is greater than the preset time length, the data acquisition time point is determined.
  • the data acquisition time point is equal to the current time minus the preset time length. For example, if the current time is 8:00 on October 12, 2012, the preset time is preset. The time is 48 hours, then the data acquisition time point is determined to be 8:00 on October 10, 2012. Large group corresponding cache time point after acquiring the data upload update data, and sends the web server. For example, if the user E included in the data query message requests the update last time at 8:00 on October 12, 2012, and the maximal group is numbered as the maximum group A, the maximal group cache server calculates the current time 2012. The time difference between 12:00 on October 12 and 8:00 on October 12, 2012 is 4 hours long. The 4 hours are less than the preset time of 48 hours, then the maximal cache server gets the pole.
  • the update data uploaded by the user in the group A and the user E as a friend after 8:00 on October 12, 2012 sends the obtained update data to the web server.
  • the maximal group cache server calculates the current time 2012 10
  • the time difference between 12:00 on the 12th of the month and 12:00 on October 5th, 2012 is 168 hours. Since the 168 hours is longer than the preset time of 48 hours, the time of the acquisition is determined to be October 10, 2012.
  • the maximal group cache server obtains the update data uploaded by the user in the group A and the user E as a friend after 12:00 on October 10, 2012, and sends the obtained update data to the web server.
  • At least two copies are further Select and save the latest update data of the version number in the new data, and discard the update data of other version numbers;
  • the web server when the user uploads data, the web server will assign a version number to the data uploaded for the current upload, and the cache corresponding to the maximal group of the uploaded data will update the version number of the user, so the data is updated.
  • the user E uploads the data to the maximal group cache server where the cache corresponding to the maximal group A is located, and the maximal group cache server saves the upload data of the user E to the cache corresponding to the maximal group A, and this time
  • the uploaded version number is set to the version number of the last time user E uploaded the data.
  • the web server after receiving the update data sent by the maximal group cache server, the web server also processes the received update data, because a certain friend of the user may belong to at least two poles to which the user belongs.
  • a friend may have at least two update data, and the web server selects and saves the latest update data of the version number from the at least two update data, and loses Discard the update data of other version numbers, for example: If the user F's friend F contains 3 update data, the version numbers are 1001, 1005, 1007, respectively, the web server selects and saves the update data with the version number 1007. Discard the update data with the version number 1001, 1005.
  • the version numbers are 1001, 1005, 1007, 1007, respectively, there are two version numbers with the latest update data.
  • the web server selects any update data with version number 1007, discards another data with version number 1007, and discards The version number of the update for the 1001 and 1005 data.
  • the web server saves the update data of the version number of the user.
  • the web server after the web server sends a data query message to the user cache server where the user cache corresponding to the friend in the non-extreme group of friends of the user is located, the web server receives the update data sent by the user cache server.
  • the data query message sent by the web server to the user cache server where the user cache corresponding to the friend in the non-extreme group of friends of the user is located includes the time when the user last requested the update and the ID of the queried friend, and the user cache server Determining the friend's user cache by using the friend's ID, and obtaining the update data in the user cache according to the time when the user last requested the update, which will be obtained more
  • the new data is sent to the web server, so that the web server will receive the update data sent by the user cache server, and implement data update to the friends in the non-extreme group of friends of the user.
  • steps 306 and 308 are not in sequential order.
  • the set is ⁇ 1, 2, 3, 4, 6, 10, 11, 12 ⁇ , then the non-extreme group of friends in the friend set of node 1 and not in the maximal group of node 1 belongs to ⁇ 6, 12 ⁇ , the web server will send data query messages to the maximal group cache server where the cache corresponding to the maximal group (1, 2, 3, 4) and (1, 10, 11) respectively, and respectively to the node 6 and the user cache server corresponding to the user cache corresponding to the node 12 sends a data query message to obtain update data.
  • the web server receives the data update request of the user, it determines the maximal group to which the user belongs and the non-extreme group of friends of the user, and the cache corresponding to the maximal group to which the user belongs is located.
  • the large group cache server sends a data query message, where the data query message includes the time when the user last requested the update and the number of the macro group requesting the query, so that the maximal group cache server according to the time when the user last requested the update and the request for the query.
  • the number of the maximal group obtains the update data and sends it to the web server, and when the non-extreme group of friends of the user is not an empty set, sends the message to the user cache server where the user of the friend in the non-extreme group of friends is cached.
  • the data query message obtains update data of the friend in the non-extreme group of friends of the user, and implements data update of the user.
  • the data update of the friends in the maximal group only needs to send a data query message once, and does not need to send multiple data query messages, which can be effective. Reduce the number of data query messages sent, avoid taking up a lot of resources, and save resources.
  • FIG. 4 Includes:
  • the web server receives the data currently uploaded by the user, determining that the user belongs to the maximal group, and the users in the maximal group are friends of each other;
  • the user can upload data when using the social network. For example, if the user posts a message using the microblog, the message is the data currently uploaded by the user. If the web server receives the data currently uploaded by the user, it will determine the set of the maximal group to which the user belongs and the user's good a set of friends, wherein the web server can determine the maximal group to which the user belongs by searching the correspondence between the user and the maximal group in the database, or the web server sends a huge group query message to the cache server, and the maximal group query message Including the ID of the user, the cache server can use the ID of the user to query the correspondence between the saved user and the maximal group to determine the maximal group to which the user belongs, and send the determined maximal group to which the user belongs to the web. server.
  • the web server after determining the maximal group to which the user belongs, sends the data currently uploaded by the user to the maximal group cache server where the cache corresponding to the maximal group to which the user belongs, so that the maximal group cache is generated.
  • the server saves the data currently uploaded by the user to the cache corresponding to the maximal group to which the user belongs. For example, if the maximal group to which the user E belongs is A and B, the cache of the maximal group A is cached on the maximal group cache server C. The cache of the maximal group B is cached on the maximal group cache server D. Therefore, the web server sends the data currently uploaded by the user E to the maximal group cache servers C and D, respectively, so that the maximal group cache server C uploads the user E currently. The data is saved in the cache corresponding to the maximal group A, and the maximal group cache server D saves the data currently uploaded by the user E to the cache corresponding to the maximal group B.
  • the data currently uploaded by the user includes the version number of the currently uploaded data
  • the maximal group cache server determines whether the version number is included according to the version number contained therein. Save the update. If the version number of the currently uploaded data is greater than the version number of the last data uploaded by the user, save the data currently uploaded by the user. If the version number of the data currently uploaded by the user is smaller than the version of the data that the user last uploaded. Number, the data currently uploaded by the user is discarded.
  • the web server may further perform the following steps:
  • the web server also sends the data currently uploaded by the user to the user cache server where the user caches, so that the user cache server saves the data currently uploaded by the user to the user cache corresponding to the user.
  • the data currently uploaded by the user is saved in the user cache of the user, so that the web server obtains the update from the maximal group cache server to which the user belongs. If the data fails, the web server may determine the user's friend set, send a data query message to the user cache server where the friend's user cache in the user's friend set is located, obtain update data from the user's user cache, and implement data update.
  • the web server may determine the maximal group to which the user belongs, and send the currently uploaded user to the maximal group cache server where the maximal group to which the user belongs.
  • the data enables the maximal group cache server to save the data currently uploaded by the user in the cache corresponding to the maximal group to which the user belongs. Since the users in the maximal group are friends with each other, the cache corresponding to the maximal group is located at the pole.
  • the large group cache server sends the data currently uploaded by the user, which can effectively save the resources occupied by the data uploaded by the user.
  • an embodiment of a structure of a web server includes: a determining unit 501, configured to: if receiving a data update request of a user, determine a maximum group to which the user belongs, a user in the maximal group Two and two are friends with each other;
  • the sending unit 502 is configured to send, after the determining unit 501 determines the maximal group to which the user belongs, a data query message to the maximal group cache server where the cache corresponding to the maximal group to which the user belongs is sent;
  • the receiving unit 503 is configured to receive, after the sending unit 502 sends the data query message, the update data sent by the maximal group cache server, to implement data update of the user.
  • the determining unit 501 determines the maximal group to which the user belongs, and then the sending unit 502 sends the maximal group corresponding to the cache corresponding to the maximal group to which the user belongs.
  • the cache server sends a data query message.
  • the receiving unit 503 receives the update data returned by the maximal group cache server to implement data update of the user.
  • the web server obtains the update data of the user by sending a data query message to the maximal group cache server to which the user belongs, because the users in the maximal group to which the user belongs are friends of the user,
  • the data update of the plurality of friends in the maximal group only needs to send a data query message to obtain update data of multiple friends in the maximal group, which effectively reduces the number of data query messages sent by the web server. To avoid user data update taking up too many resources and saving system resources.
  • FIG. 6 is an embodiment of another structure of the web server in the embodiment of the present invention, including:
  • a determining unit 501 a sending unit 502, a receiving unit 503 in the embodiment shown in FIG. 5, and Similar to the content described in the embodiment shown in FIG. 5, details are not described herein again.
  • the update data received by the receiving unit 503 includes the version number of the last time the user's friend uploaded the data
  • the web server also includes:
  • the optimization unit 601 is configured to: after the receiving unit 503 receives the update data, if the friend of the user in the update data includes at least two pieces of update data, select and save a version from the at least two pieces of update data. No. Update data, discard update data of other version numbers.
  • the web server further includes:
  • the obtaining unit 602 after the determining unit 501 determines the maximal group to which the user belongs, acquires the user's friend set;
  • the set determining unit 603 is configured to determine, after the obtaining unit 602 determines the buddy set of the user, the non-extreme group buddy set of the user according to the maximal group to which the user belongs and the buddy set of the user, where the non-extreme group buddy set is included in the user a collection of friends in the set of friends that are not in the collection of maximal groups to which the user belongs;
  • the message sending unit 604 is configured to: when the non-maximum group buddy set is not an empty set, send a data query message to the user cache server where the user cache corresponding to the buddy in the non-extreme group buddy set is located; the data receiving unit 605, in the message After the sending unit 604 sends the data query message, it receives the update data sent by the user cache server.
  • the determining unit 501 determines the maximal group to which the user belongs, and the sending unit 502 caches the maximal group in which the cache corresponding to the maximal group to which the user belongs is located.
  • the server sends a data query message. If the maximal group cache server feeds back the update data to the web server, the receiving unit 503 will receive the update data returned by the maximal group cache server.
  • the obtaining unit 602 will obtain the user's friend set; then, the set The determining unit 603 determines the non-extreme group of friends of the user according to the maximal group to which the user belongs and the set of friends of the user.
  • the message sending unit 604 sends the friend to the non-extreme group of friends.
  • the user cache server where the corresponding user cache is located sends a data query message; finally, the data receiving unit 605 receives the update data sent by the user cache server, so the web server can receive the large max cache server, or receive the huge The number of updates sent by the cluster cache server and the user cache server According to, it is used to implement user data update.
  • the optimization unit 601 selects from the at least two pieces of update data. Select and save the latest update data for the version number and discard the update data for the other version number.
  • the web server receives the data update request of the user, it determines the maximal group to which the user belongs and the non-extreme group of friends of the user, and the cache corresponding to the maximal group to which the user belongs is located.
  • the large group cache server sends a data query message, where the data query message includes the time when the user last requested the update and the number of the macro group requesting the query, so that the maximal group cache server according to the time when the user last requested the update and the request for the query.
  • the number of the maximal group obtains the update data and sends it to the web server, and when the non-extreme group of friends of the user is not an empty set, sends the message to the user cache server where the user of the friend in the non-extreme group of friends is cached.
  • the data query message obtains update data of the friend in the non-extreme group of friends of the user, and implements data update of the user.
  • the data update of the friends in the maximal group only needs to send a data query message once, and does not need to send multiple data query messages, which can be effective. Reduce the number of data query messages sent, avoid taking up a lot of resources, and save resources.
  • an embodiment of another structure of a web server includes: a maximal group determining unit 701, configured to determine a maximal group to which a user belongs if receiving data currently uploaded by a user, The users in the great group are friends with each other;
  • the first sending unit 702 is configured to: after the maximal group determining unit 701 determines the maximal group to which the user belongs, send the data currently uploaded by the user to the maximal group cache server where the cache corresponding to the maximal group to which the user belongs, so that the pole
  • the large group cache server saves the data currently uploaded by the user to the cache corresponding to the maximal group.
  • the web server may further include: a user cache server at the user, so that the user cache server saves the data currently uploaded by the user to the user cache of the user.
  • the maximal group determining unit 701 determines the maximal group to which the user belongs, and then, the first sending unit 702 caches the maximal group to which the user belongs.
  • the maximal group cache server is located to send the data currently uploaded by the user.
  • the second sending unit 703 can also send the data currently uploaded by the user to the user cache server where the user cache of the user is located, so that the user cache server uploads the current user. The data is saved to the user's user cache.
  • the web server may determine the maximal group to which the user belongs, and send the currently uploaded user to the maximal group cache server where the maximal group to which the user belongs.
  • the data enables the maximal group cache server to save the data currently uploaded by the user in the cache corresponding to the maximal group to which the user belongs. Since the users in the maximal group are friends with each other, the cache corresponding to the maximal group is located at the pole.
  • the large group cache server sends the data currently uploaded by the user, which can effectively save the resources occupied by the data uploaded by the user.
  • an embodiment of a structure of a web server includes: a processor 801, a memory 802, a receiving device 803, and a sending device 804;
  • the receiving device 803 is configured to receive a data update request of the user, and the processor 801 is configured to determine, after the receiving device 803 receives the data update request of the user, the maximal group to which the user belongs, and the user in the maximal group. Two and two are friends with each other;
  • the sending device 804 is configured to: after the processor 801 determines the maximal group to which the user belongs, send a data query message to the maximal group cache server where the cache corresponding to the maximal group is located; and receive the data query message by the receiving device 803.
  • the update data sent by the maximal group cache server is used to implement data update of the user.
  • the processor 801 is further configured to: after the receiving device 803 receives the update data, if the friend of the user in the update data includes at least two pieces of update data, select and save a version number from the at least two pieces of update data. The latest update data, discard the update data of other version numbers.
  • the processor 801 is further configured to: after determining the maximal group for the domain, obtain the friend set of the user; determine the non-extreme group friend of the user according to the maximal group to which the user belongs and the friend set of the user. a set, wherein the non-extreme group buddy set includes a set of buddies in the set of buddies of the user and not in the set of maximal corps to which the user belongs, and when the set of non-extreme buddies is not an empty set, the sending device 804 sends The user cache server where the user cache corresponding to the friend in the non-extreme group of friends gathers sends a data query message to obtain update data of the friends in the non-extreme group of friends.
  • the web server described above implements the method of updating the data.
  • the web server may also implement data uploading, where the receiving device 803 receives the current upload of the user.
  • the processor 801 will determine the maximal group to which the user belongs, wherein the users in the maximal group are friends with each other, and then the sending device 804 caches the maximal group corresponding to the cache corresponding to the maximal group to which the user belongs.
  • the server sends the data currently uploaded by the user, so that the maximal group cache server saves the data currently uploaded by the user to the cache corresponding to the maximal group.
  • the sending device 804 also sends the data currently uploaded by the user to the user cache server where the user cache of the user is located, so that the user cache server saves the data currently uploaded by the user into the user cache of the user.
  • the web server receives the data update request of the user, and determines the maximal group to which the user belongs and the non-extreme group of friends of the user, the cache corresponding to the maximal group to which the user belongs is located.
  • the large group cache server sends a data query message, so that the maximal group cache server feeds back the update data to the web server, and when the user's non-extreme group of friends is not an empty set, the friend in the non-extreme group of friends is
  • the user cache server where the user cache is located sends a data query message to obtain update data of the friend in the non-extreme group of friends of the user, and implements data update of the user.
  • the data update of the friends in the maximal group only needs to send a data query message once, and does not need to send multiple data query messages, which can be effective. Reduce the number of data query messages sent, avoid taking up a lot of resources, and save resources.
  • the web server may determine the maximal group to which the user belongs, and send the data currently uploaded by the user to the maximal group cache server where the maximal group to which the user belongs, so that the data is greatly
  • the group cache server can save the data currently uploaded by the user in the cache corresponding to the maximal group to which the user belongs, because the users in the maximal group are friends with each other, and therefore, send to the maximal group cache server where the cache corresponding to the maximal group is located.
  • the data currently uploaded by the user can effectively save the resources occupied by the data uploaded by the user.
  • the medium can be a read only memory, a magnetic disk or a compact disk or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例公开了一种数据更新方法及web服务器。本发明实施例方法包括:若web服务器接收到用户的数据更新请求,确定用户所属的极大团,极大团中的用户两两互为好友;web服务器向极大团对应的缓存所在的极大团缓存服务器发送数据查询消息;web服务器接收极大团缓存服务器发送的更新数据,用于实现请求数据更新的用户的数据更新,因对该用户所属的极大团中的N个好友,只需要发送一个数据查询消息或者进行一次数据传送,能够有效地减少web服务器在数据更新或者数据上传中占用的资源,有效地节约系统资源。

Description

一种数据更新方法及 web服务器 本申请要求于 2012 年 11 月 19 日提交中国专利局、 申请号为 201210467886.1、 发明名称为 "一种数据更新方法及 web服务器" 的中国专利 申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域
本发明涉及通信技术领域, 尤其涉及一种数据更新方法及 web服务器。
背景技术
近几年,社交网络得到了快速的发展, 并日益成为人们日常生活的一部分。 美国 InSites Consulting公司发布的 2011年全球社交媒体报告显示: 目前全球 有超过 10亿人在使用社交网络, 占网民人数的大约 70%。 并且超过 6亿用户 每天都在使用社交网络。 同时, 另一项资料显示, 全球最大的社交网 Facebook (脸语)在今年 6月的全球访问量为 7.342亿, 目前注册用户数超过 7.5亿, 覆盖了全球总人口的 10%。对于这种大型系统,如何进行部署和维护直接影响 了系统的性能、稳定性以及用户体验, 所以对社交网络内容分发机制的研究具 有很重要的意义。
在社交网络中, 用户会频繁获取好友用户的内容更新。 比如在人人网中, 用户会获取好友的 "新鲜事" , "新鲜事" 可以包括状态更新、 图片、 文档、 视频等。 用户获取好友内容更新的流程通常如下:
1 )用户登录社交网站的页面或客户端, 系统自动或用户手动(如点击 "更 新" 按钮等) 向 Web服务器发送更新请求;
2 ) Web 服务器得到请求后向该用户好友所在的数据库服务器发送查询 ( query ) 消息;
3 ) Web服务器获取由数据库服务器查询到的内容更新, 并反回给用户终 端, 使得用户可以在网站页面上浏览好友的内容更新。 由于用户的数据保存在数据库中, 随着数据量增大、访问集中, 就会出现 数据库负载加重、响应恶化的问题, 并由此带来内容显示延时等不佳的用户体 验。 因此, 在实际部署中, 通常使用緩存技术来解决用户数据库瓶颈。 緩存服 务器将数据库中的内容緩存在内存中, 在大多数情况下, web服务器只需要访 问緩存服务器即可获得查询结果, 只有当查询的内容未被緩存时, 才会去查询 数据库服务器。 又由于緩存服务器中的数据是保存在内存中, 可以提供比访问 保存在本地硬盘中的数据库快几个数量级的访问速度,所以采用緩存方案可以 减少数据库的访问次数, 提高查询的响应速度, 为用户带来更好的用户体验。
目前, 绝大多数的大规模社交网站都采用了緩存方案, facebook和 mixi ( 曰本最大的社交网站) 都采用 memcached 搭建其緩存服务器集群。 memcached是一个高性能的分布式内存对象緩存系统, 用于动态 Web应用以 减轻数据库负载。 它通过在内存中緩存数据和对象来减少读取数据库的次数, 从而提供动态、 数据库驱动网站的速度。
其中, 基于 memcached的 "pull-on-demand" 机制是在用户查询好友内容 更新时, 向 web服务器发送请求, web服务器先从该用户社会关系緩存获取该 用户的好友信息,再向该用户所有好友所在的緩存服务器发送查询消息,在用 户的好友的数据分步在 N各緩存服务器中时, web服务器就得发送 N条查询 消息, 当好友数据量很大且内容更新频繁时, 该 N值将很大, 导致查询的开 销很大, 占用大量系统资源; 其中, 基于 memcached "push-on-change" 机制是是一旦某个用户进行了 内容更新, 该用户将主动更新的内容推送到所有好友的内容緩存上, 然而, 若 该用户有 N个好友, 就要推送 N次, 当用户的好友数目众多时, 将占用大量 的系统资源, 给后端服务器带来很大的负载。
发明内容
本发明实施例提供了一种数据更新方法及 web服务器, web服务器在接收 到用户的数据更新请求或者用户当前的上传数据之后,通过向用户所属的极大 团对应的緩存所在的极大团緩存服务器发送数据查询消息或者用户当前的上 传数据, 以实现数据更新或者数据上传, 使得对该用户所属的极大团中的 N 个好友, 只需要发送一个数据查询消息或者进行一次数据传送, 能够有效地减 少 web服务器在数据更新或者数据上传中占用的资源, 有效地节约系统资源。
本发明一方面提供了一种数据更新方法, 包括:
若 web服务器接收到用户的数据更新请求, 确定所述用户所属的极大团, 所述极大团中的用户两两互为好友;
所述 web服务器向所述极大团对应的緩存所在的极大团緩存服务器发送 数据查询消息;
所述 web服务器接收所述极大团緩存服务器发送的更新数据, 用于实现 请求数据更新的所述用户的数据更新。
在第一种可能的实现方式中,更新数据中包含所述用户的好友最后一次上 传数据的版本号。
结合第一方面或第一方面第一种可能的实现方式,在第二种可能的实现方 式中, 所述接收所述极大团緩存服务器发送的更新数据之后还包括:
若所述更新数据中所述用户的好友包含至少两份更新数据,则从所述至少 两份更新数据中选择并保存一份版本号最新的更新数据,丟弃其他版本号的更 新数据。
结合第一方面或者第一方面第一种可能的实现方式或者第一方面第二可 能的实现方式, 在第三种可能的实现方式中, 所述数据更新方法还包括:
获取所述用户的好友集合;
根据所述用户所属的极大团及所述用户的好友集合确定所述用户的非极 大团好友集合,所述非极大团好友集合包含在所述用户的好友集合中且不在所 述用户所属的极大团中的好友集合;
若所述非极大团好友集合不是空集,则向所述非极大团好友集合中的好友 对应的用户緩存所在的用户緩存服务器发送数据查询消息;
接收所述用户緩存服务器发送的的更新数据。
结合第一方面第三种可能的实现方式中,所述数据查询消息中包含所述用 户上一次请求更新的时间 ,使得接收到所述数据查询消息的极大团緩存服务器 和 /或所述用户緩存服务器根据所述用户上一次请求更新的时间向 web服务器 发送更新数据。
本发明第二方面提供了一种数据上传方法, 包括:
若 web服务器接收到用户当前上传的数据, 确定所述用户所属的极大团, 所述极大团中的用户两两互为好友;
向所述用户所属的极大团对应的极大团緩存服务器发送所述用户当前上 传的数据,使得所述极大团緩存服务器将所述用户当前上传的数据保存至所述 极大团对应的緩存中。
在第二方面第一种可能的实现方式中, 所述数据上传方法还包括: 将所述用户当前上传的数据发送给所述用户的用户緩存所在的用户緩存 服务器,使得所述用户緩存服务器将所述用户当前上传的数据保存至所述用户 的用户緩存中。
结合第二方面或者第二方面的第一种可能的实现方式,第二种可能的实现 方式中, 所述用户当前上传的数据中包含版本号,使得接收到所述用户当前上 传的数据的极大团緩存服务器根据所述版本号确定是否保存所述用户当前上 传的数据。
本发明第三方面提供了一种 web服务器, 包括:
确定单元, 用于若接收到用户的数据更新请求,确定所述用户所属的极大 团, 所述极大团中的用户两两互为好友;
发送单元, 用于在所述确定单元确定所述用户所属的极大团之后, 向所述 极大团对应的緩存所在的极大团緩存服务器发送数据查询消息;
接收单元, 用于在发送单元发送所述数据查询消息之后,接收所述极大团 緩存服务器发送的更新数据, 用于实现所述用户的数据更新。
在第三方面第一种可能的实现方式中,更新数据中包含所述用户的好友最 后一次上传数据的版本号; 则所述 web服务器还包括:
优化单元, 用于在接收单元接收到更新数据之后, 若所述更新数据中所述 用户的好友包含至少两份更新数据,则从所述至少两份更新数据中选择并保存 一份版本号最新的更新数据, 丟弃其他版本号的更新数据。
结合第三方面或者第三方面第一种可能的实现方式,在第二种可能的实现 方式中, 所述 web服务器还包括:
获取单元, 用户在所述确定单元确定所述用户所属的极大团之后, 获取所 述用户的好友集合;
集合确定单元, 用于在所述获取单元确定获取所述用户的好友集合之后, 根据所述用户所属的极大团及所述用户的好友集合确定所述用户的非极大团 好友集合,所述非极大团好友集合包含在所述用户的好友集合中且不在所述用 户所属的极大团的集合中的好友的集合;
消息发送单元, 用于在所述非极大团好友集合不是空集时, 向所述非极大 团好友集合中的好友对应的用户緩存所在的用户緩存服务器发送数据查询消 息;
数据接收单元,在所述消息发送单元发送数据查询消息之后,接收所述用 户緩存服务器发送的的更新数据。
本发明第四方面提供了一种 web服务器, 包括:
极大团确定单元, 用于若接收到用户当前上传的数据, 确定所述用户所属 的极大团, 所述极大团中的用户两两互为好友;
第一发送单元, 用于在所述极大团确定单元确定所述极大团之后, 向所述 极大团对应的緩存所在的极大团緩存服务器发送所述用户当前上传的数据,使 得所述极大团緩存服务器将所述用户当前上传的数据保存至所述极大团对应 的緩存中。
在第四方面第一种可能的实现方式中, 所述 web服务器还包括: 存所在的用户緩存服务器,使得所述用户緩存服务器将所述用户当前上传的数 据保存至所述用户的用户緩存中。
从以上技术方案可以看出, 本发明实施例具有以下优点:
若 web服务器接收到用户发送的数据更新请求, 则确定该用户所属的极 大团,向用户所属的极大团对应的緩存所在的极大团緩存服务器发送数据查询 消息, 接收极大团緩存服务器发送的更新数据, 实现用户的数据更新, 或者, web服务器可将接收到的用户当前上传的数据发送给该用户所属的极大团对 应的緩存所在的緩存服务器, 以实现数据上传, 由于极大团中的用户均为该用 户的好友,使得向用户所属的极大团对应的极大团緩存服务器发送数据查询消 息或者用户当前上传的数据时,对一个极大团中的多个好友的更新数据的查询 只需要发送一个数据查询消息,且对一个极大团中的多个好友的数据上传只需 要进行一次数据上传, 能够有效地减少 web服务器在数据更新或者数据上传 中占用的资源, 有效地节约系统资源。
附图说明 图 1为本发明实施例中一种数据更新方法的一个示意图;
图 2为本发明实施例中极大团的示意图;
图 3为本发明实施例中一种数据更新方法的另一示意图;
图 4为本发明实施例中一种数据上传方法的一个示意图;
图 5为本发明实施例中 web服务器的结构的一个示意图;
图 6为本发明实施例中 web服务器的结构的另一示意图;
图 7为本发明实施例中 web服务器的结构的一个示意图;
图 8为本发明实施例中 web服务器的结构的一个示意图。
具体实施方式
本发明实施例提供了一种数据更新方法及 web服务器, 用于实现用户数 据的更新, 能够有效的减少 web服务器发送的数据查询消息的数目, 节约系 统资源。
请参阅图 1 , 为本发明实施例中一种数据更新方法的实施例, 包括: 101、 若 web服务器接收到用户的数据更新请求, 则确定用户所属的极大 团, 极大团中的用户两两互为好友;
在本发明实施例中, 用户在使用社交网络时, 可手动点击发出数据更新请 求, 或者用户在登陆社交网络后, 系统自动生成数据更新请求, 该数据更新请 求用于请求更新用户所有好友的内容, web服务器在接收到该数据更新请求之 后,则确定该用户所属的极大团的集合,其中,极大团中的用户两两互为好友。
在本发明实施例中, 后端服务器将周期性的计算社交网络中存在的极大 团, 并将计算得到的极大团发送给多个极大团緩存服务器,该多个极大团緩存 服务器将为极大团分配緩存, 其中,极大团緩存服务器为极大团分配緩存的大 小可根据具体情况确定, 此处不做限定, 例如: 若后台服务器计算得到 9个极 大团, 编号分别为 1至 9, 有 2个极大团緩存服务器分别为 A, B, 则可由极 大团緩存服务器 A为极大团 1至 4分配緩存, 由极大图緩存服务器 B为极大 团 5至 9分配緩存, 或者, 由极大团緩存服务器 A为极大团 1和 9分配緩存, 由极大团緩存服务器 B为极大团 2至 8分配緩存。
此外, 后端服务器还将建立极大团緩存服务器与极大团之间的对应关系, 及用户与其所属极大团之间的对应关系, 其中,极大团緩存服务器与极大团之 间的对应关系可保存在数据库中或者緩存服务器中,用户与其所属极大团之间 的对应关系也可保存在数据库中或者緩存服务器中, web服务器可从数据库中 或者通过緩存服务器确定用户所属的极大团,及用户所属的极大团的緩存所在 的极大团緩存服务器。
在本发明实施例中, 极大团的定义如下: 请参参阅 2, 为本发明实施例中 的极大团的示意图, 该图可以表示为0= , E), 其中, V={1 , 2, 3 , ,
14}是图中的节点的集合, E是图的边集, 图中的团是指一个两两之间连接的 节点的集合, 如果一个团不是其他任何一个团的真子集, 则该团称为极大团, 在图 2中, 节点 1 , 2, 3 , 4构成一个极大团, 节点 7, 8, 9构成一个极大团, 节点 1 , 10, 11构成一个极大团, 节点 8, 13 , 14构成一个极大团。
在本发明实施例中,后台服务器利用极大团的原理根据用户之间的好友关 系划分极大团, 并建立用户与其所属的极大团之间的对应关系,且将用户与其 所属的极大团之间的对应关系保存在緩存服务器中, 此外,后台服务器还可将 用户与其所属的极大团之间的对应关系保存在数据库中。
在本发明实施例中, web服务器接收到用户的数据更新请求之后, 可根据 该用户的身份标识(ID, Identity ) 查找数据库中已保存的用户与其所属的极 大团之间的对应关系确定该用户所属的极大团, 例如, 以图 2 为例, 若 web 服务器接收到用户发送的数据更新请求, 该用户为节点 8, 则可从数据库中的 用户与其所属的极大团之间的对应关系中确定节点 8 所属的极大团的集合包 含两个极大团, 即节点 7, 8, 9构成的极大团及节点 8, 13 , 14构成的极大团, 则用户所属的极大团的集合包括: { ( 7, 8, 9 ), ( 8, 13 , 14 ) }。
此外, web服务器还可向保存了用户与其所属的极大团之间的对应关系的 緩存服务器发送查询请求, 在该请求中携带用户的 ID, 使得緩存服务器接收 到 web服务器发送的查询请求之后, 在保存的用户与其所属的极大团之间的 对应关系中查找与该用户的 ID对应的极大团, 并将查找到的用户所属的极大 团的集合发送给 web服务器, 其中, 用户所属的极大团是指所有包含该用户 的极大团, 且极大团中包含构成极大团的所有用户的 ID。
在本发明实施例中,用户与其好友之间的对应关系保存在数据库中或者緩 存服务器中, web服务器可以根据用户的 ID从数据库中查找该用户的好友集 合, 也可以通过向緩存服务器发送查询请求获得该用户的好友集合。
102、 向极大团对应的緩存所在的极大团緩存服务器发送数据查询消息; 在本发明实施例中, web服务器在确定用户所属的极大图之后, 将向用户 所属的极大团对应的的緩存所在的极大团緩存服务器发送数据查询消息,且该 数据查询消息中至少包含请求查询的极大团的编号, 例如: 若用户所属的极大 团为极大团 A和极大团 B, 且极大团 A所在的极大团緩存服务器为 C, 极大 团 B所在的极大团緩存服务器为 D, 则 web服务器向极大团緩存服务器 C发 送包含极大团 A的编号的数据查询消息, 向极大团緩存服务器 D发送包含极 大团 B的编号的数据查询消息, 以获得极大团 A和极大团 B中的用户的更新 数据。
103、接收极大团緩存服务器发送的更新数据, 用于实现用户的数据更新。 在本发明实施例中,极大团緩存服务器在接收到数据查询消息之后,将根 据该数据查询消息中包含的极大团的编号查找对应的緩存,获得该极大团中的 更新数据, 并将更新数据发送给 web服务器, 因此, web服务器可接收到极大 团緩存服务器发送的更新数据, 用于实现用户的数据更新。
在本发明实施例中, web服务器通过向用户所属的极大团緩存服务器发送 数据查询消息, 可获得该用户的更新数据, 由于用户所属的极大团中的用户均 为该用户的好友, 因此,对该极大团中的多个好友的数据更新只需要发送一个 数据查询消息, 即可获得该极大团中的多个好友的更新数据, 有效的减少了 web服务器发送的数据查询消息的数量, 避免用户的数据更新占用过多的资 源, 节约系统资源。
为了更好的理解本发明实施例中的数据更新方法, 请参阅图 3 , 为本发明 实施例中数据更新方法的实施例, 包括:
301、 若 web服务器接收到用户的数据更新请求, 则确定用户所属的极大 团, 极大团中的用户两两互为好友, 分别执行步骤 302和步骤 303;
在本发明实施例中, 步骤 301描述的内容与图 1所示实施例中的步骤 101 描述的内容相似, 此处不再赘述。
302、 向用户所属的极大团对应的緩存所在的极大团緩存服务器发送数据 查询消息, 继续执行步骤 306; 本发明实施例中, 步骤 302描述的内容与图 1 所示实施例中的步骤 102 描述的内容相似, 此处不再赘述。
303、 获取用户的好友集合;
在本发明实施例中, web服务器在确定用户所属的极大团之后, 还将获取 用户的好友集合, 其中, web服务器可从保存了用户与其好友之间的对应关系 的緩存服务器或者数据库中获得用户的好友集合, 具体的, web服务器可向保 存了用户与其好友的对应关系的緩存服务器发送好友查询消息,该緩存服务器 利用接收到的好友查询消息中的用户 ID查询与其对应的好友集合, 并将查询 到的好友集合发送给 web服务器, 或者, web服务器可根据用户 ID查询数据 库, 获得与该用户对应的好友集合。
304、 根据用户所属的极大团及用户的好友集合确定用户的非极大团好友 集合,非极大团好友集合包含在用户的好友集合中且不在用户所属的极大团的 集合中的好友的集合;
本发明实施例中, web服务器获取用户所属的极大团及用户的好友集合之 后,可根据该用户所属的极大团及用户的好友集合确定用户的非极大团好友集 合, 其中, 非极大团好友集合中包含在用户的好友集合中且不在用户所属的极 大团中的好友的集合。 以图 2为例, 若发送数据查询消息的用户为节点 1 , 节 点 1所属的的极大团为 (1 , 2, 3 , 4 )和( 1 , 10, 11 ), 节点 1的好友集合为 {1 , 2, 3 , 4, 6, 10, 11 , 12} , 则在节点 1的好友集合中且不在节点 1的所 属的极大团中的好友的非极大团好友集合为 {6, 12}。
305、 若非极大团好友集合不是空集, 则向非极大团好友集合中的好友对 应的用户緩存所在的用户緩存服务器发送数据查询消息, 继续执行步骤 308; 在本发明实施例中, 若用户的非极大团好友集合不是空集, 则 web服务 器还将向该非极大团好友集合中的好友对应的用户緩存所在的用户緩存服务 器发送数据查询消息, 且该数据查询消息中至少包含请求查询的好友的 ID, 使得接收到该数据查询消息的用户緩存服务器可按照该好友的 ID查询对应的 用户緩存, 获取该好友的更新数据。
需要说明的是, 在本发明实施例中, 若用户的非极大团好友集合是空集, 则说明该用户的所有好友都在其所属的极大团之中,通过向该用户所属的极大 团发送数据查询消息即可获得该用户的所有好友的更新数据。
306、 接收极大团緩存服务器发送的更新数据;
在本发明实施例中,极大团緩存服务器将获取更新数据并将获取到的更新 数据发送给 web服务器, 因此, web服务器可接收到极大团緩存服务器发送的 更新数据。
需要说明的是,数据查询消息中还包含用户上一次请求更新的时间,使得 接收到该数据查询消息的极大团緩存服务器可根据该用户上一次请求更新的 时间获取请求查询的极大团对应的緩存中的更新数据,并将获取到的数据发送 给 web服务器, 具体的包括: 极大团緩存服务器计算用户上一次请求更新的 时间与当前时间之间的时间差, 若该时间差小于或等于预置的时间长, 则极大 团緩存服务器从数据查询消息中包含的极大团的编号对应的緩存中,将在用户 上一次请求更新的时间点之后上传的更新数据发送给 web服务器, 若该时间 差大于预置的时间长, 则确定数据获取时间点, 该数据获取时间点等于当前时 间减去预置的时间长, 例如, 若当前时间为 2012年 10月 12日 8:00, 预置的 时间长为 48小时, 则确定数据获取时间点为 2012年 10月 10日 8:00,获取极 大团对应的緩存中在该数据获取时间点之后上传的更新数据, 并发送给 web 服务器。例如:若数据查询消息中包含的用户 E上一次请求更新的时间为 2012 年 10月 12日 8:00,极大团的编号为极大团 A, 则极大团緩存服务器计算得到 当前时间 2012年 10月 12日 12:00与 2012年 10月 12日 8:00之间的时间差为 4个小时长, 该 4个小时小于预置的时间长 48个小时, 则极大团緩存服务器 获取极大团 A中的与用户 E为好友的用户在 2012年 10月 12日 8:00之后上传 的更新数据, 将获得的更新数据发送给 web服务器。 若数据查询消息中包含 的用户 E上一次请求更新的时间为 2012年 10月 5 日 12:00, 极大团的编号为 极大团 A, 则极大团緩存服务器计算得到当前时间 2012年 10月 12 日 12:00 与 2012年 10月 5 日 12:00之间的时间差为 168小时, 由于 168小时大于预置 的时间长 48个小时, 因此, 确定获取时间点为 2012年 10月 10日 12:00, 极 大团緩存服务器获取极大团 A中与用户 E为好友的用户在 2012年 10月 10日 12:00之后上传的更新数据, 将获得的更新数据发送给 web服务器。
307、 若更新数据中用户的好友包含至少两份更新数据, 则从至少两份更 新数据中选择并保存一份版本号最新的更新数据, 丟弃其他版本号的更新数 据;
在本发明实施例中, 用户在上传数据时, web服务器将为其此次上传数据 分配一个版本号,且得到该上传数据的极大团对应的緩存将更新该用户的版本 号, 因此更新数据中包含用户的好友最后一次上传数据的版本号。 例如, 用户 E上传数据到极大团 A对应的緩存所在的极大团緩存服务器中,极大团緩存服 务器将保存该用户 E的上传数据到极大团 A对应的緩存中, 并将此次上传的 版本号设置为用户 E最后一次上传数据的版本号。
在本发明实施例中, web服务器在接收到极大团緩存服务器发送的更新数 据之后,还将对接收到的更新数据进行处理, 因为用户的某个好友可能属于该 用户所属的至少两个极大团中, 则在 web服务器接收到的更新数据中, 某个 好友可能具有至少两份更新数据, web服务器则从该至少两份更新数据中选择 并保存一份版本号最新的更新数据, 丟弃其他版本号的更新数据, 例如: 若更 新数据中, 用户 E的好友 F包含 3份更新数据, 版本号分别为 1001 , 1005 , 1007, 则 web服务器选择并保存版本号为 1007 的更新数据, 丟弃版本号为 1001,1005的更新数据; 若更新数据中, 用户 E的好友 F包含 4份更新数据, 版本号分别为 1001 , 1005 , 1007, 1007, 则有两份版本号最新的更新数据, web服务器选择任意一份版本号为 1007 的更新数据, 丟弃另一份版本号为 1007的数据, 及丟弃版本号为 1001及 1005的更新数据。
需要说明的是,在本发明实施例中,若用户的好友只有一个版本号的更新 数据, 则 web服务器将保存该用户该版本号的更新数据。
308、 接收用户緩存服务器发送的的更新数据。
在本发明实施例中, web服务器向用户的非极大团好友集合中的好友对应 的用户緩存所在的用户緩存服务器发送数据查询消息之后, web服务器将接收 用户緩存服务器发送的更新数据。
其中, web服务器向用户的非极大团好友集合中的好友对应的用户緩存所 在的用户緩存服务器发送的数据查询消息中包含该用户上一次请求更新的时 间及查询的好友的 ID ,用户緩存服务器利用好友的 ID确定该好友的用户緩存, 并根据用户上一次请求更新的时间获取该用户緩存中的更新数据 ,将获得的更 新数据发送给 web服务器, 使得 web服务器将接收到用户緩存服务器发送的 更新数据, 实现对用户的非极大团好友集合中的好友的数据更新。
需要说明的是,在本发明实施例中,步骤 306与步骤 308并没有先后顺序。 例如: 以图 2为例, 若发送数据查询消息的用户为节点 1 , 节点 1所属的 的极大团为 (1 , 2, 3 , 4 )和(1 , 10, 11 ), 节点 1的好友集合为 {1 , 2, 3 , 4, 6, 10, 11 , 12} , 则在节点 1的好友集合中且不在节点 1的所属的极大团 中的好友的非极大团好友集合为 {6, 12} , 则 web服务器将分别向极大团 ( 1 , 2, 3 , 4 )和(1 , 10, 11 )对应的緩存所在的极大团緩存服务器发送数据查询 消息, 及分别向节点 6和节点 12对应的用户緩存所在的用户緩存服务器发送 数据查询消息, 以获得更新数据。
在本发明实施例中, 若 web服务器接收到用户的数据更新请求, 则确定 该用户所属的极大团及用户的非极大团好友集合,向用户所属的极大团对应的 緩存所在的极大团緩存服务器发送数据查询消息,该数据查询消息中包含用户 上一次请求更新的时间及请求查询的极大团的编号,使得极大团緩存服务器根 据用户上一次请求更新的时间及请求查询的极大团的编号获得更新数据,并发 送给 web服务器, 且在用户的非极大团好友集合不是空集时, 向该非极大团 好友集合中的好友的用户緩存所在的用户緩存服务器发送数据查询消息,以获 得用户的非极大团好友集合中的好友的更新数据, 实现用户的数据更新。 由于 用户所属的极大团中的用户均为该用户的好友, 因此,对该极大团中的好友的 数据更新只需要发送一次数据查询消息, 而不需要发送多个数据查询消息, 能 够有效的减少数据查询消息的发送数目, 避免占用大量的资源, 节约资源。
在图 1及图 3所示实施例中描述了 web服务器进行数据更新的方法, 在 实际应用中,用户还可上传数据,下面将详细介绍基于极大团的数据上传方法, 请参阅图 4, 包括:
401、 若 web服务器接收到用户当前上传的数据, 则确定用户所属的极大 团, 极大团中的用户两两互为好友;
在本发明实施例中, 用户在使用社交网络时可上传数据, 例如, 若用户使 用微博发布了一条消息, 则该条消息即为用户当前上传的数据。 若 web服务 器接收到用户当前上传的数据,则将确定用户所属的极大团的集合及用户的好 友集合, 其中, web服务器可通过查找数据库中用户与极大团之间的对应关系 确定用户所属的极大团, 或者 web服务器向緩存服务器发送极大团查询消息, 该极大团查询消息中包含用户的 ID,緩存服务器可利用该用户的 ID查询已保 存的用户与极大团之间的对应关系确定该用户所属的极大团,并将确定的该用 户所属的极大团发送给 web服务器。
402、 向用户的极大团对应的緩存所在的极大团緩存服务器发送用户当前 上传的数据, 使得极大团对应的緩存中保存用户当前上传的数据。
在本发明实施例中, web服务器在确定用户所属的极大团之后, 将向该用 户所属的极大团对应的緩存所在的极大团緩存服务器发送用户当前上传的数 据,使得极大团緩存服务器将用户当前上传的数据保存至用户所属的极大团对 应的緩存中, 例如, 若用户 E所属的极大团为 A和 B, 极大团 A的緩存在极 大团緩存服务器 C上,极大团 B的緩存在极大团緩存服务器 D上, 因此, web 服务器将用户 E当前上传的数据分别发送给极大团緩存服务器 C和 D, 使得 极大团緩存服务器 C将用户 E当前上传的数据保存至极大团 A对应的緩存中, 极大团緩存服务器 D将用户 E当前上传的数据保存至极大团 B对应的緩存中。
需要说明的是,在本发明实施例中,用户当前上传的数据中包含当前上传 数据的版本号,极大团緩存服务器接收到该用户当前上传的数据之后,将根据 其中包含的版本号确定是否保存此次更新,若当前上传的数据的版本号大于该 用户上次上传数据的版本号, 则保存该用户当前上传的数据, 若用户当前上传 的数据的版本号小于用户上次上传数据的版本号,则丟弃该用户当前上传的数 据。
优选的, 在本发明实施例中, web服务器还可执行以下步骤:
403、 将用户当前上传的数据发送给用户的用户緩存所在的用户緩存服务 器, 使得用户緩存服务器将用户当前上传的数据保存至用户的用户緩存中。
在本发明实施例中, web服务器还将用户当前上传的数据发送给用户的緩 存所在的用户緩存服务器,使得用户緩存服务器将用户当前上传的数据保存至 该用户对应的用户緩存中。
需要说明的是,在本发明实施例中,通过在用户的用户緩存中保存用户当 前上传的数据, 使得若 web服务器从用户所属的极大团緩存服务器获取更新 数据失败, 则 web服务器可确定用户的好友集合, 分别向用户的好友集合中 的好友的用户緩存所在的用户緩存服务器发送数据查询消息,从用户的用户緩 存中获取更新数据, 实现数据更新。
在本发明实施例中, web服务器接收到用户当前上传的数据之后, 可确定 该用户所属的极大团,并向该用户所属的极大团所在的极大团緩存服务器发送 该用户当前上传的数据,使得极大团緩存服务器可在用户所属的极大团对应的 緩存中保存用户当前上传的数据, 由于极大团中的用户互为好友, 因此, 向极 大团对应的緩存所在的极大团緩存服务器发送用户当前上传的数据,能够有效 的节约用户当前上传的数据推送的占用的资源。
请参阅图 5 , 为本发明实施例中 web服务器的结构的实施例, 包括: 确定单元 501 , 用于若接收到用户的数据更新请求, 确定用户所属的极大 团, 极大团中的用户两两互为好友;
发送单元 502, 用于在确定单元 501确定用户所属的极大团之后, 向用户 所属的极大团对应的緩存所在的极大团緩存服务器发送数据查询消息;
接收单元 503 , 用于在发送单元 502发送数据查询消息之后, 接收极大团 緩存服务器发送的更新数据, 用于实现用户的数据更新。
在本发明实施例中, web服务器若接收到用户的数据更新请求, 则确定单 元 501将确定用户所属的极大团,接着发送单元 502向用户所属的极大团对应 的緩存所在的极大团緩存服务器发送数据查询消息, 最后, 由接收单元 503 接收极大团緩存服务器返回的更新数据, 实现用户的数据更新。
在本发明实施例中, web服务器通过向用户所属的极大团緩存服务器发送 数据查询消息, 可获得该用户的更新数据, 由于用户所属的极大团中的用户均 为该用户的好友, 因此,对该极大团中的多个好友的数据更新只需要发送一个 数据查询消息即可获得该极大团中的多个好友的更新数据,有效的减少了 web 服务器发送的数据查询消息的数量,避免用户的数据更新占用过多的资源, 节 约系统资源。
为了更好的理解本发明实施例中的 web服务器, 请参阅图 6, 为本发明实 施例中 web服务器的另一结构的实施例, 包括:
如图 5所示实施例中的确定单元 501 , 发送单元 502, 接收单元 503 , 且 与图 5所示实施例中描述的内容相似, 此处不再赘述。
在本发明实施例中 ,接收单元 503接收的更新数据中包含用户的好友最后 一次上传数据的版本号;
则该 web服务器还包括:
优化单元 601 , 用于在接收单元 503接收到更新数据之后, 若所述更新数 据中所述用户的好友包含至少两份更新数据,则从所述至少两份更新数据中选 择并保存一份版本号最新的更新数据, 丟弃其他版本号的更新数据。
在本发明实施例中, web服务器还包括:
获取单元 602, 用户在确定单元 501确定用户所属的极大团之后, 获取用 户的好友集合;
集合确定单元 603 , 用于在获取单元 602确定获取用户的好友集合之后, 根据用户所属的极大团及用户的好友集合确定用户的非极大团好友集合,非极 大团好友集合包含在用户的好友集合中且不在用户所属的极大团的集合中的 好友的集合;
消息发送单元 604, 用于在非极大团好友集合不是空集时, 向非极大团好 友集合中的好友对应的用户緩存所在的用户緩存服务器发送数据查询消息; 数据接收单元 605 , 在消息发送单元 604发送数据查询消息之后, 接收用 户緩存服务器发送的的更新数据。
在本发明实施例中, web服务器若接收到用户的数据更新请求, 则确定单 元 501将确定用户所属的极大团,发送单元 502向用户所属的极大团对应的緩 存所在的极大团緩存服务器发送数据查询消息, 若极大团緩存服务器向 web 服务器反馈更新数据,则接收单元 503将接收极大团緩存服务器返回的更新数 据, 此外, 获取单元 602 将获取用户的好友集合; 接着, 集合确定单元 603 根据用户所属的极大团及用户的好友集合确定用户的非极大团好友集合,若非 极大团好友集合不是空集,则消息发送单元 604向非极大团好友集合中的好友 对应的用户緩存所在的用户緩存服务器发送数据查询消息; 最后,数据接收单 元 605 , 接收用户緩存服务器发送的的更新数据, 因此, web服务器可接收大 极大团緩存服务器,或者,接收到极大团緩存服务器和用户緩存服务器发送的 更新数据, 用于实现用户的数据更新。 在本发明实施例中, web服务器在接收单元 503接收到更新数据之后, 若 所述更新数据中所述用户的好友包含至少两份更新数据,则优化单元 601从所 述至少两份更新数据中选择并保存一份版本号最新的更新数据,丟弃其他版本 号的更新数据。
在本发明实施例中, 若 web服务器接收到用户的数据更新请求, 则确定 该用户所属的极大团及用户的非极大团好友集合,向用户所属的极大团对应的 緩存所在的极大团緩存服务器发送数据查询消息,该数据查询消息中包含用户 上一次请求更新的时间及请求查询的极大团的编号,使得极大团緩存服务器根 据用户上一次请求更新的时间及请求查询的极大团的编号获得更新数据,并发 送给 web服务器, 且在用户的非极大团好友集合不是空集时, 向该非极大团 好友集合中的好友的用户緩存所在的用户緩存服务器发送数据查询消息,以获 得用户的非极大团好友集合中的好友的更新数据, 实现用户的数据更新。 由于 用户所属的极大团中的用户均为该用户的好友, 因此,对该极大团中的好友的 数据更新只需要发送一次数据查询消息, 而不需要发送多个数据查询消息, 能 够有效的减少数据查询消息的发送数目, 避免占用大量的资源, 节约资源。
请参阅图 7, 为本发明实施例中 web服务器的另一结构的实施例, 包括: 极大团确定单元 701 , 用于若接收到用户当前上传的数据, 则确定用户所 属的极大团, 极大团中的用户两两互为好友;
第一发送单元 702, 用于在极大团确定单元 701确定用户所属的极大团之 后,向用户所属的极大团对应的緩存所在的极大团緩存服务器发送用户当前上 传的数据,使得极大团緩存服务器将用户当前上传的数据保存至极大团对应的 緩存中。
优选的, 在本发明实施例中, web服务器还可包含: 在的用户緩存服务器,使得用户緩存服务器将用户当前上传的数据保存至用户 的用户緩存中。
在本发明实施例中, 若 web服务器接收到用户当前上传的数据, 则极大 团确定单元 701确定用户所属的极大团,接着, 第一发送单元 702向用户所属 的极大团对应的緩存所在的极大团緩存服务器发送用户当前上传的数据。需要 说明的是, web服务器在接收到用户当前上传的数据之后, 还可由第二发送单 元 703将用户当前上传的数据发送给用户的用户緩存所在的用户緩存服务器, 使得用户緩存服务器将用户当前上传的数据保存至用户的用户緩存中。
在本发明实施例中, web服务器接收到用户当前上传的数据之后, 可确定 该用户所属的极大团,并向该用户所属的极大团所在的极大团緩存服务器发送 该用户当前上传的数据,使得极大团緩存服务器可在用户所属的极大团对应的 緩存中保存用户当前上传的数据, 由于极大团中的用户互为好友, 因此, 向极 大团对应的緩存所在的极大团緩存服务器发送用户当前上传的数据,能够有效 的节约用户当前上传的数据推送的占用的资源。
请参阅图 8, 为本发明实施例中 web服务器的结构的实施例, 包括: 处理器 801 , 存储器 802, 接收装置 803 , 发送装置 804;
其中,接收装置 803用于接收用户的数据更新请求, 处理器 801则用于在 接收装置 803接收用户的数据更新请求之后,确定所述用户所属的极大团, 所 述极大团中的用户两两互为好友;
其中,发送装置 804则用于在所述处理器 801确定用户所属的极大团之后, 向所述极大团对应的緩存所在的极大团緩存服务器发送数据查询消息;且可由 接收装置 803接收所述极大团緩存服务器发送的更新数据,用于实现所述用户 的数据更新。
此外, 处理器 801还用于在接收装置 803接收到更新数据之后, 若更新数 据中所述用户的好友包含至少两份更新数据,则从该至少两份更新数据中选择 并保存一份版本号最新的更新数据, 丟弃其他版本号的更新数据。
在本发明实施例中, 处理器 801还用于在确定用于所属的极大团之后, 获 取用户的好友集合;根据用户所属的极大团及用户的好友集合确定用户的非极 大团好友集合, 其中, 非极大团好友集合包含在用户的好友集合中且不在用户 所属的极大团的集合中的好友的集合,在非极大团好友的集合不是空集时,发 送装置 804 向非极大团好友集合中的好友对应的用户緩存所在的用户緩存服 务器发送数据查询消息, 以获得非极大团好友集合中的好友的更新数据。
以上描述的 web服务器实现数据更新的方式, 此外, 在本发明实施例中, web服务器还可实现数据上传, 其中,接收装置 803在接收到用户当前上传的 数据之后, 处理器 801将确定用户所属的极大团, 其中, 极大团中的用户两两 互为好友,接着,发送装置 804向用户所属的极大团对应的緩存所在的极大团 緩存服务器发送用户当前上传的数据,使得极大团緩存服务器将用户当前上传 的数据保存至极大团对应的緩存中。此外,发送装置 804还将用户当前上传的 数据发送给用户的用户緩存所在的用户緩存服务器,使得用户緩存服务器将用 户当前上传的数据保存至该用户的用户緩存中。
本发明实施例中, 若 web服务器接收到用户的数据更新请求, 则确定该 用户所属的极大团及用户的非极大团好友集合,则向用户所属的极大团对应的 緩存所在的极大团緩存服务器发送数据查询消息,使得极大团緩存服务器将更 新数据反馈给 web服务器, 且在用户的非极大团好友集合不是空集时, 向该 非极大团好友集合中的好友的用户緩存所在的用户緩存服务器发送数据查询 消息, 以获得用户的非极大团好友集合中的好友的更新数据, 实现用户的数据 更新。 由于用户所属的极大团中的用户均为该用户的好友, 因此, 对该极大团 中的好友的数据更新只需要发送一次数据查询消息,而不需要发送多个数据查 询消息, 能够有效的减少数据查询消息的发送数目, 避免占用大量的资源, 节 约资源。
此外, web服务器接收到用户当前上传的数据之后, 可确定该用户所属的 极大团,并向该用户所属的极大团所在的极大团緩存服务器发送该用户当前上 传的数据,使得极大团緩存服务器可在用户所属的极大团对应的緩存中保存用 户当前上传的数据, 由于极大团中的用户互为好友, 因此, 向极大团对应的緩 存所在的极大团緩存服务器发送用户当前上传的数据,能够有效的节约用户当 前上传的数据推送的占用的资源。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可 读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。
以上对本发明所提供的一种数据更新方法及 web服务器进行了详细介绍, 对于本领域的一般技术人员,依据本发明实施例的思想,在具体实施方式及应 用范围上均会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限 制。

Claims

权 利 要 求
1、 一种数据更新方法, 其特征在于, 包括:
若 web服务器接收到用户的数据更新请求, 确定所述用户所属的极大团, 所述极大团中的用户两两互为好友;
所述 web服务器向所述极大团对应的緩存所在的极大团緩存服务器发送 数据查询消息;
所述 web服务器接收所述极大团緩存服务器发送的更新数据, 用于实现 请求数据更新的所述用户的数据更新。
2、 根据权利要求 1所述的数据更新方法, 其特征在于, 所述更新数据中 包含所述用户的好友最后一次上传数据的版本号;
则所述接收所述极大团緩存服务器发送的更新数据之后还包括:
若所述更新数据中所述用户的好友包含至少两份更新数据,则从所述至少 两份更新数据中选择并保存一份版本号最新的更新数据,丟弃其他版本号的更 新数据。
3、 根据权利要求 1或 2所述的数据更新方法, 其特征在于, 所述数据更 新方法还包括:
获取所述用户的好友集合;
根据所述用户所属的极大团及所述用户的好友集合确定所述用户的非极 大团好友集合,所述非极大团好友集合包含在所述用户的好友集合中且不在所 述用户所属的极大团中的好友集合;
若所述非极大团好友集合不是空集,则向所述非极大团好友集合中的好友 对应的用户緩存所在的用户緩存服务器发送数据查询消息;
接收所述用户緩存服务器发送的的更新数据。
4、 根据权利要求 3所述的数据更新方法, 其特征在于, 所述数据查询消 息中包含所述用户上一次请求更新的时间,使得接收到所述数据查询消息的极 大团緩存服务器和 /或所述用户緩存服务器根据所述用户上一次请求更新的时 间向 web服务器发送更新数据。
5、 一种数据上传方法, 其特征在于, 包括:
若 web服务器接收到用户当前上传的数据, 确定所述用户所属的极大团, 所述极大团中的用户两两互为好友;
向所述用户所属的极大团对应的极大团緩存服务器发送所述用户当前上 传的数据,使得所述极大团緩存服务器将所述用户当前上传的数据保存至所述 极大团对应的緩存中。
6、 根据权利要求 5所述的数据上传方法, 其特征在于, 所述方法还包括: 将所述用户当前上传的数据发送给所述用户的用户緩存所在的用户緩存 服务器,使得所述用户緩存服务器将所述用户当前上传的数据保存至所述用户 的用户緩存中。
7、 根据权利要求 5或 6所述的数据上传方法, 其特征在于, 所述用户当 前上传的数据中包含版本号,使得接收到所述用户当前上传的数据的极大团緩
8、 一种 web服务器, 其特征在于, 包括:
确定单元, 用于若接收到用户的数据更新请求,确定所述用户所属的极大 团, 所述极大团中的用户两两互为好友;
发送单元, 用于在所述确定单元确定所述用户所属的极大团之后, 向所述 极大团对应的緩存所在的极大团緩存服务器发送数据查询消息;
接收单元, 用于在发送单元发送所述数据查询消息之后,接收所述极大团 緩存服务器发送的更新数据, 用于实现所述用户的数据更新。
9、 根据权利要去 8所述的 web服务器, 其特征在于, 所述更新数据中包 含所述用户的好友最后一次上传数据的版本号;
则所述 web服务器还包括:
优化单元, 用于在接收单元接收到更新数据之后, 若所述更新数据中所述 用户的好友包含至少两份更新数据,则从所述至少两份更新数据中选择并保存 一份版本号最新的更新数据, 丟弃其他版本号的更新数据。
10、 根据权利要求 8或 9所述的 web服务器, 其特征在于, 所述 web服 务器还包括:
获取单元, 用户在所述确定单元确定所述用户所属的极大团之后, 获取所 述用户的好友集合;
集合确定单元, 用于在所述获取单元确定获取所述用户的好友集合之后 , 根据所述用户所属的极大团及所述用户的好友集合确定所述用户的非极大团 好友集合,所述非极大团好友集合包含在所述用户的好友集合中且不在所述用 户所属的极大团的集合中的好友的集合;
消息发送单元, 用于在所述非极大团好友集合不是空集时, 向所述非极大 团好友集合中的好友对应的用户緩存所在的用户緩存服务器发送数据查询消 息;
数据接收单元,在所述消息发送单元发送数据查询消息之后,接收所述用 户緩存服务器发送的的更新数据。
11、 一种 web服务器, 其特征在于, 包括:
极大团确定单元, 用于若接收到用户当前上传的数据, 确定所述用户所属 的极大团, 所述极大团中的用户两两互为好友;
第一发送单元, 用于在所述极大团确定单元确定所述极大团之后, 向所述 极大团对应的緩存所在的极大团緩存服务器发送所述用户当前上传的数据,使 得所述极大团緩存服务器将所述用户当前上传的数据保存至所述极大团对应 的緩存中。
12、 根据权利要求 11所述的 web服务器, 其特征在于, 所述 web服务器 还包括: 存所在的用户緩存服务器,使得所述用户緩存服务器将所述用户当前上传的数 据保存至所述用户的用户緩存中。
PCT/CN2013/074580 2012-11-19 2013-04-24 一种数据更新方法及web服务器 WO2014075426A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210467886.1 2012-11-19
CN201210467886.1A CN103825922B (zh) 2012-11-19 2012-11-19 一种数据更新方法及web服务器

Publications (1)

Publication Number Publication Date
WO2014075426A1 true WO2014075426A1 (zh) 2014-05-22

Family

ID=50730550

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/074580 WO2014075426A1 (zh) 2012-11-19 2013-04-24 一种数据更新方法及web服务器

Country Status (2)

Country Link
CN (1) CN103825922B (zh)
WO (1) WO2014075426A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918406A (zh) * 2019-01-27 2019-06-21 浙江工业大学 一种基于最大团算法的自动等质组卷方法及组卷系统

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105897832A (zh) * 2015-12-01 2016-08-24 乐视网信息技术(北京)股份有限公司 用于提供服务数据的服务器、方法及系统
CN105472008B (zh) * 2015-12-18 2019-03-15 福建天晴数码有限公司 web服务器缓存管理方法及系统
CN114327738B (zh) * 2022-03-14 2022-06-14 恒生电子股份有限公司 用户界面的刷新方法、装置、电子设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090371A (zh) * 2006-06-14 2007-12-19 阿里巴巴公司 一种即时通讯系统中用户信息管理的方法及系统
US7437364B1 (en) * 2004-06-30 2008-10-14 Google Inc. System and method of accessing a document efficiently through multi-tier web caching
CN101438565A (zh) * 2004-01-16 2009-05-20 摩托罗拉公司 用于促进无线的基于呈现服务的方法和装置
CN102713909A (zh) * 2010-01-24 2012-10-03 微软公司 用于移动搜索的基于社区的动态高速缓存

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101388895A (zh) * 2008-11-04 2009-03-18 中国网络通信集团公司 企业号簿更新方法及系统、企业号簿更新服务器和客户端
CN101414984B (zh) * 2008-12-03 2010-12-08 腾讯科技(深圳)有限公司 一种在群组中展现群蜜语的方法、系统及服务器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101438565A (zh) * 2004-01-16 2009-05-20 摩托罗拉公司 用于促进无线的基于呈现服务的方法和装置
US7437364B1 (en) * 2004-06-30 2008-10-14 Google Inc. System and method of accessing a document efficiently through multi-tier web caching
CN101090371A (zh) * 2006-06-14 2007-12-19 阿里巴巴公司 一种即时通讯系统中用户信息管理的方法及系统
CN102713909A (zh) * 2010-01-24 2012-10-03 微软公司 用于移动搜索的基于社区的动态高速缓存

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109918406A (zh) * 2019-01-27 2019-06-21 浙江工业大学 一种基于最大团算法的自动等质组卷方法及组卷系统
CN109918406B (zh) * 2019-01-27 2021-07-23 浙江工业大学 一种基于最大团算法的自动等质组卷方法及组卷系统

Also Published As

Publication number Publication date
CN103825922B (zh) 2018-02-06
CN103825922A (zh) 2014-05-28

Similar Documents

Publication Publication Date Title
KR101753766B1 (ko) 그래프 데이터용 분산형 캐시
US10270726B2 (en) Selective distribution of messages in a scalable, real-time messaging system
Shen et al. SocialTube: P2P-assisted video sharing in online social networks
US20140280606A1 (en) Method and Apparatus for Content Management
EP2993853B1 (en) Method for routing and forwarding, and network controller
CN101841553B (zh) 网络上请求资源的位置信息的方法、用户节点和服务器
US10193805B2 (en) User oriented IoT data discovery and retrieval in ICN networks
CN105357246B (zh) 基于信息中心网络的缓存方法和系统
WO2010118638A1 (zh) 一种基于地理位置信息编码的cdn网络系统及数据分发方法
WO2011150830A1 (zh) 获取内容的方法、节点及内容网络
Ma et al. An improved web cache replacement algorithm based on weighting and cost
JP5847185B2 (ja) コンテンツ中心のネットワーク環境でグループ変更に関する情報を用いるコンテンツ共有方法及び装置
WO2010127618A1 (zh) 一种实现流媒体内容服务的系统和方法
CN103260050A (zh) 基于Google App Engine云平台的视频点播系统
WO2013120386A1 (zh) 一种云端订阅下载的方法、系统和计算机存储介质
WO2013010432A1 (zh) 一种对等网络中数据存储和查询的方法、节点及系统
WO2014075426A1 (zh) 一种数据更新方法及web服务器
WO2019005446A1 (en) PROVIDING MULTIMEDIA CONTENT TO SUBSCRIBERS OF A MESSAGING SYSTEM
Li et al. SCOM: A scalable content centric network architecture with mobility support
WO2013120412A1 (zh) 数据下载方法、终端、服务器和系统
CN108419097A (zh) 一种移动自组网下基于聚类树的视频共享方法
TW201117581A (en) Method for transmitting buffer map and network thereof
Lee et al. InfoMax: An information maximizing transport layer protocol for named data networks
Chang et al. Social VoD: A social feature-based P2P system
Adhatarao et al. ORICE: An architecture for object resolution services in information-centric environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13854561

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13854561

Country of ref document: EP

Kind code of ref document: A1