Control Method, Device, Electronic Device and Computer Readable Storage Medium for Message Sending

By setting priority and quantity thresholds for messages, the message backlog problem caused by slow client processing speed in the live broadcast platform is solved, ensuring the sending of important messages and the stability of the terminal.

CN112199174BActive Publication Date: 2025-07-08DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011060102.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-30
Publication Date
2025-07-08
Estimated Expiration
2041-02-28

AI Technical Summary

Technical Problem

In live streaming platforms, slow client processing speed leads to a backlog of messages, which may lead to client crash.

Method used

By setting priority for messages and setting a number threshold according to priority, we can determine whether the number of messages to be sent exceeds the threshold. If it exceeds the message, the message will be discarded to ensure that the client is not overloaded.

Benefits of technology

Effectively control message traffic, avoid crashes caused by slow processing speed of clients, ensure priority processing of important messages, and balance the sending speed of servers and terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112199174B_ABST
    Figure CN112199174B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a control method, apparatus, electronic device, and computer-readable storage medium for message sending. The control method for message sending includes: obtaining a message to be sent; determining the priority of the message to be sent; determining a first quantity, where the first quantity is the quantity of messages with the same priority that have been sent before the message to be sent; and discarding the message to be sent when the first quantity is greater than or equal to the quantity threshold corresponding to the priority. The above method determines whether to send the message based on the quantity threshold corresponding to the priority of the message, solving the technical problem of message backlog caused by slow terminal processing speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of message processing, and in particular, to a method, apparatus, electronic device, and computer-readable storage medium for controlling message sending. Background Art

[0002] With the rapid development of information technology, mobile Internet technology has also advanced by leaps and bounds. Whether it is the emergence of intelligent devices, the arrival of the 5G era, or the application of technologies such as big data, AI intelligence, and algorithms, they have all given wings to electronic mobile devices. In real life, thanks to these technologies, social interactions have become rich and colorful. In particular, the emergence of smartphones has broken the time and space limitations of human daily interactions. It is a truly comprehensive palm-sized mobile device that integrates a vast amount of information, network audio-visual, and leisure entertainment, meeting people's daily information needs and social interactions.

[0003] Currently, many platforms provide live broadcast services. The number of people in a live broadcast room may range from a few to hundreds of thousands. The frequency of audience interaction is very high, and hundreds of interaction messages may be generated per second. However, the processing capacity of the client is limited. If messages are sent too quickly while the client's processing speed is too slow, message backlogs may occur, which may lead to the crash of the client. Summary of the Invention

[0004] This Summary of the Invention section is provided to introduce concepts in a brief form, which will be described in detail in the following Detailed Implementation section. This Summary of the Invention section is not intended to identify the key features or essential features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.

[0005] To solve the above technical problems, the embodiments of the present disclosure propose the following technical solutions.

[0006] In a first aspect, an embodiment of the present disclosure provides a method for controlling message sending, including:

[0007] Obtain a message to be sent;

[0008] Determine the priority of the message to be sent;

[0009] Determine a first quantity, where the first quantity is the number of messages of the priority that have been sent before the message to be sent is sent;

[0010] Discard the message to be sent when the first quantity is greater than or equal to the quantity threshold corresponding to the priority.

[0011] In a second aspect, an embodiment of the present disclosure provides a device for controlling message sending, including:

[0012] A message to be sent acquisition module, configured to acquire a message to be sent;

[0013] A priority determination module, configured to determine the priority of the message to be sent;

[0014] A first quantity determination module, configured to determine a first quantity, where the first quantity is the quantity of messages of the priority that have been sent before the message to be sent is sent;

[0015] A control module, configured to discard the message to be sent when the first quantity is greater than or equal to a quantity threshold corresponding to the priority.

[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor; and,

[0017] A memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods in the foregoing first aspect.

[0018] In a fourth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute any of the methods in the foregoing first aspect.

[0019] Embodiments of the present disclosure disclose a control method, device, electronic device, and computer-readable storage medium for message sending. The control method for message sending includes: acquiring a message to be sent; determining the priority of the message to be sent; determining a first quantity, where the first quantity is the quantity of messages of the priority that have been sent before the message to be sent is sent; and discarding the message to be sent when the first quantity is greater than or equal to a quantity threshold corresponding to the priority. The above method determines whether to send the message through a quantity threshold corresponding to the priority of the message, and solves the technical problem of message backlog caused by slow terminal processing speed.

[0020] The above description is only an overview of the technical solution of the present disclosure. In order to understand the technical means of the present disclosure more clearly, it can be implemented according to the content of the description. In order to make the above and other purposes, features, and advantages of the present disclosure more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the drawings, details are described as follows. Description of the Drawings

[0021] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the original elements and elements are not necessarily drawn to scale.

[0022] Figure 1 It is a schematic flowchart of a method for controlling message sending provided by an embodiment of the present disclosure;

[0023] Figure 2 It is a schematic flowchart of determining the priority of a message to be sent in the method for controlling message sending provided by an embodiment of the present disclosure;

[0024] Figure 3 It is an example schematic diagram of determining the first quantity in the method for controlling message sending provided by an embodiment of the present disclosure;

[0025] Figure 4 It is a schematic flowchart of starting a counter in the method for controlling message sending provided by an embodiment of the present disclosure;

[0026] Figure 5 It is a schematic diagram of the usage mode of the counter in the method for controlling message sending provided by an embodiment of the present disclosure;

[0027] Figure 6 It is a schematic diagram of the application scenario of the method for controlling message sending provided by an embodiment of the present disclosure.

[0028] Figure 7 It is a schematic structural diagram of an embodiment of a control device for message sending provided by an embodiment of the present disclosure;

[0029] Figure 8 It is a schematic structural diagram of an electronic device provided according to an embodiment of the present disclosure. Specific Embodiments

[0030] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0031] It should be understood that the various steps recorded in the method embodiments of the present disclosure can be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0032] As used herein, the term "including" and its variations are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0033] It should be noted that the concepts such as "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence relationship of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "a plurality" mentioned in this disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of this disclosure are only for illustrative purposes, and are not used to limit the scope of these messages or information.

[0036] Figure 1 The flowchart of the control method for message sending provided for the embodiments of this disclosure. The control method for message sending provided in this embodiment can be executed by a control device for message sending. The control device for message sending can be implemented as software, or implemented as a combination of software and hardware. The control device for message sending can be integrally arranged in a certain device in the message sending control system, such as a control server for message sending or a control terminal device for message sending. As Figure 1 shown, the method includes the following steps:

[0037] Step S101, obtain the message to be sent;

[0038] Optionally, the message to be sent is a message generated by the message sending device or a message to be forwarded received by the server from the terminal device. Exemplarily, in a live broadcast scenario, multiple terminal devices located in the same live broadcast room will send messages to the server providing the live broadcast service. Then, the multiple terminals regularly pull all the messages of the previous time period from the server. After the server receives the pull instruction, it sends the messages cached in the previous time period to the terminal corresponding to the pull instruction.

[0039] Exemplarily, the message to be sent is cached in the server, and the terminal device sends a message pull request once per unit time. After receiving the pull request, the server retrieves one by one the messages cached in the previous unit time from the cache. Each of the cached messages is the message to be sent in this step. Optionally, the message to be sent is cached in a queue, and when the server obtains the message to be sent, it retrieves one message to be sent from the top of the queue each time.

[0040] Exemplarily, in the live broadcast scenario, the messages to be sent are chat messages, gift messages, etc. obtained from all terminals that have joined the live broadcast room.

[0041] Step S102, determine the priority of the message to be sent;

[0042] In the embodiments of the present disclosure, all messages have corresponding priorities, and the priority is an identifier set in advance to represent the importance degree of the message.

[0043] Optionally, step S102 includes:

[0044] Step S201, determine the type of the message to be sent;

[0045] Step S202, determine the priority of the message to be sent according to the type.

[0046] Optionally, in a message system, messages are divided into multiple types. Exemplarily, messages are divided into type A messages and type B messages, and the priority of each type of message is set in advance. For example, the priority of type A messages is the first priority, and the priority of type B messages is the second priority; further, each type of message can be further divided into subtypes. For example, type B messages can be divided into type B1 messages and type B2 messages. In the subtypes, there can be further sub-priorities. In the case of the second priority, the sub-priority of type B1 messages is higher than that of type B2 messages. Taking the above live broadcast scenario as an example, the messages in the live broadcast can generally be divided into chat messages and gift messages. The priority of chat messages is 1, and the priority of gift messages is 2; and since gifts have different types, they can be divided into gift 1 and gift 2. Among them, the priority of gift 1 is 2.1, and the priority of gift 2 is 2.2. In this way, in step S202, the priority of the message can be determined through the type of the message.

[0047] Optionally, before the above step S101 or step S102, it further includes: setting priorities for each type of message. Optionally, priority setting instructions can be received through a human-machine interface to set priorities for each type of message; alternatively, the priorities of each type of message can also be automatically set according to the number of historical messages, such as counting the number of messages of each type in a historical time period and automatically setting the priorities according to the number. Exemplarily, the more the number of messages, the lower the corresponding priority, and the fewer the number of messages, the higher the corresponding priority. For example, in the above live broadcast scenario, the priority of chat messages can be set lower than that of gift messages, and then among the gift messages, the priority of gift 1 is lower than that of gift 2, and so on.

[0048] Optionally, before the above step S101 or step S102, it further includes:

[0049] Setting quantity thresholds for messages with different priorities. Optionally, the quantity threshold for high-priority messages is not less than that for low-priority messages. That is, more high-priority messages can be sent than low-priority messages.

[0050] Step S103, determining a first quantity;

[0051] Wherein, the first quantity is the quantity of messages of the said priority that have been sent before the message to be sent. In this step, after determining the priority of the message to be sent, the first quantity of messages of the said priority that have been sent is obtained. Exemplarily, if the priority of the message to be sent is the first priority, then the quantity of messages of the first priority that have been sent before the message to be sent is obtained.

[0052] Optionally, counters are set for messages with different priorities to record the quantity of messages of different priorities that have been sent. For example, for the counter of the first priority, whenever a message of the first priority is sent out, the counter of the first priority is incremented by 1. When the first quantity needs to be obtained, the value of the counter is read.

[0053] Optionally, the said step S103 includes:

[0054] Step S301, obtaining the timestamp of the message to be sent;

[0055] Step S302, determining the first quantity of messages of the said priority that have been sent within a unit time according to the timestamp.

[0056] In this alternative embodiment, each message to be sent carries a timestamp T. Exemplarily, the timestamp is represented in seconds, that is, it is obtained through step S301 which message to be sent in which second. It can be understood that since there are many messages within one second, the second-level timestamps of many messages are the same. At this time, messages of the same type can be distinguished according to the message ID or serial number or lower-level timestamp, which will not be elaborated here.

[0057] Optionally, in step S302, the timestamp corresponds to the unit time. For example, the unit time is the period for the terminal to pull messages from the server, such as once every second, and the accuracy of the timestamp is also 1 second. Then the timestamp and the unit time can be directly corresponded. For example, if T = 1, then directly calculate the number of messages of the said priority that have been sent with the timestamp T = 1, which is the first quantity.

[0058] Optionally, as described above, a counter is used to record the first data corresponding to messages of different priorities. At this time, after step S101, it further includes:

[0059] Step S401, obtain the first timestamp of the message to be sent;

[0060] Step S402, if the first timestamp is different from the second timestamp of the previous message to be sent, then start the counter corresponding to the first timestamp, where the counter is used to record the number of messages that have been sent with the timestamp being the first timestamp.

[0061] In this alternative embodiment, the timestamp of the message corresponds to the unit time, that is, when the timestamp changes, it indicates that the message pulling in the next time period is entered. Therefore, in step S401, the first timestamp of the message to be sent is obtained. In step S402, it is compared whether the first timestamp is the same as the second timestamp of the previous message to be sent. If they are different, the two messages are in different pulling time periods. At this time, a counter is started for the first timestamp to record the number of messages that have been sent with the timestamp being the first timestamp.

[0062] Optionally, since the server corresponds to multiple terminals and the processing capabilities of each terminal are different, the first quantity of messages that have been sent under each priority level is independently recorded for different terminals. For example, for each terminal in the live broadcast room, the number of messages that have been sent for each priority is independently calculated.

[0063] Step S104, in the case where the first quantity is greater than or equal to the quantity threshold corresponding to the priority, then discard the message to be sent;

[0064] Among them, the quantity threshold of messages with different priorities is related to the priority of the message. Exemplarily, the quantity threshold of high-priority messages is not less than that of low-priority messages. That is, the greater the priority of the message, the more the quantity that can be sent.

[0065] In this step, it is judged whether the first quantity is greater than or equal to a preset quantity threshold. If it is greater than or equal to, the message to be sent is discarded because at this time the messages that have been sent have exceeded the processing capacity of the corresponding terminal, and even if the data to be sent is sent to the terminal, the terminal cannot process it.

[0066] With the above technical solution, setting quantity thresholds independently for messages with different priorities can effectively control problems such as the terminal being unable to process due to excessive messages or the client for processing messages on the terminal crashing. And because quantity thresholds are set independently for different priorities, it can ensure that important messages are processed first, which can not only control the message traffic but also ensure that important messages are not lost.

[0067] Further, after the step S104, it further includes:

[0068] In the case where the first quantity is less than the quantity threshold corresponding to the priority, send the message to be sent;

[0069] Accumulate the first quantity.

[0070] That is, if it does not exceed the preset quantity threshold, send the message and accumulate the quantity of the messages that have been sent corresponding to the priority of the message.

[0071] On the basis of the above technical solution, optionally, the step S302 includes:

[0072] In response to the first sub-priority of the first priority of the message to be sent, determine the first quantity of the messages of the first priority that have been sent within a unit time according to the time stamp; wherein the first quantity is recorded within the unit time determined by the next time stamp.

[0073] Among them, the first sub-priority is the high-level sub-priority under the first priority. In this alternative embodiment, the number of messages with the first sub-priority that have been sent is recorded in the counter used in the next time period. Exemplarily, in a live broadcast scenario, gift messages include Gift 1 and Gift 2, where Gift 2 has a higher sub-priority; and since Gift 1 and Gift 2 share the counter for gift messages, it is possible that the number of Gift 1 is excessive, consuming the quantity threshold of the first priority, while the more important Gift 2 cannot be sent. Therefore, in this alternative embodiment, the counter used in the unit time determined by the next timestamp is used to count the messages with the first sub-priority. If the timestamp of the message to be sent is T, the counter of the first priority with the timestamp T+1 is used to count the first sub-priority messages that have been sent.

[0074] Optionally, step S302 includes:

[0075] In response to the second sub-priority of the first priority of the message to be sent, determine the first quantity of the first-priority messages that have been sent within the unit time where the timestamp is located; where the quantity of the first-priority messages that have been sent includes the quantity of the first sub-priority messages of the first priority sent within the previous unit time.

[0076] In this alternative embodiment, if the priority of the message to be sent is the second sub-priority of the first priority, read the first quantity of the first-priority messages from the counter corresponding to the unit time where the timestamp is located. It should be noted that except for the counter corresponding to the first timestamp, the counters of the first-priority messages corresponding to other timestamps all include the quantity of the first sub-priority messages of the first priority sent within the previous unit time. That is, the quantity of the second sub-priority messages sent in the previous time period is included in the quantity of the first-priority messages that have been sent in the current time period.

[0077] Figure 5 This is an example of the above message counting method. Such as Figure 5As shown, the system includes two types of messages, Message A and Message B. Message B can be further divided into Message B1 and Message B2. The priority of Message A is lower than that of Message B, and the priority of Message B1 is lower than that of Message B2. At time T1, all the sent Message A are counted by counter countA_T1, all the sent Message B1 are counted by countB_T1, and all the sent Message B2 are counted by countB_T2, and so on. In this way, since Message B2 is counted using the counter of the next time period, it can be ensured that Message B2 is sent out, so that the message with a higher priority can be guaranteed to be sent out.

[0078] Optionally, the above message sending control method further includes:

[0079] In the case where the first quantity is less than the quantity threshold corresponding to the priority, determine whether the quantity of all the sent messages is greater than or equal to the total threshold;

[0080] If the quantity of all the sent messages is greater than or equal to the total threshold, discard the message to be sent;

[0081] If the quantity of all the sent messages is less than the total threshold, send the message to be sent and increment the first quantity.

[0082] In the above optional embodiment, a total threshold also needs to be set. The total threshold can be the maximum processing capacity of the terminal device for messages. In this optional embodiment, the total threshold is less than the sum of the quantity thresholds of messages with each priority. At this time, when the quantity of the sent messages with the priority is less than the quantity threshold, it cannot be guaranteed that the terminal device can process the message to be sent. It is necessary to further confirm whether the quantity of all the sent messages is greater than or equal to the total threshold. If all the sent messages are greater than or equal to the total threshold, discard the message to be sent. Otherwise, send the message to be sent and increment the first quantity of the sent messages with the priority. Exemplarily, the messages include Message A, Message B, and Message C. The quantity threshold of Message A is 20, the quantity threshold of Message B is 30, the quantity threshold of Message C is 50, and the total threshold is 80. Then, if the quantity of the sent Message A is 10, the quantity of the sent Message B is 20, and the quantity of the sent Message C is 50, since the total quantity of the sent messages has reached 80, even if the sent quantities of Message A and Message B have not reached the quantity threshold, they will be discarded.

[0083] Figure 6 This is a schematic diagram of an application scenario of an embodiment of the present disclosure. As Figure 6As shown, in this application scenario, there are multiple terminal devices 601 - 603 and a server 604, where the multiple terminal devices and the server perform data interaction through a wired or wireless connection. As Figure 6 As shown, it is a process of sending messages in a live broadcast scenario. During a certain period, terminal devices 601 - 603 send messages to other terminals in the live broadcast room, and these messages are cached on the server 604. After that, when the server receives a pull instruction from a terminal device, it sends the cached messages to the corresponding terminal device. Since the processing capabilities of each terminal device may be different, the upper limit of the number of messages that each terminal device or each type of terminal device can process per unit time (such as 1 second) can be configured on the server, such as 100 messages per second, that is, the total threshold mentioned above. Using the technical solution in the embodiments of the present disclosure, a quantity threshold per unit time can also be set for each different type of message, such as 50 chat messages and 50 gift messages. In this way, when the number of chat messages sent within 1 second exceeds 50 or the number of gift messages exceeds 50, the corresponding type of message is discarded; further, gift messages can be divided into gift A messages and gift B messages. Among them, since gift B has a higher value, its priority is higher. As mentioned above, in order to ensure that gift B messages can be sent, the count of gift B is recorded by the counter of the next time period, so that gift B can be guaranteed to be sent. Assume that 50 chat messages, gift A, and gift B are all generated during period T. Since gift B uses the counter of period T + 1, the gift can be guaranteed to be sent. And by the time of period T + 1, since the counter of the gift message has been full of 50, all gift A in period T + 1 is discarded, while gift B can use the counter of period T + 1 to ensure being sent. Under normal circumstances, since the value of gift B is relatively high, the messages of gift B will not always be generated at the above speed. Therefore, it can be ensured that in general, the total number of messages after period T + 1 is not greater than 100 to maintain the balance between the sending speed of the server and the processing speed of the terminal device.

[0084] The embodiments of the present disclosure disclose a method, device, electronic device, and computer - readable storage medium for controlling message sending. The method for controlling message sending includes: obtaining a message to be sent; determining the priority of the message to be sent; determining a first quantity, where the first quantity is the number of messages with the same priority that have been sent before the message to be sent; and discarding the message to be sent when the first quantity is greater than or equal to the quantity threshold corresponding to the priority. The above - mentioned method determines whether to send the message through the quantity threshold corresponding to the priority of the message, and solves the technical problem of message backlog caused by slow terminal processing speed.

[0085] In the foregoing, although the steps in the above method embodiments are described in the above order, those skilled in the art should understand that the steps in the embodiments of the present disclosure do not necessarily need to be executed in the above order, and they can also be executed in other orders such as reverse order, parallel order, cross order, etc. Moreover, based on the above steps, those skilled in the art can also add other steps, and these obvious variations or equivalent replacement methods should also be included in the protection scope of the present disclosure and will not be elaborated herein.

[0086] Figure 7 The figure is a schematic structural diagram of an embodiment of a control device for message sending provided by an embodiment of the present disclosure. As Figure 7 shown, the device 700 includes: a message to be sent acquisition module 701, a priority determination module 702, a first quantity determination module 703, and a control module 704. Among them,

[0087] The message to be sent acquisition module 701 is configured to acquire a message to be sent;

[0088] The priority determination module 702 is configured to determine the priority of the message to be sent;

[0089] The first quantity determination module 703 is configured to determine a first quantity, where the first quantity is the quantity of messages of the priority that have been sent before the message to be sent is sent;

[0090] The control module 704 is configured to discard the message to be sent when the first quantity is greater than or equal to the quantity threshold corresponding to the priority.

[0091] Furthermore, the control module 704 is further configured to:

[0092] Send the message to be sent when the first quantity is less than the quantity threshold corresponding to the priority; and accumulate the first quantity.

[0093] Furthermore, the first quantity determination module 703 is further configured to:

[0094] Obtain the timestamp of the message to be sent;

[0095] Determine the first quantity of messages of the priority that have been sent within a unit time according to the timestamp.

[0096] Furthermore, the first quantity determination module 703 is further configured to:

[0097] In response to the first sub-priority of the first priority of the message to be sent, determine the first quantity of messages of the first priority that have been sent within a unit time according to the timestamp; where the first quantity is recorded within the unit time determined by the next timestamp.

[0098] Further, the first quantity determination module 703 is further configured to:

[0099] In response to the second sub-priority of the first priority of the message to be sent, determine the first quantity of the messages of the first priority that have been sent within the unit time where the time stamp is located; wherein, the first quantity of the messages of the first priority that have been sent includes the quantity of the messages of the first sub-priority of the first priority sent within the previous unit time.

[0100] Further, the control module 704 is further configured to:

[0101] When the first quantity is less than the quantity threshold corresponding to the priority, determine whether the quantity of all the sent messages is greater than or equal to the total threshold;

[0102] If the quantity of all the sent messages is greater than or equal to the total threshold, discard the message to be sent;

[0103] If the quantity of all the sent messages is less than the total threshold, send the message to be sent and accumulate the first quantity.

[0104] Further, the priority determination module 702 is further configured to:

[0105] Determine the type of the message to be sent;

[0106] Determine the priority of the message to be sent according to the type.

[0107] Further, the apparatus 700 further includes:

[0108] A quantity threshold setting module, configured to set quantity thresholds for messages of different priorities, wherein the quantity threshold for high-priority messages is not less than the quantity threshold for low-priority messages.

[0109] Further, the apparatus 700 further includes:

[0110] A counter start module, configured to obtain the first time stamp of the message to be sent; if the first time stamp is different from the second time stamp of the previous message to be sent, start the counter corresponding to the first time stamp, wherein the counter is used to record the quantity of the messages with the time stamp being the first time stamp that have been sent.

[0111] Figure 7 The shown apparatus can execute Figures 1-5 The method of the shown embodiment. For parts not described in detail in this embodiment, reference can be made to Figures 1-5Description of the related embodiments shown. For the implementation process and technical effects of this technical solution, please refer to Figures 1-5 the description in the embodiments shown, which will not be elaborated here.

[0112] Next, refer to Figure 8 , which shows a schematic structural diagram of an electronic device 800 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0113] As Figure 8 shown, the electronic device 800 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 802 or the programs loaded from the storage device 808 into the random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.

[0114] Generally, the following devices may be connected to the I / O interface 805: an input device 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. The communication device 809 can allow the electronic device 800 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 8 shows the electronic device 800 having various devices, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.

[0115] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowchart can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-described functions defined in the method of the embodiment of the present disclosure are performed.

[0116] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0117] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LANs"), wide area networks ("WANs"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.

[0118] The above computer-readable medium can be included in the above electronic device; or can exist separately without being assembled into the electronic device.

[0119] The above computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: obtain an input image and a first text; extract features of the input image to obtain a feature vector of the input image; encode the first text to obtain a feature vector of the first text; obtain a joint feature vector according to the feature vector of the input image and the feature vector of the first text; and decode the joint feature vector to generate a second text.

[0120] Computer program code for performing the operations of the present disclosure can be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet).

[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code, which contains one or more executable instructions for implementing the specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in a different order than that noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0122] The units involved in the embodiments described in the present disclosure can be implemented in software or in hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.

[0123] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Arrays (FPGA), Application Specific Integrated Circuits (ASIC), Application Specific Standard Products (ASSP), System on a Chip (SOC), Complex Programmable Logic Devices (CPLD), and so on.

[0124] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM or Flash Memory), an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] According to one or more embodiments of the present disclosure, a method for controlling message sending is provided, including:

[0126] Obtaining a message to be sent;

[0127] Determine the priority of the message to be sent;

[0128] Determine a first quantity, where the first quantity is the number of messages of the priority that have been sent before the message to be sent is sent;

[0129] In the case where the first quantity is greater than or equal to the quantity threshold corresponding to the priority, discard the message to be sent.

[0130] Furthermore, the method further includes:

[0131] In the case where the first quantity is less than the quantity threshold corresponding to the priority, send the message to be sent;

[0132] Accumulate the first quantity.

[0133] Furthermore, the determination of the first quantity includes:

[0134] Obtain the timestamp of the message to be sent;

[0135] Determine a first quantity of messages of the priority that have been sent within a unit time according to the timestamp.

[0136] Furthermore, the determination of the first quantity of messages of the priority that have been sent within a unit time according to the timestamp includes:

[0137] In response to the first sub - priority of the first priority of the message to be sent, determine a first quantity of messages of the first priority that have been sent within a unit time according to the timestamp; where the first quantity is recorded within the unit time determined by the next timestamp.

[0138] Furthermore, the determination of the first quantity of messages of the priority that have been sent within a unit time according to the timestamp includes:

[0139] In response to the second sub - priority of the first priority of the message to be sent, determine a first quantity of messages of the first priority that have been sent within the unit time where the timestamp is located according to the timestamp; where the first quantity of the messages of the first priority that have been sent includes the number of messages of the first sub - priority of the first priority sent within the previous unit time.

[0140] Furthermore, the method further includes:

[0141] In the case where the first quantity is less than the quantity threshold corresponding to the priority, determine whether the number of all sent messages is greater than or equal to the total threshold;

[0142] If the number of all the messages that have been sent is greater than or equal to the total threshold value, discard the message to be sent;

[0143] If the number of all the messages that have been sent is less than the total threshold value, send the message to be sent and accumulate the first quantity.

[0144] Further, determining the priority of the message to be sent includes:

[0145] Determine the type of the message to be sent;

[0146] Determine the priority of the message to be sent according to the type.

[0147] Further, before obtaining the message to be sent, it further includes:

[0148] Set quantity thresholds for messages with different priorities, where the quantity threshold for high-priority messages is not less than that for low-priority messages.

[0149] Further, after obtaining the message to be sent, it further includes:

[0150] Obtain the first timestamp of the message to be sent;

[0151] If the first timestamp is different from the second timestamp of the previous message to be sent, start a counter corresponding to the first timestamp, where the counter is used to record the number of messages with the first timestamp that have been sent.

[0152] According to one or more embodiments of the present disclosure, there is provided a control device for message sending, including:

[0153] A message to be sent acquisition module, configured to acquire a message to be sent;

[0154] A priority determination module, configured to determine the priority of the message to be sent;

[0155] A first quantity determination module, configured to determine a first quantity, where the first quantity is the number of messages of the priority that have been sent before the message to be sent is sent;

[0156] A control module, configured to discard the message to be sent when the first quantity is greater than or equal to the quantity threshold corresponding to the priority.

[0157] Further, the control module is further configured to:

[0158] Send the message to be sent when the first quantity is less than the quantity threshold corresponding to the priority; accumulate the first quantity.

[0159] Further, the first quantity determination module is further configured to:

[0160] Obtain the timestamp of the message to be sent;

[0161] Determine a first quantity of messages of the priority level that have been sent within a unit time according to the timestamp.

[0162] Further, the first quantity determination module is further configured to:

[0163] In response to the first sub-priority of the priority level of the message to be sent being the first priority level, determine a first quantity of messages of the first priority level that have been sent within a unit time according to the timestamp; wherein the first quantity is recorded within the unit time determined by the next timestamp.

[0164] Further, the first quantity determination module is further configured to:

[0165] In response to the second sub-priority of the priority level of the message to be sent being the first priority level, determine a first quantity of messages of the first priority level that have been sent within the unit time where the timestamp is located; wherein the first quantity of the messages of the first priority level that have been sent includes the quantity of messages of the first sub-priority of the first priority level sent within the previous unit time.

[0166] Further, the control module is further configured to:

[0167] In the case where the first quantity is less than the quantity threshold corresponding to the priority level, determine whether the quantity of all the messages that have been sent is greater than or equal to the total quantity threshold;

[0168] If the quantity of all the messages that have been sent is greater than or equal to the total quantity threshold, discard the message to be sent;

[0169] If the quantity of all the messages that have been sent is less than the total quantity threshold, send the message to be sent and accumulate the first quantity.

[0170] Further, the priority determination module is further configured to:

[0171] Determine the type of the message to be sent;

[0172] Determine the priority level of the message to be sent according to the type.

[0173] Further, the apparatus further includes:

[0174] A quantity threshold setting module, configured to set quantity thresholds for messages of different priority levels, wherein the quantity threshold for a message of a high priority level is not less than the quantity threshold for a message of a low priority level.

[0175] Further, the device further includes:

[0176] A counter start module, configured to obtain a first timestamp of the message to be sent; if the first timestamp is different from a second timestamp of the previous message to be sent, start a counter corresponding to the first timestamp, where the counter is used to record the number of messages that have been sent with the timestamp being the first timestamp.

[0177] According to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the message sending control methods in the foregoing first aspect.

[0178] According to one or more embodiments of the present disclosure, there is provided a non-transitory computer-readable storage medium, characterized in that the non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute any one of the message sending control methods in the foregoing first aspect.

[0179] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, a technical solution formed by mutually replacing the above features with (but not limited to) technical features having similar functions disclosed in the present disclosure.

Claims

1. A control method for message sending, characterized in that, Including: Obtain the message to be sent; Determine the priority of the message to be sent; Specifically including: Automatically set the priority of each type of message according to the number of historical messages; Determine a first quantity, where the first quantity is the number of messages of the priority that have been sent before the message to be sent is sent; wherein, the determining of the first quantity specifically includes: Obtain the timestamp of the message to be sent; Determine the first quantity of the messages of the priority that have been sent within a unit time according to the timestamp; wherein, the determining of the first quantity of the messages of the priority that have been sent within a unit time according to the timestamp specifically includes: In response to the priority of the message to be sent being the first sub-priority of the first priority, determine the number of messages of the first sub-priority that have been sent within a unit time according to the timestamp, and record the quantity as the first quantity in the counter used in the next time period; The first priority includes a first sub-priority and a second sub-priority, and the priority of the first sub-priority is higher than that of the second sub-priority; In the case where the first quantity is greater than or equal to the quantity threshold corresponding to the priority, discard the message to be sent.

2. The control method for message sending according to claim 1, characterized in that The method further includes: In the case where the first quantity is less than the quantity threshold corresponding to the priority, send the message to be sent; Accumulate the first quantity.

3. The control method for message sending according to claim 1, wherein The determining of the first quantity of the messages of the priority that have been sent within a unit time according to the timestamp includes: In response to the priority of the message to be sent being the second sub-priority of the first priority, determine the first quantity of the messages of the first priority that have been sent within the unit time where the timestamp is located according to the timestamp; wherein, the first quantity of the messages of the first priority that have been sent includes the number of messages of the first sub-priority of the first priority sent in the previous unit time.

4. The control method for message sending according to claim 1, characterized in that, The method further includes: In the case where the first quantity is less than the quantity threshold corresponding to the priority, determine whether the number of all sent messages is greater than or equal to the total threshold; If the number of all sent messages is greater than or equal to the total threshold, discard the message to be sent; If the number of all sent messages is less than the total threshold, send the message to be sent and accumulate the first quantity.

5. The control method for message sending according to claim 1, wherein The determining of the priority of the message to be sent includes: Determine the type of the message to be sent; Determine the priority of the message to be sent according to the type.

6. The control method for message sending according to claim 1, characterized in that, Before the obtaining of the message to be sent, it further includes: Set quantity thresholds for messages of different priorities, where the quantity threshold for high-priority messages is not less than that for low-priority messages.

7. The control method for message sending according to claim 1, characterized in that After the obtaining of the message to be sent, it further includes: Obtain the first timestamp of the message to be sent; If the first timestamp is different from the second timestamp of the previous message to be sent, start the counter corresponding to the first timestamp, where the counter is used to record the number of sent messages with the timestamp being the first timestamp.

8. A control device for message sending, characterized in that Including: A module for obtaining the message to be sent, configured to obtain the message to be sent; A priority determination module for determining the priority of the message to be sent; Specifically for: automatically setting the priority of each type of message according to the number of historical messages; A first quantity determination module for determining a first quantity, where the first quantity is the number of messages of the priority that have been sent before the message to be sent is sent; specifically for: obtaining the timestamp of the message to be sent; determining the first quantity of the messages of the priority that have been sent within a unit time according to the timestamp; specifically for: in response to the priority of the message to be sent being the first sub-priority of the first priority, determining the number of messages of the first sub-priority that have been sent within a unit time according to the timestamp, and recording the quantity as the first quantity in the counter used in the next time period; the first priority includes a first sub-priority and a second sub-priority, and the priority of the first sub-priority is higher than that of the second sub-priority; A control module for discarding the message to be sent when the first quantity is greater than or equal to the quantity threshold corresponding to the priority.

9. An electronic device, comprising: A memory for storing computer-readable instructions; And A processor for running the computer-readable instructions, so that when the processor runs, it implements the method according to any one of claims 1-7.

10. A non-transitory computer-readable storage medium for storing computer-readable instructions, which when executed by a computer, cause the computer to execute the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for processing interactive message in live video

    CN110191348A

  • Message sending method and device, readable medium and electronic equipment

    CN110662085A