Message broadcasting method, device, electronic device and storage medium

By obtaining and updating target change data and timestamps in message broadcasts, and broadcasting based on timestamp order, the traffic overload problem caused by message broadcasts is solved, and efficient information transmission and system load management are achieved.

CN112764951BActive Publication Date: 2024-09-20GUANGZHOU FANGGUI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110113077.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-27
Publication Date
2024-09-20
Estimated Expiration
2041-01-27

AI Technical Summary

Technical Problem

In a network environment, when messages are broadcast, it is easy for the instantaneous traffic to exceed the system processing limit, affecting the efficiency and normal interaction of the business system.

Method used

By obtaining the target change data and change timestamp within the broadcast time interval, update the data set in the message queue, and broadcast based on the timestamp order to reduce unnecessary message transmission.

Benefits of technology

It effectively reduces the number of broadcast messages, reduces traffic usage and system load during peak hours, ensures that only information that the target object actually cares about is transmitted, and meets normal interaction needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112764951B
    Figure CN112764951B
Patent Text Reader

Abstract

The present application discloses a message broadcasting method, device, electronic device and storage medium, and relates to the field of computer technology. The method includes: obtaining target change data within the broadcast time interval and the change timestamp corresponding to the target change data; based on the target change data and the corresponding change timestamp, updating the target data set in the message queue to obtain an updated data set; based on the order of the timestamps corresponding to each element in the updated data set, broadcasting the content corresponding to each element in sequence. The present application broadcasts some messages by updating the target data set, which can reduce the number of broadcast messages while satisfying normal interaction, effectively reduce the traffic occupied by broadcast messages during peak hours, reduce the situation where the instantaneous traffic exceeds the system processing limit, and reduce the system load.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a message broadcasting method, device, electronic device and storage medium. Background Art

[0002] Broadcasting messages is a common way of sending messages in a network environment, and is mainly applicable to scenarios where the same message needs to be sent to multiple objects. However, in the related art, when broadcasting messages, there is a situation where the instantaneous flow exceeds the system processing limit, thereby affecting the business system. Summary of the invention

[0003] In view of the above problems, the embodiments of the present application propose a message broadcasting method, device, electronic device and storage medium to improve the above problems.

[0004] In the first aspect, an embodiment of the present application provides a message broadcasting method, the method comprising: obtaining target change data within a broadcast time interval and a change timestamp corresponding to the target change data; based on the target change data and the corresponding change timestamp, updating the target data set in the message queue to obtain an updated data set; based on the order of the timestamps corresponding to each element in the updated data set, broadcasting the content corresponding to each element in turn.

[0005] In the second aspect, the embodiment of the present application provides a message broadcasting device, which includes: a data acquisition module, a data set update module and a content broadcasting module. Among them, the data acquisition module is used to obtain the target change data and the change timestamp corresponding to the target change data within the broadcast time interval; the data set update module is used to update the target data set in the message queue based on the target change data and the corresponding change timestamp to obtain an updated data set; the content broadcasting module is used to broadcast the content corresponding to each element in the updated data set in sequence based on the order of the timestamps corresponding to each element.

[0006] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the above method.

[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, wherein the above method is executed when the program code is executed by a processor.

[0008] In a fifth aspect, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above method.

[0009] A message broadcasting method, device, electronic device and storage medium provided by the embodiments of the present application, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, first update the target data set in the message queue based on the target change data and the corresponding change timestamp to obtain an updated data set, and then broadcast the content corresponding to each element in the updated data set in sequence based on the order of the timestamps corresponding to each element. Since what is broadcast is the elements in the updated data set, and the updated data set is obtained by updating the target data set in the message queue based on the target change data obtained within the preset broadcast time period and the corresponding change timestamp, the present application can broadcast part of the messages by updating the target data set based on the characteristics of the correlation between the data, that is, not all the target update data will be broadcast. Compared with the traditional message queue broadcasting method of broadcasting all the change data, the number of broadcast messages can be reduced, and the traffic occupancy of broadcast messages during peak hours can be effectively reduced, the situation where the instantaneous traffic exceeds the system processing limit can be reduced, and the system load can be reduced. At the same time, again, since part of the messages are broadcast by updating the target data set in the present application, the messages finally broadcast are all of actual concern to the target objects, and even if only part of the messages are broadcast, the needs of normal interaction can be met. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic diagram showing an application environment proposed in an embodiment of the present application is shown;

[0012] Figure 2 A flow chart of a message broadcasting method proposed in one embodiment of the present application is shown;

[0013] Figure 3 A flowchart of another message broadcasting method proposed in an embodiment of the present application is shown;

[0014] Figure 4 Shows Figure 3 A flowchart of an implementation of S230 in a message broadcasting method proposed in the illustrated embodiment;

[0015] Figure 5 Shows Figure 3 A schematic diagram of a flow chart of S230 in a message broadcasting method proposed in the illustrated embodiment;

[0016] Figure 6 A schematic diagram of a first data set proposed in an embodiment of the present application is shown;

[0017] Figure 7 A flowchart of another message broadcasting method proposed in an embodiment of the present application is shown;

[0018] Figure 8 A schematic diagram of the internal structure of a message queue proposed in an embodiment of the present application is shown;

[0019] Fig. 9 A schematic diagram of the structure of a message broadcasting system proposed in one embodiment of the present application is shown;

[0020] Fig.10 A flowchart of another message broadcasting method proposed in an embodiment of the present application is shown;

[0021] Fig.11 A block diagram of a message broadcasting device proposed in an embodiment of the present application is shown;

[0022] Fig.12 A structural block diagram of an electronic device for executing a message broadcasting method according to an embodiment of the present application is shown;

[0023] Fig.13 A storage unit for storing or carrying program codes for implementing a message broadcasting method according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] Various data are generated in the network environment. In scenarios where data interaction exists, these data can be sent from one node to another as messages. Among them, some data needs to be sent to multiple objects uniformly. Such data is usually not specific, that is, the data sent to each object is the same. For such data, it can usually be sent by broadcasting.

[0026] For example, in the scenario of channel message sending in a live broadcast application, some data in the channel needs to be sent as messages to all users in the channel, such as data generated by VIP users entering and leaving the channel. In this case, the message can be sent by broadcasting in the channel.

[0027] For example, in a commodity auction scenario in an e-commerce system, the data generated by each user's auction operation for a certain commodity needs to be sent as a message to all users related to the auction. For example, user A's price increase operation for commodity A needs to be sent to all users related to the auction so that each user can understand the commodity price.

[0028] Sending messages by broadcasting can simplify the processing logic of back-end services. However, the inventors have studied the methods of related message broadcasting and found that when broadcasting simplifies the back-end service processing, there is an obvious traffic expansion phenomenon, and this expansion increases with the increase in the number of objects that need to send messages. If there is no restriction on broadcast messages, it is easy to cause instantaneous high traffic. Once the instantaneous traffic reaches the system processing limit, it will not only affect the system processing efficiency, but also may affect other services in the business system.

[0029] There are some general solutions for flow control in related technologies. For example, unprocessed messages are temporarily stored through message queues, and then the system processes the messages according to the processing capabilities of its own services. However, most messages are time-sensitive. Therefore, in time-sensitive scenarios, a timeout period needs to be added. Messages that exceed the processing capacity and time out may be discarded. This causes the traditional message queue method to discard messages, thereby affecting normal interaction.

[0030] In order to improve the above problems, the inventor studied the content of the message and found that some data are actually related to each other. Take the channel message sending scenario in the live broadcast application as an example. For example, in the scenario where VIP users enter and exit the channel, VIP user A and VIP user B may enter and exit the same channel. The correlation between the data in this example is that the same channel; for another example, VIP user A may enter and exit the channel multiple times in a short period of time. The correlation between the data in this example is that the same user.

[0031] Based on the discovery of the correlation between the above data, the inventors further thought and found that if the channel is regarded as a dimension, then the operations of each VIP user under the same channel can be aggregated into one message for broadcast, thereby reducing the number of messages; and if the same VIP user is regarded as a dimension, then the same VIP user generates channel entry and exit data at different time points, but considering that the business level only cares about the most recent user behavior, therefore, the multiple operations of the VIP user before the next message broadcast are aggregated into one message for broadcast, that is, the latest data of the VIP user before the next message broadcast is taken, thereby reducing the number of messages.

[0032] Therefore, the inventor proposed the message broadcasting method, device, electronic device and storage medium provided in the present application. In this method, after obtaining the target change data and the change timestamp corresponding to the target change data within the broadcast time interval, the target data set in the message queue is first updated based on the target change data and the corresponding change timestamp to obtain an updated data set, and then based on the order of the timestamps corresponding to each element in the updated data set, the content corresponding to each element is broadcast in sequence.

[0033] In the aforementioned method, since what is broadcast is the elements in the updated data set, and the updated data set is obtained by updating the target data set in the message queue based on the target change data obtained within the preset broadcast time period and the corresponding change timestamp, the present application can broadcast part of the messages by updating the target data set based on the characteristics of the correlation between the data, that is, not all the target updated data will be broadcast. Compared with the traditional message queue broadcasting method of broadcasting all the changed data, the number of broadcast messages can be reduced. At the same time, again, since part of the messages are broadcast by updating the target data set in the present application, the messages finally broadcast are all of actual concern to the target objects, so even if only part of the messages are broadcast, the needs of normal interaction can be met.

[0034] Before further describing the embodiments of the present application in detail, an application environment involved in the embodiments of the present application is introduced.

[0035] like Figure 1 As shown, Figure 1 The schematic diagram of an application environment proposed in the embodiment of the present application is shown. It includes a server 110 and a client 120 connected to the network. The number of the client 120 is multiple. Figure 1 Only two are used as examples for illustration.

[0036] The server 110 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The electronic device where the client 120 is located may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, etc., but is not limited thereto.

[0037] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0038] See also Figure 2 , Figure 2 The flowchart of a message broadcasting method proposed in an embodiment of the present application is shown. The method can be applied to a server. The method includes:

[0039] S110, acquiring target change data within a broadcast time interval and a change timestamp corresponding to the target change data.

[0040] It is understandable that after the target object of the operation client initiates the business operation, the business data will be changed. Therefore, the target change data can refer to the business data that has changed after the target object initiates the business operation. Among them, the change timestamp corresponding to the target change data refers to the timestamp when the business data is changed.

[0041] For example, in the scenario of channel message sending in the live broadcast application mentioned above, user A corresponding to the client may initiate a business operation to enter channel 1, which results in a change in user data in the business data in channel 1. Therefore, target change data can be generated. At this time, the target change data may include: user A enters channel 1.

[0042] For another example, in the commodity auction scenario in the e-commerce system mentioned above, user A corresponding to the client may initiate a business operation to bid for commodity 1, which will cause the auction price data in the business data of commodity 1 to change. Therefore, target change data can be generated. At this time, the target change data may include: user A bids for commodity 1.

[0043] It should be noted that the object of initiating business operations on the client side can be not only a normal user, but also AI (Artificial Intelligence) in some virtual and cheating situations. That is, the business operations initiated by AI on the client side may also generate target change data.

[0044] As can be seen from the above content, the traditional message queue can only temporarily store unprocessed messages, and then process the messages according to the processing capacity of its own service. After broadcasting the previous message in the message queue, it immediately broadcasts the next message, and so on. In essence, the messages to be sent are not processed, and only the messages that exceed the processing capacity and time out are discarded, which affects the normal interaction while controlling the flow. Therefore, in order to avoid excessive instantaneous traffic and exceed the system processing limit without affecting normal interaction, that is, to achieve the effect of flow control, the time interval for each broadcast message can be pre-set, first obtain the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, and then process the target change data within the broadcast time interval before broadcasting.

[0045] There are multiple ways to obtain the target change data and the change timestamp corresponding to the target change data within the broadcast time interval. Optionally, it can be obtained in real time, that is, each time a business data change is detected, the target change data is obtained; optionally, all target change data within the broadcast time interval can be obtained when the broadcast time interval arrives.

[0046] The time interval between each broadcast message can be determined based on the time delay that the user can tolerate and the maximum number of short-time messages that the system can process.

[0047] For scenarios that are not so sensitive to time delays, that is, users can tolerate larger time delays, for example, in the scenario of channel message sending in the live broadcast application mentioned above, users can tolerate larger time delays. For example, even if there is a delay of 3 seconds or 5 seconds, it will not have any impact on the user experience. In this scenario, the time interval for broadcasting messages can be set to a larger value.

[0048] For scenarios that are more sensitive to time delays, that is, users can tolerate smaller time delays, for example, in the commodity auction scenario in the e-commerce system mentioned above, users can tolerate smaller time delays, such as a delay of 3 seconds or 5 seconds, which will affect the user's re-bidding behavior and cause losses. In this scenario, the time interval for broadcasting messages can be set to a smaller value, for example, it can be set to 0.5 seconds.

[0049] In addition, the time interval for broadcasting messages can also be determined based on the maximum amount of messages that the system can tolerate in a short period of time. For example, the maximum amount of messages that the system can tolerate within 3 seconds is 300MB. If the number of messages in a short period of time is large and exceeds 300MB, the time interval for broadcasting messages can be set to a smaller value. For example, 2 seconds can be selected as the time interval for broadcasting messages to avoid selecting 3 seconds as the time interval for broadcasting messages, thereby avoiding the number of messages exceeding the maximum amount that the system can tolerate in a short period of time.

[0050] By adopting the method of the embodiment of the present application, by changing the broadcast time interval, it is possible to adapt to systems with different time delays or system bandwidths.

[0051] S120, based on the target change data and the corresponding change timestamp, update the target data set in the message queue to obtain an updated data set.

[0052] Among them, the target data set refers to the data set in the message queue corresponding to the target change data. The number of target sets can be 1 or more. Each target data set includes multiple elements, and the target change data corresponds to an element in the target set.

[0053] Therefore, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, the target data set in the message queue can be updated to obtain an updated data set.

[0054] Among them, combined with the above content, it can be known that the method of obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data can be real-time acquisition, or all target change data within the broadcast time interval can be obtained when the broadcast time interval arrives.

[0055] Therefore, for the case of obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data in real time, the target data set in the message queue is updated accordingly. Each time the target change data within the broadcast time interval and the change timestamp corresponding to the target change data are obtained, the target data set in the message queue is updated once, and finally an updated data set is obtained.

[0056] As for the case where all target change data within the broadcast time interval is obtained when the broadcast time interval arrives, the target data set in the message queue is updated accordingly by selecting the target update data with the largest timestamp from the target update data corresponding to each element in the target data set, and using the target update data with the largest timestamp to update the corresponding target data set, and finally obtaining the updated data set.

[0057] It can be understood that updating the target data set in the message queue may specifically be updating the corresponding elements in the target data set.

[0058] As one approach, each element in the updated data set may include target change data and a corresponding change timestamp.

[0059] S130, broadcasting the content corresponding to each element in the updated data set in sequence based on the sequence of timestamps corresponding to each element.

[0060] The timestamp corresponding to each element in the updated data set may be understood as the change timestamp corresponding to each element in the updated data set.

[0061] In order to allow earlier updated messages in the message queue to be broadcast earlier within the broadcast time interval, in this embodiment, the content corresponding to each element in the updated data set may be broadcast in sequence based on the order of the timestamps corresponding to each element in the updated data set.

[0062] As a method, the order of the timestamps corresponding to the elements in the updated data set can be obtained by taking out all the elements in a set from a message queue and then sorting them according to the size of the timestamps between the elements.

[0063] As another way, the order of timestamps corresponding to the elements in the updated data set can also be obtained by automatically arranging the message queue. In this case, the set in the message queue can be an ordered set, and the ordered set can automatically sort the elements in the set according to the requirements, and the above-mentioned function of sorting according to timestamps is realized through the ordered set.

[0064] The present application provides a message broadcasting method, after obtaining the target change data and the change timestamp corresponding to the target change data within the broadcast time interval, first based on the target change data and the corresponding change timestamp, the target data set in the message queue is updated to obtain the updated data set, and then based on the order of the timestamps corresponding to the elements in the updated data set, the content corresponding to each element is broadcasted in sequence. Since the elements in the updated data set are broadcasted, and the updated data set is obtained by updating the target data set in the message queue based on the target change data and the corresponding change timestamp obtained within the preset broadcast time period, the present application can broadcast part of the message by updating the target data set based on the characteristics of the correlation between the data, that is, not broadcasting all the target update data, compared with the traditional message queue broadcasting method of broadcasting all the change data, it can reduce the number of broadcast messages, effectively reduce the traffic occupation of the broadcast message at peak time, reduce the situation where the instantaneous traffic exceeds the system processing limit, and reduce the system load. At the same time, again, since the present application broadcasts part of the message by updating the target data set, the messages finally broadcasted are all the actual concerns of the target object, so even if only part of the message is broadcast, it can meet the needs of normal interaction.

[0065] In addition, based on the above content, it can be seen that the correlation between data can be associated in many ways.

[0066] As a method, the correlation between data can be based on the target identifier between data, where the target identifier refers to the identifier of the target object. For example, in the scenario where a VIP user enters and exits a channel, the target identifier can be the VIP user identifier, that is, the correlation between data lies in the VIP user identifier. For another example, in the scenario where a product is auctioned in an e-commerce system, the target identifier can be the user identifier participating in the auction, that is, the correlation between data lies in the user identifier participating in the auction.

[0067] As a method, the correlation between data can be based on the attribute identification between data, where the attribute identification refers to the identification of the attribute of the business object targeted in the business operation initiated by the target object. For example, in the scenario of VIP users entering and exiting the channel, the attribute identification can be the channel identification, that is, the correlation between data lies in the channel identification. For another example, in the scenario of commodity auction in the e-commerce system, the attribute identification can be the identification of the commodity participating in the auction, that is, the correlation between data lies in the identification of the commodity participating in the auction.

[0068] Therefore, different message broadcasting methods can be used depending on the relevance between data.

[0069] See also Figure 3 , Figure 3The flowchart of a message broadcast method proposed in another embodiment of the present application is shown. In the method, the correlation between the data mainly considered is the target identifier. In this case, the target change data includes the target identifier, and each first element in the first data set corresponds to a target identifier. The method may include:

[0070] S210, obtaining target change data within a broadcast time interval and a change timestamp corresponding to the target change data.

[0071] S220: Search the first data set for a target first element having the same target identifier as the target changed data.

[0072] The first data set refers to a set in the message queue for storing first elements, and each first element in the first data set may include a target identifier, data content corresponding to the target identifier, and a timestamp corresponding to the target identifier. Therefore, each first element in the first data set corresponds to a target identifier.

[0073] The target first element refers to the first element in the first data set that has the same target identifier as the target changed data.

[0074] Therefore, in order to subsequently update the target content and timestamp included in the target first element based on the target change data and the corresponding change timestamp, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, the target first element with the same target identifier as the target change data can be searched from the first data set.

[0075] In a specific example, for example, in a scenario where a VIP user enters and exits a channel, it is assumed that the first data set includes three first elements, the first element 1 is used to store the data content corresponding to VIP user A and the timestamp of the data content being generated, the first element 2 is used to store the data content corresponding to VIP user A and the timestamp of the data content being generated, the first element 3 is used to store the data content corresponding to VIP user C and the timestamp of the data content being generated. If the target identifier of the target change data is VIP user A, the first element 1 for storing the data content of VIP user A and the timestamp of the data content being generated is found from the first data set.

[0076] S230: Based on the target change data and the corresponding change timestamp, update the target content and timestamp included in the target first element to obtain an updated first data set.

[0077] Since the target first element includes the target content and timestamp, after obtaining the target change data and the corresponding change timestamp, the target content and timestamp included in the target first element can be updated based on the target change data and the corresponding change timestamp to obtain the updated first data set.

[0078] As a method, the target content included in the first element can be replaced by the target change data, and the timestamp included in the first element can be replaced by the change timestamp, so as to update the target content and timestamp included in the target first element.

[0079] As another way, Figure 4 As shown, based on the target change data and the corresponding change timestamp, the target content and timestamp included in the target first element are updated to obtain an updated first data set, including:

[0080] S231, reading and deleting the content and timestamp included in the target first element from the first data set.

[0081] In this embodiment, after searching the first data set for a target first element having the same target identifier as the target change data, the content and timestamp included in the target first element may be read and deleted from the first data set.

[0082] S232, taking the target change data and the corresponding change timestamp as the content and timestamp included in the updated target first element respectively, writing the updated target first element into the first data set, and obtaining the updated first data set.

[0083] In this embodiment, after reading and deleting the content and timestamp included in the target first element from the first data set, the target change data and the corresponding change timestamp can be used as the content and timestamp included in the updated target first element, respectively, and the updated target first element can be written into the first data set to obtain the updated first data set.

[0084] As a way, Figure 5 As shown, after obtaining the target change data data, you can first execute the operation of reading the same target identifier msg, that is, execute msg = msg_que.get, and then execute the operation of updating msg, that is, execute msg = msg_add.(data), and finally you can execute the operation of rewriting the queue, that is, execute msg_que.push(timestamp, msg), and finally get the updated first data set.

[0085] S240: broadcast the contents of each first element in the updated first data set in sequence based on the sequence of timestamps included in each first element in the updated first data set.

[0086] It can be understood that since each first element in the updated first data set includes timestamp information, in order to enable the content of the first element that was changed earlier to be broadcast as early as possible, the content of each first element in the updated first data set can be broadcast in sequence based on the order of the timestamps included in each first element in the updated first data set.

[0087] The solution of this embodiment is described in detail below with a specific example:

[0088] Continuing with the scenario of VIP users entering and exiting the channel, assume that the first data set includes three first elements, first element 1 is used to store the data content corresponding to VIP user A and the timestamp of the data content, first element 2 is used to store the data content corresponding to VIP user A and the timestamp of the data content, and first element 3 is used to store the data content corresponding to VIP user C and the timestamp of the data content. And assume that in this scenario, the behavior that occurs is: at timestamp T1, A enters channel 1, at timestamp T2, A exits channel 1, at timestamp T3, B enters channel 2, at timestamp T4, C enters channel 1, and at timestamp T5, A enters channel 1. Among them, timestamps T1-T5 increase in sequence, and timestamps T1-T5 are within the same broadcast time interval.

[0089] In this case, when the target change data "A enters channel 1" and the corresponding change timestamp "timestamp T1" are obtained, for the first element 1, "A enters channel 1" and "timestamp T1" can be used to update the first element 1 to obtain the updated first data set. At this time, the first element 1 in the first data set includes the target content "A enters channel 1" and the timestamp is "timestamp T1".

[0090] When the target change data "A output channel 1" and the corresponding change timestamp "timestamp T2" are obtained, for the first element 1, "A output channel 1" and "timestamp T2" can be used to update the first element 1 in the updated first data set to obtain the first data set after being updated again. At this time, the first element 1 in the first data set includes the target content "A output channel 1" and the timestamp is "timestamp T2".

[0091] Next, when the target change data "Y enters channel 2" and the corresponding change timestamp "timestamp T3" are obtained, the first data set updated again can also be obtained. At this time, the first element 2 in the first data set includes the target content "Y enters channel 2" and the timestamp is "timestamp T3".

[0092] Next, when the target change data "Channel 1" and the corresponding change timestamp "timestamp T4" are obtained, the first data set updated again can also be obtained. At this time, the first element 3 in the first data set includes the target content "Channel 1" and the timestamp is "timestamp T4".

[0093] Next, when the target change data "A enters channel 1" and the corresponding change timestamp "timestamp T5" are obtained, "A enters channel 1" and "timestamp T5" can be used to update the first element 1 in the updated first data set to obtain the first data set after being updated again. At this time, the first element 1 in the first data set includes the target content "A enters channel 1" and the timestamp is "timestamp T5".

[0094] After obtaining all the above target change data and the change timestamps corresponding to the target change data within the broadcast time interval, the final updated first data set can be obtained, such as Figure 6 As shown, Figure 6 A schematic diagram of a first data set provided by the present embodiment is shown. At this time, the target content included in the first element 1 of the first data set is "User A enters channel 1", and the timestamp is "timestamp T5", the target content included in the first element 2 is "User B enters channel 2", and the timestamp is "timestamp T3", and the target content included in the first element 3 is "User C enters channel 1", and the timestamp is "timestamp T4". And because timestamp T3, timestamp T4, and timestamp T5 increase in sequence, when the broadcast time of the message broadcast arrives, first, a broadcast message is used to broadcast the content corresponding to the first element 2, that is, "User B enters channel 2 at timestamp T3", and then another broadcast message is used to broadcast the content corresponding to the first element 3, that is, "User C enters channel 1 at timestamp T4", and finally another broadcast message is used to broadcast the content corresponding to the first element 1, that is, "User A enters channel 1 at timestamp T5". That is, the number of messages broadcasted in the end is reduced from 5 to 3.

[0095] The effect of this embodiment is described in detail below with a specific example:

[0096] Assume that the peak traffic volume that the entire broadcast system can accept is 100MB of data per second and 100 messages per second, and the size of a single broadcast message is 1MB on average. Under normal circumstances, the data is updated in real time, and each user behavior triggers an update. In this case, only 100 data updates can be processed per second, that is, 100 broadcast messages are broadcast. More messages exceed the processing capacity of the broadcast system. If the time interval between broadcast messages is 2 seconds, and only a simple aggregation of the time range is performed, a maximum of 200 data updates can be aggregated, that is, 200 broadcast messages are broadcast, because the traffic bandwidth limit is exceeded. If the data of each user changes twice within 1s on average, an average of 400 data updates can be processed within 2 seconds using the solution of the embodiment of the present application.

[0097] It can be seen from the above examples that the message broadcasting method of the embodiment of the present application can aggregate the target change data with the same target identifier within the broadcast time interval according to the corresponding change timestamp, that is, aggregate the target change data from the dimension of the target identifier, thereby reducing the number of broadcast messages without affecting normal interaction, thereby effectively reducing the traffic occupancy of broadcast messages during peak hours, reducing the situation where instantaneous traffic exceeds the system processing limit, and reducing the system load.

[0098] See also Figure 7 , Figure 7 The flowchart of a message broadcast method proposed in another embodiment of the present application is shown. In this method, the association between the data mainly considered is the target identifier and the attribute identifier. In this case, the target change data includes the target identifier and the attribute identifier. Each first element in the first data set corresponds to a target identifier, and each second element in the second data set corresponds to an attribute identifier. The method may include:

[0099] S310, obtaining target change data within a broadcast time interval and a change timestamp corresponding to the target change data.

[0100] S320: Search the first data set for a target first element having the same target identifier as the target changed data.

[0101] S330: Based on the target change data and the corresponding change timestamp, update the target content and timestamp included in the target first element to obtain an updated first data set.

[0102] S340: Search the second data set for a target second element having the same attribute identifier as the target changed data.

[0103] The second data set refers to a set in the message queue for storing second elements, and each second element in the second data set may include an attribute identifier and a timestamp corresponding to the attribute identifier. Therefore, each second element in the second data set corresponds to an attribute identifier.

[0104] The target second element refers to the second element in the second data set that has the same attribute identifier as the target changed data.

[0105] Therefore, in order to subsequently update the timestamp included in the target second element based on the change timestamp corresponding to the target change data, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, the target second element with the same attribute identifier as the target change data can also be searched from the second data set.

[0106] In a specific example, still in the scenario of VIP users entering and exiting a channel, assuming that the scenario specifically includes two channels, namely, channel 1 and channel 2, then the second data set may include two second elements, second element 1 is used to store the timestamps of channel 1 and the VIP user entering and exiting the channel in channel 1, and second element 2 is used to store the timestamps of channel 2 and the VIP user entering and exiting the channel in channel 2. If the attribute identifier of the target change data is channel 1, the second element 1 used to store the timestamps of channel 1 and the VIP user entering and exiting the channel in channel 1 is found from the second data set.

[0107] As a method, redis (Remote Dictionary Server) can be used to implement message queues. Implementing message queues through redis has a certain degree of versatility and can be applied to different data updates. It is convenient to aggregate messages at the specific business level.

[0108] S350: Based on the change timestamp corresponding to the target change data, update the timestamp included in the target second element to obtain an updated second data set.

[0109] Since the target second element includes the attribute identifier and the timestamp corresponding to the attribute identifier, after obtaining the change timestamp corresponding to the target change data, the timestamp included in the target second element can be updated based on the change timestamp corresponding to the target change data, thereby obtaining an updated second data set.

[0110] As a method, the timestamp included in the second element may be directly replaced with the change timestamp corresponding to the target change data, so as to update the timestamp included in the target second element.

[0111] As another method, the target second element including the timestamp can be read and deleted from the second data set, and then the change timestamp corresponding to the target change data can be used as the timestamp included in the updated target second element, and the updated target second element can be written into the second data set to obtain the updated second data set.

[0112] S360, based on the attribute identifiers corresponding to the first elements in the updated first data set, aggregate the first elements with the same attribute identifier to obtain a first subset, wherein each first subset corresponds to the attribute identifier of a second element in the updated second data set.

[0113] In this embodiment, since the target change data may include a target identifier and an attribute identifier, in order to further reduce the number of broadcast messages, it may be considered to aggregate the first elements in the updated first data set again from the dimension of the attribute identifier, that is, to aggregate the first elements with the same attribute identifier to obtain a first subset. It can be understood that since the first elements in the updated first data set are aggregated again from the dimension of the attribute identifier, each first subset corresponds to an attribute identifier.

[0114] In addition, in order to improve the updating efficiency of the elements in the first data set and the second data set, a correspondence between the first subset and the elements in the second data set can be established, that is, each first subset corresponds to the attribute identifier of a second element in the updated second data set. In this way, when updating the first data set or the second data set, the data corresponding to the attribute identifier can be directly found in the first subset through the attribute identifier, without having to traverse the first subset data to find the first subset corresponding to the attribute identifier. At the same time, each first subset is corresponded to the attribute identifier of a second element in the updated second data set, so that when broadcasting messages later, the timestamps included in each element in the second data set can be directly used to distinguish the broadcast order of the contents of each first subset.

[0115] S370: Based on the sequence of timestamps included in each second element in the updated second data set, broadcast the contents of the first subset corresponding to the attribute identifier of each second element in the updated second data set in sequence.

[0116] It can be understood that in this embodiment, the target change data within the broadcast time interval is aggregated from two dimensions: the target identifier and the attribute identifier. Therefore, when broadcasting the message, only the timestamp information included in each second element in the updated second data set needs to be considered. Therefore, in order to enable the content of the first subset that changed earlier to be broadcast earlier, the content of the first subset corresponding to the attribute identifier of each second element in the updated second data set can be broadcast in sequence based on the order of the timestamps included in each second element in the updated second data set.

[0117] The solution of this embodiment is described in detail below with a specific example:

[0118] Continuing with the scenario of VIP users entering and exiting the channel, it is assumed that the first data set includes 3 first elements, the first element 1 is used to store the data content corresponding to VIP user A and the timestamp of the data content being generated, the first element 2 is used to store the data content corresponding to VIP user A and the timestamp of the data content being generated, and the first element 3 is used to store the data content corresponding to VIP user C and the timestamp of the data content being generated; the second data set includes 2 second elements, the second element 1 is used to store channel 1 and the timestamp of the VIP user's entry and exit operations in channel 1, and the second element 2 is used to store channel 2 and the timestamp of the VIP user's entry and exit operations in channel 2.

[0119] Assume that in this scenario, the following behaviors occur: at timestamp T1, A enters channel 1; at timestamp T2, A leaves channel 1; at timestamp T3, B enters channel 2; at timestamp T4, C enters channel 1; and at timestamp T5, A enters channel 1. Timestamps T1-T5 increase in sequence, and timestamps T1-T5 are within the same broadcast time interval.

[0120] In this case, when the target change data "A enters channel 1" and the corresponding change timestamp "timestamp T1" are obtained, for the first element 1, "A enters channel 1" and "timestamp T1" can be used to update the first element 1 to obtain the updated first data set. At this time, the first element 1 in the first data set includes the target content "A enters channel 1" and the timestamp is "timestamp T1". In addition, the second element 1 with the same attribute identifier as "Channel 1" can also be updated using "timestamp T1" to obtain the updated second data set. At this time, the second element 1 in the second data set includes the content "Channel 1" and the timestamp is "timestamp T1".

[0121] When the target change data "A out of channel 1" and the corresponding change timestamp "timestamp T2" are obtained, for the first element 1, "A out of channel 1" and "timestamp T2" can be used to update the first element 1 in the updated first data set to obtain the first data set after being updated again. At this time, the first element 1 in the first data set includes the target content "A out of channel 1" and the timestamp is "timestamp T2". In addition, "timestamp T2" can also be used to update the second element 1 with the same attribute identifier as "Channel 1" to obtain the updated second data set. At this time, the second element 1 in the second data set includes the content "Channel 1" and the timestamp is "timestamp T2".

[0122] Next, when the target change data "B enters channel 2" and the corresponding change timestamp "timestamp T3" are obtained, the first data set that is updated again can also be obtained. At this time, the first element 2 in the first data set includes the target content "B enters channel 2" and the timestamp is "timestamp T3". In addition, the second element 2 with the same attribute identifier as "channel 2" can also be updated using "timestamp T3" to obtain the updated second data set. At this time, the second element 2 in the second data set includes the content "channel 2" and the timestamp is "timestamp T3".

[0123] Next, when the target change data "Channel 1" and the corresponding change timestamp "Timestamp T4" are obtained, the first data set that is updated again can also be obtained. At this time, the first element 3 in the first data set includes the target content "Channel 1" and the timestamp is "Timestamp T4". In addition, the second element 1 with the same attribute identifier as "Channel 1" can also be updated using "Timestamp T4" to obtain the updated second data set. At this time, the second element 1 in the second data set includes the content "Channel 1" and the timestamp is "Timestamp T4".

[0124] Next, when the target change data "A enters channel 1" and the corresponding change timestamp "timestamp T5" are obtained, the first element 1 in the updated first data set can be updated using "A enters channel 1" and "timestamp T5" to obtain the first data set after being updated again. At this time, the target content included in the first element 1 in the first data set is "A enters channel 1" and the timestamp is "timestamp T5". In addition, the second element 1 with the same attribute identifier as "Channel 1" can also be updated using "timestamp T5" to obtain the updated second data set. At this time, the content included in the second element 1 in the second data set is "Channel 1" and the timestamp is "timestamp T5".

[0125] After obtaining all the above target change data and the change timestamps corresponding to the target change data within the broadcast time interval, the final updated message queue can be obtained. The updated message queue includes the first data set and the second data set. Figure 8 As shown, Figure 8 A schematic diagram of the internal structure of a message queue provided by this embodiment is shown.

[0126] like Figure 8 As shown, the second element 1 in the second data set in the message queue includes: channel 1, timestamp T5, and the first subset corresponding to the attribute identifier of the second element includes: target content is "A enters channel 1", timestamp is "timestamp T5" and target content is "C enters channel 1", timestamp is "timestamp T4";

[0127] The second element 2 in the second data set in the message queue includes: channel 2, timestamp T3, and the first subset corresponding to the attribute identifier of the second element includes: target content is "B enters channel 2", and timestamp is "timestamp T3".

[0128] As can be seen from the above example, the number of messages finally broadcasted is reduced from 5 to 2. The message broadcasting method of the embodiment of the present application can aggregate the target change data with the same target identifier within the broadcast time interval according to the corresponding change timestamp, and aggregate the target change data with the same attribute identifier according to the corresponding change timestamp, that is, the target change data is aggregated from both the target identifier and the attribute identifier, thereby further reducing the number of broadcast messages without affecting normal interaction, thereby effectively reducing the traffic occupied by broadcast messages during peak hours, reducing the situation where the instantaneous traffic exceeds the system processing limit, and reducing the system load.

[0129] In addition, considering that all messages in the message queue can be broadcast after each broadcast time interval ends, then when the next broadcast time interval begins, there will be no content in the message queue set. Therefore, before searching for the target first element with the same target identifier as the target change data from the first data set, it also includes: when there is no target first element with the same target identifier as the target change data in the first data set, the target change data and the corresponding change timestamp are respectively added to the first data set as the content and timestamp included in the first element in the first data set to obtain the first data set.

[0130] In this embodiment, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, it is determined whether there is a target first element with the same target identifier as the target change data in the first data set of the message queue. If there is a target first element with the same target identifier as the target change data, the aforementioned steps S320-S330 are executed; if there is no target first element with the same target identifier as the target change data, the target change data and the corresponding change timestamp are respectively added to the first data set as the content and timestamp included in the first element in the first data set to obtain the first data set so that the aforementioned steps S320-S330 can be executed subsequently.

[0131] Similarly, before searching the second data set for the target second element having the same attribute identifier as the target changed data, the method further includes:

[0132] When there is no target second element with the same attribute identifier as the target change data in the second data set, the attribute identifier and the corresponding change timestamp included in the target change data are added to the second data set as the attribute identifier and timestamp included in the second element in the second data set, respectively, to obtain the second data set.

[0133] In this embodiment, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, it is also determined whether there is a target second element with the same attribute identifier as the target change data in the second data set of the message queue. If there is a target first element with the same attribute identifier as the target change data, the aforementioned steps S340-S370 are executed; if there is no target second element with the same attribute identifier as the target change data, the attribute identifier and the corresponding change timestamp included in the target change data are respectively used as the attribute identifier and timestamp included in the second element in the second data set, and are added to the second data set to obtain the second data set, so that the aforementioned steps S340-S370 can be continued to be executed later.

[0134] See also Fig. 9 , Fig. 9 FIG. 1 is a schematic diagram of a message broadcast system according to another embodiment of the present invention. The system can be used to execute Figure 7 The message broadcasting method shown in the figure comprises a first element writing module, a second element writing module, a message queue, a timed consumption module and a broadcasting module.

[0135] The first element writing module is used to update the target content and timestamp included in the target first element based on the target change data and the corresponding change timestamp to obtain an updated first data set.

[0136] The second element writing module is used to update the timestamp included in the target second element based on the change timestamp corresponding to the target change data to obtain an updated second data set.

[0137] The message queue includes a first data set and a second data set, and is used to store the first data set and the second data set.

[0138] The timing consumption module is used to take out the content of the first subset corresponding to the attribute identifier of each second element in the updated second data set from the message queue at a regular time according to the broadcast time interval, and send it to the broadcast module.

[0139] The broadcast module is used to broadcast the contents of the first subset corresponding to the attribute identifier of each second element in the updated second data set in sequence based on the sequence of timestamps included in each second element in the updated second data set.

[0140] in, Fig. 9 The message broadcast system shown can be operated on Figure 1 The system within server 110 is shown.

[0141] See also Fig.10 , Fig.10 The flowchart of a message broadcast method proposed in another embodiment of the present application is shown. In the method, the correlation between the data mainly considered is the attribute identifier. In this case, the target change data includes the attribute identifier, and each third element in the third data set corresponds to an attribute identifier. The method may include:

[0142] S410, obtaining target change data within a broadcast time interval and a change timestamp corresponding to the target change data.

[0143] S420: Search the third data set for a target third element having the same attribute identifier as the target changed data.

[0144] The third data set refers to a set in the message queue for storing third elements, and each third element in the third data set may include an attribute identifier and a timestamp corresponding to the attribute identifier. Therefore, each third element in the third data set corresponds to an attribute identifier.

[0145] The target third element refers to the third element in the third data set that has the same attribute identifier as the target changed data.

[0146] Therefore, in order to subsequently update the timestamp included in the target third element based on the change timestamp corresponding to the target change data, after obtaining the target change data within the broadcast time interval and the change timestamp corresponding to the target change data, the target third element with the same attribute identifier as the target change data can also be searched from the third data set.

[0147] S430: Based on the target change data and the corresponding change timestamp, update the timestamp included in the target third element to obtain an updated third data set.

[0148] Since the target third element includes the attribute identifier and the timestamp corresponding to the attribute identifier, after obtaining the change timestamp corresponding to the target change data, the timestamp included in the target third element can be updated based on the change timestamp corresponding to the target change data, thereby obtaining the updated third data set.

[0149] S440, based on the attribute identifiers corresponding to the respective target change data, the target change data with the same attribute identifier are aggregated to obtain a fourth data set, wherein each fourth data set corresponds to the attribute identifier of a third element in the updated third data set.

[0150] In this embodiment, since the target change data may include attribute identifiers, in order to reduce the number of broadcast messages, it is also possible to consider aggregating the target change data with the same attribute identifier from the dimension of the attribute identifier to obtain a fourth data set. It can be understood that since the target change data is aggregated from the dimension of the attribute identifier, each fourth data set corresponds to an attribute identifier.

[0151] By corresponding each of the four sets to the attribute identifier of a third element in the updated third data set, it is possible to directly use the timestamp included in each element in the third data set when broadcasting messages later, so as to distinguish the broadcast order of the contents of each fourth set.

[0152] S450: Based on the sequence of timestamps included in each third element in the updated third data set, broadcast the contents of the fourth data set corresponding to the attribute identifiers of each third element in the updated third data set.

[0153] It can be understood that since each third element in the updated third data set includes timestamp information, in order to enable the content of the fourth data set corresponding to the attribute identifiers of each third element in the third data set that was changed earlier to be broadcast as early as possible, the content of the fourth data set corresponding to the attribute identifiers of each third element in the updated third data set can be broadcast in sequence directly based on the order of the timestamps included in each third element in the updated third data set.

[0154] The message broadcasting method of the embodiment of the present application can aggregate the target change data with the same attribute identifier within the broadcast time interval according to the corresponding change timestamp, that is, aggregate the target change data from the dimension of the attribute identifier, thereby reducing the number of broadcast messages without affecting normal interaction, thereby effectively reducing the traffic occupancy of broadcast messages during peak hours, reducing the situation where instantaneous traffic exceeds the system processing limit, and reducing the system load.

[0155] See also Fig.11 , Fig.11 A block diagram of a message broadcasting device 500 proposed in an embodiment of the present application is shown. The device 500 may include: a data acquisition module 510, a data set update module 520 and a content broadcasting module 530.

[0156] The data acquisition module 510 is used to acquire target change data within a broadcast time interval and a change timestamp corresponding to the target change data;

[0157] The data set updating module 520 is used to update the target data set in the message queue based on the target change data and the corresponding change timestamp to obtain an updated data set;

[0158] The content broadcasting module 530 is used to broadcast the content corresponding to each element in sequence based on the sequence of timestamps corresponding to each element in the updated data set.

[0159] As an approach, the target data set includes a first data set, the target change data includes a target identifier, each first element in the first data set corresponds to a target identifier, and the data set updating module 520 may include:

[0160] A target first element search submodule is used to search the target first element having the same target identifier as the target change data from the first data set;

[0161] The first data set updating submodule is used to update the target content and timestamp included in the target first element based on the target change data and the corresponding change timestamp to obtain an updated first data set.

[0162] Accordingly, the content broadcast module 530 includes:

[0163] The first content broadcasting submodule is used to broadcast the content of each first element in the updated first data set in sequence based on the sequence of timestamps included in each first element in the updated first data set.

[0164] As a mode, the target data set further includes a second data set, the target change data further includes an attribute identifier, each second element in the second data set corresponds to an attribute identifier, and the message broadcasting device 500 further includes:

[0165] A target second element search module, used to search the target second element having the same attribute identifier as the target change data from the second data set;

[0166] A second data set updating module, configured to update the timestamp included in the target second element based on the change timestamp corresponding to the target change data, to obtain an updated second data set;

[0167] An aggregation module is used to aggregate first elements with the same attribute identifier based on the attribute identifier corresponding to each first element in the updated first data set to obtain a first subset, wherein each first subset corresponds to the attribute identifier of a second element in the updated second data set.

[0168] Accordingly, the content broadcast module 530 includes:

[0169] The second content broadcasting submodule is used to broadcast the contents of the first subset corresponding to the attribute identifiers of the second elements in the updated second data set in sequence based on the sequence of timestamps included in the second elements in the updated second data set.

[0170] As a method, the message broadcasting device 500 further includes:

[0171] The first data set acquisition module is used to add the target change data and the corresponding change timestamp as the content and timestamp included in the first element in the first data set, respectively, to the first data set when there is no target first element with the same target identifier as the target change data in the first data set, so as to obtain the first data set.

[0172] As a method, the message broadcasting device 500 further includes:

[0173] The second data set acquisition module is used to add the attribute identifier and the corresponding change timestamp included in the target change data to the second data set as the attribute identifier and timestamp included in the second element in the second data set, respectively, when there is no target second element with the same attribute identifier as the target change data in the second data set, so as to obtain the second data set.

[0174] As one approach, the target identifier is the user identifier and the attribute identifier is the channel identifier.

[0175] As one approach, the first data set updating submodule includes:

[0176] A reading and deleting unit, used for reading and deleting the content and timestamp of the target first element from the first data set;

[0177] The writing unit is used to use the target change data and the corresponding change timestamp as the content and timestamp included in the updated target first element respectively, write the updated target first element into the first data set, and obtain the updated first data set.

[0178] As an approach, the target data set includes the third data set, the target change data includes an attribute identifier, each third element in the third data set corresponds to an attribute identifier, and the data set updating module 520 may include:

[0179] A target third element search submodule is used to search the target third element having the same attribute identifier as the target change data from the third data set;

[0180] A third data set updating submodule, configured to update the timestamp included in the target third element based on the target change data and the corresponding change timestamp, to obtain an updated third data set;

[0181] The fourth data set acquisition submodule is used to aggregate the target change data with the same attribute identifier based on the attribute identifier corresponding to each target change data to obtain a fourth data set, wherein each fourth data set corresponds to the attribute identifier of a third element in the updated third data set.

[0182] Accordingly, the content broadcast module 530 includes:

[0183] The third content broadcasting submodule is used to broadcast the contents of the fourth data set corresponding to the attribute identifiers of the third elements in the updated third data set in sequence based on the sequence of timestamps included in the third elements in the updated third data set.

[0184] The present application provides a message broadcasting device. Since what is broadcast is the elements in an updated data set, and the updated data set is obtained by updating the target data set in the message queue based on the target change data obtained within a preset broadcast time period and the corresponding change timestamp, the present application can broadcast part of the messages by updating the target data set based on the characteristics of the correlation between the data, that is, not all the target update data will be broadcast. Compared with the traditional message queue broadcasting method of broadcasting all the change data, the number of broadcast messages can be reduced, and the traffic occupancy of the broadcast messages during peak hours can be effectively reduced, and the situation where the instantaneous traffic exceeds the system processing limit can be reduced, and the system load can be reduced. At the same time, again, since part of the messages are broadcast by updating the target data set in the present application, the messages finally broadcast are all of actual concern to the target objects, and even if only part of the messages are broadcast, the needs of normal interaction can be met.

[0185] It should be noted that the device embodiment in the present application corresponds to the aforementioned method embodiment. The specific principles in the device embodiment can be found in the contents of the aforementioned method embodiment and will not be repeated here.

[0186] The following will be combined Fig.12 An electronic device provided by the present application is described.

[0187] See also Fig.12 Based on the above message broadcasting method, the embodiment of the present application also provides another electronic device 200 including a processor 104 that can execute the above message broadcasting method. The electronic device 200 can be a smart phone, a tablet computer, a computer, or a portable computer. The electronic device 200 also includes a memory 104, a network module 106, and a screen 108. The memory 104 stores a program that can execute the content of the above embodiment, and the processor 102 can execute the program stored in the memory 104.

[0188] Among them, the processor 102 may include one or more cores for processing data and a message matrix unit. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 200, and executes various functions and processes data of the electronic device 200 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.

[0189] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the terminal 100 during use.

[0190] The network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, for example, communicate with an audio playback device. The network module 106 may include various existing circuit elements for performing these functions, for example, an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a user identity module (SIM) card, a memory, etc. The network module 106 may communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices via a wireless network. The above-mentioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 may exchange information with a base station.

[0191] The screen 108 can display interface content and can also be used to respond to touch gestures.

[0192] It should be noted that, in order to achieve more functions, the electronic device 200 can also protect more devices, for example, it can also protect a structured light sensor for collecting facial information or a camera for collecting irises.

[0193] Please refer to Fig.13 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1100 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0194] The computer readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1110 can be compressed, for example, in an appropriate form.

[0195] Based on the above message broadcasting method, according to one aspect of the embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in the above various optional implementations.

[0196] In summary, the message broadcasting method, device, electronic device, storage medium and computer program product or computer program provided by the embodiments of the present application, because the broadcast broadcasts the elements in the updated data set, and the updated data set is obtained by updating the target data set in the message queue based on the target change data obtained within the preset broadcast time period and the corresponding change timestamp, therefore, the present application can broadcast part of the message by updating the target data set based on the characteristics of the correlation between the data, that is, not all the target update data will be broadcast, compared with the traditional message queue broadcasting method of broadcasting all the change data, it can reduce the number of broadcast messages, effectively reduce the traffic occupancy of broadcast messages at peak times, reduce the situation where the instantaneous traffic exceeds the system processing limit, and reduce the system load. At the same time, again, because in the present application, part of the message is broadcast by updating the target data set, the messages finally broadcast are all of actual concern to the target object, so even if only part of the message is broadcast, it can meet the needs of normal interaction.

[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A message broadcasting method, characterized in that: include: Obtain target change data within a broadcast time interval and a change timestamp corresponding to the target change data; Based on the target change data and the corresponding change timestamp, the target data set in the message queue is updated to obtain an updated data set, wherein the target change data and the corresponding change timestamp are updated to obtain the target data set in the message queue, including: selecting the target update data with the largest timestamp from the target update data corresponding to each element in the target data set, and updating the corresponding target data set with the target update data with the largest timestamp; Based on the order of timestamps corresponding to each element in the updated data set, the content corresponding to each element is broadcast in sequence, and the timestamps corresponding to each element in the updated data set represent the change timestamps corresponding to each element in the updated data set.

2. The method according to claim 1, characterized in that The target data set includes a first data set, the target change data includes a target identifier, each first element in the first data set corresponds to a target identifier, and the target data set in the message queue is updated based on the target change data and the corresponding change timestamp to obtain an updated data set, including: Searching the first data set for a target first element having the same target identifier as the target change data; Based on the target change data and the corresponding change timestamp, the target content and the timestamp included in the target first element are updated to obtain an updated first data set; The broadcasting of the contents of each element in sequence based on the order of timestamps corresponding to each element in the updated data set includes: Based on the sequence of timestamps included in each first element in the updated first data set, the contents of each first element in the updated first data set are broadcasted in sequence.

3. The method according to claim 2, characterized in that The target data set further includes a second data set, the target change data further includes an attribute identifier, each second element in the second data set corresponds to an attribute identifier, and the method further includes: Searching the second data set for a target second element having the same attribute identifier as the target change data; Based on the change timestamp corresponding to the target change data, the timestamp included in the target second element is updated to obtain an updated second data set; Based on the attribute identifiers corresponding to the first elements in the updated first data set, aggregating the first elements with the same attribute identifier to obtain a first subset, wherein each of the first subsets corresponds to the attribute identifier of a second element in the updated second data set; The broadcasting of the contents of each element in sequence based on the order of timestamps corresponding to each element in the updated data set includes: Based on the sequence of timestamps included in each second element in the updated second data set, the contents of the first subset corresponding to the attribute identifier of each second element in the updated second data set are broadcasted in sequence.

4. The method according to claim 2 or 3, characterized in that: Before searching the first data set for a target first element having the same target identifier as the target change data, the method further includes: When there is no target first element with the same target identifier as the target change data in the first data set, the target change data and the corresponding change timestamp are added to the first data set as the content and timestamp included in the first element in the first data set, respectively, to obtain the first data set.

5. The method according to claim 3, characterized in that: Before searching the second data set for a target second element having the same attribute identifier as the target change data, the method further includes: When there is no target second element with the same attribute identifier as the target change data in the second data set, the attribute identifier and the corresponding change timestamp included in the target change data are added to the second data set as the attribute identifier and timestamp included in the second element in the second data set, respectively, to obtain the second data set.

6. The method according to claim 3, characterized in that The target identifier is a user identifier, and the attribute identifier is a channel identifier.

7. The method according to claim 2, characterized in that The updating of the first target content and the timestamp included in the first target element based on the target change data and the corresponding change timestamp to obtain an updated first data set includes: Read and delete the content and timestamp of the target first element from the first data set; The target change data and the corresponding change timestamp are used as the content and timestamp of the updated target first element respectively, and the updated target first element is written into the first data set to obtain the updated first data set.

8. The method according to claim 1, characterized in that The target data set includes a third data set, the target change data includes an attribute identifier, each third element in the third data set corresponds to an attribute identifier, and the target data set in the message queue is updated based on the target change data and the corresponding change timestamp to obtain an updated data set, including: Searching for a target third element having the same attribute identifier as the target change data from the third data set; Based on the target change data and the corresponding change timestamp, updating the timestamp included in the target third element to obtain an updated third data set; Based on the attribute identifiers corresponding to the respective target change data, the target change data having the same attribute identifier are aggregated to obtain a fourth data set, wherein each of the fourth data sets corresponds to the attribute identifier of a third element in the updated third data set; The broadcasting of the contents of each element in sequence based on the order of timestamps corresponding to each element in the updated data set includes: Based on the sequence of timestamps included in each third element in the updated third data set, the contents of the fourth data set corresponding to the attribute identifiers of each third element in the updated third data set are broadcasted in sequence.

9. A message broadcasting device, characterized in that: The device comprises: A data acquisition module, used to acquire target change data within a broadcast time interval and a change timestamp corresponding to the target change data; A data set updating module, used to update the target data set in the message queue based on the target change data and the corresponding change timestamp to obtain an updated data set, wherein the updating of the target data set in the message queue based on the target change data and the corresponding change timestamp includes: selecting the target update data with the largest timestamp from the target update data corresponding to each element in the target data set, and updating the corresponding target data set with the target update data with the largest timestamp; The content broadcasting module is used to broadcast the content corresponding to each element in the updated data set in sequence based on the chronological order of the timestamps corresponding to each element in the updated data set, and the timestamps corresponding to each element in the updated data set represent the change timestamps corresponding to each element in the updated data set.

10. An electronic device, characterized in that: The method comprises a processor and a memory; one or more programs are stored in the memory and configured to be executed by the processor to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is executed by a processor, the method according to any one of claims 1 to 8 is executed.