WO2012028033A1 - 消息更新的方法和装置 - Google Patents

消息更新的方法和装置 Download PDF

Info

Publication number
WO2012028033A1
WO2012028033A1 PCT/CN2011/076820 CN2011076820W WO2012028033A1 WO 2012028033 A1 WO2012028033 A1 WO 2012028033A1 CN 2011076820 W CN2011076820 W CN 2011076820W WO 2012028033 A1 WO2012028033 A1 WO 2012028033A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
index
message index
update
user
Prior art date
Application number
PCT/CN2011/076820
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 腾讯科技(深圳)有限公司
Priority to US13/819,703 priority Critical patent/US20130232208A1/en
Publication of WO2012028033A1 publication Critical patent/WO2012028033A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/21Monitoring or handling of messages
    • H04L51/216Handling conversation history, e.g. grouping of messages in sessions or threads
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/52User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail for supporting social networking services

Definitions

  • the present invention relates to the field of microblog technology, and in particular, to a method and apparatus for message update. Background technique
  • Message notifications are very frequent in the Weibo system.
  • the method of message update in the Weibo system is: Update and display all new messages at one time.
  • the Weibo server will provide all the published messages in the Weibo system from the Weibo client last update to the microblog as a new message.
  • Bo client to complete the news update and display of the Weibo client.
  • the Weibo server Since the messages in the Weibo system are usually in large quantities, the Weibo server needs to be sent many times to complete the message notification. Therefore, the pressure on the server is increased, and the Weibo client needs to occupy a large amount of storage to update and store new messages. Space, causing waste of resources on the client side, at the same time, displaying a large amount of messages to the user at one time, and also bringing a certain degree of harassment to the user. Summary of the invention
  • an embodiment of the present invention provides a method and apparatus for message update.
  • the technical solution is as follows:
  • a method for updating a message comprising:
  • the message index is obtained from the microblog server
  • is a natural number.
  • a device for updating a message includes: An obtaining module, configured to: when the user requests the update message, obtain a message index from the microblog server; the first display module is configured to determine, according to the preset number ⁇ , the first message index in the obtained message index as the first display a message index of the message, obtaining a corresponding message from the microblog server according to the message index of the first display message, and displaying the message to the user;
  • the ⁇ is a natural number.
  • the technical solution provided by the embodiment of the present invention obtains the message index from the microblog server, determines the message index of the first display message according to the specified number, and obtains the corresponding message from the microblog server to display to the user, the microblog server does not need to be All messages are sent to the local, reducing the pressure on the Weibo server. Moreover, the local does not update and store all the messages to the local one-time, avoiding the waste of resources of the client. In addition, displaying the message to the user in a specified number of times also reduces the harassment of the user and improves the user experience.
  • FIG. 1 is a flowchart of a method for updating a message according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a method for updating a message according to Embodiment 2 of the present invention
  • FIG. 3 is a schematic diagram of a combination of a received message index and a locally saved message index provided by Embodiment 2 of the present invention
  • FIG. 4 is a schematic diagram of indexing of storage blocks and blocks according to Embodiment 2 of the present invention.
  • FIG. 5 is a structural diagram of an apparatus for updating a message according to Embodiment 3 of the present invention. detailed description
  • this embodiment provides a method for updating a message, including:
  • the message index is obtained from the microblog server.
  • is a natural number.
  • the method may further include:
  • the remaining message index of the obtained message index except the message index of the first displayed message is used as the message index of the subsequent displayed message, and is obtained from the microblog server according to the message index of the subsequent displayed message. Take the corresponding message and display it to the user.
  • the message is obtained from the microblog server according to the message index of the subsequent display message, and is displayed to the user, and specifically includes:
  • the ⁇ message index is obtained from the message index of the subsequent display message as the current message index. If there are less than K, less than K message indexes are used as the current message index.
  • the second message index gets the corresponding message from the microblog server and displays it to the user.
  • the above method provided in this embodiment is performed on the microblog client, and the user requests the update message from the microblog server by using the microblog client, and the microblog server updates the new message to the microblog client through the index.
  • the pre-specified number refers to the number of new messages displayed by the microblog client by default, which is usually preset by the microblog client.
  • the specific value is not specifically limited in this embodiment of the present invention, for example, For 20 or 30 and so on.
  • the index of messages obtained from the Weibo server is usually multiple, such as 100, 200, and so on. Among them, it is divided into two parts, one part is the message index of the first display message, and the other part is the message index of the subsequent display message.
  • the microblog client can display 30 messages at a time, obtain 200 message indexes from the microblog server, and use the first 30 of them as the message index of the first display message, and the rest as the message index of the subsequent display message, if the user If the request continues to be updated, the subsequent messages continue to be displayed.
  • the foregoing method provided in this embodiment obtains a message index from a microblog server, determines a message index of the first display message according to a specified number, and obtains a corresponding message from the microblog server to display to the user, and the microblog server does not need to have all of the information at one time.
  • the message was sent to the local, reducing the pressure on the Weibo server.
  • the local does not update and store all the messages to the local one-time, avoiding the waste of resources of the client.
  • displaying the message to the user in a specified number of times also reduces the harassment of the user and improves the user experience.
  • this embodiment provides a method for updating a message, including:
  • the local microblog client forwards the request to the microblog server, and receives the message index returned by the microblog server.
  • the index of the message received by the microblog client is an index of all new messages stored by the microblog server since the microblog client last updated.
  • the Weibo client last updated the Weibo message at 9:00, and the current time 10:00 requests the update again, then the Weibo server sends the message index of all new messages between 9:00 and 10:00.
  • the publisher of all the new messages may be a microblog client, but is usually a plurality of microblog clients, which are not specifically limited in this embodiment of the present invention.
  • the messages involved in this embodiment all refer to messages published in the microblog system, and the message index refers to an index number that identifies the message, such as an ID number and the like.
  • the local microblog client determines whether the received message index overlaps with the locally saved message index; if there is overlap, execute 203; otherwise, execute 204.
  • the local microblog client saves the message index in various forms, including but not limited to the form of the index table.
  • a locally stored message index usually has a fixed storage area.
  • the currently received message index is usually stored in the cache, and the overlap means that the message index is the same. For example, there are 100 locally saved message indexes, one of which has a message index number of 50, and the current received message index has 70, and there is also a message index number of 50, which can determine that there is overlap.
  • the non-overlapping part of the received message index is used as the message index of the current update, and then 205 is performed. For example, if there are currently 70 received message indexes, and 20 of the message indexes overlap with the locally saved message index, the remaining 50, that is, the non-overlapping parts are used as the message index of the current update, and overlapped. The part does not need to be updated.
  • the locally saved message index has changed, and the content includes the original message index before the current message index update, and the message index saved in the current update.
  • Figure 3 which contains a locally saved message index
  • Table 2 shows the received message index of the temporary cache, one of which is the part that overlaps with the locally saved message index, and the other part is the non-overlapping part. That is, the new message index
  • Table 3 is the locally saved new table obtained after determining the message index of this update, which is the result obtained by combining Table 1 and Table 2, wherein the overlapping part is unchanged, which is equivalent to A new message index is added based on Table 1.
  • the new message index consists of two parts: the message index of the first displayed message and the message index of the subsequent displayed message.
  • the step of merging the locally saved message index linked list and the temporarily cached received message index linked list may specifically adopt a Merge merge algorithm, which involves indexing the locally saved message index linked list and the cache linked list. Delete and add, merge to get a new local message index list, and make this list can represent the latest message status of the server.
  • the index of the message that has been determined to be updated is stored locally, and may be in various forms, which is not specifically limited in this embodiment of the present invention.
  • the maintenance may be performed in the form of a linked list and in units of blocks, as follows: The determined message index of this update is recorded as a block and the index of the block is set; the block and block of the block are saved locally. Since the Weibo client frequently updates the message, after multiple updates, multiple blocks are saved, and each update stores a block, and each block corresponds to an index of a block, which needs to be from the Weibo server. When pulling a message, first find the corresponding block through the index of the block, and then pull the corresponding message from the microblog server according to the message index in the block to update.
  • the message index is stored in the linked list, and each updated message index corresponds to a block in the linked list.
  • three blocks are taken as an example, and from bottom to top, respectively, block 1, block 2, and block 3
  • index numbers 1, 2 and 3 are index numbers 1, 2 and 3.
  • some blocks contain only the message index of the first displayed message, such as block 1, and some blocks contain not only the message index of the first displayed message, but also the message index of the subsequent displayed message.
  • This embodiment is referred to as a fault, such as block 2 and block 3.
  • the fault refers to that the message update is not completed once, but is completed according to the user's request.
  • the message is continuously pulled according to the subsequent message index, according to the pre-specified number. K, each time the user requests to continue to update, the ⁇ message is pulled from the microblog server, and the update is completed step by step until all the messages are pulled or the user stops requesting to continue the update.
  • 206 Obtain a corresponding message from the microblog server according to the determined message index of the first displayed message, and display the message to the user; at this time, the first display is completed, and the subsequent message is not pulled, in the local microblog client Only the message index of the subsequent message is saved, so the storage space of the Weibo client is greatly saved, and the waste of resources is avoided.
  • the user can browse the two messages. If the user requests to continue the update, when the determined message index of the current update is maintained in units of blocks, according to the index of the block saved this time. Reading the corresponding block, and using the remaining message indexes other than the first message index of the first display message as the message index of the subsequent display message, when the determined message index of the current update is otherwise maintained. Without searching for a block, the remaining message indexes other than the first message index of the first display message are directly used as the message index of the subsequent display message, and each time the user requests to continue the update, all the messages are obtained from the message index of the subsequent displayed message. The index is used as the index of the current message. If there is less than one, the index of the message will be used as the index of the current message. According to the message index of this time, the corresponding message is obtained from the microblog server and displayed to the user.
  • the number of displayed messages can be less than one. For example, if the microblog client receives 70 messages and 30 messages, the first 30 messages are displayed. When the user clicks on the request to continue the update, 30 messages are displayed again. If the user clicks on the request to continue the update, A message corresponding to the last 10 indexes of the 70 indexes is displayed to the user. A total of 3 times were displayed in the process, and the number of messages displayed last time was less than one. If the user no longer sends a request after the previous two displays, the last 10 messages are not displayed. In the embodiment of the present invention, the microblog client receives the message index sent by the microblog server, which may be one time or multiple times.
  • the microblog server when the message index is sent by the microblog server, if the message index is too large, it needs to be sent to the microblog client in multiple times.
  • the means for sending the multiple times is the prior art, and the embodiment of the present invention does not Make specific limits.
  • the microblog server needs to send 200 message indexes, and according to the communication protocol, only 70 can be sent at a time, then the microblog server will send 3 times, the first two are 70, and the last time is 60.
  • the microblog server first sends a message index to the microblog client, and the microblog client obtains the corresponding message from the microblog server according to the message index of the first displayed message and the message index of the subsequent displayed message.
  • the Bo server does not need to send all messages to the Weibo client at one time, which reduces the pressure on the Weibo server.
  • the microblog client does not update and store all the messages to the local one time.
  • the subsequent messages are updated. If the user does not request to continue the update, the subsequent messages are not updated, and the client is avoided. Waste of resources.
  • displaying the message to the user in a specified number of times also reduces the harassment of the user and improves the user experience.
  • the embodiment provides a device for updating a message, including:
  • the obtaining module 501 is configured to: when the user requests the update message, obtain the message index from the microblog server; the first display module 502 is configured to determine, according to the pre-specified number K, the message index as the first display in the obtained message index.
  • the message index of the message is obtained from the microblog server according to the message index of the first displayed message, and is displayed to the user; wherein, ⁇ is a natural number.
  • the device may further include:
  • a first subsequent display module configured to: if the user requests to continue to update, use the remaining message index of the message index of the first displayed message in the obtained message index as the message index of the subsequent display message, according to the message index of the subsequent displayed message
  • the blog server obtains the corresponding message and displays it to the user.
  • the first subsequent display module is configured to: when the corresponding message is obtained from the microblog server according to the message index of the subsequent display message, and is displayed to the user, specifically:
  • the message index is obtained from the message index of the subsequent display message as the current message index. If less than ⁇ , less than one message index is used as the current message index.
  • the second message index gets the corresponding message from the microblog server and displays it to the user.
  • the first display module 502 can include:
  • a judging unit configured to determine whether the obtained message index overlaps with the locally saved message index; and the processing unit is configured to: if there is an overlap, the non-overlapping part of the obtained message index is used as the cancellation of the current update Index; if there is no overlap, the obtained message index is used as the message index of this update;
  • the determining unit is configured to save the updated message index locally, and determine the ⁇ message index as the message index of the first displayed message in the updated message index according to the pre-specified number ⁇ .
  • the determining unit may include:
  • Save subunits which are used to save the index of blocks and blocks locally.
  • the device may further include:
  • a second subsequent display module configured to: if the user requests to continue to update, read the block according to the index of the block, and use the remaining message index of the block except the message index of the first displayed message as the message index of the subsequent display message, at each time the user When the request continues to be updated, the ⁇ message index is obtained from the message index of the subsequent display message as the current message index. If less than ⁇ , less than one message index is used as the current message index, according to the current message index. The corresponding message is obtained from the Weibo server and displayed to the user.
  • the message index obtained by the obtaining module 501 is an index of all new messages stored by the microblog server since the local last update.
  • the foregoing device provided in this embodiment may be a microblog client, and the method in any one of the foregoing method embodiments may be performed on the device.
  • the method in any one of the foregoing method embodiments may be performed on the device.
  • the foregoing apparatus obtains a message index from the microblog server, and obtains a corresponding message from the microblog server according to the message index of the first display message and the message index of the subsequent display message, so that the microblog server does not need to be sent at one time. All the news has alleviated the pressure on the Weibo server. Moreover, the local does not update and store all the messages to the local one time. When the user requests to continue to update, the subsequent messages are updated. If the user does not request to continue the update, the subsequent messages are not updated, and the resource waste of the client is avoided. In addition, displaying the message to the user in a specified number of times also reduces the harassment of the user and improves the user experience.
  • the storage medium may be a magnetic disk, an optical disk, a read only memory (ROM) or a random access memory (RAM).
  • Each functional unit in the embodiment of the present invention may be integrated into one processing module, or each unit may exist physically separately, or two or more units may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules, if implemented in the form of software functional modules and sold or used as separate products, may also be stored in a computer readable storage medium.
  • the above-mentioned storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • Each of the above described devices or systems may perform the methods of the corresponding method embodiments.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种消息更新的方法和装置,属于微博技术领域。所述方法包括:当用户请求更新消息时,从微博服务器获取消息索引;按照预先指定的个数K,在获取的消息索引中确定K个消息索引作为首次显示消息的消息索引,根据首次显示消息的消息索引从微博服务器获取相应的消息,并显示给用户;其中,K为自然数。所述装置包括:获取模块和首次显示模块。本发明减轻了微博服务器的压力,避免了客户端的资源浪费,提升了用户的体验。

Description

消息更新的方法和装置 技术领域
本发明涉及微博技术领域, 特别涉及一种消息更新的方法和装置。 背景技术
在微博系统中, 当一个微博用户发表一条消息时, 所有关注这个用户的其它用户都会 收到一条新消息的通知。 这意味着, 微博服务器向微博客户端分发消息时, 不再是传统 IM ( Instant Message, 即时通讯) 应用中一对一的关系, 而是一对多的关系。
消息通知在微博系统中是非常频繁的, 目前微博系统中消息更新的方法是: 一次更新 并展示所有的新消息。 当一个微博客户端向微博服务器请求新消息时, 微博服务器会将自 该微博客户端上次更新至今微博系统中所有已发布的消息, 作为新消息一次性地提供给该 微博客户端, 以完成该微博客户端的消息更新和展示。
由于微博系统中的消息通常为大批量的, 微博服务器需要发送很多次, 才能完成消息 通知, 因此, 增加了服务器的压力, 而且微博客户端更新及存储新消息, 需要占用大量的 存储空间, 造成了客户端的资源浪费, 同时, 一次性显示大量消息给用户, 也给用户带来 了一定程度的骚扰。 发明内容
为了解决现有技术的问题, 本发明实施例提供了一种消息更新的方法和装置。 所述技 术方案如下:
一方面, 一种消息更新的方法, 所述方法包括:
当用户请求更新消息时, 从微博服务器获取消息索引;
按照预先指定的个数 K,在获取的所述消息索引中确定 Κ个消息索引作为首次显示消息 的消息索引, 根据所述首次显示消息的消息索引从所述微博服务器获取相应的消息, 并显 示给用户;
其中, 所述 κ为自然数。
另一方面, 一种消息更新的装置, 包括: 获取模块, 用于当用户请求更新消息时, 从微博服务器获取消息索引; 首次显示模块, 用于按照预先指定的个数 κ, 在获取的所述消息索引中确定 Κ个消息索 引作为首次显示消息的消息索引, 根据所述首次显示消息的消息索引从所述微博服务器获 取相应的消息, 并显示给用户;
其中, 所述 Κ为自然数。
本发明实施例提供的技术方案, 通过从微博服务器获取消息索引, 按照指定个数确定 首次显示消息的消息索引, 并从微博服务器获取相应的消息显示给用户, 微博服务器无需 一次性将所有消息发送给本地, 减轻了微博服务器的压力。 而且, 本地也不是一次性地将 所有消息更新及存储到本地, 避免了客户端的资源浪费。 另外, 按照指定个数分次显示消 息给用户, 也减轻了对用户的骚扰, 提升了用户的体验。 附图说明
图 1是本发明实施例 1提供的消息更新的方法流程图;
图 2是本发明实施例 2提供的消息更新的方法流程图;
图 3是本发明实施例 2提供的接收到的消息索引与本地已保存的消息索引的合并示意 图;
图 4是本发明实施例 2提供的存储块和块的索引示意图;
图 5是本发明实施例 3提供的消息更新的装置结构图。 具体实施方式
为使本发明的目的、 技术方案和优点更加清楚, 下面将结合附图对本发明实施方式作 进一步地详细描述。
实施例 1
参见图 1, 本实施例提供了一种消息更新的方法, 包括:
101: 当用户请求更新消息时, 从微博服务器获取消息索引。
102: 按照预先指定的个数 Κ, 在获取的消息索引中确定 Κ个消息索引作为首次显示消 息的消息索引, 根据首次显示消息的消息索引从微博服务器获取相应的消息, 并显示给用 户; 其中, κ为自然数。
本实施例中, 进一步地, 在 102之后还可以包括:
如果用户请求继续更新, 则将获取的消息索引中除首次显示消息的消息索引以外的其 余消息索引作为后续显示消息的消息索引, 根据后续显示消息的消息索引从微博服务器获 取相应的消息, 并显示给用户。
其中, 根据后续显示消息的消息索引从微博服务器获取相应的消息, 并显示给用户, 具体包括:
在每次用户请求继续更新时, 均从后续显示消息的消息索引中获取 κ个消息索引作为 本次的消息索引, 如果不足 K个则将不足 K个消息索引作为本次的消息索引, 根据本次的 消息索引从微博服务器获取相应的消息, 并显示给用户。
本实施例提供的上述方法是在微博客户端执行的, 用户使用微博客户端向微博服务器 请求更新消息, 微博服务器通过索引将新消息更新到微博客户端。
本实施例中, 预先指定的个数是指微博客户端一次默认显示新消息的个数, 通常由微 博客户端预先设置好, 具体数值本发明实施例对此不做具体限定, 如可以为 20个或 30个 等等。 从微博服务器获取的消息索引通常为多个, 如 100个、 200个等等。 其中, 分成两部 分, 一部分为首次显示消息的消息索引, 另一部分为后续显示消息的消息索引。 例如, 微 博客户端一次能够显示 30个消息, 从微博服务器获取到 200个消息索引, 将其中的前 30 个作为首次显示消息的消息索引, 其余的作为后续显示消息的消息索引, 如果用户请求继 续更新, 则继续显示后续的消息。
本实施例提供的上述方法, 通过从微博服务器获取消息索引, 按照指定个数确定首次 显示消息的消息索引, 并从微博服务器获取相应的消息显示给用户, 微博服务器无需一次 性将所有消息发送给本地, 减轻了微博服务器的压力。 而且, 本地也不是一次性地将所有 消息更新及存储到本地, 避免了客户端的资源浪费。 另外, 按照指定个数分次显示消息给 用户, 也减轻了对用户的骚扰, 提升了用户的体验。 实施例 2
参见图 2, 本实施例提供了一种消息更新的方法, 包括:
201: 当用户请求更新消息时, 本地的微博客户端将该请求转发给微博服务器, 并接收 微博服务器返回的消息索引。
其中, 微博客户端接收到的消息索引为自微博客户端上次更新至今, 微博服务器存储 的所有新消息的索引。
例如, 微博客户端上次在 9 : 00时刻更新了微博消息, 当前时刻 10 : 00又请求更新, 则 微博服务器将 9 : 00至 10 : 00之间的所有新消息的消息索引发送给微博客户端, 该所有新消 息的发布者可以是一个微博客户端, 但通常都是多个微博客户端, 本发明实施例对此不做 具体限定。 本实施例中涉及的消息均是指微博系统中发布的消息, 消息索引是指标识该消息的索 引号, 如 ID号等等。
202: 本地的微博客户端判断接收到的消息索引与本地已保存的消息索引是否有重叠; 如果有重叠, 则执行 203; 否则, 执行 204。
本实施例中, 本地微博客户端保存消息索引有多种形式, 包括但不限于索引表的形式 等。 本地保存的消息索引通常有固定的存储区, 当前接收到的消息索引通常保存在缓存中, 重叠是指消息索引相同。 例如, 本地已保存的消息索引有 100个, 其中, 有一个消息索引 号为 50, 当前接收到的消息索引有 70个, 其中也有一个消息索引号位 50, 则可以判定二 者有重叠。
203: 将接收到的消息索引中未重叠的部分作为本次更新的消息索引, 然后执行 205。 例如, 当前接收到的消息索引有 70个, 其中, 有 20个消息索引与本地已保存的消息 索引有重叠, 则将剩余的 50个即未重叠的部分作为本次更新的消息索引, 已重叠的部分则 不需要进行更新。
204: 由于不存在重叠, 因此, 需要全部更新, 则将接收到的消息索引全部作为本次更 新的消息索引, 然后执行 205。
205: 将已确定的本次更新的消息索引保存在本地, 并按照预先指定的个数 K, 在本次 更新的消息索引中确定 Κ个消息索引作为首次显示消息的消息索引, 其中, Κ为自然数。
具体地, 在本次消息索引更新后, 本地已保存的消息索引已经发生变化, 其内容包括 本次消息索引更新前原有的消息索引, 还有本次更新中保存的消息索引。 例如, 参见图 3, 表 1 中包含本地已保存的消息索引; 表 2为临时缓存的接收到的消息索引, 其中一部分为 与本地已保存的消息索引重叠的部分, 另一部分为未重叠的部分即新的消息索引; 表 3 为 确定本次更新的消息索引后, 得到的本地保存的新表, 就是将表 1和表 2合并后得到的结 果, 其中, 重叠的部分未变, 相当于在表 1 的基础上增加了新的消息索引, 该新的消息索 引包括两个部分: 首次显示消息的消息索引和后续显示消息的消息索引。
上述对本地已保存的消息索引链表和临时缓存的接收到的消息索引链表进行合并的步 骤, 具体地可以采用 Merge 合并算法, 该算法涉及对本地已保存的消息索引链表和缓存链 表中的索引的删除和增加, 合并后得到新的本地消息索引链表, 并使得这个链表能表示服 务器最新的消息状况。
本实施例中, 将已确定的本次更新的消息索引保存在本地, 可以采用多种形式, 本发 明实施例对此不做具体限定。 优选地, 可以采用链表的形式并以块为单位来进行维护, 具 体过程如下: 将已确定的本次更新的消息索引记录为块并设置块的索引; 在本地保存该块和块的索 弓 I。 由于微博客户端会经常进行消息更新, 因此, 在多次更新后, 会保存有多个块, 每次 更新都会存储一个块, 每个块都对应一个块的索引, 在需要从微博服务器拉取消息时, 先 通过块的索引找到相应的块, 再根据块中的消息索引从微博服务器拉取相应的消息进行更 新。
例如, 参见图 4, 消息索引保存在链表中, 每次更新的消息索引都对应该链表中的一个 块, 图中以 3个块为例, 由下至上分别为块 1、 块 2和块 3, 且对应地保存了该 3个块的索 弓 I, 在左侧的块索引链表中, 由下至上分别为索引号 1、 2和 3。 在右侧的消息索引链表中, 有的块仅包含首次显示消息的消息索引,如块 1,有的块不仅包含首次显示消息的消息索引, 还包含后续显示消息的消息索引, 这种情况在本实施例中称之为断层, 如块 2和块 3。 所述 断层是指消息更新不是一次完成, 而是根据用户的请求分次完成, 在完成首次默认显示后, 如果用户继续请求更新则继续根据后续的消息索引拉取消息, 按照预先指定的个数 K, 用户 每请求一次继续更新, 则从微博服务器拉取 κ个消息, 逐步完成更新, 直到全部消息均拉 取完成或者用户停止请求继续更新。
206: 根据已确定的 Κ个首次显示消息的消息索引, 从微博服务器获取相应的消息, 并 显示给用户; 此时, 完成首次显示, 后续的消息并未进行拉取, 在本地微博客户端只保存 有后续消息的消息索引, 因此, 极大地节省了微博客户端的存储空间, 避免了资源浪费。
207: 在完成首次显示后, 用户可以浏览该 Κ个消息, 如果用户请求继续更新, 当将已 确定的本次更新的消息索引以块为单位进行维护时, 则根据本次保存的块的索引读取对应 的块, 将该块中除首次显示消息的 Κ个消息索引以外的其余消息索引作为后续显示消息的 消息索引, 当将已确定的本次更新的消息索引以其他方式进行维护时, 无须查找块, 直接 将除首次显示消息的 Κ个消息索引以外的其余消息索引作为后续显示消息的消息索引, 在 每次用户请求继续更新时, 均从后续显示消息的消息索引中获取 Κ个消息索引作为本次的 消息索引, 如果不足 Κ个则将不足 Κ个消息索引作为本次的消息索引, 根据本次的消息索 引从微博服务器获取相应的消息, 并显示给用户。
在该过程中, 每次均拉取并显示 Κ个消息在本地, 最后一次例外, 显示的消息的个数 可以小于 Κ个。 例如, 微博客户端接收到的消息索引为 70个, Κ为 30个, 则首次显示 30 个消息, 用户点击请求继续更新, 则再次显示 30个消息, 如果用户再点击请求继续更新, 则将该 70个索引中的最后 10个索引对应的消息显示给用户。 该过程中共显示了 3次, 最 后一次显示的消息个数不足 Κ个。 如果完成前两次显示后, 用户不再发送请求, 则不显示 最后 10条消息。 在本发明实施例中, 微博客户端接收微博服务器发送的消息索引, 可以为一次, 也可 以为多次。 根据通信协议, 微博服务器在发送消息索引时, 如果消息索引太多, 则需要分 多次发送给微博客户端, 该分多次发送的手段为现有技术, 本发明实施例对此不做具体限 定。 例如, 微博服务器需要发送 200个消息索引, 而根据通信协议每次只能发送 70个, 则 微博服务器会发送 3次, 前两次均为 70个, 最后一次为 60个。
本实施例提供的上述方法, 微博服务器先发送消息索引给微博客户端, 微博客户端按 照首次显示消息的消息索引和后续显示消息的消息索引分别从微博服务器获取相应的消 息, 微博服务器无需一次性将所有消息发送给微博客户端, 减轻了微博服务器的压力。 而 且, 微博客户端也不是一次性地将所有消息更新及存储到本地, 在用户请求继续更新时, 再更新后续消息, 如果用户不请求继续更新, 则不再更新后续消息, 避免了客户端的资源 浪费。 另外, 按照指定个数分次显示消息给用户, 也减轻了对用户的骚扰, 提升了用户的 体验。 实施例 3
参见图 5, 本实施例提供了一种消息更新的装置, 包括:
获取模块 501, 用于当用户请求更新消息时, 从微博服务器获取消息索引; 首次显示模块 502, 用于按照预先指定的个数 K, 在获取的消息索引中确定 Κ个消息索 引作为首次显示消息的消息索引, 根据首次显示消息的消息索引从微博服务器获取相应的 消息, 并显示给用户; 其中, Κ为自然数。
本实施例中, 进一步地, 上述装置还可以包括:
第一后续显示模块, 用于如果用户请求继续更新, 则将获取的消息索引中除首次显示 消息的消息索引以外的其余消息索引作为后续显示消息的消息索引, 根据后续显示消息的 消息索引从微博服务器获取相应的消息, 并显示给用户。
第一后续显示模块在用于根据后续显示消息的消息索引从微博服务器获取相应的消 息, 并显示给用户时, 具体用于:
在每次用户请求继续更新时, 均从后续显示消息的消息索引中获取 Κ个消息索引作为 本次的消息索引, 如果不足 κ个则将不足 Κ个消息索引作为本次的消息索引, 根据本次的 消息索引从微博服务器获取相应的消息, 并显示给用户。
本实施例中, 首次显示模块 502可以包括:
判断单元, 用于判断获取的消息索引与本地已保存的消息索引是否有重叠; 处理单元, 用于如果有重叠, 则将获取的消息索引中未重叠的部分作为本次更新的消 息索引; 如果没有重叠, 则将获取的消息索引作为本次更新的消息索引;
确定单元, 用于将本次更新的消息索引保存在本地, 并按照预先指定的个数 κ, 在本次 更新的消息索引中确定 κ个消息索引作为首次显示消息的消息索引。
进一步地, 上述确定单元可以包括:
设置子单元, 用于将本次更新的消息索引记录为块并设置块的索引;
保存子单元, 用于在本地保存块和块的索引。
本实施例中, 进一步地, 上述装置还可以包括:
第二后续显示模块, 用于如果用户请求继续更新, 则根据块的索引读取块, 将块中除 首次显示消息的消息索引以外的其余消息索引作为后续显示消息的消息索引, 在每次用户 请求继续更新时, 均从后续显示消息的消息索引中获取 κ个消息索引作为本次的消息索引, 如果不足 κ个则将不足 Κ个消息索引作为本次的消息索引, 根据本次的消息索引从微博服 务器获取相应的消息, 并显示给用户。
在本实施例中, 获取模块 501 获取的消息索引为自本地上次更新至今微博服务器存储 的所有新消息的索引。
本实施例提供的上述装置, 具体可以是微博客户端, 在该装置上可以执行上述任一方 法实施例中的方法, 其具体实现过程详见方法实施例, 这里不再赘述。
本实施例提供的上述装置, 通过从微博服务器获取消息索引, 并按照首次显示消息的 消息索引和后续显示消息的消息索引分别从微博服务器获取相应的消息, 使得微博服务器 无需一次性发送所有消息, 减轻了微博服务器的压力。 而且, 本地也不是一次性地将所有 消息更新及存储到本地, 在用户请求继续更新时, 再更新后续消息, 如果用户不请求继续 更新, 则不再更新后续消息, 避免了客户端的资源浪费。 另外, 按照指定个数分次显示消 息给用户, 也减轻了对用户的骚扰, 提升了用户的体验。 最后需要说明的是, 本领域普通技术人员可以理解实现上述实施例方法中的全部或部 分流程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于一计算机 可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施例的流程。 其中, 所述 的存储介质可为磁碟、 光盘、 只读存储记忆体 (ROM) 或随机存储记忆体 (RAM) 等。
本发明实施例中的各功能单元可以集成在一个处理模块中, 也可以是各个单元单独物 理存在, 也可以两个或两个以上单元集成在一个模块中。 上述集成的模块既可以采用硬件 的形式实现, 也可以采用软件功能模块的形式实现。 所述集成的模块如果以软件功能模块 的形式实现并作为独立的产品销售或使用时, 也可以存储在一个计算机可读取存储介质中。 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。 上述的各装置或系统, 可以执行 相应方法实施例中的方法。
以上所述仅为本发明的较佳实施例, 并不用以限制本发明, 凡在本发明的精神和原则 之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。

Claims

权 利 要 求 书
1、 一种消息更新的方法, 其特征在于, 所述方法包括:
当用户请求更新消息时, 从微博服务器获取消息索引;
按照预先指定的个数 K, 在获取的所述消息索引中确定 Κ个消息索引作为首次显示消息 的消息索引, 根据所述首次显示消息的消息索引从所述微博服务器获取相应的消息, 并显示 给用户;
其中, 所述 κ为自然数。
2、根据权利要求 1所述的方法, 其特征在于, 根据所述首次显示消息的消息索引从所述 微博服务器获取相应的消息, 并显示给用户之后, 还包括:
如果用户请求继续更新, 则将获取的所述消息索引中除所述首次显示消息的消息索引以 外的其余消息索引作为后续显示消息的消息索引, 根据所述后续显示消息的消息索引从所述 微博服务器获取相应的消息, 并显示给用户。
3、根据权利要求 2所述的方法, 其特征在于, 根据所述后续显示消息的消息索引从所述 微博服务器获取相应的消息, 并显示给用户, 包括:
在每次用户请求继续更新时, 均从所述后续显示消息的消息索引中获取 Κ个消息索引作 为本次的消息索引, 如果不足 Κ个则将所述不足 Κ个消息索引作为本次的消息索引, 根据本 次的消息索引从所述微博服务器获取相应的消息, 并显示给用户。
4、 根据权利要求 1所述的方法, 其特征在于, 按照预先指定的个数 Κ, 在获取的所述消 息索引中确定 Κ个消息索引作为首次显示消息的消息索引, 包括:
判断获取的所述消息索引与本地已保存的消息索引是否有重叠;
如果有重叠, 则将获取的所述消息索引中未重叠的部分作为本次更新的消息索引; 如果没有重叠, 则将获取的所述消息索引作为本次更新的消息索引;
将所述本次更新的消息索引保存在本地, 并按照预先指定的个数 Κ, 在所述本次更新的 消息索引中确定 Κ个消息索引作为首次显示消息的消息索引。
5、 根据权利要求 4所述的方法, 其特征在于, 将所述本次更新的消息索引保存在本地, 包括:
将所述本次更新的消息索引记录为块并设置所述块的索引;
在本地保存所述块和块的索引。
6、根据权利要求 5所述的方法, 其特征在于, 根据所述首次显示消息的消息索引从所述 微博服务器获取相应的消息, 并显示给用户之后, 还包括:
如果用户请求继续更新, 则根据所述块的索引读取所述块, 将所述块中除所述首次显示 消息的消息索引以外的其余消息索引作为后续显示消息的消息索引, 在每次用户请求继续更 新时, 均从所述后续显示消息的消息索引中获取 K个消息索引作为本次的消息索引, 如果不 足 K个则将所述不足 K个消息索引作为本次的消息索引, 根据本次的消息索引从所述微博服 务器获取相应的消息, 并显示给用户。
7、根据权利要求 1至 6中任一权利要求所述的方法, 其特征在于, 获取的所述消息索引 为自本地上次更新至今所述微博服务器存储的所有新消息的索引。
8、 一种消息更新的装置, 其特征在于, 所述装置包括:
获取模块, 用于当用户请求更新消息时, 从微博服务器获取消息索引;
首次显示模块, 用于按照预先指定的个数 K, 在获取的所述消息索引中确定 Κ个消息索 引作为首次显示消息的消息索引, 根据所述首次显示消息的消息索引从所述微博服务器获取 相应的消息, 并显示给用户;
其中, 所述 Κ为自然数。
9、 根据权利要求 8所述的装置, 其特征在于, 所述装置还包括:
第一后续显示模块, 用于如果用户请求继续更新, 则将获取的所述消息索引中除所述首 次显示消息的消息索引以外的其余消息索引作为后续显示消息的消息索引, 根据所述后续显 示消息的消息索引从所述微博服务器获取相应的消息, 并显示给用户。
10、 根据权利要求 9所述的装置, 其特征在于, 所述第一后续显示模块在用于根据所述 后续显示消息的消息索引从所述微博服务器获取相应的消息, 并显示给用户时, 具体用于: 在每次用户请求继续更新时, 均从所述后续显示消息的消息索引中获取 Κ个消息索引作 为本次的消息索引, 如果不足 κ个则将所述不足 K个消息索引作为本次的消息索引, 根据本 次的消息索引从所述微博服务器获取相应的消息, 并显示给用户。
11、 根据权利要求 8所述的装置, 其特征在于, 所述首次显示模块包括:
判断单元, 用于判断获取的所述消息索引与本地已保存的消息索引是否有重叠; 处理单元, 用于如果有重叠, 则将获取的所述消息索引中未重叠的部分作为本次更新的 消息索引; 如果没有重叠, 则将获取的所述消息索引作为本次更新的消息索引;
确定单元, 用于将所述本次更新的消息索引保存在本地, 并按照预先指定的个数 K, 在 所述本次更新的消息索引中确定 Κ个消息索引作为首次显示消息的消息索引。
12、 根据权利要求 11所述的装置, 其特征在于, 所述确定单元包括:
设置子单元, 用于将所述本次更新的消息索引记录为块并设置所述块的索引; 保存子单元, 用于在本地保存所述块和块的索引。
13、 根据权利要求 12所述的装置, 其特征在于, 所述装置还包括:
第二后续显示模块, 用于如果用户请求继续更新, 则根据所述块的索引读取所述块, 将 所述块中除所述首次显示消息的消息索引以外的其余消息索引作为后续显示消息的消息索 弓 I, 在每次用户请求继续更新时, 均从所述后续显示消息的消息索引中获取 κ个消息索引作 为本次的消息索引, 如果不足 κ个则将所述不足 Κ个消息索引作为本次的消息索引, 根据本 次的消息索引从所述微博服务器获取相应的消息, 并显示给用户。
14、根据权利要求 8至 13中任一权利要求所述的装置, 其特征在于, 所述获取模块获取 的所述消息索引为自本地上次更新至今所述微博服务器存储的所有新消息的索引。
PCT/CN2011/076820 2010-08-31 2011-07-04 消息更新的方法和装置 WO2012028033A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US13/819,703 US20130232208A1 (en) 2010-08-31 2011-07-04 Method and device for updating messages

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2010102723350A CN102387178A (zh) 2010-08-31 2010-08-31 消息更新的方法和装置
CN201010272335.0 2010-08-31

Publications (1)

Publication Number Publication Date
WO2012028033A1 true WO2012028033A1 (zh) 2012-03-08

Family

ID=45772134

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076820 WO2012028033A1 (zh) 2010-08-31 2011-07-04 消息更新的方法和装置

Country Status (3)

Country Link
US (1) US20130232208A1 (zh)
CN (1) CN102387178A (zh)
WO (1) WO2012028033A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9082154B2 (en) * 2012-03-15 2015-07-14 Sap Se Aggregation and semantic modeling of tagged content
WO2013149381A1 (en) * 2012-04-05 2013-10-10 Microsoft Corporation Platform for continuous graph update and computation
US20150040005A1 (en) * 2013-07-30 2015-02-05 Google Inc. Mobile computing device configured to output haptic indication of task progress
CN105100143A (zh) * 2014-05-04 2015-11-25 腾讯科技(深圳)有限公司 显示数据的方法及装置
CN104935657A (zh) * 2015-06-15 2015-09-23 清华大学深圳研究生院 主动推送信息的方法和嵌入式节点操作系统
CN110493122B (zh) * 2019-08-29 2022-01-28 北京拉勾网络技术有限公司 一种会话信息的同步方法、装置、计算设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722671A (zh) * 2004-07-14 2006-01-18 中兴通讯股份有限公司 电信网管的大流量数据显示方法
CN101304549A (zh) * 2007-05-08 2008-11-12 华为技术有限公司 不下载发送消息的方法、消息服务器和终端
CN101674318A (zh) * 2008-09-11 2010-03-17 北大方正集团有限公司 一种向移动设备定时推送数据的方法

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6167402A (en) * 1998-04-27 2000-12-26 Sun Microsystems, Inc. High performance message store
US7308453B2 (en) * 2004-06-29 2007-12-11 Nokia Corporation Meta-data approach to indexing, retrieval and management of stored messages in a portable communication device
US7693948B2 (en) * 2006-05-15 2010-04-06 Sap Ag Email traffic integration into a knowledge management system
JP4887918B2 (ja) * 2006-06-09 2012-02-29 富士通株式会社 メール一覧表示プログラムおよびメール管理プログラム
KR100765791B1 (ko) * 2006-07-13 2007-10-12 삼성전자주식회사 콘텐트 관리 방법 및 장치
CN101192218A (zh) * 2006-11-23 2008-06-04 国际商业机器公司 提供和获取网络内容的方法、装置和系统
CN101277472B (zh) * 2007-03-30 2011-08-10 华为技术有限公司 博客内容的同步方法、设备和系统
US7836037B2 (en) * 2007-10-04 2010-11-16 Sap Ag Selection of rows and values from indexes with updates
US20090106311A1 (en) * 2007-10-19 2009-04-23 Lior Hod Search and find system for facilitating retrieval of information
US20100274795A1 (en) * 2009-04-22 2010-10-28 Yahoo! Inc. Method and system for implementing a composite database
US20110178995A1 (en) * 2010-01-21 2011-07-21 Microsoft Corporation Microblog search interface
US8621012B2 (en) * 2010-02-08 2013-12-31 Google Inc. Active e-mails

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722671A (zh) * 2004-07-14 2006-01-18 中兴通讯股份有限公司 电信网管的大流量数据显示方法
CN101304549A (zh) * 2007-05-08 2008-11-12 华为技术有限公司 不下载发送消息的方法、消息服务器和终端
CN101674318A (zh) * 2008-09-11 2010-03-17 北大方正集团有限公司 一种向移动设备定时推送数据的方法

Also Published As

Publication number Publication date
CN102387178A (zh) 2012-03-21
US20130232208A1 (en) 2013-09-05

Similar Documents

Publication Publication Date Title
JP6423059B2 (ja) セキュリティプロトコルの動的選択
US20180205976A1 (en) Method and apparatus of obtaining video fragment
JP2022050451A (ja) インターネットクラウドでホストされる自然言語による対話型メッセージングシステムサーバ連携
US9131054B2 (en) Synchronization in unified messaging systems
US9165081B2 (en) Hovercard pivoting for mobile devices
US10097659B1 (en) High performance geographically distributed data storage, retrieval and update
JP6952060B2 (ja) インターネットクラウドでホストされる自然言語による対話型メッセージングシステムユーザリゾルバ
WO2017181709A1 (zh) 推送消息获取、消息推送方法及装置
US10331613B2 (en) Methods for enabling direct memory access (DMA) capable devices for remote DMA (RDMA) usage and devices therof
WO2012028033A1 (zh) 消息更新的方法和装置
CN106874334B (zh) 一种数据处理方法及装置、资讯处理系统
JP2019530033A (ja) インターネットクラウドでホストされる自然言語による対話型メッセージングシステムセッション化部
US20130024526A1 (en) Method of managing feeds based on classifications
JP2013521562A5 (zh)
WO2013078689A1 (zh) 一种云消息服务中实现消息传递的方法和装置
CN103312751A (zh) 一种基于浏览器的即时通信方法
EP3028437A1 (en) Messaging api over http protocol to establish context for data exchange
JP2013522782A5 (zh)
EP2991280A1 (en) Content sharing method and social synchronizing apparatus
US20150039675A1 (en) Messaging over http protocol for data exchange
US9876776B2 (en) Methods for generating and publishing a web site based on selected items and devices thereof
AU2014321418A1 (en) Email webclient notification queuing
WO2012031511A1 (zh) 管理消息的方法和装置
WO2010078791A1 (zh) 一种社会网络服务sns浏览方法及提供sns浏览的设备
WO2019242279A1 (zh) 一种消息处理方法及装置

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: 11821059

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 13819703

Country of ref document: US

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 08/05/2013)

122 Ep: pct application non-entry in european phase

Ref document number: 11821059

Country of ref document: EP

Kind code of ref document: A1