Message data processing method, device, equipment and storage medium

By introducing the message queue mechanism and timestamp screening mechanism in FEED streaming data processing, the problem of slow user query response and database resources in existing technologies have been solved, and efficient update message processing and resource optimization have been achieved.

CN112380266BActive Publication Date: 2025-01-28GUANGZHOU BAIGUOYUAN NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011112173.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-16
Publication Date
2025-01-28
Estimated Expiration
2040-10-16

AI Technical Summary

Technical Problem

The existing feed flow mechanism cannot respond to user query requests in a timely manner when processing a large number of subscription data sources. The push model takes a long time to maintain the feed list of subscribers, occupying a large amount of database resources, resulting in excessive storage space.

Method used

By introducing the message queue mechanism, the update message published by the data source is stored in the queue, and the subscribers are screened according to the current timestamp and historical timestamp relationship. Only the update list of subscribers will be updated to optimize database resources.

Benefits of technology

When the user query the update message does not access a lot of data sources, it can respond in time, reduce data writing and storage space occupation, optimize the distribution of database resources, and avoid the problem of delay in the release of data sources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112380266B_ABST
    Figure CN112380266B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a message data processing method, device, equipment and storage medium, wherein the method comprises: step 1, obtaining an update message recorded in a first message queue; step 2, determining a subscriber corresponding to the data source; step 3, obtaining a current timestamp and a historical timestamp when the subscriber last queried an update message; step 4, filtering the subscriber according to the relationship between the current timestamp and the historical timestamp; step 5, updating the update list of the filtered subscriber according to the update content; step 6, obtaining another update message in the first message queue, and repeating steps 2 to 5. This solution can improve the response speed to user queries, save storage space, and optimize resource allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to a message data processing method, apparatus, device and storage medium. Background Art

[0002] Message data is a data format used to provide users with frequently updated content, such as feed data. The feed mechanism can provide users with subscriptions and updates, that is, users can subscribe to certain data sources and receive continuous updates from these data sources.

[0003] The existing feed stream mechanism implementation is mainly divided into the pull model and the push model. In the pull model, when a user views the feed stream, the system obtains the data of the subscribed data source to construct the feed stream data and feeds back the constructed feed stream data to the user. In the push model, the system maintains a feed list for each user. When the data source publishes an update message, the data is updated to the feed list of all subscribed users to feed back to the user. The defect of the pull model is that when the number of subscribed data sources of the user is large, the construction of the feed stream data needs to access a large number of subscribed data sources, and the user's query request cannot be responded to in time. The defect of the push model is that when a data source has a large number of subscribed users, the maintenance of the feed list of the subscribed users is time-consuming, and the subscribed users need a long time to query the data update; when the data source writes to the database, due to the large number of subscribed users, it occupies a large amount of database resources. For data sources with a small number of subscribed users, the database resources cannot be used reasonably; in addition, the push model stores the feed list of all subscribed users, which occupies a lot of storage space. Summary of the invention

[0004] The embodiments of the present invention provide a message data processing method, device, equipment and storage medium, so that when users query update messages, they do not need to access a large number of data sources, can get timely responses, and the maintenance of update lists is more targeted, reducing data writing and saving storage space. At the same time, the resource allocation of the database is optimized, so that data sources with fewer subscribers can also be reasonably allocated to database resources, and when update messages are released, the problem of delayed release of certain data sources is avoided.

[0005] In a first aspect, an embodiment of the present invention provides a message data processing method, the method comprising:

[0006] Step 1: Obtain an update message recorded in the first message queue, wherein the update message includes a data source and associated update content;

[0007] Step 2: Determine the subscriber corresponding to the data source;

[0008] Step 3: Obtain the current timestamp and the historical timestamp of the last time the subscribed user queried for update messages;

[0009] Step 4: Filter the subscribed users according to the relationship between the current timestamp and the historical timestamp;

[0010] Step 5: updating the update list of the screened subscribed users according to the update content;

[0011] Step 6: Get another update message in the first message queue, and repeat steps 2 to 5 until all update messages recorded in the first message queue are processed.

[0012] In a second aspect, an embodiment of the present invention further provides a message data processing method, the method comprising:

[0013] When detecting that a user queries for an update message, obtaining a current timestamp and a historical timestamp of the user's most recent query for an update message;

[0014] If the relationship between the current timestamp and the historical timestamp meets a first preset condition, determining the subscription data source corresponding to the user, and obtaining an update message of the subscription data source for data feedback;

[0015] If the relationship between the current timestamp and the historical timestamp meets a second preset condition, the update list corresponding to the user is read for data feedback.

[0016] In a third aspect, an embodiment of the present invention further provides a message data processing device, the device comprising:

[0017] A message acquisition module, used to acquire an update message recorded in the first message queue, wherein the update message includes a data source and associated update content;

[0018] A user determination module, used to determine a subscribed user corresponding to the data source;

[0019] A timestamp recording module is used to obtain the current timestamp and the historical timestamp of the last time the subscribed user queried the update message;

[0020] A user screening module, screening the subscribed users according to the relationship between the current timestamp and the historical timestamp;

[0021] The message updating module is used to update the update list of the filtered subscribed users according to the update content.

[0022] In a fourth aspect, an embodiment of the present invention further provides another message data processing device, the device comprising:

[0023] A timestamp recording module is used to obtain the current timestamp and the historical timestamp of the user's most recent query for update messages when detecting that the user queries for update messages;

[0024] A first message query module, configured to determine the subscription data source corresponding to the user if the relationship between the current timestamp and the historical timestamp meets a first preset condition, and obtain an update message of the subscription data source for data feedback;

[0025] The second message query module is used to read the update list corresponding to the user for data feedback if the relationship between the current timestamp and the historical timestamp meets a second preset condition.

[0026] In a fifth aspect, an embodiment of the present invention further provides a message data processing device, the device comprising:

[0027] one or more processors;

[0028] a storage device for storing one or more programs,

[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the message data processing method described in the embodiment of the present invention.

[0030] In a sixth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the message data processing method described in the embodiment of the present invention.

[0031] In an embodiment of the present invention, when processing an update message published by a data source, an update message recorded in the first message queue is obtained, the subscriber corresponding to the data source is determined, the current timestamp and the historical timestamp of the last time the subscriber queried the update message are obtained, the subscriber is screened according to the relationship between the current timestamp and the historical timestamp, and the update list of the screened subscriber is updated according to the update content. When the update message is processed, another update message recorded in the first message queue is processed, and so on. When the user queries the update message, the current timestamp and the historical timestamp of the last time the user queried the update message are obtained. If the relationship between the current timestamp and the historical timestamp meets the first preset condition, the subscription data source corresponding to the user is determined, and the update message of the subscription data source is obtained for data feedback. If the relationship between the current timestamp and the historical timestamp meets the second preset condition, the update list corresponding to the user is read for data feedback. This solution allows the user to query the update message without accessing a large number of data sources, and can get a response in time, and the maintenance of the update list is more targeted, reducing data writing and saving storage space. At the same time, the resource allocation of the database is optimized so that data sources with fewer subscribers can also be reasonably allocated database resources, avoiding the problem of delayed release of certain data sources when updating messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A flowchart of a message data processing method provided by an embodiment of the present invention;

[0033] Figure 1a A schematic diagram of a first message queue structure provided by an embodiment of the present invention;

[0034] Figure 1b A schematic diagram of a corresponding relationship between a data source and a subscribing user provided in an embodiment of the present invention;

[0035] Figure 2 A flowchart of another message data processing method provided by an embodiment of the present invention;

[0036] Figure 2a A schematic diagram of a subscription user list provided by an embodiment of the present invention;

[0037] Figure 2b A schematic diagram of a message queue provided by an embodiment of the present invention;

[0038] Figure 3 A flowchart of another message data processing method provided by an embodiment of the present invention;

[0039] Figure 4A flowchart of another message data processing method provided by an embodiment of the present invention;

[0040] Figure 4a A flowchart of determining a header data source list and updating the update list accordingly provided by an embodiment of the present invention;

[0041] Figure 5 A structural block diagram of a message data processing device provided by an embodiment of the present invention;

[0042] Figure 6 A structural block diagram of another message data processing device provided by an embodiment of the present invention;

[0043] Figure 7 A schematic diagram of the structure of a message data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0044] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than to limit the embodiments of the present invention. It is also necessary to explain that, for ease of description, only parts related to the embodiments of the present invention are shown in the accompanying drawings, rather than all structures.

[0045] Figure 1 This is a flowchart of a message data processing method provided by an embodiment of the present invention. This embodiment can be applied to processing feed stream data to provide subscription and data update to users. The method can be executed by a message data processing device, such as a server, and specifically includes the following steps:

[0046] Step S101: Acquire an update message recorded in a first message queue, wherein the update message includes a data source and associated update content.

[0047] In one embodiment, when a data source publishes an update message, unlike the existing method of directly processing the update message, the user list of the subscribed user is not directly updated, but the update message is stored in a queue, which is exemplarily recorded as the first message queue. The queue is a special linear table, and the deletion operation is performed at the front end of the table and the insertion operation is performed at the back end of the table. Optionally, the first message queue can be a first-in-first-out queue. That is, when an update message is generated, the update message is inserted into the end of the first message queue, and so on.

[0048] In the user subscription update mechanism, there can be multiple data sources, and each data source can be subscribed by multiple users. For example, taking Weibo as an example, everyone can register as a data source and can also subscribe to other data sources. For example, the writer Zhang San (as a data source) can have a large number of subscribers. When Zhang San publishes an update message, all of his corresponding subscribers can query the update message.

[0049] In one embodiment, the update message stored in the first message queue includes a data source and associated update content. The data source can be represented in the form of an ID. Each data source is assigned a unique ID in the system background for marking and confirming the data source. The update content can be any multimedia information such as text, voice, picture, video, etc. Specifically, when it is detected that a data source publishes an update message, a message body is constructed, such as the message body: update message 1 (data source 1, update content 1) and stored in the first message queue. For another update message published by the data source, another message body is constructed, such as: update message 2 (data source 2, update content 2), and update message 2 is also inserted into the queue. Figure 1a As shown, Figure 1a A schematic diagram of the structure of a first message queue provided by an embodiment of the present invention, wherein update message 1 to update message W, a total of W update messages, are stored in the first message queue.

[0050] When processing the update message in the first message queue, an update message recorded in the first message queue is obtained. Exemplarily, the update message recorded in the first message queue can be obtained for subsequent processing by maintaining a system processing process. Specifically, the update information in the first message queue can be obtained in sequence. When an update message is processed, the update message stored after the update message is obtained according to the first-in-first-out queue mechanism to process it.

[0051] By introducing a queue mechanism, update messages published by the data source are stored in a queue, rather than being directly processed when the data source is detected to have published an update message. This is because when a data source has a large number of subscribers, processing the update messages of the data source can easily cause congestion, making it impossible to respond to subsequent update messages in a timely manner.

[0052] Step S102: Determine the subscribed user corresponding to the data source.

[0053] As can be seen from the above, one data source may correspond to multiple subscribed users. When an update message is obtained from the queue and processed, the corresponding subscribed user is determined based on the data source recorded in the update message. In one embodiment, a user list is maintained for each data source, and the user list records all subscribed users who subscribe to the data source. For example, the subscribed users can be represented in the form of IDs, that is, each subscribed user corresponds to a unique ID, which can be generated at the time of registration. When a data source is determined, each subscribed user who subscribes to the data source can be confirmed by querying the user list of the data source. Figure 1b As shown, Figure 1b A schematic diagram of the correspondence between a data source and subscribed users provided in an embodiment of the present invention, data source 1 corresponds to user list 1, data source 2 corresponds to user list 2, and data source Z corresponds to user list Z, wherein user list 1 records corresponding subscribed users 11 to 1a, user list 2 records corresponding subscribed users 21 to 2b, and user list Z records corresponding subscribed users Z1 to Zc.

[0054] Step S103: Obtain the current timestamp and the historical timestamp of the last time the subscribed user queried for an update message.

[0055] In one embodiment, the time when each user last queried an update message is recorded, which is a historical timestamp, and the current timestamp is the current time of the acquired system. Exemplarily, a timestamp can be maintained for each user, and after the user queries an update message once, the corresponding recorded historical timestamp is updated. In this step, a new parameter, namely the concept of timestamp, is introduced when processing message data.

[0056] Step S104: Filter the subscribed users according to the relationship between the current timestamp and the historical timestamp.

[0057] In one embodiment, after determining the subscribers corresponding to the data source, the subscribers are screened according to the relationship between the historical timestamp and the current timestamp of each subscriber. Optionally, a preset time T can be set to screen out the subscribers whose difference between the current timestamp and the historical timestamp is less than the preset time T, that is, to filter out the subscribers who have not queried for updated messages for a long time. Exemplary preset time T can be 30 minutes, 2 hours, etc., and can be adaptively adjusted according to actual needs. Optionally, it is also possible to determine the corresponding preset time T based on the current timestamp, and the preset time T is associated with the current timestamp, such as from 0:00 to 8:00, the corresponding preset time T is 3 hours, and from 8:00 to 0:00, the corresponding preset time T is 30 minutes.

[0058] In this step, the subscribed users are screened by comparing the timestamps instead of batch processing all the subscribed users, so that the subsequent processing of the subscribed users is more targeted.

[0059] Step S105: updating the update list of the screened subscribed users according to the update content.

[0060] Each subscriber maintains an update list, which records the update messages published by the subscriber data source. In one embodiment, the update list of the selected subscribers is updated according to the update content recorded in the update message, while the update list of the subscribers discarded during the screening process is not updated, thereby significantly reducing the amount of data written.

[0061] Step S106, obtaining another update message in the first message queue, and repeating steps S102 to S105 until the update messages recorded in the first message queue are processed.

[0062] When the aforementioned step S105 is executed, another update message is taken out from the first message queue, and steps S102 to S105 are repeatedly executed until the update messages recorded in the first message queue are processed, and the corresponding processed update messages are removed from the queue. In one embodiment, in order to improve the data processing speed, multiple processes can be run simultaneously, and each process processes the update messages in a queue to further improve the data processing speed and throughput.

[0063] It can be seen from the above scheme that by setting up the message queue and screening the subscribed users, the blocking phenomenon when the data source publishes update messages is avoided, and the amount of data written is significantly reduced.

[0064] Figure 2 The flowchart of another message data processing method provided by the embodiment of the present invention provides an optimized processing mechanism for subscribed users. Figure 2 As shown, the technical solution is as follows:

[0065] Step S201: When it is detected that a data source publishes an update message, the update message is added to the first message queue.

[0066] Step S202: Obtain an update message recorded in the first message queue, where the update message includes a data source and associated update content.

[0067] Step S203: Determine a subscription user list corresponding to the data source.

[0068] Step S204: Determine the first N subscribers recorded in the subscriber list.

[0069] The subscriber list may contain multiple subscribers. Some popular data sources have a very large number of subscribers, some of which may reach millions or even tens of millions of subscribers. When this type of data source publishes an update message, a large amount of database resources will be occupied by updating the user list, which may easily cause delays in other data sources. In one embodiment, after obtaining the subscriber list, the first N subscribers recorded in the subscriber list are determined, where N can be 500, 1,000, 10,000 or 100,000, etc., and can be set according to actual needs. In this step, since the number of subscribers is partially intercepted (the first N subscribers) instead of processing all subscribers at once, it avoids the problem that a data source with too many subscribers will occupy resources when publishing update messages, thereby causing other data sources to be unable to obtain database resources.

[0070] Step S205: Obtain the current timestamp and the historical timestamps of the last time the first N subscribed users queried for update messages.

[0071] Accordingly, after determining the first N subscribers in the user list, the historical timestamps of the first N subscribers are obtained for subsequent further screening. Exemplarily, if the number of subscribers in the subscriber list is less than N, the historical timestamp of each user in the subscriber list is obtained.

[0072] Step S206: Filter the subscribed users according to the relationship between the current timestamp and the historical timestamp.

[0073] Step S207: updating the update list of the screened subscribed users according to the update content.

[0074] Step S208, determine whether the number of users recorded in the subscription user list is greater than N, if so, execute step S209, otherwise execute step S210.

[0075] In one embodiment, it is determined whether the number of users recorded in the subscription user list is greater than N. If it is greater than N, the part after the first N subscription users is recorded in another message queue for processing, such as Figure 2a As shown, Figure 2a A schematic diagram of a subscription user list provided for an embodiment of the present invention, wherein a total of K subscription users are recorded in the subscription user list. Among these K subscription users, the first N subscription users are updated during the first message queue processing, and the subscription users after N are exemplarily recorded in the second message queue. For an exemplary processing method, see step S209.

[0076] Step S209: Add the update message and the corresponding processing identifier to the second message queue.

[0077] The second message queue is another queue structure different from the first message queue, and similarly, it can be a first-in-first-out queue. Subscribers after the aforementioned N are processed in this queue.

[0078] In one embodiment, the update message obtained in the message queue and the corresponding processing identifier can be added to the second message queue. The processing identifier can be understood as a mark for determining unprocessed subscribed users. Specifically, during the queue entry process, a message body can be constructed, such as: update message 1 (data source 1, update content 1, S), where S is the processing identifier. Taking the example of the first N subscribed users being processed in the aforementioned steps, S here can be N+1, that is, the subscribed users from N+1 to K are recorded in the second message queue for processing.

[0079] The processing method of the update message in the second message queue is basically the same as that of the first message queue. After obtaining the update message, the subscription user list is determined, and the subscription users are screened before updating the update list. In the batch processing of subscription users, only N subscription users are screened. For the part of subscription users exceeding N, they are reinserted into the second message queue or recorded in the third message queue for processing, and so on.

[0080] Step S210: Get another update message in the first message queue, and repeat steps S203 to S209 until all update messages recorded in the first message queue are processed.

[0081] From the above scheme, it can be seen that by setting up a double queue, the subscribed users are processed in batches, as shown in the example below: Figure 2b As shown, Figure 2bA schematic diagram of a message queue provided for an embodiment of the present invention. As can be seen from the figure, the first message queue records update messages 1 to update messages W. When processing update message 1, the first N subscribers are screened, and the subscribers exceeding N are recorded in the second message queue; in the first message queue, after the first N subscribers are processed, update message 2 is obtained for processing. At this time, assuming that the number of subscribers corresponding to the data source in update message 2 does not exceed N, all its subscribers are screened for timestamp relationship; when processing update message 3 in the first message queue, the total number of subscribers corresponding to update message 3 is X, assuming that X is greater than N and less than 2N, the subscribers in update message 3 from N+1 to X are recorded in the second message queue for processing, and the same applies to update message 4; in the processing of the second message queue, assuming that when processing the subscribers in the N+1 to K part of update message 1, it is determined that K is greater than 2N, then 2N+1 to K are recorded in the second message queue. At this time, the first message queue is already processing update message 3, and update message 4 has not yet been processed, so the data schematic form of the message queue in the example figure is formed. By adopting a batch processing mechanism for subscription data, when the data source publishes an update message, each data source competes for database resources at the same time, reducing the update delay of the data source.

[0082] Figure 3 A flowchart of another message data processing method provided by an embodiment of the present invention. This embodiment can be applied to processing feed stream data to provide subscription and data update to users. The method can be executed by a message data processing device, such as a server, and specifically includes the following steps:

[0083] Step S301: When it is detected that a user queries for an update message, a current timestamp and a historical timestamp of the user's most recent query for an update message are obtained.

[0084] In the feed stream data implementation mechanism, users can initiate query requests at any time to query update messages. Different from the existing implementation mechanism, in this step, when it is detected that the user queries for update messages, the current timestamp and the historical timestamp of the user's most recent query for update messages are obtained. The explanation of the current timestamp and the historical timestamp can be found in step S103, which will not be repeated here.

[0085] Step S302: If the relationship between the current timestamp and the historical timestamp meets a first preset condition, determine the subscription data source corresponding to the user, and obtain an update message of the subscription data source for data feedback.

[0086] Among them, the first preset condition can be that the difference between the current timestamp and the historical timestamp is greater than the preset time T. The exemplary preset time T can be 30 minutes, 2 hours, etc., and can be adaptively adjusted according to actual needs. Optionally, it can also be that the corresponding preset time T is determined according to the current timestamp, and the preset time T is associated with the current timestamp, such as from 0:00 to 8:00, the corresponding preset time T is 3 hours, and from 8:00 to 0:00, the corresponding preset time T is 30 minutes.

[0087] If the difference between the current timestamp and the historical timestamp is greater than the preset time T, the subscription data source corresponding to the user is determined, and the update message of the subscription data source is obtained for data feedback. Specifically, after the subscription data source corresponding to the user is determined, the update message of each subscription data source is taken out from the database and added to the user's update list, and the update list content is fed back to the user.

[0088] Step S303: If the relationship between the current timestamp and the historical timestamp meets a second preset condition, read the update list corresponding to the user to perform data feedback.

[0089] Among them, the second preset condition can be that the difference between the current timestamp and the historical timestamp is not greater than the preset time T. The exemplary preset time T can be 30 minutes, 2 hours, etc., and can be adaptively adjusted according to actual needs. Optionally, it can also be that the corresponding preset time T is determined according to the current timestamp, and the preset time T is associated with the current timestamp, such as from 0:00 to 8:00, the corresponding preset time T is 3 hours, and from 8:00 to 0:00, the corresponding preset time T is 30 minutes.

[0090] If the difference between the current timestamp and the historical timestamp is not greater than the preset time T, the update list corresponding to the user is read for data feedback.

[0091] It can be seen from the above scheme that when it is detected that a user queries for an update message, the current timestamp and the historical timestamp of the user's most recent query for an update message are obtained. By comparing the current timestamp with the historical timestamp, different methods are used for data feedback, and the query mechanism for update messages is optimized. For situations where the query time interval is short, data feedback is performed by reading the update list. For situations where the query time interval is long, data feedback is performed by reading the update message of the subscription data source. This is superior to the existing mechanism of using a pull model or a push model alone for update message feedback.

[0092] Correspondingly, based on the above technical solution, in the process of responding to the user's query request, it also includes the step of updating the user's historical timestamp, that is, updating the current timestamp to the historical timestamp corresponding to the user.

[0093] Figure 4 The flowchart of another message data processing method provided by the embodiment of the present invention further optimizes the mechanism of responding to the user's query request. Figure 4 As shown, the technical solution is as follows:

[0094] Step S401: When it is detected that a user queries for update messages, a current timestamp and a historical timestamp of the user's most recent query for update messages are obtained.

[0095] Step S402: determine whether the difference between the current timestamp and the historical timestamp is greater than a preset time T. If yes, execute step S403; otherwise, execute step S404.

[0096] Step S403: determine the subscription data source corresponding to the user, obtain a preset number of update messages from the subscription data source, and add the update messages to the update list corresponding to the user for data feedback.

[0097] In one embodiment, after determining the subscription data source of the user, a preset number (exemplarily, 3, 5, or 10, etc.) of update messages in the subscription data source are taken, and the update messages are added to the update list corresponding to the user for data feedback. The preset number of update messages can be determined according to the update time of the update messages, such as selecting the 5 update messages with the latest update time in each subscription data source.

[0098] Step S404: read the update list corresponding to the user, update the data of the subscription data source that meets the update condition in the update list, and feed back the updated update list.

[0099] In the update list corresponding to each user, the recorded content exemplarily includes subscription data sources and corresponding update data. For example, user 1 corresponds to an update list 1, in which subscription data sources 1 to subscription data sources P are recorded, and each subscription data source is associated with corresponding update data.

[0100] In response to the user's query request, different from the conventional way of updating the update list, in this step, the subscription data sources in the update list that meet the update condition are updated. The update condition may be, for example, updating the update data of important subscription data sources, or updating the update data of subscription data sources with high activity.

[0101] Step S405: Update the current timestamp to the historical timestamp corresponding to the user.

[0102] It can be seen from the above scheme that when adding update messages of subscription data sources, a preset number of update messages are added instead of adding all update messages of subscription data sources, thereby reducing the access volume of data resources and improving the response speed to user query requests. At the same time, when updating the update list, the data of the subscription data sources that meet the update conditions in the update list are updated, which reduces data writing and saves storage space.

[0103] In another embodiment, the above step S404 is further limited, and the specific process is as follows: Figure 4a As shown, Figure 4a A flowchart of determining a header data source list and updating the update list based on the list provided by an embodiment of the present invention is as follows:

[0104] Step S4041: Determine the data update volume and the number of subscribed users corresponding to each data source.

[0105] Step S4042: Generate a header data source list according to the data update volume and / or the subscribed user data volume, and update it regularly.

[0106] Exemplarily, for each subscription data source, the amount of data updates within a period of time t (t can be 1 day, 3 days or a week, etc.) is recorded as tn, and the number of subscribed users is recorded as u. A header data source list is generated based on the data update amount and the amount of subscribed user data, and statistics are performed on each subscription data source to obtain a statistical value tsum, and tsum can be calculated as tsum=tn*u. After obtaining tsum, each subscription data source is sorted according to the size of the tsum value, and the first v subscription data sources in the sorting result are determined as header data sources to form a header data source list.

[0107] In another embodiment, the method for determining the header data source list may also be: determining the activity tq of each subscription data source, and the method for determining the activity tp may be determined based on the increment in the number of subscribed users and the number of comment forwardings. For example, the increment in the number of subscribed users is recorded as tg, and the number of comment forwardings is recorded as tr. The activity tp = tg*tr. Similarly, after obtaining tp, each subscription data source is sorted according to the size of the tp value, and the first v subscription data sources in the sorting result are determined as header data sources to form a header data source list.

[0108] Step S4043: Compare the subscription data source in the update list with the header data source recorded in the system, and obtain the update message of the subscription data source that matches the comparison to update the data.

[0109] In one embodiment, by utilizing a header data source list that is generated and regularly maintained, when the update list is updated, data is updated for the subscription data source recorded in the update list that is consistent with the header data source, thereby reducing data writing and storage space usage, and update messages of the header data source can also be viewed in real time.

[0110] Based on the above technical solution, it also includes: if it is regularly detected that the relationship between the current timestamp and the historical timestamp meets the third preset condition, the data record in the update list is cleared. The third preset condition may be that the difference between the current timestamp and the historical timestamp is greater than a preset time D, and the preset time D may be 3 days, a week, or two weeks, etc., and the regular time period may be 5 days, two weeks, or a month, etc. Thus, the data records that exceed a certain time are deleted, and the storage space is further released.

[0111] Figure 5 This is a structural block diagram of a message data processing device provided by an embodiment of the present invention. The device is used to execute the message data processing method provided by some of the above embodiments, and has the corresponding functional modules and beneficial effects of the execution method. Figure 5 As shown, the device specifically includes: a message acquisition module 101, a user determination module 102, a timestamp recording module 103, a user screening module 104 and a message updating module 105, wherein:

[0112] The message acquisition module 101 is used to acquire an update message recorded in the first message queue, wherein the update message includes a data source and associated update content;

[0113] A user determination module 102, used to determine a subscribed user corresponding to the data source;

[0114] The timestamp recording module 103 is used to obtain the current timestamp and the historical timestamp when the subscribed user last queried the update message;

[0115] A user screening module 104, screening the subscribed users according to the relationship between the current timestamp and the historical timestamp;

[0116] The message updating module 105 is used to update the update list of the screened subscribed users according to the update content.

[0117] As can be seen from the above scheme, this scheme allows users to query update messages without accessing a large number of data sources, and can get timely responses. The maintenance of the update list is more targeted, reducing data writing and saving storage space. At the same time, it optimizes the resource allocation of the database, so that data sources with fewer subscribers can also be reasonably allocated to database resources, avoiding the problem of delayed release of some data sources when publishing update messages.

[0118] In a possible embodiment, the device further includes: a message inserting module 106, which is used to add an update message recorded in the first message queue to the first message queue when it is detected that the data source publishes the update message before acquiring the update message recorded in the first message queue.

[0119] In a possible embodiment, the user determination module 102 is specifically configured to:

[0120] Determine a list of subscribers corresponding to the data source;

[0121] The timestamp recording module 103 is specifically used for:

[0122] Determine the first N subscribers recorded in the subscriber list, where N is an integer greater than 0;

[0123] Get the current timestamp and the historical timestamp of the last time the first N subscribers queried for update messages.

[0124] In a possible embodiment, the message insertion module 106 is further configured to:

[0125] After determining the first N subscribers recorded in the subscriber list, the update message and the corresponding processing identifier are added to the second message queue.

[0126] Figure 6 This is a structural block diagram of another message data processing device provided by an embodiment of the present invention, which is used to execute the message data processing method provided by some of the above embodiments, and has the corresponding functional modules and beneficial effects of the execution method. Figure 6 As shown, the device specifically includes: a timestamp recording module 201, a first message query module 202 and a second message query module 203, wherein:

[0127] The timestamp recording module 201 is used to obtain the current timestamp and the historical timestamp of the last time the user queried the update message when detecting that the user queried the update message;

[0128] A first message query module 202 is configured to determine a subscription data source corresponding to the user and obtain an update message of the subscription data source for data feedback if the relationship between the current timestamp and the historical timestamp meets a first preset condition;

[0129] The second message query module 203 is used to read the update list corresponding to the user for data feedback if the relationship between the current timestamp and the historical timestamp meets a second preset condition.

[0130] As can be seen from the above scheme, this scheme allows users to query update messages without accessing a large number of data sources, and can get timely responses. The maintenance of the update list is more targeted, reducing data writing and saving storage space. At the same time, it optimizes the resource allocation of the database, so that data sources with fewer subscribers can also be reasonably allocated to database resources, avoiding the problem of delayed release of some data sources when publishing update messages.

[0131] In a possible embodiment, the first message query module 202 is specifically used to:

[0132] Obtaining a preset number of update messages from the subscription data source;

[0133] The update message is added to the update list corresponding to the user for data feedback.

[0134] In a possible embodiment, the second message query module 203 is specifically used to:

[0135] Read the update list corresponding to the user;

[0136] Update data of the subscription data sources in the update list that meet the update conditions;

[0137] Feedback the updated list of updates.

[0138] In a possible embodiment, the second message query module 203 is specifically used to:

[0139] Comparing the subscription data source in the update list with the header data source of the system record;

[0140] Get the update message of the subscription data source that is consistent with the comparison to update the data.

[0141] In a possible embodiment, the device further includes a header data source generating module 204, which is specifically used to:

[0142] Determine the amount of data updates and the number of subscribers corresponding to each data source;

[0143] A header data source list is generated according to the data update volume and / or the subscribed user data volume, and is updated regularly.

[0144] In a possible embodiment, the first preset condition includes: a difference between the current timestamp and the historical timestamp is greater than a preset time T;

[0145] The second preset condition includes:

[0146] The difference between the current timestamp and the historical timestamp is not greater than the preset time T.

[0147] In a possible embodiment, the device further includes: a data cleaning module 205, specifically configured to:

[0148] If it is regularly detected that the relationship between the current timestamp and the historical timestamp meets a third preset condition, the data record in the update list is cleared.

[0149] Figure 7 A structural diagram of a message data processing device provided by an embodiment of the present invention, such as Figure 7 As shown, the device includes a processor 301, a memory 302, an input device 303 and an output device 304; the number of processors 301 in the device can be one or more. Figure 7 A processor 301 is taken as an example; the processor 301, memory 302, input device 303 and output device 304 in the device can be connected by a bus or other means. Figure 7 The example of connecting via a bus is taken. The memory 302, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the message data processing method in the embodiment of the present invention. The processor 301 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 302, that is, implements the above-mentioned message data processing method. The input device 303 can be used to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 304 may include a display device such as a display screen.

[0150] An embodiment of the present invention further provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a message data processing method when executed by a computer processor, the method comprising:

[0151] Obtain an update message recorded in the first message queue, wherein the update message includes a data source and associated update content;

[0152] Determine a subscriber corresponding to the data source;

[0153] Get the current timestamp and the historical timestamp of the last time the subscribed user queried for update messages;

[0154] Filtering the subscribed users according to the relationship between the current timestamp and the historical timestamp;

[0155] updating the update list of the screened subscribed users according to the update content;

[0156] Obtain another update message in the first message queue, and repeat the above processing steps until the update messages recorded in the first message queue are processed;

[0157] When detecting that a user queries for an update message, obtaining a current timestamp and a historical timestamp of the user's most recent query for an update message;

[0158] If the relationship between the current timestamp and the historical timestamp meets a first preset condition, determining the subscription data source corresponding to the user, and obtaining an update message of the subscription data source for data feedback;

[0159] If the relationship between the current timestamp and the historical timestamp meets a second preset condition, the update list corresponding to the user is read for data feedback.

[0160] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the embodiments of the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the embodiments of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the embodiments of the present invention.

[0161] It is worth noting that in the embodiment of the above-mentioned message data processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.

[0162] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention are described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims

1. A message data processing method, characterized in that: include: Step 1: Obtain an update message recorded in the first message queue, wherein the update message includes a data source and associated update content; Step 2: Determine the subscriber corresponding to the data source; Step 3: Obtain the current timestamp and the historical timestamp of the last time the subscribed user queried for update messages; Step 4: Filter the subscribed users according to the relationship between the current timestamp and the historical timestamp; Step 5: Update the update list of the filtered subscription users according to the update content, so that when it is detected that the user queries for update messages, the current timestamp and the historical timestamp of the user's most recent query for update messages are obtained. If the difference between the current timestamp and the historical timestamp of the user's most recent query for update messages is not greater than a preset time T, the update list corresponding to the user is read, and data of the subscription data source that meets the update condition in the update list is updated, and the updated update list is fed back; Step 6: Get another update message in the first message queue, and repeat steps 2 to 5 until all update messages recorded in the first message queue are processed.

2. The method according to claim 1, characterized in that Before obtaining an update message recorded in the first message queue, the method further includes: When it is detected that the data source publishes an update message, the update message is added to the first message queue.

3. The method according to claim 1 or 2, characterized in that: The determining the subscriber corresponding to the data source includes: Determine a list of subscribers corresponding to the data source; Accordingly, the obtaining of the current timestamp and the historical timestamp of the last time the subscribed user queried for an update message includes: Determine the first N subscribers recorded in the subscriber list, where N is an integer greater than 0; Get the current timestamp and the historical timestamp of the last time the first N subscribers queried for update messages.

4. The method according to claim 3, characterized in that After determining the first N subscribers recorded in the subscriber list, the method further includes: The update message and the corresponding processing identifier in step 1 are added to the second message queue for updating the update list, wherein the processing identifier is used to mark the subscribers in the subscriber list who have not been updated.

5. A message data processing method, characterized in that: include: When detecting that a user queries for an update message, obtaining a current timestamp and a historical timestamp of the user's most recent query for an update message; If the difference between the current timestamp and the historical timestamp is greater than a preset time T, the subscription data source corresponding to the user is determined, a preset number of update messages in the subscription data source are obtained, and the update messages are added to the update list corresponding to the user for data feedback; If the difference between the current timestamp and the historical timestamp is not greater than the preset time T, the update list corresponding to the user is read, data of the subscription data source that meets the update condition in the update list is updated, and the updated update list is fed back.

6. The method according to claim 5, characterized in that The updating of data of the subscription data source in the update list that meets the update condition includes: Comparing the subscription data source in the update list with the header data source of the system record; Get the update message of the subscription data source that is consistent with the comparison to update the data.

7. The method according to claim 6, characterized in that Also includes: Determine the amount of data updates and the number of subscribers corresponding to each data source; A header data source list is generated according to the data update volume and / or the subscribed user data volume, and is updated regularly.

8. The method according to any one of claims 5 to 7, characterized in that: Also includes: If it is regularly detected that the difference between the current timestamp and the historical timestamp is greater than a preset time D, the data record in the update list is cleared.

9. A message data processing device, characterized in that: include: A message acquisition module, used to acquire an update message recorded in the first message queue, wherein the update message includes a data source and associated update content; A user determination module, used to determine a subscribed user corresponding to the data source; A timestamp recording module is used to obtain the current timestamp and the historical timestamp of the last time the subscribed user queried the update message; A user screening module, screening the subscribed users according to the relationship between the current timestamp and the historical timestamp; A message updating module, used to update the update list of the screened subscribed users according to the update content; The message data processing device is also used to obtain the current timestamp and the historical timestamp of the user's most recent query for update messages when it is detected that the user queries for update messages. If the difference between the current timestamp and the historical timestamp of the user's most recent query for update messages is not greater than a preset time T, the update list corresponding to the user is read, data is updated for the subscription data source in the update list that meets the update conditions, and the updated update list is fed back.

10. A message data processing device, characterized in that: include: A timestamp recording module is used to obtain the current timestamp and the historical timestamp of the user's most recent query for update messages when detecting that the user queries for update messages; A first message query module is used to determine the subscription data source corresponding to the user if the difference between the current timestamp and the historical timestamp is greater than a preset time T, obtain a preset number of update messages from the subscription data source, and add the update messages to the update list corresponding to the user for data feedback; The second message query module is used to read the update list corresponding to the user if the difference between the current timestamp and the historical timestamp is not greater than the preset time T, update the subscription data source that meets the update condition in the update list, and feed back the updated update list.

11. A message data processing device, the device comprising: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the message data processing method according to any one of claims 1-8.

12. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the message data processing method according to any one of claims 1 to 8 when executed by a computer processor.

Citation Information

Patent Citations

  • Message push method and device

    CN105847447A

  • Application information push method and device, computer equipment and storage medium

    CN107733968A