Movatterモバイル変換


[0]ホーム

URL:


CN112199174B - Message sending control method and device, electronic equipment and computer readable storage medium - Google Patents

Message sending control method and device, electronic equipment and computer readable storage medium
Download PDF

Info

Publication number
CN112199174B
CN112199174BCN202011060102.4ACN202011060102ACN112199174BCN 112199174 BCN112199174 BCN 112199174BCN 202011060102 ACN202011060102 ACN 202011060102ACN 112199174 BCN112199174 BCN 112199174B
Authority
CN
China
Prior art keywords
priority
message
sent
messages
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011060102.4A
Other languages
Chinese (zh)
Other versions
CN112199174A (en
Inventor
许凤强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co LtdfiledCriticalBeijing ByteDance Network Technology Co Ltd
Priority to CN202011060102.4ApriorityCriticalpatent/CN112199174B/en
Publication of CN112199174ApublicationCriticalpatent/CN112199174A/en
Priority to PCT/CN2021/115015prioritypatent/WO2022068488A1/en
Application grantedgrantedCritical
Publication of CN112199174BpublicationCriticalpatent/CN112199174B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本公开实施例公开了一种消息发送的控制方法、装置、电子设备和计算机可读存储介质。其中该消息发送的控制方法包括:获取待发送消息;确定所述待发送消息的优先级;确定第一数量,其中所述第一数量为在所述待发送消息发送之前已经发送的所述优先级的消息的数量;在所述第一数量大于或等于与所述优先级所对应的数量阈值的情况下,丢弃所述待发送消息。上述方法通过与消息的优先级对应的数量阈值确定是否发送所述消息,解决了终端处理速度慢所导致的消息积压的技术问题。

The disclosed embodiments 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, wherein the first quantity is the number 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 by a quantity threshold corresponding to the priority of the message, thereby solving the technical problem of message backlog caused by slow terminal processing speed.

Description

Message sending control method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of message processing, and in particular, to a method and apparatus for controlling message transmission, an electronic device, and a computer readable storage medium.
Background
With the rapid development of information technology, mobile internet technology is also rapidly advancing. Whether the intelligent equipment is appeared or the 5G age is coming, or the big data, AI intelligence, algorithm and other technologies are applied, the flying wings are inserted into the electronic mobile equipment. In real life, the technology is beneficial to the richness and the color of social interaction, especially the appearance of a smart phone, breaks the space-time limit of daily interaction of human beings, is a comprehensive palm mobile device truly integrating mass information, network audio-visual and leisure entertainment and the like, and meets the daily information demands and the social interaction of people.
Many platforms currently provide live services, the number of people in a live broadcast room may vary from a few people to hundreds of thousands of people, the interaction frequency of audiences is very high, hundreds of interaction messages may be generated per second, and the processing capacity of a client is limited.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In order to solve the above technical problems, the embodiments of the present disclosure provide the following technical solutions.
In a first aspect, an embodiment of the present disclosure provides a method for controlling message transmission, including:
Acquiring a message to be sent;
Determining the priority of the message to be sent;
determining a first number, wherein the first number is the number of messages of the priority that have been sent prior to the sending of the message to be sent;
And discarding the message to be sent when the first number is greater than or equal to a number threshold corresponding to the priority.
In a second aspect, an embodiment of the present disclosure provides a control apparatus for message transmission, including:
The message to be sent acquisition module is used for acquiring the message to be sent;
a priority determining module, configured to determine a priority of the message to be sent;
A first number determining module configured to determine a first number, where the first number is a number of messages of the priority that have been sent before the message to be sent is sent;
and the control module is used for discarding the message to be sent when the first number is greater than or equal to a number threshold corresponding to the priority.
In a third aspect, embodiments of the present disclosure provide an electronic device comprising at least one processor, and
And a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of the preceding aspects.
In a fourth aspect, embodiments of the present disclosure provide 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 perform the method of any one of the preceding aspects.
The embodiment of the disclosure discloses a method, a device, an electronic device and a computer readable storage medium for controlling message transmission. The message transmission control method comprises the steps of obtaining a message to be transmitted, determining the priority of the message to be transmitted, determining a first quantity, wherein the first quantity is the quantity of messages with the priority, which are transmitted before the message to be transmitted is transmitted, and discarding the message to be transmitted when the first quantity is greater than or equal to a quantity threshold corresponding to the priority. . The method determines whether to send the message or not through the quantity threshold corresponding to the priority of the message, and solves the technical problem of message backlog caused by low terminal processing speed.
The foregoing description is only an overview of the disclosed technology, and may be implemented in accordance with the disclosure of the present disclosure, so that the above-mentioned and other objects, features and advantages of the present disclosure can be more clearly understood, and the following detailed description of the preferred embodiments is given with reference to the accompanying drawings.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a flow chart of a method for controlling message transmission according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of determining a priority of a message to be sent in a method for controlling message sending according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an example of determining a first number in a method for controlling message transmission according to an embodiment of the present disclosure;
fig. 4 is a schematic flow chart of starting a counter in a control method for message transmission according to an embodiment of the disclosure;
Fig. 5 is a schematic diagram of a usage manner of a counter in a method for controlling message transmission according to an embodiment of the present disclosure;
Fig. 6 is an application scenario schematic diagram of a method for controlling message transmission according to an embodiment of the present disclosure.
Fig. 7 is a schematic structural diagram of an embodiment of a control device for message transmission provided in an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment," another embodiment "means" at least one additional embodiment, "and" some embodiments "means" at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Fig. 1 is a flowchart of an embodiment of a method for controlling messaging according to an embodiment of the present disclosure, where the method for controlling messaging according to the embodiment may be performed by a messaging control device, and the messaging control device may be implemented in software, or a combination of software and hardware, and the messaging control device may be integrally provided in a device in a messaging control system, such as a messaging control server or a messaging control terminal device. As shown in fig. 1, the method comprises the steps of:
step S101, obtaining a message to be sent;
Optionally, the message to be sent is a message generated by a sending device of the message or a message to be forwarded received by the server from the terminal device. In an exemplary live broadcast scenario, a plurality of terminal devices located in the same live broadcast room send messages to a server providing live broadcast services, then the plurality of terminals regularly pull all messages in a previous period from the server, and after receiving a pull instruction, the server sends the messages cached in the previous period to the terminal corresponding to the pull instruction.
The message to be sent is buffered in a server, the terminal device sends a pull request of the message every unit time, and the server fetches the messages buffered in the last unit time from the buffer after receiving the pull request. Wherein each of the cached messages is a message to be sent in the step. Optionally, the message to be sent is cached in a queue, and when the server acquires the message to be sent, one message to be sent is fetched from the top of the queue at a time.
Illustratively, in the live broadcast scenario, the message to be sent is a chat message, a gift message, or the like acquired from all terminals joining the live broadcast room.
Step S102, determining the priority of the message to be sent;
in the embodiment of the disclosure, all the messages have corresponding priorities, and the priorities are preset identifiers for representing importance degrees of the messages.
Optionally, the step S102 includes:
Step S201, determining the type of the message to be sent;
step S202, determining the priority of the message to be sent according to the type.
Optionally, in a messaging system, the messages are divided into a plurality of types, and exemplary, the messages are divided into type a messages and type B messages, each type of message is pre-prioritized, e.g., the type a message is prioritized to a first priority and the type B message is prioritized to a second priority, further, each type of message may be further subdivided into sub-types, e.g., the type B message may be further subdivided into type B1 messages and type B2 messages, and in the sub-types, there may be further sub-priorities, where in the case of the second priority, the sub-priority of the type B1 message is higher than the sub-priority of the type B2 message. Taking the live broadcast scenario as an example, the messages in live broadcast can be generally divided into chat messages and gift messages, wherein the priority of the chat messages is 1, and the priority of the gift messages is 2, and the gift can be divided into gift 1 and gift 2 due to different types, wherein the priority of the gift 1 is 2.1, and the priority of the gift 2 is 2.2. Thus, in step S202, the priority of the message can be determined by the type of the message.
Optionally, before the step S101 or the step S102, a priority is set for each type of message. Optionally, the priority of each type of message can be automatically set according to the number of the historical messages, for example, the number of the messages is counted, the priority is automatically set according to the number of the messages, and the lower the corresponding priority is, the lower the corresponding number of the messages is, and the corresponding priority is higher. As in the live scenario described above, the priority of chat messages may be set lower than the priority of gift messages, and then in the gift messages, the priority of gift 1 is lower than the priority of gift 2, and so on.
Optionally, before the step S101 or the step S102, the method further includes:
a number threshold is set for messages of different priorities. Optionally, the number threshold of messages of high priority is not less than the number threshold of messages of low priority. That is, a high priority message may send more than a low priority message.
Step S103, determining a first quantity;
Wherein the first number is the number of messages of the priority that have been sent before the message to be sent was sent. In this step, after determining the priority of the message to be sent, a first number of messages of said priority that have been sent is obtained. For example, if the priority of the message to be sent is the first priority, the number of messages of the first priority that have been sent before the message to be sent is obtained.
Alternatively, the number of messages of different priorities that have been sent is recorded by setting a counter to the messages of different priorities. Such as a first priority counter, which is incremented by 1 each time a first priority message is sent. When the first number needs to be acquired, the value of the counter is read.
Optionally, the step S103 includes:
step S301, a time stamp of the message to be sent is obtained;
step S302, determining a first number of messages of the priority that have been sent in a unit time according to the timestamp.
In this alternative embodiment, each message to be sent is provided with a timestamp T, which is shown in seconds, that is, the message to be sent is obtained in step S301, it is understood that, since many messages in one second are obtained, the second-level timestamps of many messages are the same, and at this time, the messages of the same type can be distinguished according to the ID or the sequence number of the message or the lower-level timestamp, which is not described herein.
Optionally, in step S302, the timestamp corresponds to the unit time, for example, the unit time is a period in which the terminal pulls the message from the server, for example, 1 second once, and the accuracy of the timestamp is also 1 second, where the timestamp and the unit time may be directly corresponding to each other, for example, t=1, and the number of the messages with the priorities that have been sent and have the timestamp of t=1 is directly calculated to be the first number.
Optionally, as described above, the first data corresponding to the messages with different priorities is recorded by a counter. At this time, after the step S101, further includes:
step S401, obtaining a first time stamp of the message to be sent;
In step S402, if the first timestamp is different from the second timestamp of the last message to be sent, a counter corresponding to the first timestamp is started, where the counter is used to record the number of sent messages with the timestamp being the first timestamp.
In this alternative embodiment, the timestamp of the message corresponds to a unit of time, i.e., when the timestamp changes, indicating the message pull into the next period. Thus, in the following S401, the first timestamp of the message to be sent is obtained, and in step S402, it is compared whether the first timestamp is the same as the second timestamp of the last message to be sent, and if it is different, the two messages are located in different pull periods, at which time a counter is started for the first timestamp to record the number of sent messages whose timestamp is the first timestamp.
Alternatively, since the server corresponds to a plurality of terminals, each terminal has different processing capabilities, the first number of messages sent under each priority level is recorded independently for different terminals. The number of messages that have been sent is calculated for each priority, e.g. for each terminal in the living room.
Step S104, discarding the message to be sent when the first number is greater than or equal to the number threshold corresponding to the priority;
wherein the number threshold of messages of different priorities is related to the priority of the message. Illustratively, the number of high priority messages is not less than the number of low priority messages. I.e. the greater the priority of a message, the greater the number of messages that can be sent.
In this step, it is determined whether the first number is greater than or equal to a preset number threshold, and if so, the message to be sent is discarded, because the message sent at this time already exceeds the processing capability of the corresponding terminal, and even if the data to be sent is sent to the terminal, the terminal cannot process the data.
By the technical scheme, the number threshold is independently set for the messages with different priorities, so that the problems that the terminal cannot process the messages or the client terminal processing the messages on the terminal crashes and the like caused by too many messages can be effectively controlled. And because the quantity threshold values are independently set for different priorities, the important messages can be guaranteed to be processed preferentially, so that the flow of the messages can be controlled, and the important messages can be guaranteed not to be lost.
Further, after the step S104, the method further includes:
transmitting the message to be transmitted under the condition that the first number is smaller than a number threshold corresponding to the priority;
the first number is accumulated.
That is, if the preset number threshold is not exceeded, the message is transmitted, and the number of transmitted messages corresponding to the priority of the message is accumulated.
On the basis of the above technical solution, optionally, step S302 includes:
And responding to the first sub-priority of which the priority of the message to be sent is the first priority, and determining the first quantity of the messages of the first priority which are sent in unit time according to the time stamp, wherein the first quantity is recorded in the unit time determined by the next time stamp.
Wherein the first sub-priority is a high-level sub-priority under the first priority. In this alternative embodiment, the sent number of messages of the first sub-priority is recorded in a counter used in the next time period. For example, in a live scene, the gift message includes gift 1 and gift 2, wherein the child priority of gift 2 is higher, and since the counter of the gift message is commonly used by gift 1 and gift 2, there may be a case that the number of gift 1 is too large, the threshold value of the number of first priority is consumed, and more important gift 2 cannot be transmitted. Thus, in this alternative embodiment, the first sub-priority message is counted using a counter used per unit time as determined by the next timestamp. If the timestamp of the message to be sent is T, the counter of the first priority of the T+1 timestamp is used for counting the sent messages of the first sub-priority.
Optionally, the step S302 includes:
and responding to the second sub-priority of which the priority of the message to be sent is the first priority, and determining the first quantity of the messages of the first priority which are sent in the unit time of the time stamp according to the time stamp, wherein the quantity of the messages of the first priority which are sent comprises the quantity of the messages of the first sub-priority of the first priority which are sent in the last unit time.
In this alternative embodiment, if the priority of the message to be sent is the second sub-priority of the first priority, the first number of messages of the first priority is read from the counter corresponding to the unit time in which the timestamp is located. It should be noted that, in addition to the counter corresponding to the first timestamp, the counters of the messages of the first priority corresponding to the other timestamps include the number of the messages of the first sub-priority of the first priority sent in the previous unit time. I.e. the number of messages of the second sub-priority transmitted in the previous period, the number of messages of the second sub-priority transmitted in the previous period being included in the number of transmitted messages of the first priority in the current period.
Fig. 5 is an example of the message counting method described above. As shown in fig. 5, the system includes two messages, message a and message B, where message B can be further divided into message B1 and message B2, where message a has a lower priority than message B, message B1 has a lower priority than message B2, all messages a that have been sent out are counted by counter countA _t1 at time T1, all messages B1 that have been sent out are counted by countB _t1, all messages B2 that have been sent out are counted by countB _t2, and so on. In this way, since the counter of the next period used by the message B2 counts, it can be ensured that the message B2 is sent out, so that the message with the higher priority can be ensured to be sent out.
Optionally, the method for controlling message sending further includes:
Determining whether the number of all sent messages is greater than or equal to a total threshold value if the first number is less than a number threshold value corresponding to the priority;
Discarding the message to be sent if the number of all sent messages is greater than or equal to the total threshold;
and if the number of all the sent messages is smaller than the total number threshold value, sending the messages to be sent, and accumulating the first number.
In the above alternative embodiment, it is also necessary to set a total threshold, which may be the maximum capability of the terminal device to process messages, which is smaller than the sum of the number thresholds of messages of the respective priorities. At this time, when the number of messages having sent the priority is smaller than the number threshold, it cannot be guaranteed that the terminal device can process the messages to be sent, it needs to be further confirmed whether the number of all sent messages is greater than or equal to the total number threshold, and if all sent messages are greater than or equal to the total number threshold, the messages to be sent are discarded. Otherwise, the message to be sent is sent, and the first number of the messages with the priority sent is accumulated. By way of example, the message includes message a, message B and message C, where the number of messages a is 20, the number of messages B is 30, the number of messages C is 50, and the total number is 80, then if the number of messages a sent is 10, the number of messages B sent is 20, and the number of messages C sent is 50, then since the total number of messages sent is 80, even if the number of messages a and B sent has not reached the number threshold, they are discarded.
Fig. 6 is a schematic diagram of an application scenario in an embodiment of the disclosure. As shown in fig. 6, in this application scenario, a plurality of terminal devices 601-603 and a server 604 are included, wherein the plurality of terminal devices interact with the server via wired or wireless links. As shown in fig. 6, a process of sending a message in a live broadcast scenario is shown, in which, in a certain period of time, terminal devices 601-603 send messages to other terminals in the live broadcast room, where the messages are cached on the server 604, and then after the server receives a pull instruction of the terminal device, the cached messages are sent to the corresponding terminal devices. Since the processing capability of each terminal device may be different, the upper limit of messages that can be processed per unit time (e.g. 1 second) of each terminal device or each type of terminal device may be configured on the server, for example, 100 messages per second, that is, the total threshold described above, and using the technical solution in the embodiment of the present disclosure, a threshold of number per unit time may be set for each different type of message, for example, 50 chat messages and 50 gift messages, so that when the chat messages that have been sent in 1 second exceed 50 or the gift messages exceed 50, the corresponding type of messages are discarded, and further, the gift messages may be classified into a gift message and a gift message B, where the priority is higher due to higher value, as described above, in order to enable the gift B message to be sent out, the count of the gift B is recorded by the counter of the next period, so that the gift B can be ensured to be sent out. Assuming that 50 chat messages, gift a and gift B are generated during the T period, the gift B can be guaranteed to be transmitted since it uses the counter of the t+1 period. By the time t+1, since the counter of the gift message has been counted up to 50, the gift a is discarded in its entirety in the time t+1, and the gift B can be guaranteed to be sent out using the counter of the time t+1. In general, since the value of the gift B is high, the message of the gift B is not always generated at the above speed, so that it is ensured that the total number of messages after the period t+1 is generally not more than 100, so as to maintain the balance between the transmission speed of the server and the processing speed of the terminal device.
The embodiment of the disclosure discloses a method, a device, an electronic device and a computer readable storage medium for controlling message transmission. The message transmission control method comprises the steps of obtaining a message to be transmitted, determining the priority of the message to be transmitted, determining a first quantity, wherein the first quantity is the quantity of messages with the priority, which are transmitted before the message to be transmitted is transmitted, and discarding the message to be transmitted when the first quantity is greater than or equal to a quantity threshold corresponding to the priority. The method determines whether to send the message or not through the quantity threshold corresponding to the priority of the message, and solves the technical problem of message backlog caused by low terminal processing speed.
In the foregoing, although the steps in the foregoing method embodiments are described in the foregoing order, it should be clear to those skilled in the art that the steps in the embodiments of the disclosure are not necessarily performed in the foregoing order, but may be performed in reverse order, parallel, cross, etc., and other steps may be further added to those skilled in the art on the basis of the foregoing steps, and these obvious modifications or equivalent manners are also included in the protection scope of the disclosure and are not repeated herein.
Fig. 7 is a schematic structural diagram of an embodiment of a control device for message transmission according to an embodiment of the present disclosure. As shown in fig. 7, the apparatus 700 includes a message to be transmitted acquisition module 701, a priority determination module 702, a first number determination module 703, and a control module 704. Wherein, the
A message to be sent acquisition module 701, configured to acquire a message to be sent;
A priority determining module 702, configured to determine a priority of the message to be sent;
a first number determining module 703, configured to determine a first number, where the first number is a number of messages of the priority that have been sent before the message to be sent is sent;
and a control module 704, configured to discard the message to be sent if the first number is greater than or equal to a number threshold corresponding to the priority.
Further, the control module 704 is further configured to:
and under the condition that the first quantity is smaller than a quantity threshold corresponding to the priority, sending the message to be sent, and accumulating the first quantity.
Further, the first number determining module 703 is further configured to:
Acquiring a time stamp of the message to be sent;
A first number of messages of the priority that have been sent in a unit time is determined from the timestamp.
Further, the first number determining module 703 is further configured to:
and determining a first number of messages of the first priority, which have been transmitted in a unit time, according to the time stamp in response to the priority of the message to be transmitted being a first sub-priority of the first priority, wherein the first number is recorded in the unit time determined by the next time stamp.
Further, the first number determining module 703 is further configured to:
And responding to the second sub-priority of which the priority of the message to be sent is the first priority, and determining the first quantity of the messages of the first priority which are sent in the unit time of the time stamp according to the time stamp, wherein the first quantity of the messages of the first priority which are sent comprises the quantity of the messages of the first sub-priority of the first priority which are sent in the last unit time.
Further, the control module 704 is further configured to:
Determining whether the number of all sent messages is greater than or equal to a total threshold value if the first number is less than a number threshold value corresponding to the priority;
Discarding the message to be sent if the number of all sent messages is greater than or equal to the total threshold;
and if the number of all the sent messages is smaller than the total number threshold value, sending the messages to be sent, and accumulating the first number.
Further, the priority determining module 702 is further configured to:
Determining the type of the message to be sent;
And determining the priority of the message to be sent according to the type.
Further, the apparatus 700 further includes:
And the quantity threshold setting module is used for setting quantity thresholds for messages with different priorities, wherein the quantity threshold of the messages with high priority is not smaller than the quantity threshold of the messages with low priority.
Further, the apparatus 700 further includes:
And if the first time stamp is different from the second time stamp of the last message to be sent, starting a counter corresponding to the first time stamp, wherein the counter is used for recording the number of the sent messages with the time stamp being the first time stamp.
The apparatus of fig. 7 may perform the method of the embodiment of fig. 1-5, and reference is made to the relevant description of the embodiment of fig. 1-5 for parts of this embodiment not described in detail. The implementation process and the technical effect of this technical solution are described in the embodiments shown in fig. 1 to 5, and are not described herein.
Referring now to fig. 8, a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a 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 by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, devices may be connected to I/O interface 805 including input devices 806 such as a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 807 including a Liquid Crystal Display (LCD), speaker, vibrator, etc., storage devices 808 including magnetic tape, hard disk, etc., and communication devices 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communication device 809, or installed from storage device 808, or installed from ROM 802. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having 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. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to electrical wiring, fiber optic cable, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be included in the electronic device or may exist alone without being incorporated into the electronic device.
The 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 feature vectors of the input image, encode the first text to obtain feature vectors of the first text, obtain joint feature vectors according to the feature vectors of the input image and the feature vectors of the first text, and decode the joint feature vectors to generate a second text.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures 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 diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic that may be used include Field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may 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. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, 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.
According to one or more embodiments of the present disclosure, there is provided a method of controlling message transmission, including:
Acquiring a message to be sent;
Determining the priority of the message to be sent;
determining a first number, wherein the first number is the number of messages of the priority that have been sent prior to the sending of the message to be sent;
And discarding the message to be sent when the first number is greater than or equal to a number threshold corresponding to the priority.
Further, the method further comprises:
transmitting the message to be transmitted under the condition that the first number is smaller than a number threshold corresponding to the priority;
the first number is accumulated.
Further, the determining the first number includes:
Acquiring a time stamp of the message to be sent;
A first number of messages of the priority that have been sent in a unit time is determined from the timestamp.
Further, the determining, according to the timestamp, the first number of messages of the priority that have been sent in a unit time includes:
and determining a first number of messages of the first priority, which have been transmitted in a unit time, according to the time stamp in response to the priority of the message to be transmitted being a first sub-priority of the first priority, wherein the first number is recorded in the unit time determined by the next time stamp.
Further, the determining, according to the timestamp, the first number of messages of the priority that have been sent in a unit time includes:
And responding to the second sub-priority of which the priority of the message to be sent is the first priority, and determining the first quantity of the messages of the first priority which are sent in the unit time of the time stamp according to the time stamp, wherein the first quantity of the messages of the first priority which are sent comprises the quantity of the messages of the first sub-priority of the first priority which are sent in the last unit time.
Further, the method further comprises:
Determining whether the number of all sent messages is greater than or equal to a total threshold value if the first number is less than a number threshold value corresponding to the priority;
Discarding the message to be sent if the number of all sent messages is greater than or equal to the total threshold;
and if the number of all the sent messages is smaller than the total number threshold value, sending the messages to be sent, and accumulating the first number.
Further, the determining the priority of the message to be sent includes:
Determining the type of the message to be sent;
And determining the priority of the message to be sent according to the type.
Further, before the obtaining the message to be sent, the method further includes:
a number threshold is set for messages of different priorities, wherein the number threshold for messages of high priority is not smaller than the number threshold for messages of low priority.
Further, after the obtaining the message to be sent, the method further includes:
Acquiring a first timestamp of the message to be sent;
And if the first time stamp is different from the second time stamp of the last message to be sent, starting a counter corresponding to the first time stamp, wherein the counter is used for recording the number of sent messages with the time stamp being the first time stamp.
According to one or more embodiments of the present disclosure, there is provided a control apparatus for message transmission, including:
The message to be sent acquisition module is used for acquiring the message to be sent;
a priority determining module, configured to determine a priority of the message to be sent;
A first number determining module configured to determine a first number, where the first number is a number of messages of the priority that have been sent before the message to be sent is sent;
and the control module is used for discarding the message to be sent when the first number is greater than or equal to a number threshold corresponding to the priority.
Further, the control module is further configured to:
and under the condition that the first quantity is smaller than a quantity threshold corresponding to the priority, sending the message to be sent, and accumulating the first quantity.
Further, the first number determining module is further configured to:
Acquiring a time stamp of the message to be sent;
A first number of messages of the priority that have been sent in a unit time is determined from the timestamp.
Further, the first number determining module is further configured to:
and determining a first number of messages of the first priority, which have been transmitted in a unit time, according to the time stamp in response to the priority of the message to be transmitted being a first sub-priority of the first priority, wherein the first number is recorded in the unit time determined by the next time stamp.
Further, the first number determining module is further configured to:
And responding to the second sub-priority of which the priority of the message to be sent is the first priority, and determining the first quantity of the messages of the first priority which are sent in the unit time of the time stamp according to the time stamp, wherein the first quantity of the messages of the first priority which are sent comprises the quantity of the messages of the first sub-priority of the first priority which are sent in the last unit time.
Further, the control module is further configured to:
Determining whether the number of all sent messages is greater than or equal to a total threshold value if the first number is less than a number threshold value corresponding to the priority;
Discarding the message to be sent if the number of all sent messages is greater than or equal to the total threshold;
and if the number of all the sent messages is smaller than the total number threshold value, sending the messages to be sent, and accumulating the first number.
Further, the priority determining module is further configured to:
Determining the type of the message to be sent;
And determining the priority of the message to be sent according to the type.
Further, the device further comprises:
And the quantity threshold setting module is used for setting quantity thresholds for messages with different priorities, wherein the quantity threshold of the messages with high priority is not smaller than the quantity threshold of the messages with low priority.
Further, the device further comprises:
And if the first time stamp is different from the second time stamp of the last message to be sent, starting a counter corresponding to the first time stamp, wherein the counter is used for recording the number of the sent messages with the time stamp being the first time stamp.
According to one or more embodiments of the present disclosure, there is provided an electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of controlling messaging of any of the preceding aspects.
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 the control method of message transmission of any one of the foregoing first aspects.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).

Claims (10)

Determining a first number of messages of the priority, wherein the first number is the number of messages of the priority, which have been transmitted before the messages to be transmitted are transmitted, wherein the determining the first number comprises obtaining a time stamp of the messages to be transmitted, determining the first number of messages of the priority, which have been transmitted in a unit time, according to the time stamp, wherein the determining the first number of messages of the priority, which have been transmitted in a unit time, according to the time stamp, comprises determining the number of messages of the first sub-priority, which have been transmitted in a unit time, according to the time stamp, in response to a first sub-priority of the messages of the first priority, and recording the number in a counter used in a next time period as the first number, wherein the first priority comprises a first sub-priority and a second sub-priority, and the first sub-priority is higher than the second sub-priority;
A first quantity determining module, configured to determine a first quantity, wherein the first quantity is a quantity of messages of the priority that have been sent before the message to be sent is sent, and specifically configured to obtain a timestamp of the message to be sent, determine, according to the timestamp, a first quantity of messages of the priority that have been sent in a unit time, and specifically configured to determine, according to the timestamp, a quantity of messages of the first sub-priority that have been sent in a unit time, in response to the priority of the message to be sent being a first sub-priority, and record the quantity as the first quantity in a counter used in a next period, where the first priority includes a first sub-priority and a second sub-priority, and the first sub-priority is higher than the second sub-priority;
CN202011060102.4A2020-09-302020-09-30Message sending control method and device, electronic equipment and computer readable storage mediumActiveCN112199174B (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN202011060102.4ACN112199174B (en)2020-09-302020-09-30Message sending control method and device, electronic equipment and computer readable storage medium
PCT/CN2021/115015WO2022068488A1 (en)2020-09-302021-08-27Message sending control method and apparatus, and electronic device and computer-readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011060102.4ACN112199174B (en)2020-09-302020-09-30Message sending control method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication NumberPublication Date
CN112199174A CN112199174A (en)2021-01-08
CN112199174Btrue CN112199174B (en)2025-07-08

Family

ID=74012520

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011060102.4AActiveCN112199174B (en)2020-09-302020-09-30Message sending control method and device, electronic equipment and computer readable storage medium

Country Status (2)

CountryLink
CN (1)CN112199174B (en)
WO (1)WO2022068488A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
KR101856857B1 (en)*2016-09-092018-05-11현대오트론 주식회사Apparatus and method for controlling message communication load
CN112199174B (en)*2020-09-302025-07-08北京字节跳动网络技术有限公司Message sending control method and device, electronic equipment and computer readable storage medium
CN112994934B (en)*2021-02-072023-02-10杭州迪普科技股份有限公司Data interaction method, device and system
CN115209166A (en)*2021-04-122022-10-18北京字节跳动网络技术有限公司Message sending method, device, equipment and storage medium
CN116701009B (en)*2022-11-212024-05-17荣耀终端有限公司 Data communication method and electronic equipment
CN116302593A (en)*2023-01-302023-06-23中国建设银行股份有限公司System message current limiting method, device and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110191348A (en)*2018-02-232019-08-30武汉斗鱼网络科技有限公司The processing method and processing device of interactive message in net cast
CN110662085A (en)*2019-10-162020-01-07北京字节跳动网络技术有限公司 Message sending method, apparatus, readable medium and electronic device

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20070002736A1 (en)*2005-06-162007-01-04Cisco Technology, Inc.System and method for improving network resource utilization
CN103561394B (en)*2013-11-082018-08-21惠州Tcl移动通信有限公司A kind of method and system sending message
CN106257958B (en)*2015-06-302019-10-15北京智谷睿拓技术服务有限公司Message method, message receival method and its device
CN108174305B (en)*2016-12-072019-03-12北京云中融信网络科技有限公司The message treatment method and device of chatroom is broadcast live
CN108093123A (en)*2017-10-302018-05-29努比亚技术有限公司A kind of message informing processing method, terminal and computer readable storage medium
US10747596B2 (en)*2018-07-312020-08-18International Business Machines CorporationDetermining when to send message to a computing node to process items using a machine learning module
CN109245867B (en)*2018-08-142022-09-27深圳壹账通智能科技有限公司 A message sending method, computer readable storage medium and terminal device
CN110297711B (en)*2019-05-162024-01-19平安科技(深圳)有限公司Batch data processing method, device, computer equipment and storage medium
CN110231972B (en)*2019-05-272022-10-25维沃移动通信有限公司 A message display method and terminal device
CN110417879A (en)*2019-07-182019-11-05北京蜜莱坞网络科技有限公司A kind of message treatment method, device, equipment and storage medium
CN111078430A (en)*2019-12-092020-04-28苏州浪潮智能科技有限公司 A message notification processing method, device and storage medium
CN111124573B (en)*2019-12-162022-04-22维沃移动通信有限公司Message notification method and electronic equipment
CN111416765A (en)*2020-03-202020-07-14北京字节跳动网络技术有限公司Interactive message processing method and device
CN112199174B (en)*2020-09-302025-07-08北京字节跳动网络技术有限公司Message sending control method and device, electronic equipment and computer readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110191348A (en)*2018-02-232019-08-30武汉斗鱼网络科技有限公司The processing method and processing device of interactive message in net cast
CN110662085A (en)*2019-10-162020-01-07北京字节跳动网络技术有限公司 Message sending method, apparatus, readable medium and electronic device

Also Published As

Publication numberPublication date
CN112199174A (en)2021-01-08
WO2022068488A1 (en)2022-04-07

Similar Documents

PublicationPublication DateTitle
CN112199174B (en)Message sending control method and device, electronic equipment and computer readable storage medium
KR102725987B1 (en) Information transmission method, device, readable medium and electronic device
CN112311656B (en)Message aggregation and display method and device, electronic equipment and computer readable medium
CN113765692B (en)Current limiting method, device, electronic equipment and computer readable medium
CN112954354B (en)Video transcoding method, device, equipment and medium
CN111314439A (en)Data sending method and device and electronic equipment
CN110636367A (en)Video loading method and device, terminal equipment and medium
CN110910469A (en)Method, device, medium and electronic equipment for drawing handwriting
CN114721829B (en) A method, device, equipment and storage medium for configuring coroutine stack resources
CN113542856B (en)Method, device, equipment and computer readable medium for reverse playing of online video
CN112218034A (en)Video processing method, system, terminal and storage medium
CN113115074B (en)Video jamming processing method and device
CN111478916B (en)Data transmission method, device and storage medium based on video stream
CN112162682A (en)Content display method and device, electronic equipment and computer readable storage medium
CN111225255B (en)Target video push playing method and device, electronic equipment and storage medium
CN112203103B (en)Message processing method, device, electronic equipment and computer readable storage medium
CN115225586B (en)Data packet transmitting method, device, equipment and computer readable storage medium
CN110719233A (en) Method and apparatus for sending information
CN112040328B (en)Data interaction method and device and electronic equipment
CN107342981B (en)Sensor data transmission method and device and virtual reality head-mounted equipment
CN116156267A (en)Virtual resource acquisition and transmission method and device, storage medium and electronic equipment
WO2022218103A1 (en)Message sending method and apparatus, and device and storage medium
CN112182002A (en)Data disaster tolerance method and device, electronic equipment and computer readable medium
CN111405341A (en)Control display method and device and electronic equipment
CN113556352B (en)Information pushing method and device, terminal equipment and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TG01Patent term adjustment
TG01Patent term adjustment

[8]ページ先頭

©2009-2025 Movatter.jp